/* ==========================================================================
   ArchiTask — Component library
   Buttons, cards, badges, forms, tables, tabs, menus, modals, toasts,
   avatars, progress, kanban, empty states, command palette.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 36px; padding: 0 var(--s4);
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: var(--fs-13); font-weight: 560; white-space: nowrap;
  color: var(--text); background: var(--surface);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

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

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

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--critical); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

.btn-sm { height: 30px; padding: 0 var(--s3); font-size: var(--fs-12); }
.btn-lg { height: 42px; padding: 0 var(--s5); font-size: var(--fs-14); }
.btn-block { width: 100%; }

.btn-icon { width: 34px; padding: 0; flex: 0 0 34px; }
.btn-icon.btn-sm { width: 28px; flex-basis: 28px; }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: var(--brand-on); animation: spin .6s linear infinite;
}
.btn-secondary.btn-loading::after, .btn-ghost.btn-loading::after { color: var(--text-2); }

/* Segmented control (view switchers, ranges) */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-3); border-radius: var(--r-md);
}
.segmented button {
  height: 28px; padding: 0 var(--s3); border-radius: var(--r-sm);
  font-size: var(--fs-12); font-weight: 560; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.segmented button svg { width: 15px; height: 15px; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  background: var(--surface); color: var(--text); box-shadow: var(--sh-1);
}

/* --------------------------------------------------------------------------
   Cards & panels
   -------------------------------------------------------------------------- */
/* Surfaces sit on the hairline border alone. Shadow is reserved for things
   that actually float, so the page reads flat and quiet. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.card-pad { padding: var(--s5); }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--border);
}
.card-head .h3 { line-height: 1.3; }
.card-head .sub { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }
.card-body { padding: var(--s5); }
.card-foot {
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  font-size: var(--fs-12);
}
.card-hover { transition: box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.card-hover:hover { box-shadow: var(--sh-2); border-color: var(--border-strong); }

/* --------------------------------------------------------------------------
   Badges, pills, chips
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-11); font-weight: 620; letter-spacing: .01em;
  background: var(--neutral-soft); color: var(--neutral-ink);
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; flex: 0 0 12px; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.badge-good     { background: var(--good-soft);     color: var(--good-ink); }
.badge-warning  { background: var(--warning-soft);  color: var(--warning-ink); }
.badge-serious  { background: var(--serious-soft);  color: var(--serious-ink); }
.badge-critical { background: var(--critical-soft); color: var(--critical-ink); }
.badge-brand    { background: var(--brand-soft);    color: var(--brand-ink); }
.badge-lg { height: 26px; padding: 0 10px; font-size: var(--fs-12); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-2);
  font-size: var(--fs-12); font-weight: 500;
}
.chip button { display: inline-grid; place-items: center; color: var(--text-3); }
.chip button:hover { color: var(--critical); }
.chip svg { width: 13px; height: 13px; }

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */
.avatar {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: var(--fs-12); font-weight: 620; letter-spacing: -.01em;
  color: #fff; background: var(--text-2);
  user-select: none;
}
.avatar-xs { width: 22px; height: 22px; font-size: var(--fs-11); }
.avatar-sm { width: 26px; height: 26px; font-size: var(--fs-11); }
.avatar-lg { width: 40px; height: 40px; font-size: var(--fs-14); }
.avatar-xl { width: 56px; height: 56px; font-size: var(--fs-18); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more {
  background: var(--surface-3); color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label {
  font-size: var(--fs-12); font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 4px;
}
.label .req { color: var(--critical); }
.field .hint { font-size: var(--fs-11); color: var(--text-3); }
.field .err { font-size: var(--fs-11); color: var(--critical-ink); display: flex; align-items: center; gap: 4px; }
.field .err svg { width: 12px; height: 12px; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 var(--s3);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-14);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.textarea { height: auto; min-height: 84px; padding: 9px var(--s3); resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring);
}
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea {
  border-color: var(--critical);
}
.field.is-invalid .input:focus { box-shadow: 0 0 0 3px rgba(208,59,59,.2); }

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

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 34px; }
.input-group > svg {
  position: absolute; left: 10px; width: 16px; height: 16px;
  color: var(--text-3); pointer-events: none;
}
.input-group .clear {
  position: absolute; right: 8px; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%; color: var(--text-3);
}
.input-group .clear:hover { background: var(--surface-3); color: var(--text); }
.input-group .clear svg { width: 13px; height: 13px; }

.check {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-13); color: var(--text-2); cursor: pointer; user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }

.switch {
  position: relative; display: inline-flex; align-items: center;
  width: 38px; height: 22px; flex: 0 0 38px;
  border-radius: var(--r-full); background: var(--border-strong);
  transition: background var(--t-med) var(--ease); cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .knob {
  position: absolute; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  /* Tracks the accent's ink: white on the near-black light accent, dark on
     the near-white dark one — otherwise the knob disappears when checked. */
  background: var(--brand-on); box-shadow: var(--sh-1);
  transition: transform var(--t-med) var(--ease-out);
}
.switch:has(input:checked) { background: var(--brand); }
.switch:has(input:checked) .knob { transform: translateX(16px); }
.switch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Filter bar — one row above everything it scopes. */
.filterbar {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  margin-bottom: var(--s5);
}
.filterbar .input-group { flex: 1 1 240px; max-width: 380px; }
.filterbar .select { width: auto; min-width: 130px; height: 36px; }
.filterbar .spacer { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.table { font-size: var(--fs-13); }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left; font-size: var(--fs-11); font-weight: 620;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap;
}
.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--text-2); }
.table thead th .sort-ind { display: inline-block; margin-left: 4px; opacity: .45; }
.table thead th[aria-sort] .sort-ind { opacity: 1; color: var(--accent-ink); }
.table tbody td {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-link { cursor: pointer; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table .actions .btn-icon { opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.table tbody tr:hover .actions .btn-icon,
.table .actions .btn-icon:focus-visible { opacity: 1; }
@media (hover: none) { .table .actions .btn-icon { opacity: 1; } }

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex; align-items: center; gap: var(--s1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 10px var(--s3) 11px;
  font-size: var(--fs-13); font-weight: 560; color: var(--text-2);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab .count {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text-3);
  font-size: var(--fs-11); font-weight: 620; font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] { color: var(--text); font-weight: 620; }
.tab[aria-selected="true"] .count { background: var(--brand-soft); color: var(--brand-ink); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
  animation: fade-in var(--t-med) var(--ease) both;
}

/* --------------------------------------------------------------------------
   Dropdown menus
   -------------------------------------------------------------------------- */
.menu-anchor { position: relative; }
.menu {
  position: absolute; z-index: 70; min-width: 190px;
  padding: var(--s1); margin-top: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-4);
  animation: pop-in var(--t-fast) var(--ease-out) both;
  transform-origin: top right;
}
.menu.to-right { right: 0; }
.menu.to-left { left: 0; transform-origin: top left; }
.menu-item {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; padding: 8px var(--s3); border-radius: var(--r-sm);
  font-size: var(--fs-13); color: var(--text-2); text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.menu-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-item svg { width: 15px; height: 15px; flex: 0 0 15px; opacity: .8; }
.menu-item.is-danger { color: var(--critical-ink); }
.menu-item.is-danger:hover { background: var(--critical-soft); }
.menu-item .shortcut { margin-left: auto; font-size: var(--fs-11); color: var(--text-3); }
.menu-sep { height: 1px; background: var(--border); margin: var(--s1) 0; }
.menu-label {
  padding: 6px var(--s3) 4px; font-size: var(--fs-11); font-weight: 620;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Modal / drawer
   -------------------------------------------------------------------------- */
.modal-root {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: var(--s5);
  background: rgba(8,11,18,.5);
  animation: fade-in var(--t-med) var(--ease) both;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 560px;
  max-height: calc(100dvh - var(--s9));
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  animation: pop-in var(--t-med) var(--ease-out) both;
  overflow: hidden;
}
.modal-lg { max-width: 760px; }
.modal-sm { max-width: 420px; }
.modal-head {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s5) var(--s5) var(--s4);
  flex: 0 0 auto;
}
.modal-head .grow { min-width: 0; }
.modal-head .sub { font-size: var(--fs-13); color: var(--text-2); margin-top: 3px; }
.modal-body { padding: 0 var(--s5) var(--s5); overflow-y: auto; flex: 1 1 auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--s2);
  padding: var(--s4) var(--s5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  flex: 0 0 auto;
}
.modal-foot .grow { flex: 1 1 auto; }
.modal-icon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: var(--r-lg);
  display: grid; place-items: center;
}
.modal-icon svg { width: 20px; height: 20px; }
.modal-icon.is-danger { background: var(--critical-soft); color: var(--critical-ink); }
.modal-icon.is-brand  { background: var(--brand-soft); color: var(--brand-ink); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--s4); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .modal-root { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; }
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toast-root {
  position: fixed; z-index: 120;
  right: var(--s5); bottom: var(--s5);
  display: flex; flex-direction: column-reverse; gap: var(--s2);
  max-width: min(400px, calc(100vw - var(--s8)));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-4);
  animation: slide-left var(--t-slow) var(--ease-out) both;
  pointer-events: auto;
}
.toast.is-out { animation: fade-in var(--t-med) var(--ease) reverse both; }
.toast .ico { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; }
.toast .body { flex: 1 1 auto; min-width: 0; }
.toast .body b { display: block; font-size: var(--fs-13); font-weight: 600; }
.toast .body span { display: block; font-size: var(--fs-12); color: var(--text-2); margin-top: 1px; }
.toast .undo {
  flex: 0 0 auto; font-size: var(--fs-12); font-weight: 620; color: var(--text);
  padding: 3px 8px; border-radius: var(--r-sm);
}
.toast .undo:hover { background: var(--brand-soft); }
.toast-good .ico     { color: var(--good); }
.toast-warning .ico  { color: var(--warning-ink); }
.toast-critical .ico { color: var(--critical); }
.toast-info .ico { color: var(--accent-ink); }
@media (max-width: 620px) {
  .toast-root { left: var(--s4); right: var(--s4); bottom: var(--s4); max-width: none; }
}

/* --------------------------------------------------------------------------
   Progress
   -------------------------------------------------------------------------- */
.meter {
  position: relative; height: 6px; border-radius: var(--r-full);
  background: var(--ord-track); overflow: hidden;
}
.meter-lg { height: 8px; }
.meter .fill {
  position: absolute; inset: 0 auto 0 0;
  border-radius: var(--r-full);
  background: var(--series-1);
  transition: width var(--t-slow) var(--ease-out);
}
/* Secondary segment: work started but not done. 2px surface gap separates it. */
.meter .fill-2 {
  position: absolute; inset: 0 auto 0 0;
  border-radius: var(--r-full);
  background: var(--ord-2);
  opacity: .55;
}
.meter.is-good .fill     { background: var(--good); }
.meter.is-warning .fill  { background: var(--warning); }
.meter.is-critical .fill { background: var(--critical); }

.progress-line { display: flex; align-items: center; gap: var(--s3); }
.progress-line .meter { flex: 1 1 auto; }
.progress-line .pct {
  flex: 0 0 auto; font-size: var(--fs-12); font-weight: 640;
  font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 34px; text-align: right;
}

/* --------------------------------------------------------------------------
   Kanban board
   -------------------------------------------------------------------------- */
.board {
  display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: var(--s4);
  overflow-x: auto;
  padding-bottom: var(--s3);
  align-items: start;
}
.board-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  min-height: 180px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.board-col.is-over { background: var(--accent-soft); border-color: var(--accent); }
.board-col-head {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
}
.board-col-head .swatch { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.board-col-head b { font-size: var(--fs-13); font-weight: 620; }
.board-col-head .count {
  margin-left: auto; font-size: var(--fs-11); font-weight: 620;
  color: var(--text-3); font-variant-numeric: tabular-nums;
  background: var(--surface-3); padding: 1px 7px; border-radius: var(--r-pill);
}
.board-col-body {
  padding: var(--s3); display: flex; flex-direction: column; gap: var(--s3);
  min-height: 60px;
}
.tcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s3);
  box-shadow: var(--sh-1); cursor: grab;
  transition: box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  animation: rise-in var(--t-med) var(--ease-out) both;
}
.tcard:hover { box-shadow: var(--sh-3); border-color: var(--border-strong); }
.tcard.is-dragging { opacity: .4; cursor: grabbing; transform: rotate(1.5deg); }
.tcard .title { font-size: var(--fs-13); font-weight: 560; line-height: 1.4; }
.tcard .proj { font-size: var(--fs-11); color: var(--text-3); }
.tcard .foot { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.tcard .due { font-size: var(--fs-11); color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.tcard .due svg { width: 12px; height: 12px; }
.tcard .due.is-overdue { color: var(--critical-ink); font-weight: 600; }
.tcard .due.is-soon { color: var(--warning-ink); font-weight: 600; }
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(4, minmax(78vw, 1fr)); }
}

