/* DPDPA Privacy Dashboard — design system */
:root {
  --ink: #14171F;
  --ink-2: #2A2F3A;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --bg: #F5F4EE;
  --bg-2: #EEEDE6;
  --surface: #FFFFFF;
  --border: #E2DFD3;
  --border-2: #ECEAE0;
  --accent: #1F4F8B;
  --accent-tint: #E8EEF6;
  --ok: #15803D;
  --ok-tint: #E6F2EA;
  --warn: #B45309;
  --warn-tint: #FBF1E0;
  --danger: #B42318;
  --danger-tint: #FBEAE7;
  --violet: #5B4FCF;
  --violet-tint: #ECEAF8;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 0 rgba(20,23,31,.04);
  --shadow-md: 0 1px 2px rgba(20,23,31,.05), 0 4px 12px rgba(20,23,31,.04);
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "IBM Plex Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 18px 12px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;
}
.nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.nav-scroll::-webkit-scrollbar { width: 8px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 10.5px; color: var(--muted); margin-top: -2px; font-family: var(--font-mono); }

.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-2); font-weight: 600;
  padding: 14px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: var(--r-sm);
  color: var(--ink-2); cursor: pointer;
  font-size: 12.5px; font-weight: 450;
  border: none; background: none; text-align: left; width: 100%;
  position: relative;
}
.nav-item:hover { background: var(--bg-2); }
.nav-item.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-2);
}
.nav-item .ico { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.nav-item.active .ico { color: var(--accent); }
.nav-item .badge {
  margin-left: auto;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 1px 5px; border-radius: 4px; font-weight: 500;
}
.nav-item .badge.warn { background: var(--warn); color: #fff; }
.nav-item .badge.danger { background: var(--danger); color: #fff; }

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #2A4570, #1F4F8B);
  color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; }
.data-mode-bar {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; flex-shrink: 0;
}
.data-mode-bar .tag { font-size: 10.5px; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
  flex-wrap: wrap;
}
.breadcrumb { font-size: 12px; color: var(--muted); }
.breadcrumb b { color: var(--ink); font-weight: 550; }
.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: var(--r-sm);
  width: 280px; font-size: 12px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; font-family: inherit; font-size: 12px; color: var(--ink); }
.search .kbd {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--bg-2); padding: 1px 5px; border-radius: 4px;
  color: var(--muted);
}
.iconbtn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent;
  display: grid; place-items: center; color: var(--ink-2);
  cursor: pointer; position: relative;
}
.iconbtn:hover { background: var(--bg-2); }
.iconbtn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger); border: 1.5px solid var(--bg);
}

/* ── Page chrome ────────────────────────────────────────────────────── */
.page { padding: 24px 28px 60px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0; line-height: 1.1; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--ink);
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { padding: 3px 8px; font-size: 11.5px; }
.btn.danger { color: var(--danger); border-color: var(--danger-tint); background: var(--surface); }
.btn .ico { width: 13px; height: 13px; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }
.card-head .sub { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

/* ── Stat tiles ─────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.stat .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 550; }
.stat .val { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-family: var(--font-sans); }
.stat .val .unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat .delta { font-size: 11px; font-family: var(--font-mono); display: inline-flex; align-items: center; gap: 4px; }
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--danger); }
.stat .delta.neutral { color: var(--muted); }
.stat .spark { position: absolute; right: 12px; top: 14px; opacity: 0.6; }

/* ── Tags / chips ───────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 2px 7px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
  white-space: nowrap;
}
.tag.ok { background: var(--ok-tint); color: var(--ok); }
.tag.warn { background: var(--warn-tint); color: var(--warn); }
.tag.danger { background: var(--danger-tint); color: var(--danger); }
.tag.accent { background: var(--accent-tint); color: var(--accent); }
.tag.violet { background: var(--violet-tint); color: var(--violet); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Table ──────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table thead th {
  text-align: left; font-weight: 550; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding: 10px 16px;
  border-bottom: 1px solid var(--border-2);
  background: var(--bg-2);
}
.table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FAF9F4; cursor: pointer; }
.table tbody tr.selected { background: var(--accent-tint); }
.table .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }
.table .name { font-weight: 500; }
.table .meta { color: var(--muted); font-size: 11.5px; }
.table .row-grip { color: var(--muted-2); width: 16px; }

/* ── Progress / bars ────────────────────────────────────────────────── */
.bar { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }

/* ── Grids ──────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ── Drawer ─────────────────────────────────────────────────────────── */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(20,23,31,.32);
  z-index: 50; backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px;
  background: var(--surface); z-index: 51;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 40px rgba(20,23,31,.08);
  animation: slideIn .22s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  padding: 16px 22px; border-bottom: 1px solid var(--border-2);
  display: flex; align-items: flex-start; gap: 10px;
}
.drawer-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.drawer-head .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.drawer-foot {
  padding: 12px 22px; border-top: 1px solid var(--border-2);
  display: flex; gap: 8px; align-items: center;
}

