:root {
  color-scheme: dark;
  --bg: #0c0e12;
  --surface: #13151a;
  --surface-2: #191c22;
  --surface-3: #21242b;
  --sidebar: #0f1116;
  --line: #2e323b;
  --line-strong: #434955;
  --control: #616875;
  --text: #e7e9ed;
  --muted: #9aa0ab;
  --dim: #828894;
  --pink: #d9789f;
  /* Rodzina rozu zamiast jednej wartosci: jasniejszy na hover i highlighty,
     wygaszony do obramowan, fiolet jako drugi akcent. Zielen zostaje wylacznie
     statusowi. Interfejs zaczyna wygladac na zaprojektowany, nie zlozony. */
  --pink-soft: #efa9c6;
  --pink-muted: rgba(217, 120, 159, .26);
  --violet: #8b7fd4;
  --pink-strong: #e88bb0;
  --purple: #8b7fd4;
  --green: #4cc27a;
  --amber: #d9a441;
  --red: #e8626e;
  --shadow: 0 8px 24px rgba(0, 0, 0, .5);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-chip: 4px;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--line-strong); background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--control); background-clip: content-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font: 13px/1.5 "Segoe UI Variable Text", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: #fff; background: rgba(217, 120, 159, .3); }
:where(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--pink); outline-offset: 1px; }
.content:focus { outline: 0; }
svg { display: block; flex: 0 0 auto; }