.board-more {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: var(--s3); margin: 0 var(--s3) var(--s3);
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  font-size: var(--fs-12); font-weight: 560; color: var(--text-2);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.board-more:hover {
  border-color: var(--accent); color: var(--accent-ink);
  background: var(--accent-soft); text-decoration: none;
}
.board-more svg { width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   Empty & error states
   -------------------------------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--s9) var(--s5);
  animation: fade-in var(--t-slow) var(--ease) both;
}
.empty .glyph {
  width: 52px; height: 52px; border-radius: var(--r-lg);
  display: grid; place-items: center; margin-bottom: var(--s4);
  background: var(--surface-3); color: var(--text-3);
}
.empty .glyph svg { width: 24px; height: 24px; }
.empty b { font-size: var(--fs-15); font-weight: 620; }
.empty p { font-size: var(--fs-13); color: var(--text-2); margin-top: 4px; max-width: 42ch; }
.empty .btn { margin-top: var(--s4); }

/* --------------------------------------------------------------------------
   Command palette
   -------------------------------------------------------------------------- */
.palette-root {
  position: fixed; inset: 0; z-index: 130;
  display: flex; justify-content: center;
  padding: 12vh var(--s5) var(--s5);
  background: rgba(8,11,18,.5);
  animation: fade-in var(--t-fast) var(--ease) both;
}
.palette {
  width: 100%; max-width: 580px; align-self: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-4);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: 70vh;
  animation: pop-in var(--t-med) var(--ease-out) both;
}
.palette-input {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.palette-input svg { width: 18px; height: 18px; color: var(--text-3); flex: 0 0 18px; }
.palette-input input {
  flex: 1 1 auto; border: none; background: none; outline: none;
  font-size: var(--fs-15); color: var(--text); min-width: 0;
}
.palette-input input::placeholder { color: var(--text-3); }
.palette-list { overflow-y: auto; padding: var(--s2); flex: 1 1 auto; }
.palette-group { padding: var(--s2) var(--s3) 4px; }
.palette-item {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; padding: 9px var(--s3); border-radius: var(--r-md);
  text-align: left; color: var(--text-2); font-size: var(--fs-13);
}
.palette-item .ico {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--surface-3); color: var(--text-2);
}
.palette-item .ico svg { width: 15px; height: 15px; }
.palette-item .grow b { display: block; font-weight: 560; color: var(--text); }
.palette-item .grow span { display: block; font-size: var(--fs-11); color: var(--text-3); }
.palette-item.is-active { background: var(--brand-soft); color: var(--text); }
.palette-item.is-active .ico { background: var(--brand); color: var(--brand-on); }
.palette-foot {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s2) var(--s5); border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: var(--fs-11); color: var(--text-3);
  flex: 0 0 auto;
}
.palette-foot .row { gap: 5px; }

