/* ============================================================
   Taskee V1 — Main Stylesheet
   taskee.prudens.si
   ============================================================ */

/* ---- CSS Variables ---------------------------------------- */
:root {
  /* Sidebar */
  --sidebar-bg:         #2b2d2f;
  --sidebar-width:      240px;
  --sidebar-text:       #e8e8e8;
  --sidebar-muted:      #9a9a9a;
  --sidebar-border:     rgba(255,255,255,0.07);

  /* Accent */
  --accent:             #E07B30;
  --accent-hover:       #c96e28;
  --accent-tint:        rgba(224, 123, 48, 0.13);
  --accent-tint-hover:  rgba(224, 123, 48, 0.20);

  /* Page */
  --page-bg:            #f4f5f7;
  --surface:            #ffffff;
  --border:             #e2e4e8;
  --border-hover:       #cdd0d6;

  /* Text */
  --text-primary:       #1a1c1e;
  --text-secondary:     #5a5f6b;
  --text-muted:         #9098a5;

  /* Status colors */
  --overdue-color:      #c0392b;
  --streak-color:       #EF9F27;

  /* Priority dots */
  --priority-now:       #e63946;
  --priority-plan:      #E07B30;
  --priority-delegate:  #3a86ff;
  --priority-someday:   #D4B896;

  /* Misc */
  --radius:             8px;
  --radius-lg:          12px;
  --shadow-sm:          0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:             0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:          0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
  --transition:         0.18s ease;
}

/* ---- Reset & Base ----------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ---- App Layout ------------------------------------------- */
.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ---- Sidebar ---------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 100;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-app-name-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  height: 32px;
}

.sidebar-app-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-app-sub {
  font-size: 9px;
  font-weight: 600;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
}

/* Add Task Button */
.sidebar-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 12px 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  width: calc(100% - 24px);
  border: none;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.sidebar-add-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.sidebar-add-btn:active {
  transform: translateY(0);
}

.sidebar-add-btn svg {
  flex-shrink: 0;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 6px 8px 4px;
}

.sidebar-nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 8px 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text);
}

.sidebar-nav-item.active {
  background: var(--accent-tint);
  color: var(--accent);
}

.sidebar-nav-item.active svg {
  color: var(--accent);
}

.sidebar-nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.sidebar-nav-item.active svg {
  opacity: 1;
}

/* Task count badge in sidebar */
.sidebar-count {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-nav-item.active .sidebar-count {
  background: var(--accent-tint);
  color: var(--accent);
}

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 6px 12px;
}

/* Sidebar group label */
.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 18px 4px;
}

/* Sidebar bottom area */
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
}

/* Search box */
.sidebar-search {
  padding: 10px 12px;
}

.sidebar-search-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 7px 10px 7px 32px;
  color: var(--sidebar-text);
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.sidebar-search-input::placeholder {
  color: var(--sidebar-muted);
}

.sidebar-search-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
}

.sidebar-search-wrap {
  position: relative;
}

.sidebar-search-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--sidebar-muted);
  pointer-events: none;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e2022;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(255,255,255,0.07);
}

.search-result-name {
  flex: 1;
  font-size: 12.5px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 11px;
  color: var(--sidebar-muted);
  white-space: nowrap;
}

.search-no-results {
  padding: 16px 12px;
  text-align: center;
  color: var(--sidebar-muted);
  font-size: 12px;
}

/* Streak + Language bar */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 8px;
}

.streak-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--streak-color);
}

.streak-counter .streak-num {
  font-size: 13px;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-muted);
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  background: none;
  border: none;
  letter-spacing: 0.03em;
}

.lang-btn:hover {
  color: var(--sidebar-text);
  background: rgba(255,255,255,0.07);
}

.lang-btn.active {
  color: var(--accent);
  background: var(--accent-tint);
}

/* Settings link */
.sidebar-settings-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  color: var(--sidebar-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
}

.sidebar-settings-link:hover {
  color: var(--sidebar-text);
}

.sidebar-settings-link svg {
  width: 15px;
  height: 15px;
}

/* ---- Main Content ----------------------------------------- */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 32px;
  overflow-y: auto;
  max-width: 924px; /* 860px content + 32px padding each side */
}

.page-header {
  padding: 28px 0 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.page-body {
  padding: 0 32px 40px;
  flex: 1;
}

/* ---- Cards & Containers ----------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 16px 20px;
}

/* ---- Task List -------------------------------------------- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  position: relative;
}

.task-row:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.task-row:first-child {
  border-radius: var(--radius) var(--radius) var(--radius) var(--radius);
}

/* Priority dot */
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.priority-dot.now      { background: var(--priority-now); }
.priority-dot.plan     { background: var(--priority-plan); }
.priority-dot.delegate { background: var(--priority-delegate); }
.priority-dot.someday  { background: var(--priority-someday); }

/* Checkbox */
.task-checkbox {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--border-hover);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--surface);
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.task-checkbox.checked svg {
  display: block;
}

.task-checkbox svg {
  display: none;
  width: 10px;
  height: 10px;
  color: white;
}