.login-page { position: relative; display: grid; place-items: center; min-height: 100vh; overflow: hidden; background: #0a0c10; isolation: isolate; }
.login-page::before { content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none; background-image: linear-gradient(to right, rgba(231, 233, 237, .009) 1px, transparent 1px), linear-gradient(to bottom, rgba(231, 233, 237, .009) 1px, transparent 1px), linear-gradient(to right, rgba(231, 233, 237, .019) 1px, transparent 1px), linear-gradient(to bottom, rgba(231, 233, 237, .019) 1px, transparent 1px); background-size: 30px 30px, 30px 30px, 150px 150px, 150px 150px; background-position: 50% 50%; -webkit-mask-image: radial-gradient(64% 54% at 31% 27%, #000 4%, transparent 70%), radial-gradient(38% 44% at 82% 79%, #000 2%, transparent 62%); mask-image: radial-gradient(64% 54% at 31% 27%, #000 4%, transparent 70%), radial-gradient(38% 44% at 82% 79%, #000 2%, transparent 62%); }
.login-page::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 50% 45%, transparent 0, rgba(10, 12, 16, .12) 48%, rgba(10, 12, 16, .82) 100%); }
.login-ambient { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.ambient-bloom { position: absolute; display: block; opacity: .42; filter: blur(84px); will-change: transform; }
/* Idealne kolo to czytelny znak generatora - lamiemy je nieregularnym promieniem. */
.bloom-one, .bloom-two, .bloom-three { border-radius: 58% 42% 47% 53% / 51% 60% 40% 49%; }
.bloom-one { top: -26%; left: -16%; width: min(56vw, 800px); aspect-ratio: 1; opacity: .5; background: rgba(139, 127, 212, .17); animation: bloom-drift-one 18s ease-in-out infinite alternate; }
.bloom-two { right: -22%; bottom: -30%; width: min(37vw, 520px); aspect-ratio: 1; opacity: .34; background: rgba(217, 120, 159, .19); animation: bloom-drift-two 22s ease-in-out infinite alternate; }
.bloom-three { top: 68%; left: 6%; width: min(17vw, 240px); aspect-ratio: 1; opacity: .13; background: rgba(217, 120, 159, .12); animation: bloom-pulse 14s ease-in-out infinite alternate; }
/* 10. Wlasny mikrodetal: znak marki jako faktura tla, ledwo widoczny. */
.ambient-petal { position: absolute; right: -7vw; bottom: -13vh; display: block; width: min(46vw, 560px); aspect-ratio: 1; opacity: .042; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8b6cd'%3E%3Ccircle cx='12' cy='7.2' r='3.7'/%3E%3Ccircle cx='12' cy='16.8' r='3.7'/%3E%3Ccircle cx='7.2' cy='12' r='3.7'/%3E%3Ccircle cx='16.8' cy='12' r='3.7'/%3E%3C/svg%3E") center / contain no-repeat; transform: rotate(-14deg); }
.ambient-petal::after { content: ""; position: absolute; top: -46vh; left: -34vw; width: min(19vw, 230px); aspect-ratio: 1; opacity: .55; background: inherit; transform: rotate(19deg); }
.login-shell { position: relative; z-index: 1; width: min(100% - 32px, 420px); }
.login-card { position: relative; overflow: hidden; padding: 32px 30px 26px; border: 1px solid rgba(136, 143, 156, .17); border-radius: 19px; background: linear-gradient(168deg, rgba(25, 27, 34, .9) 0%, rgba(18, 20, 25, .92) 46%, rgba(15, 17, 22, .93) 100%); box-shadow: 0 28px 80px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .06); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: login-card-in .32s ease-out both; }
.login-card::before { content: ""; position: absolute; top: 0; right: 15%; left: 15%; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 139, 176, .58), transparent); pointer-events: none; }
.login-card::after { content: ""; position: absolute; top: -120px; right: -120px; width: 250px; height: 250px; border-radius: 50%; background: rgba(217, 120, 159, .07); filter: blur(38px); pointer-events: none; }
.login-brand-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-brand-copy { display: grid; gap: 1px; }
.login-brand-copy .eyebrow { margin: 0; color: #f6f3f7; font-size: 12.5px; font-weight: 700; letter-spacing: .145em; }
.login-brand-copy > span { color: rgba(154, 160, 171, .7); font-size: 10.5px; letter-spacing: .015em; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(217, 120, 159, .3); border-radius: 10px; color: #e88bb0; background: linear-gradient(145deg, rgba(217, 120, 159, .14), rgba(139, 127, 212, .06)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045); font-size: 17px; }
.brand-mark svg { width: 20px; height: 20px; }
.login-card .brand-mark { position: relative; overflow: hidden; width: 42px; height: 42px; border-color: rgba(217, 120, 159, .24); border-radius: 12px; background: linear-gradient(152deg, rgba(239, 169, 198, .2), rgba(139, 127, 212, .07) 58%, rgba(217, 120, 159, .05)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 3px rgba(0, 0, 0, .28); }
.login-card .brand-mark::after { content: ""; position: absolute; inset: -55% -30% auto -30%; height: 90%; background: linear-gradient(180deg, rgba(255, 255, 255, .085), transparent); border-radius: 50%; pointer-events: none; }
.login-card .brand-mark svg { position: relative; z-index: 1; width: 21px; height: 21px; }
.brand-mark.small { width: 30px; height: 30px; margin: 0; border-radius: var(--radius-sm); font-size: 13px; }
.brand-mark.small svg { width: 16px; height: 16px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.011em; }
.login-heading { position: relative; z-index: 1; margin-top: 40px; }
.login-card h1 { margin-bottom: 10px; font-size: 26px; line-height: 1.18; letter-spacing: -.02em; }
.login-heading p { max-width: 33ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.muted { color: var(--muted); }
.login-status { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 14px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid rgba(136, 143, 156, .16); border-radius: 999px; background: rgba(25, 28, 34, .6); color: var(--muted); font-size: 11.5px; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--red); }
.status-dot.online { background: var(--green); }
.status-dot.status-waiting { background: var(--amber); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .1s ease, border-color .1s ease, color .1s ease; }
.button svg { width: 15px; height: 15px; }
.button-primary { color: #1b1015; font-weight: 600; background: var(--pink); }
.button-primary:hover { background: var(--pink-strong); }
.dashboard-page .button-primary { box-shadow: 0 5px 16px rgba(217, 120, 159, .12); }
.button-quiet { border-color: var(--control); background: var(--surface-2); }
.button-quiet:hover { border-color: #6b7280; background: var(--surface-3); }
.button-danger { color: #f0a5ac; border-color: var(--control); background: var(--surface-2); }
.button-danger:hover { color: #ffc0c5; border-color: rgba(232, 98, 110, .55); background: rgba(232, 98, 110, .1); }
.button-wide { position: relative; z-index: 1; width: 100%; min-height: 44px; }
.login-card .button-primary { border-color: rgba(255, 255, 255, .1); border-radius: 11px; background: linear-gradient(180deg, var(--pink-soft) 0%, var(--pink) 62%, #cf6b94 100%); box-shadow: 0 2px 6px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .3); font-size: 13.5px; transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; }
.login-card .button-primary:hover { background: linear-gradient(180deg, #f4b6d0 0%, var(--pink-soft) 60%, var(--pink) 100%); box-shadow: 0 5px 14px rgba(217, 120, 159, .16), 0 2px 6px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .36); transform: translateY(-1px); }
.login-card .button-primary:active { box-shadow: 0 1px 3px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .24); transform: translateY(0); }
.login-card .button-primary.is-disabled { border-color: var(--line-strong); background: var(--surface-2); box-shadow: none; transform: none; }
/* Globalna obwodka focusa jest rozowa, a przycisk ma rozowe tlo - znikala. */
.button-primary:focus-visible { outline-color: #f7f4fa; outline-offset: 2px; }
.button-icon { display: grid; place-items: center; }
.button-icon svg { width: 17px; height: 17px; }
.is-disabled { color: var(--dim); border-color: var(--line-strong); background: var(--surface-2); pointer-events: none; }
.security-note { position: relative; z-index: 1; display: block; margin: 22px 0 0; color: var(--dim); font-size: 11.5px; line-height: 1.65; }
.security-note > span:last-child { display: block; }
.security-note > span:last-child { display: grid; gap: 1px; }
.security-note strong { color: var(--muted); font-weight: 600; }
.security-note small { color: var(--dim); font-size: 11px; }
.security-note-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-right: 6px; color: rgba(154, 160, 171, .92); vertical-align: -3px; }
.security-note-icon svg { width: 14px; height: 14px; }
.login-mark { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 11px; margin: 22px 0 0; color: rgba(217, 120, 159, .38); font-size: 11px; }
.login-mark::before, .login-mark::after { content: ""; width: 30px; height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 120, 159, .2)); }
.login-mark::after { transform: scaleX(-1); }
.login-error { margin: 12px 0 0; color: #f0a5ac; font-size: 12px; }

.dashboard-page { position: relative; overflow-x: hidden; background: #0a0c10; isolation: isolate; }
.dashboard-ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.dashboard-ambient::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(to right, rgba(231, 233, 237, .018) 1px, transparent 1px), linear-gradient(to bottom, rgba(231, 233, 237, .018) 1px, transparent 1px); background-size: 36px 36px; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%); mask-image: linear-gradient(to bottom, #000, transparent 72%); }
.dashboard-bloom { position: absolute; display: block; border-radius: 50%; filter: blur(100px); opacity: .36; }
.dashboard-bloom-one { top: -26%; right: -12%; width: min(48vw, 720px); aspect-ratio: 1; background: rgba(139, 127, 212, .13); animation: bloom-drift-two 28s ease-in-out infinite alternate; }
.dashboard-bloom-two { bottom: -32%; left: 14%; width: min(42vw, 620px); aspect-ratio: 1; background: rgba(217, 120, 159, .1); animation: bloom-drift-one 32s ease-in-out infinite alternate; }
.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 10px; border-right: 1px solid rgba(136, 143, 156, .18); background: rgba(13, 15, 20, .9); box-shadow: inset -1px 0 rgba(255, 255, 255, .015); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); z-index: 10; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px 6px 16px; border-bottom: 1px solid rgba(136, 143, 156, .13); }
.sidebar-brand div:last-child { display: grid; }
.sidebar-brand strong { font-size: 13px; font-weight: 600; }
.sidebar-brand span, .sidebar-footer span, .user-copy span { color: var(--dim); font-size: 11px; }
.navigation { display: grid; gap: 3px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 13px; text-align: left; cursor: pointer; transition: background .14s ease, color .14s ease, box-shadow .14s ease; }
.nav-item span { display: grid; place-items: center; width: 16px; color: var(--dim); transition: color .1s ease; }
.nav-item svg { width: 16px; height: 16px; }
.nav-item:hover { color: var(--text); background: rgba(47, 51, 61, .62); }
.nav-item:hover span { color: var(--muted); }
.nav-item { position: relative; }
.nav-item.active { color: var(--text); font-weight: 500; background: linear-gradient(90deg, rgba(217, 120, 159, .13), rgba(139, 127, 212, .055)); box-shadow: inset 0 0 0 1px rgba(217, 120, 159, .08); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 50%; width: 2px; height: 18px; border-radius: 0 2px 2px 0; background: var(--pink); transform: translateY(-50%); }
.nav-item.active span { color: var(--pink); }
.nav-item[hidden] { display: none; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid rgba(136, 143, 156, .13); }
.sidebar-footer div { display: grid; }
.sidebar-footer strong { font-size: 12px; font-weight: 500; }
.workspace { position: relative; min-width: 0; }
.topbar { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 24px; border-bottom: 1px solid rgba(136, 143, 156, .16); background: rgba(10, 12, 16, .84); box-shadow: 0 1px 0 rgba(255, 255, 255, .012); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); z-index: 8; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.breadcrumbs span { color: var(--dim); font-size: 12px; white-space: nowrap; }
.breadcrumbs span::after { content: "/"; margin-left: 8px; color: var(--muted); }
.breadcrumbs strong { overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.command-palette-trigger { display: flex; align-items: center; gap: 8px; width: min(300px, 28vw); min-height: 34px; padding: 0 10px; border: 1px solid rgba(136, 143, 156, .23); border-radius: 8px; color: var(--dim); background: rgba(25, 28, 34, .72); cursor: pointer; transition: color .12s ease, border-color .12s ease, background .12s ease; }
.command-palette-trigger:hover { color: var(--text); border-color: rgba(136, 143, 156, .42); background: rgba(31, 34, 42, .88); }
.command-palette-trigger svg { width: 15px; height: 15px; }
.command-palette-trigger > span { overflow: hidden; flex: 1; font-size: 12px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; min-height: 20px; padding: 0 5px; border: 1px solid rgba(136, 143, 156, .25); border-bottom-color: rgba(136, 143, 156, .42); border-radius: 5px; color: var(--dim); background: rgba(10, 12, 16, .55); font: 10px/1 "Cascadia Mono", ui-monospace, monospace; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.sync-indicator { display: flex; align-items: center; gap: 7px; padding-right: 4px; color: var(--dim); font-size: 11px; white-space: nowrap; }
.sync-indicator[data-state="error"] { color: #f0a5ac; }
.sync-indicator[data-state="retrying"] { color: #e8c583; }
.user-copy { display: grid; min-width: 0; max-width: 140px; }
.user-copy strong, .user-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; font-weight: 500; }
.user-avatar { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(217, 120, 159, .2); border-radius: 8px; color: #dca0b9; background: rgba(217, 120, 159, .08); font-size: 10px; font-weight: 600; }
.content { width: min(100%, 1440px); margin: 0 auto; padding: 28px 28px 44px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 4px; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.system-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 13px 15px; border: 1px solid rgba(136, 143, 156, .18); border-radius: 10px; background: rgba(18, 20, 25, .84); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018); }
.system-summary.healthy { border-color: rgba(76, 194, 122, .2); }
.system-summary.attention { border-color: rgba(217, 164, 65, .28); }
.system-summary-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; color: #86e0a8; background: rgba(76, 194, 122, .1); font-size: 13px; font-weight: 700; }
.system-summary.attention .system-summary-icon { color: #e8c583; background: rgba(217, 164, 65, .1); }
.system-summary > div { min-width: 0; flex: 1; }
.system-summary strong { display: block; font-size: 13px; font-weight: 600; }
.system-summary p { margin: 2px 0 0; color: var(--dim); font-size: 11px; overflow-wrap: anywhere; }
.grid { display: grid; gap: 12px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-column { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); }
.three-column { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { position: relative; min-width: 0; padding: 17px; border: 1px solid rgba(136, 143, 156, .18); border-radius: 10px; background: rgba(18, 20, 25, .84); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018), 0 10px 32px rgba(0, 0, 0, .1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; padding-bottom: 13px; border-bottom: 1px solid rgba(136, 143, 156, .14); }
.card-head h2, .card-head h3 { min-width: 0; margin: 0; font-size: 15px; font-weight: 600; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.module-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 11px 12px; border: 1px solid rgba(136, 143, 156, .15); border-radius: 8px; color: var(--text); background: rgba(25, 28, 34, .5); text-align: left; cursor: pointer; transition: border-color .12s ease, background .12s ease, transform .12s ease; }
.module-shortcut:hover { border-color: rgba(217, 120, 159, .25); background: rgba(33, 36, 44, .72); transform: translateY(-1px); }
.module-shortcut > span:first-child { min-width: 0; }
.module-shortcut strong, .module-shortcut small { display: block; }
.module-shortcut strong { font-size: 12px; font-weight: 600; }
.module-shortcut small { margin-top: 2px; overflow: hidden; color: var(--dim); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.module-shortcut-arrow { flex: 0 0 auto; color: var(--pink); font-size: 16px; }
.card > .table-wrap:last-child { margin: 0 -17px -17px; border: 0; border-top: 1px solid rgba(136, 143, 156, .14); border-radius: 0 0 10px 10px; }
.card > .table-wrap:last-child table { border-radius: inherit; }
.stat-card::before { content: ""; position: absolute; top: 17px; right: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent, var(--pink)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent, var(--pink)) 55%, transparent); }
.stat-card .stat-label { padding-right: 14px; }
.stat-card.accent-green { --accent: var(--green); }
.stat-card.accent-purple { --accent: var(--purple); }
.stat-card.accent-amber { --accent: var(--amber); }
.stat-card.accent-red { --accent: var(--red); }
.stat-card.accent-pink { --accent: var(--pink); }
.section-gap { margin-top: 12px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { display: block; margin-top: 7px; font-size: 23px; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-foot { display: block; margin-top: 6px; color: var(--dim); font-size: 11px; }
.metric-headline { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.metric-headline .stat-value { margin-top: 0; }
.metric-unit { color: var(--muted); font-size: 13px; }
.sparkline-wrap { margin: 14px 0 16px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--green); }
.sparkline { display: block; width: 100%; height: 44px; }
.metric-row { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.metric-row div { display: grid; gap: 2px; }
.metric-row span { color: var(--dim); font-size: 11px; }
.metric-row strong { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.network-probe-note { margin: 12px 0 0; color: var(--dim); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid rgba(136, 143, 156, .24); border-radius: 999px; color: var(--muted); background: rgba(31, 34, 42, .72); font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge.success { color: #86e0a8; border-color: rgba(76, 194, 122, .3); background: rgba(76, 194, 122, .09); }
.badge.warning { color: #e8c583; border-color: rgba(217, 164, 65, .3); background: rgba(217, 164, 65, .09); }
.badge.danger { color: #f0a5ac; border-color: rgba(232, 98, 110, .3); background: rgba(232, 98, 110, .09); }
.table-wrap { overflow-x: auto; border: 1px solid rgba(136, 143, 156, .17); border-radius: 8px; background: rgba(14, 16, 20, .28); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--dim); font-size: 11px; font-weight: 500; white-space: nowrap; background: rgba(28, 31, 38, .82); }
td { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(35, 39, 48, .5); }
.mono { font-family: "Cascadia Mono", ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: var(--muted); }
.stack { display: grid; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; padding-bottom: 0; }
.item-main { min-width: 0; }
.item-main strong, .item-main span { display: block; }
.item-main strong { font-size: 13px; font-weight: 500; }
.item-main span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.actions:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.actions .button { min-height: 26px; padding: 0 9px; font-size: 12px; }
.actions > input, .actions > select { flex: 0 1 200px; width: auto; min-height: 28px; }
.stack > .button { justify-self: start; margin-top: 12px; }
td .item-main strong { font-weight: 400; }
td .item-main span { margin-top: 1px; }
td .badge { vertical-align: middle; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters > input, .filters > select { flex: 1 1 200px; width: auto; }
.filters .button { flex: 0 0 auto; }
input, select, textarea { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid rgba(136, 143, 156, .38); border-radius: 7px; color: var(--text); background: rgba(25, 28, 34, .88); transition: border-color .12s ease, background .12s ease; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:hover, select:hover, textarea:hover { border-color: #6b7280; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); }
textarea { min-height: 80px; padding: 8px 10px; resize: vertical; }
.field { display: grid; gap: 5px; }
.field label { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.empty-state, .state-card { display: grid; place-items: center; min-height: 200px; padding: 28px; text-align: center; border: 1px solid rgba(136, 143, 156, .17); border-radius: 10px; color: var(--muted); }
.empty-state { background: rgba(25, 28, 34, .5); }
.state-card { background: rgba(18, 20, 25, .8); }
.empty-state h3, .state-card h1 { margin: 12px 0 3px; color: var(--text); font-size: 15px; }
.empty-state p, .state-card p { margin: 0; font-size: 12px; }
.state-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface-3); }
.state-icon svg { width: 16px; height: 16px; }
.state-icon.danger { color: var(--red); border-color: rgba(232, 98, 110, .4); background: rgba(232, 98, 110, .1); }
.loader { width: 22px; height: 22px; border: 2px solid var(--line-strong); border-top-color: var(--pink); border-radius: 50%; animation: spin .7s linear infinite; }
.event-line { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.event-line > div { min-width: 0; }
.event-line:last-child { border: 0; padding-bottom: 0; }
.event-line strong { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.event-line span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.event-line > .badge { justify-self: start; }
.event-line > span:last-child { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.toast-region { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 30; }
.toast { width: min(340px, calc(100vw - 32px)); padding: 11px 13px; border: 1px solid var(--line-strong); border-left-width: 2px; border-radius: var(--radius-sm); background: var(--surface-3); box-shadow: var(--shadow); font-size: 12px; animation: toast-in .14s ease-out both; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.modal { width: min(560px, calc(100vw - 28px)); padding: 0; border: 1px solid rgba(136, 143, 156, .3); border-radius: 12px; color: var(--text); background: rgba(18, 20, 25, .96); box-shadow: 0 28px 80px rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.modal[open] { animation: modal-in .14s ease-out both; }
.modal::backdrop { background: rgba(4, 5, 7, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-head, .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-head > div { min-width: 0; }
.modal-head h2 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.modal-body { display: grid; gap: 12px; max-height: 65vh; padding: 16px; overflow-y: auto; }
.modal-body .stats-grid, .modal-body .two-column, .modal-body .three-column { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.modal-body .card { padding: 12px; }
.modal-body .stat-value { font-size: 19px; }
.modal-actions { justify-content: flex-end; border-top: 1px solid var(--line); background: var(--surface-2); }
.palette-modal { width: min(620px, calc(100vw - 28px)); }
.palette-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border-bottom: 1px solid rgba(136, 143, 156, .15); }
.palette-head .eyebrow { margin-bottom: 3px; }
.palette-head h2 { margin: 0; font-size: 16px; }
.palette-search { display: flex; align-items: center; gap: 8px; margin: 14px 16px 10px; padding: 0 10px; border: 1px solid rgba(136, 143, 156, .28); border-radius: 8px; background: rgba(25, 28, 34, .72); }
.palette-search:focus-within { border-color: var(--pink); }
.palette-search svg { width: 16px; height: 16px; color: var(--dim); }
.palette-search input { min-height: 38px; padding: 0; border: 0; outline: 0; background: transparent; }
.palette-list { display: grid; gap: 4px; max-height: min(52vh, 430px); padding: 0 16px; overflow-y: auto; }
.palette-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 10px 11px; border: 1px solid transparent; border-radius: 8px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.palette-item:hover, .palette-item:focus-visible { border-color: rgba(217, 120, 159, .2); background: rgba(35, 39, 48, .68); }
.palette-item strong, .palette-item small { display: block; }
.palette-item strong { font-size: 12px; font-weight: 600; }
.palette-item small { margin-top: 2px; color: var(--dim); font-size: 11px; }
.palette-arrow { color: var(--pink); font-size: 15px; }
.palette-empty { margin: 14px 0; padding: 18px; color: var(--muted); text-align: center; }
.palette-hint { display: flex; align-items: center; gap: 5px; margin: 12px 16px 0; padding: 12px 0 14px; border-top: 1px solid rgba(136, 143, 156, .13); color: var(--dim); font-size: 10px; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface-2); cursor: pointer; transition: color .1s ease, background .1s ease; }
.icon-button:hover { color: var(--text); background: var(--surface-3); }
.icon-button svg { width: 16px; height: 16px; }
.mobile-only { display: none; }
.code-block { max-height: 400px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: #c3c9d4; background: #0a0c10; font-family: "Cascadia Mono", ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes login-card-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes bloom-drift-one { to { transform: translate3d(7vw, 5vh, 0) scale(1.08); } }
@keyframes bloom-drift-two { to { transform: translate3d(-6vw, -4vh, 0) scale(.94); } }
@keyframes bloom-pulse { to { transform: scale(1.18); opacity: .34; } }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .breadcrumbs { display: none; }
  .command-palette-trigger { margin-right: auto; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; visibility: hidden; transform: translateX(-105%); width: 248px; transition: transform .16s ease, visibility .16s; box-shadow: var(--shadow); }
  .sidebar.open { visibility: visible; transform: translateX(0); }
  .dashboard-page:has(.sidebar.open)::before { content: ""; position: fixed; inset: 0; z-index: 7; background: rgba(0, 0, 0, .55); }
  .mobile-only { display: grid; }
  .topbar { gap: 7px; padding: 0 10px; }
  .breadcrumbs { display: none; }
  .command-palette-trigger { width: 32px; min-height: 32px; padding: 0; justify-content: center; }
  .command-palette-trigger > span, .command-palette-trigger kbd, .sync-indicator > span:last-child { display: none; }
  .user-menu { gap: 5px; }
  .sync-indicator { padding: 0 2px; }
  .user-copy { display: none; }
  #logout-all-button { width: 30px; padding: 0; overflow: hidden; font-size: 0; }
  #logout-all-button::after { content: "⇥"; font-size: 14px; }
  .content { padding: 16px 12px 32px; }
  .stats-grid, .three-column, .form-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .system-summary { align-items: flex-start; flex-wrap: wrap; }
  .system-summary .button { width: 100%; }
  .quick-links { grid-template-columns: 1fr; }
  .module-shortcut:hover { transform: none; }
  .login-card { padding: 26px 22px; border-radius: 12px; }
  .login-heading { margin-top: 27px; }
  .login-card h1 { font-size: 23px; }
  .ambient-bloom { filter: blur(58px); }
  .event-line { grid-template-columns: 1fr; gap: 4px; }
  .event-line > span:last-child { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .loader { animation: none !important; border-top-color: var(--pink); }
}
@media (forced-colors: active) {
  .login-page::before, .login-page::after, .login-ambient, .dashboard-ambient, .login-card::before, .login-card::after, .stat-card::before { display: none; }
  .card, .table-wrap, .badge, .button { border: 1px solid CanvasText; }
}
