/* ═══ Autowhat UI refresh — a cleaner, more contemporary SaaS look on top of base.css ═══
   Loaded last, so it only overrides the cascade (same class names). It keeps the dense data screens fully functional:
   softer depth, a refined accent, larger radii on containers, and consistent focus / hover micro-interactions. */

/* Tokens: css/tokens.css (the one token file). */

/* ─── Global feel ───────────────────────────────────────── */
::selection { background: var(--accent-soft); }
.num, table.tbl td.num, table.tbl th.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Shell chrome ──────────────────────────────────────── */
.app.shell > .topbar {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.app.shell > .app-workspace > .sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar-foot { border-top: 1px solid var(--line); color: var(--muted); }

/* hub tabs: a filled underline pill instead of a hard 2px bar */
.hub-tab { border-bottom: 0; border-radius: 8px 8px 0 0; margin-bottom: 0; }
.hub-tab.active { background: var(--accent-soft); }
.hub-tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--accent);
}
.hub-tab { position: relative; }

/* search & top-bar buttons */
.search-btn { border-radius: 10px; background: var(--surface-2); }
.search-btn:hover { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.app.shell .topbar .icon-btn { border-radius: 8px; }

/* ─── Navigation ────────────────────────────────────────── */
.nav-group { letter-spacing: .07em; }
.nav-item, .nav-q { border-radius: 8px; }
.nav-item:hover, .nav-q:hover { background: var(--surface-2); }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item.active::before { display: none; } /* the polish-pass bar is replaced by the inset edge */
.nav-hub-h { border-radius: 8px; }
.nav-search input { border-radius: 10px; }
.nav-search input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ─── Cards & KPIs ──────────────────────────────────────── */
.card { border-radius: 12px; box-shadow: var(--shadow); }
.card-h { padding: 10px 14px; }
.card-b { padding: 12px 14px; }
.card-h::before { width: 3px; height: 16px; border-radius: 3px; }
.card { transition: border-color var(--t-fast) ease; }
.card:hover { box-shadow: var(--e1), var(--highlight); border-color: var(--line-2); }
.kpi { border-radius: 12px; padding: 10px 12px 9px; box-shadow: var(--shadow); }
.kpi:hover { transform: none; border-color: var(--line-2); }
.kpi .l { letter-spacing: .06em; }
.kpi .v { font-size: 24px; }

/* ─── Buttons ───────────────────────────────────────────── */
.btn { border-radius: 8px; font-weight: 500; transition: background .14s ease, box-shadow .14s ease, transform .08s ease, border-color .14s ease; }
.btn:hover { border-color: var(--line-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: none; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); filter: none; }
.btn:active { background: var(--surface-3); }
.btn.primary:active { background: var(--accent-hover); }

/* ─── Tables ────────────────────────────────────────────── */
.tbl th {
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  letter-spacing: .05em;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-2);
}
.tbl td { padding: 6px 10px; }
.tbl tbody tr:hover td { background: var(--accent-soft); }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl-wrap { border-radius: 8px; }

/* ─── Pills, badges, tags ───────────────────────────────── */
.pill { border-radius: 999px; padding: 2px 9px; font-size: 10.5px; }
.badge { border-radius: 999px; }
.tag { border-radius: 6px; }

/* ─── Forms ─────────────────────────────────────────────── */
.fld > label:not(.check-row):not(.ewb2-chk) { font-weight: 600; letter-spacing: .01em; }
.fld input:not([type=checkbox]):not([type=file]):not([type=radio]),
.fld select,
.fld textarea,
.auth-form .fld input {
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fld input:focus, .fld select:focus, .fld textarea:focus,
.auth-form .fld input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-actions {
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.lines { border-radius: 12px; }

/* ─── Overlays ──────────────────────────────────────────── */
.modal { border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal-h { border-radius: 16px 16px 0 0; }
.palette { border-radius: 14px; box-shadow: var(--shadow-lg); }
.toast { border-radius: 10px; box-shadow: var(--shadow-lg); }
.drawer { box-shadow: var(--shadow-lg); }

/* ─── Auth ──────────────────────────────────────────────── */
.auth-card { border-radius: 18px; box-shadow: var(--shadow-lg); }
.auth-card .brand { background: none; }
.auth-form h2 { letter-spacing: -.015em; }

/* ─── Scrollbars ────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