/* Task name */
.task-name {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-row.completed .task-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-row.archived .task-name {
  color: var(--text-muted);
}

/* Task meta (subgroup, date) */
.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.task-subgroup {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--page-bg);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.task-due-date {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-due-date.overdue {
  color: var(--overdue-color);
  font-weight: 600;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

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

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

.btn-secondary {
  background: var(--page-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}

.btn-ghost:hover {
  background: var(--page-bg);
  color: var(--text-primary);
}

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

.btn-danger {
  background: #fef2f2;
  color: var(--overdue-color);
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

/* ---- Filter Bar ------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 32px 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 28px 5px 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239098a5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition);
}

.filter-select:focus {
  border-color: var(--accent);
}

/* Active filter indicator */
.filter-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid rgba(224,123,48,0.25);
}

.filter-clear-btn {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
}

.filter-clear-btn:hover {
  color: var(--overdue-color);
  background: #fef2f2;
}

/* Sort bar */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* ---- Empty State ------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
  gap: 10px;
}

.empty-state svg {
  opacity: 0.3;
}

/* ---- Toast Notifications ---------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--text-primary);
  color: white;
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.toast.success { border-left: 3px solid #22c55e; }
.toast.error   { border-left: 3px solid var(--overdue-color); }
.toast.info    { border-left: 3px solid var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Section headers in task list ------------------------- */
.task-section-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 16px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.task-section-badge {
  background: var(--overdue-color);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.task-section-badge.today {
  background: var(--accent);
}

.task-section-badge.upcoming {
  background: var(--text-muted);
}

/* ---- Dashboard Metric Cards ------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.metric-card-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-card-value.overdue { color: var(--overdue-color); }
.metric-card-value.today   { color: var(--accent); }
.metric-card-value.streak  { color: var(--streak-color); }

.metric-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---- Modal Overlay ---------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 460px;
  max-width: calc(100vw - 32px);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.visible .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--page-bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Form elements ---------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label .required {
  color: var(--overdue-color);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224,123,48,0.12);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239098a5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* Priority select options color indicators */
.priority-option-now      { color: var(--priority-now); }
.priority-option-plan     { color: var(--priority-plan); }
.priority-option-delegate { color: var(--priority-delegate); }
.priority-option-someday  { color: var(--priority-someday); }

/* ---- Side Panel ------------------------------------------- */
.side-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

.side-panel-overlay.visible {
  pointer-events: all;
}

.side-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.side-panel-overlay.visible .side-panel-backdrop {
  opacity: 1;
}

.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.side-panel-overlay.visible .side-panel {
  transform: translateX(0);
}

.side-panel-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.side-panel-task-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.side-panel-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition);
  flex-shrink: 0;
}

.side-panel-close:hover {
  background: var(--page-bg);
  color: var(--text-primary);
}

.side-panel-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-panel-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-panel-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.side-panel-field-value {
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.side-panel-note {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--page-bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
}

.side-panel-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Priority label chips --------------------------------- */
.priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.priority-chip.now      { background: #fef2f2; color: var(--priority-now); }
.priority-chip.plan     { background: #fff4ec; color: var(--priority-plan); }
.priority-chip.delegate { background: #eff6ff; color: var(--priority-delegate); }
.priority-chip.someday  { background: #faf8f5; color: #a0846a; }

/* ---- Settings page ---------------------------------------- */
.settings-section {
  margin-bottom: 28px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-label {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.settings-row-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* ---- Matrix visual ---------------------------------------- */
.matrix-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  aspect-ratio: 1.6;
  position: relative;
}

.matrix-quadrant {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
}

.matrix-quadrant:hover {
  border-color: var(--border-hover);
}

.matrix-quadrant-label {
  position: absolute;
  top: 8px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.matrix-quadrant.now      { background: #fff9f9; border-color: #fecdd3; }
.matrix-quadrant.plan     { background: #fffbf6; border-color: #fed7aa; }
.matrix-quadrant.delegate { background: #f8fbff; border-color: #bfdbfe; }
.matrix-quadrant.someday  { background: #fdfdfb; border-color: #e5e7eb; }

.matrix-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 26px;
}

.matrix-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.matrix-task-dot:hover {
  transform: scale(1.5);
}

.matrix-task-label {
  font-size: 10.5px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: pointer;
  transition: border-color var(--transition);
}

.matrix-task-label:hover {
  border-color: var(--accent);
}

.matrix-count {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 20px;
  font-weight: 700;
  opacity: 0.12;
  line-height: 1;
}

.matrix-count.now      { color: var(--priority-now); }
.matrix-count.plan     { color: var(--priority-plan); }
.matrix-count.delegate { color: var(--priority-delegate); }
.matrix-count.someday  { color: var(--priority-someday); }

/* ---- Utilities -------------------------------------------- */
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--overdue-color); }
.text-accent  { color: var(--accent); }
.text-streak  { color: var(--streak-color); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ---- Scrollbar styling ------------------------------------ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ---- Loading state ---------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--page-bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
