:root {
  --color-primary: #21808d;
  --color-primary-hover: #1d7480;
  --color-primary-active: #1a6873;
  --color-secondary: rgba(94, 82, 64, 0.12);
  --color-bg: #fcfcf9;
  --color-surface: #fffffe;
  --color-text: #134252;
  --color-text-secondary: #626c71;
  --color-border: rgba(94, 82, 64, 0.2);
  --color-error: #c01527;
  --color-success: #21808d;
  --color-focus: rgba(33, 128, 141, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 0;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

h1 {
  font-size: 28px;
  margin-bottom: 5px;
  font-weight: 600;
}

.subtitle {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px;
}

.panel h2 {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-panel {
  display: block;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text);
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: all 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: monospace;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-text);
}

.btn-secondary:hover {
  background-color: rgba(94, 82, 64, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger {
  background-color: var(--color-error);
  color: white;
}

.btn-danger:hover {
  background-color: #a01320;
}

.section-title {
  font-weight: 600;
  margin: 16px 0 12px 0;
  font-size: 14px;
  color: var(--color-text);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: white;
  transition: all 0.15s ease;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-delete,
.tag-edit {
  cursor: pointer;
  opacity: 0.8;
}

.color-picker {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.color-option.selected {
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px var(--color-surface);
}

.section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(33, 128, 141, 0.05);
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}

.section-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s ease;
}

.item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--color-primary);
}

.item-content {
  flex: 1;
}

.item-text {
  font-size: 14px;
  margin-bottom: 8px;
  word-break: break-word;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  display: inline-block;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.item-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.15s ease;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.item-action-btn:hover {
  background-color: var(--color-secondary);
  color: var(--color-text);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.filter-btn:hover {
  border-color: var(--color-primary);
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--color-text-secondary);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(33, 128, 141, 0.1), rgba(33, 128, 141, 0.05));
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.buttons-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
}

.divider {
  margin: 30px 0;
  border-top: 1px solid var(--color-border);
}

.helper {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 10px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-selection {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 10px;
}

.flex-1 {
  flex: 1;
}

.responsive {
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 600px) {
  .input-row {
    flex-direction: column;
  }
  .buttons-row {
    width: 100%;
  }
  .buttons-row .btn {
    width: 100%;
    justify-content: center;
  }
}