/* ── Field rows ─────────────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }

/* ── Timeline ───────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 4px; padding-left: 8px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.tl-item { display: flex; gap: 12px; padding: 6px 0 6px 14px; position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--muted-2);
}
.tl-item.ok::before { border-color: var(--ok); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-item.danger::before { border-color: var(--danger); }
.tl-item.accent::before { border-color: var(--accent); }
.tl-meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); min-width: 86px; }
.tl-body .t { font-weight: 500; font-size: 12.5px; }
.tl-body .d { color: var(--muted); font-size: 11.5px; }

/* ── Misc ───────────────────────────────────────────────────────────── */
.empty {
  padding: 28px; text-align: center; color: var(--muted); font-size: 12.5px;
}
.divider { height: 1px; background: var(--border-2); margin: 14px 0; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }

/* Tab strip */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 8px 12px; font-size: 12px; font-weight: 500;
  color: var(--muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }

/* Donut */
.donut { position: relative; width: 140px; height: 140px; }
.donut svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.donut-center .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.donut-center .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Compliance score ring */
.ring {
  width: 92px; height: 92px; position: relative; display: grid; place-items: center;
}

/* Filter bar */
.filterbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-2);
  background: var(--bg);
}
.filterbar .chip {
  padding: 4px 9px; border-radius: 999px; font-size: 11.5px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; color: var(--ink-2); font-weight: 500;
}
.filterbar .chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filterbar .spacer { flex: 1; }

