/* ==========================================================================
   QC Task Manager - Design Tokens
   Palet warna & aturan diturunkan dari sistem data-viz internal (validated).
   ========================================================================== */

:root {
  --surface-page:  #f9f9f7;
  --surface-card:  #fcfcfb;
  --surface-raise: #ffffff;
  --surface-sunken:#f2f1ee;

  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;

  --border:    rgba(11,11,11,0.10);
  --gridline:  #e1e0d9;
  --baseline:  #c3c2b7;

  --accent:        #2a78d6;
  --accent-strong: #184f95;
  --accent-soft:   #cde2fb;

  --good:      #0ca30c;
  --warning:   #fab219;
  --serious:   #ec835a;
  --critical:  #d03b3b;
  --success-text: #006300;

  --cat-1: #2a78d6; /* Inspeksi Barang Masuk */
  --cat-2: #1baf7a; /* QC Proses Produksi */
  --cat-3: #eda100; /* QC Barang Jadi */
  --cat-4: #008300; /* Kalibrasi Alat */
  --cat-5: #4a3aa7; /* Audit & Sidak */
  --cat-6: #e34948; /* Deviasi & CAPA */
  --cat-7: #e87ba4; /* Dokumentasi & Pelaporan */
  --cat-8: #eb6834; /* Pelatihan & Kompetensi */
  --cat-other: #898781;

  --shadow-sm: 0 1px 2px rgba(11,11,11,0.06);
  --shadow-md: 0 4px 16px rgba(11,11,11,0.08);
  --shadow-lg: 0 12px 32px rgba(11,11,11,0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --sidebar-w: 232px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --surface-page:  #0d0d0d;
  --surface-card:  #1a1a19;
  --surface-raise: #212120;
  --surface-sunken:#161615;

  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;

  --border:   rgba(255,255,255,0.10);
  --gridline: #2c2c2a;
  --baseline: #383835;

  --accent:        #3987e5;
  --accent-strong: #86b6ef;
  --accent-soft:   #184f95;

  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #e66767;
  --success-text: #0ca30c;

  --cat-1: #3987e5;
  --cat-2: #199e70;
  --cat-3: #c98500;
  --cat-4: #008300;
  --cat-5: #9085e9;
  --cat-6: #e66767;
  --cat-7: #d55181;
  --cat-8: #d95926;
  --cat-other: #898781;

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --surface-page:  #0d0d0d;
    --surface-card:  #1a1a19;
    --surface-raise: #212120;
    --surface-sunken:#161615;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --border:   rgba(255,255,255,0.10);
    --gridline: #2c2c2a;
    --baseline: #383835;
    --accent:        #3987e5;
    --accent-strong: #86b6ef;
    --accent-soft:   #184f95;
    --critical: #e66767;
    --success-text: #0ca30c;
    --cat-1: #3987e5; --cat-2: #199e70; --cat-3: #c98500; --cat-4: #008300;
    --cat-5: #9085e9; --cat-6: #e66767; --cat-7: #d55181; --cat-8: #d95926;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--surface-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: 14px; color: var(--text-primary); }
.hidden { display: none !important; }

.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; }
.brand-text small { color: var(--text-muted); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  border: none; background: transparent; color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500; text-align: left;
}
.nav-item:hover { background: var(--surface-sunken); color: var(--text-primary); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-strong); }
:root[data-theme="dark"] .nav-item.is-active,
body:not([data-theme]) .nav-item.is-active { color: var(--accent); }
.nav-item svg.icon { flex-shrink: 0; }

.sidebar-footer {
  display: flex; align-items: center; gap: 8px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.theme-toggle {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-raise);
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text-primary); }
.me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}
.me-name { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; padding: 22px 28px 40px; min-width: 0; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.topbar-title p { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.search-box {
  position: relative; display: flex; align-items: center;
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 10px 0 32px; height: 36px;
}
.search-box svg { position: absolute; left: 10px; color: var(--text-muted); }
.search-box input { border: none; background: transparent; outline: none; width: 220px; height: 100%; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: 13px;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface-card); border-color: var(--border); color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--baseline); }
.btn-danger { background: transparent; border-color: var(--critical); color: var(--critical); }
.btn-danger:hover { background: var(--critical); color: #fff; }

.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-card);
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text-primary); }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.filter-bar select {
  height: 32px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-card); color: var(--text-secondary);
}
.filter-chips { display: flex; gap: 6px; margin-left: auto; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-card);
  color: var(--text-secondary); font-size: 12.5px; font-weight: 600;
}
.chip:hover { border-color: var(--baseline); color: var(--text-primary); }
.chip.is-active { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }

/* ---------- Cards / dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-tile {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.stat-tile .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.stat-tile .stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-tile .stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-tile.tone-critical .stat-value { color: var(--critical); }
.stat-tile.tone-good .stat-value { color: var(--success-text); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-wide { grid-column: 1 / -1; }
.card-head { padding: 14px 16px 0; }
.card-head h3 { font-size: 14px; }
.card-body { padding: 14px 16px 16px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row .bar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bar-row .bar-label { width: 168px; flex-shrink: 0; font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: var(--surface-sunken); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.bar-count { width: 24px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }

.list-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--gridline);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { cursor: pointer; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.list-row-date { font-size: 12px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.list-row-date.is-overdue { color: var(--critical); }
.empty-note { color: var(--text-muted); font-size: 13px; padding: 6px 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge-category { color: var(--text-secondary); background: var(--surface-sunken); }
.badge-category .bar-dot { width: 7px; height: 7px; border-radius: 50%; }

.badge-priority { border: 1px solid; }
.badge-priority.p-low     { color: var(--good);     background: color-mix(in srgb, var(--good) 12%, transparent);     border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.badge-priority.p-medium  { color: #8a6400;         background: color-mix(in srgb, var(--warning) 18%, transparent);  border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.badge-priority.p-high    { color: var(--serious);  background: color-mix(in srgb, var(--serious) 15%, transparent); border-color: color-mix(in srgb, var(--serious) 40%, transparent); }
.badge-priority.p-critical{ color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, transparent);border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
:root[data-theme="dark"] .badge-priority.p-medium { color: var(--warning); }

.badge-status { background: var(--surface-sunken); color: var(--text-secondary); }
.badge-status.s-done { color: var(--success-text); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge-status.s-progress { color: var(--accent-strong); background: var(--accent-soft); }

/* ---------- Kanban ---------- */
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; align-items: start; }
.kanban-col { background: var(--surface-sunken); border-radius: var(--radius-md); padding: 10px; min-height: 200px; }
.kanban-col.is-dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.kanban-col-head h4 { font-size: 13px; }
.kanban-count { font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--surface-raise); border-radius: 999px; padding: 1px 8px; }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kanban-card {
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 11px; box-shadow: var(--shadow-sm); cursor: grab;
}
.kanban-card:hover { border-color: var(--baseline); box-shadow: var(--shadow-md); }
.kanban-card.is-dragging { opacity: 0.5; }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }
.kanban-add-btn {
  width: 100%; border: 1px dashed var(--baseline); background: transparent; color: var(--text-muted);
  border-radius: var(--radius-sm); padding: 7px; font-size: 12px; margin-top: 8px;
}
.kanban-add-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Table ---------- */
.table-card { padding: 4px; overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.task-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); font-weight: 700; padding: 12px 12px; border-bottom: 1px solid var(--gridline);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.task-table th:hover { color: var(--text-secondary); }
.task-table td { padding: 11px 12px; border-bottom: 1px solid var(--gridline); font-size: 13px; vertical-align: middle; }
.task-table tbody tr:hover { background: var(--surface-sunken); cursor: pointer; }
.task-table tbody tr:last-child td { border-bottom: none; }
.col-actions { text-align: right; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions button { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.row-actions button:hover { background: var(--surface-sunken); color: var(--text-primary); }
.cell-title { font-weight: 600; }
.cell-title .cell-sub { font-weight: 400; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.due-cell.is-overdue { color: var(--critical); font-weight: 700; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--gridline); }
.cal-head h3 { flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 10px 0; text-transform: uppercase; border-bottom: 1px solid var(--gridline); }
.cal-cell {
  min-height: 96px; border-right: 1px solid var(--gridline); border-bottom: 1px solid var(--gridline);
  padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.is-outside { background: var(--surface-sunken); }
.cal-cell.is-outside .cal-daynum { color: var(--text-muted); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-daynum { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.cal-cell.is-today .cal-daynum {
  background: var(--accent); color: #fff; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.cal-task-pill {
  font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: var(--surface-sunken);
  color: var(--text-secondary); display: flex; align-items: center; gap: 4px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.cal-task-pill .bar-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-more { font-size: 10.5px; color: var(--text-muted); font-weight: 600; padding-left: 6px; }

/* ---------- Forms / modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(11,11,11,0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100;
}
.modal-panel {
  background: var(--surface-raise); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 88vh; display: flex; flex-direction: column;
}
.modal-panel.modal-wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--gridline); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--gridline); }

.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.field-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
input[type=text], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--border); background: var(--surface-card);
  border-radius: var(--radius-sm); padding: 8px 10px; outline: none;
}
input[type=text]:focus, input[type=date]:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field.span-2 { grid-column: 1 / -1; }

.priority-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.priority-picker button {
  border: 1px solid var(--border); background: var(--surface-card); border-radius: var(--radius-sm);
  padding: 8px; font-weight: 600; font-size: 12.5px; color: var(--text-secondary);
}
.priority-picker button.is-selected[data-priority="low"] { border-color: var(--good); color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.priority-picker button.is-selected[data-priority="medium"] { border-color: var(--warning); color: #8a6400; background: color-mix(in srgb, var(--warning) 18%, transparent); }
.priority-picker button.is-selected[data-priority="high"] { border-color: var(--serious); color: var(--serious); background: color-mix(in srgb, var(--serious) 15%, transparent); }
.priority-picker button.is-selected[data-priority="critical"] { border-color: var(--critical); color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, transparent); }

.checklist-editor { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.checklist-item { display: flex; align-items: center; gap: 8px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; }
.checklist-item input[type=checkbox] { flex-shrink: 0; width: 15px; height: 15px; accent-color: var(--accent); }
.checklist-item span { flex: 1; font-size: 13px; }
.checklist-item span.is-done { text-decoration: line-through; color: var(--text-muted); }
.checklist-item button { background: transparent; border: none; color: var(--text-muted); width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist-item button:hover { color: var(--critical); }
.checklist-item button svg { width: 13px; height: 13px; }

.tag-add-row { display: flex; gap: 8px; margin-top: 4px; }
.tag-add-row input { flex: 1; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag-pill { display: flex; align-items: center; gap: 6px; background: var(--surface-sunken); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 12.5px; }
.tag-pill button { background: transparent; border: none; color: var(--text-muted); width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.tag-pill button:hover { color: var(--critical); }
.tag-pill button svg { width: 11px; height: 11px; }

.theme-options { display: flex; gap: 8px; }
.theme-options button { flex: 1; border: 1px solid var(--border); background: var(--surface-card); border-radius: var(--radius-sm); padding: 9px; font-weight: 600; color: var(--text-secondary); }
.theme-options button.is-selected { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.data-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Detail modal ---------- */
.detail-section { margin-bottom: 16px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 8px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.detail-meta-item .meta-k { font-size: 11.5px; color: var(--text-muted); }
.detail-meta-item .meta-v { font-size: 13px; font-weight: 600; margin-top: 2px; }
.detail-desc { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; }
.detail-activity { display: flex; flex-direction: column; gap: 8px; }
.activity-row { display: flex; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.activity-row .activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.activity-row .activity-time { color: var(--text-muted); flex-shrink: 0; }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--surface-raise); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; font-weight: 600;
  animation: toast-in 0.18s ease-out;
}
.toast.tone-danger { border-color: var(--critical); color: var(--critical); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Login screen ---------- */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface-page); padding: 20px; z-index: 50;
}
.login-card {
  width: 100%; max-width: 360px; background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px 26px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-lede { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
.login-card input { margin-bottom: 2px; }
.login-submit { width: 100%; justify-content: center; margin-top: 4px; }
.login-error { color: var(--critical); font-size: 12.5px; font-weight: 600; }

/* ---------- Settings extras ---------- */
.field-static { font-size: 13.5px; font-weight: 600; padding: 7px 0 2px; }
.divider-thin { border: none; border-top: 1px solid var(--gridline); margin: 14px 0; }
#change-password-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
#change-password-form input { width: 100%; }
.checkbox-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.checkbox-label input { width: auto; }
.nu-admin-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.table-wrap-plain { overflow-x: auto; }
.role-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-secondary); }
.role-badge.is-admin { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .nav { flex-direction: row; }
  .brand { padding: 0 10px 0 0; }
  .sidebar-footer { border-top: none; }
  .main { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .priority-picker { grid-template-columns: repeat(2, 1fr); }
}