/* --------------------------------------------------------------------------
   Notification popover
   -------------------------------------------------------------------------- */
.bell { position: relative; }
.bell .dot-alert {
  position: absolute; top: 5px; right: 5px;
  min-width: 8px; height: 8px; border-radius: var(--r-full);
  background: var(--critical); box-shadow: 0 0 0 2px var(--surface);
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  width: min(380px, calc(100vw - var(--s7)));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-4);
  animation: pop-in var(--t-fast) var(--ease-out) both;
  overflow: hidden;
}
.notif-list { max-height: 62vh; overflow-y: auto; }
.notif {
  display: flex; gap: var(--s3); padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border); width: 100%; text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif:last-child { border-bottom: none; }
.notif.is-unread { background: var(--brand-soft); }
.notif.is-unread:hover { background: var(--brand-soft-2); }
.notif .ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--surface-3); color: var(--text-2);
}
.notif .ico svg { width: 15px; height: 15px; }
.notif .body { min-width: 0; flex: 1 1 auto; }
.notif .body b { display: block; font-size: var(--fs-13); font-weight: 600; }
.notif .body p { font-size: var(--fs-12); color: var(--text-2); margin-top: 1px; }
.notif .body time { display: block; font-size: var(--fs-11); color: var(--text-3); margin-top: 3px; }

/* --------------------------------------------------------------------------
   Misc shared bits
   -------------------------------------------------------------------------- */
.divider-v { width: 1px; height: 20px; background: var(--border); flex: 0 0 1px; }

.kv { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: var(--s3) var(--s4); font-size: var(--fs-13); }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { margin: 0; color: var(--text); font-weight: 500; }

.dl-inline { display: flex; flex-wrap: wrap; gap: var(--s5); }
.dl-inline > div { min-width: 0; }
.dl-inline dt { font-size: var(--fs-11); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.dl-inline dd { margin: 3px 0 0; font-size: var(--fs-15); font-weight: 620; font-variant-numeric: tabular-nums; }