/* ── Login (DataKavach) ─────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}

.login-logo { display: flex; align-items: center; gap: 11px; }
.login-logo-mark {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 14px; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1F4F8B, #2A4570);
  color: #fff; box-shadow: var(--shadow-sm);
}
.login-logo-name { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.login-logo-sub { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 1px; }
.login-logo-sm { margin-bottom: 18px; }
.login-logo-sm .login-logo-mark { width: 32px; height: 32px; font-size: 12px; }

/* Left brand panel */
.login-brand {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 48px;
  color: #eef2f8;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(63,116,179,0.45), transparent 60%),
    linear-gradient(160deg, #0e1c33 0%, #122a4d 55%, #0c1830 100%);
  overflow: hidden;
}
.login-brand .login-logo-name { color: #fff; }
.login-brand .login-logo-sub { color: #9fb4d4; }
.login-brand-mid h1 {
  font-size: 34px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 650;
  margin: 0 0 14px; color: #fff;
}
.login-brand-mid p { color: #b9c8e0; font-size: 13.5px; line-height: 1.6; max-width: 440px; margin: 0 0 26px; }
.login-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.login-highlights li { display: flex; gap: 11px; align-items: flex-start; }
.login-hi-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
  background: #4f9cff; box-shadow: 0 0 0 4px rgba(79,156,255,0.18);
}
.login-highlights b { display: block; font-size: 13px; color: #fff; font-weight: 550; }
.login-highlights span { display: block; font-size: 12px; color: #9fb4d4; margin-top: 1px; }
.login-brand-foot { font-size: 11px; color: #7e93b5; font-family: var(--font-mono); }

/* Right form panel */
.login-main {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg); position: relative;
}
.login-topbar { position: absolute; top: 18px; right: 22px; }
.login-card {
  width: min(380px, 100%);
  display: flex; flex-direction: column;
}
.login-card h2 { font-size: 21px; font-weight: 620; letter-spacing: -0.015em; margin: 0 0 4px; }
.login-card-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 22px; }
.login-card .form-field { margin-bottom: 14px; }
.login-card input {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.login-pw { position: relative; display: flex; align-items: center; }
.login-pw input { padding-right: 58px; }
.login-pw-toggle {
  position: absolute; right: 6px; border: none; background: none; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--accent); padding: 4px 6px; border-radius: 6px;
}
.login-pw-toggle:hover { background: var(--accent-tint); }
.login-error {
  font-size: 12px; color: var(--danger);
  background: var(--danger-tint); border-radius: var(--r-sm);
  padding: 8px 10px; margin-bottom: 12px;
}
.login-submit { width: 100%; justify-content: center; margin-top: 4px; padding: 10px; font-size: 13px; }
.login-hint {
  margin-top: 18px; padding: 11px 12px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px dashed var(--border-2);
  display: flex; flex-direction: column; gap: 3px;
}
.login-hint span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); font-weight: 600; }
.login-hint code { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.login-footer { position: absolute; bottom: 16px; font-size: 11px; color: var(--muted-2); }

/* Splash while checking session */
.login-splash {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; background: var(--bg);
}
.login-splash-bar { width: 180px; height: 3px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.login-splash-bar span {
  display: block; height: 100%; width: 40%; border-radius: 999px; background: var(--accent);
  animation: splashSlide 1.1s ease-in-out infinite;
}
@keyframes splashSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(330%); }
}

/* ── Toasts ──────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bg);
  padding: 10px 12px; border-radius: var(--r-sm);
  box-shadow: var(--shadow-md); font-size: 12.5px; cursor: pointer;
  animation: toastIn .18s ease;
}
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.toast.ok .dot { background: var(--ok); }
.toast.warn .dot { background: var(--warn); }
.toast.danger .dot { background: var(--danger); }
.toast.info .dot { background: var(--accent); }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-x { background: none; border: none; color: var(--muted-2); cursor: pointer; font-size: 12px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,23,31,.40);
  z-index: 60; backdrop-filter: blur(2px);
}
.modal {
  position: fixed; z-index: 61; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  animation: toastIn .16s ease;
}
.modal-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border-2);
}
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.modal-head .iconbtn { margin-left: auto; }
.modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.modal.modal-wide { width: min(760px, calc(100vw - 32px)); }
.form-section { border: none; margin: 0; padding: 0; min-width: 0; }
.form-section + .form-section { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--border-2); }
.form-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); padding: 0; margin-bottom: 10px;
}
.form-section-help { font-size: 11.5px; color: var(--muted); margin: -4px 0 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.form-help { font-size: 10.5px; color: var(--muted); }
.form-field input,
.form-field select,
.form-field textarea,
.note-input {
  width: 100%; padding: 9px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg);
  font-family: inherit; font-size: 13px; color: var(--ink); resize: vertical;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.note-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ── Topbar search dropdown ──────────────────────────────────────────── */
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  padding: 6px; max-height: 320px; overflow-y: auto;
}
.search-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 8px; border: none; background: none; cursor: pointer;
  border-radius: var(--r-sm); font-family: inherit; font-size: 12.5px;
  color: var(--ink); text-align: left;
}
.search-item:hover { background: var(--bg-2); }
.search-item-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: 12px 8px; color: var(--muted); font-size: 12px; }

/* ── Notifications popover ───────────────────────────────────────────── */
.notif-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  width: 320px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 6px;
  max-height: 380px; overflow-y: auto;
}
.notif-head {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; color: var(--muted); padding: 8px 10px 4px;
}
.notif-live {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: var(--ok); padding: 0 10px 6px;
}
.notif-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.notif-item { padding: 8px 10px; border-top: 1px solid var(--border-2); }
.notif-action { font-size: 11.5px; font-weight: 600; }
.notif-target { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.notif-ts { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ── Language switcher ───────────────────────────────────────────────── */
.lang-switch {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer;
}
.lang-switch select {
  border: none; background: none; font-family: inherit; font-size: 12px;
  font-weight: 600; color: var(--ink); cursor: pointer; outline: none;
}

/* ── Inline select (toolbars) ────────────────────────────────────────── */
.select-inline {
  padding: 7px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.select-inline:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

/* ── Permission grid (RBAC) ──────────────────────────────────────────── */
.perm-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  max-height: 280px; overflow-y: auto;
}
.perm-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--bg);
  font-size: 11px; cursor: pointer;
}
.perm-item.on { border-color: var(--accent); background: var(--accent-tint); }
.perm-item input { accent-color: var(--accent); }

/* ── Discovery agent scanning ────────────────────────────────────────── */
.agent-spinner {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--accent-tint); border-top-color: var(--accent);
  animation: agentSpin .7s linear infinite;
}
@keyframes agentSpin { to { transform: rotate(360deg); } }
.agent-bar {
  display: block; height: 100%; width: 40%; border-radius: inherit;
  background: var(--accent); animation: agentSlide 1.1s ease-in-out infinite;
}
@keyframes agentSlide {
  0% { margin-left: 0; width: 20%; }
  50% { margin-left: 55%; width: 45%; }
  100% { margin-left: 0; width: 20%; }
}
