:root {
    color-scheme: dark;
    --color-primary: #5775f3;
    --color-bg: #0d1017;
    --color-surface: #151922;
    --color-surface-muted: #1b202c;
    --color-text: #edf0f7;
    --color-muted: #9ba5b8;
    --color-border: #282f3e;
    --color-danger: #f78086;
    --color-success: #72d7b2;
    --color-warning: #e8bb77;
    --radius: 14px;
    --shadow: 0 4px 20px #0000000d;
    font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); }
a { color: #a0b2ff; color: color-mix(in srgb, var(--color-primary) 55%, #dbe5ff); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a, input, select, textarea { transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
button:disabled, input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid #a8b8ff; outline-offset: 4px; }
::selection { background: #5268bc; color: #fff; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon { flex: 0 0 auto; vertical-align: middle; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 12px 20px; border-radius: 8px; background: var(--color-primary); color: #fff; }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 30px 16px 18px; background: #11141c; border-right: 1px solid var(--color-border); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--color-text); text-decoration: none; font-size: 25px; font-weight: 750; letter-spacing: -1px; }
.brand-light { font-weight: 450; }
.brand-period { color: #8ea3ff; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 40px; border-radius: 11px; color: #fff; background: var(--color-primary); background: linear-gradient(145deg, color-mix(in srgb, var(--color-primary) 70%, white), var(--color-primary)); box-shadow: 0 4px 18px #0003; }
.brand-mark .icon { width: 23px; height: 23px; }
.workspace-label { display: flex; align-items: center; gap: 7px; margin: 15px 12px 28px; font-size: 11px; color: var(--color-muted); }
.workspace-dot { width: 5px; height: 5px; background: #72d7b2; border-radius: 50%; }
.sidebar-nav { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #343d50 transparent; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-label { margin: 0 13px 9px; font-size: 10px; letter-spacing: .13em; font-weight: 650; text-transform: uppercase; color: #8792a7; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; min-height: 41px; padding: 10px 12px; margin: 3px 0; border: 1px solid transparent; border-radius: 8px; color: #a7b0c3; text-decoration: none; font-size: 12px; font-weight: 500; }
.sidebar nav a .icon { width: 18px; height: 18px; color: #8e9ab1; }
.sidebar nav a:hover { color: var(--color-text); background: #1c2230; }
.sidebar nav a.is-active { color: #bdcbff; background: color-mix(in srgb, var(--color-primary) 17%, #11141c); border-color: color-mix(in srgb, var(--color-primary) 25%, #11141c); }
.sidebar nav a.is-active .icon { color: #a5b6ff; }
.nav-active-dot { margin-left: auto; width: 5px; height: 5px; background: #99aeff; border-radius: 50%; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--color-border); padding: 17px 6px 0; margin-top: 22px; }
.sidebar-footer>div { min-width: 0; }
.sidebar-footer strong { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer div>span { display: block; margin-top: 3px; color: var(--color-muted); font-size: 10px; }
.workspace-avatar, .user-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border-radius: 10px; border: 1px solid #39425b; color: #b5c4ff; background: #222a40; font-weight: 650; text-transform: uppercase; }
.app-main { min-width: 0; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 36px; border-bottom: 1px solid var(--color-border); background: #10131b; }
.topbar-context { display: flex; align-items: center; gap: 18px; min-width: 0; font-size: 12px; }
.topbar-workspace, .breadcrumb-divider { color: var(--color-muted); }
.breadcrumb-divider { opacity: .5; }
.topbar-page { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.user-menu form { margin: 0; }
.user-avatar { width: 33px; height: 33px; border-radius: 50%; background: #293029; border-color: #3b483e; color: #c1d2b9; font-size: 12px; }
.user-identity { display: grid; gap: 1px; max-width: 200px; }
.user-identity strong { font-weight: 550; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity>span { color: var(--color-muted); font-size: 10px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--color-border); border-radius: 9px; background: transparent; color: var(--color-muted); }
.icon-button:hover { color: var(--color-text); background: var(--color-surface-muted); }
.logout-button { margin-left: 8px; border-color: transparent; }
.menu-toggle, .sidebar-close { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 25; border: 0; background: #02050bc4; backdrop-filter: blur(3px); }
.content { padding: 32px 36px 20px; max-width: 1600px; margin: 0 auto; }
.content:focus { outline: none; }
.content-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--color-border); color: #8994a9; font-size: 10px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 4px 0 7px; font-size: clamp(26px, 2.3vw, 34px); font-weight: 650; line-height: 1.25; letter-spacing: -1px; }
.page-heading p { margin: 0; color: var(--color-muted); font-size: 13px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 10px !important; font-weight: 650; color: #a2b5ff !important; margin: 0 0 6px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
h3 { font-size: 15px; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.stat-card, .panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card { position: relative; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 9px; }
.stat-card>span, .stat-card small { color: var(--color-muted); font-size: 12px; }
.stat-card strong { font-size: clamp(25px,2.2vw,34px); font-weight: 600; letter-spacing: -1px; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-card small { margin-top: auto; font-size: 11px; line-height: 1.6; }
.panel { padding: 24px; margin-top: 22px; }
.panel h2 { margin-top: 0; }
.panel>p, .section-heading p:not(.eyebrow) { color: var(--color-muted); }
.panel + .table-wrap { margin-top: 20px; }
.table-wrap { overflow: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); scrollbar-width: thin; scrollbar-color: #3c465b transparent; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 17px 20px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
th { background: #191e29; font-size: 11px; color: var(--color-muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1c2331; }
td a { text-decoration: none; font-weight: 550; }
td a:hover { text-decoration: underline; }
td .actions { flex-wrap: nowrap; }
td .button { font-size: 11px; padding: 7px 12px; min-height: 34px; }
form.stack { display: grid; gap: 20px; max-width: 720px; }
.field { display: grid; gap: 8px; min-width: 0; color: #c4cbd9; font-size: 12px; font-weight: 500; }
.field input, .field select, .field textarea, form[method=get] input, form[method=get] select { width: 100%; min-width: 0; min-height: 43px; padding: 11px 13px; border: 1px solid #343d50; border-radius: 8px; background: #10141d; color: var(--color-text); font-size: 13px; font-weight: 400; }
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus, form[method=get] input:focus, form[method=get] select:focus { border-color: #889df7; box-shadow: 0 0 0 3px #7e98ff15; }
input::placeholder, textarea::placeholder { color: #8792a7; opacity: 1; }
.field input[type=color] { padding: 5px; height: 44px; max-width: 120px; }
.field input[type=file] { padding: 8px; }
input::file-selector-button { padding: 5px 10px; border: 0; border-radius: 4px; margin-right: 12px; background: #293349; color: #d0d9f4; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--color-primary); width: 16px; height: 16px; min-height: 16px; flex-shrink: 0; }
.checkbox-field { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--color-muted); }
.field small { color: var(--color-muted); font-weight: 400; }
form[method=get].actions>input { flex: 2 1 220px; width: auto; }
form[method=get].actions>select { flex: 1 1 160px; width: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 41px; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; background: var(--color-primary); color: #fff; text-decoration: none; cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.5; }
.button:hover { background: color-mix(in srgb, var(--color-primary) 80%, #171e35); box-shadow: 0 3px 12px #0003; }
.button .icon { width: 16px; height: 16px; }
.button-secondary { background: #202736; border-color: #353f53; color: #dde3f1; }
.button-secondary:hover { background: #2b354a; border-color: #4e5d7c; }
.button-danger { background: #48242f; border-color: #713443; color: #ffaab0; }
.button-danger:hover { background: #62303d; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.link-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: #a7b9ff; cursor: pointer; padding: 4px; font-size: 12px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; }
.alert-success { background: #152c27; border-color: #295444; color: #8ce0b6; }
.alert-error { background: #34212a; border-color: #66343f; color: #ffb0b6; }
.alert button { min-width: 32px; min-height: 32px; border: 0; background: none; color: inherit; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; padding: 20px; border-top: 1px solid var(--color-border); color: var(--color-muted); font-size: 12px; }
.pagination a { text-decoration: none; padding: 5px 10px; border-radius: 6px; background: var(--color-surface-muted); }
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px; background: #0d1017; }
.auth-layout { width: min(1120px,100%); min-height: 690px; display: grid; grid-template-columns: 1.05fr 1fr; border: 1px solid var(--color-border); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 100px #0004; }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 44px; background: radial-gradient(ellipse at 20% 90%, #24356b 0, transparent 65%), #131a2a; }
.auth-story::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(#ffffff03 1px,transparent 1px),linear-gradient(90deg,#ffffff03 1px,transparent 1px); background-size: 46px 46px; }
.auth-story>* { position: relative; }
.auth-story-copy { margin-top: 65px; }
.auth-story h2 { max-width: 390px; font-size: clamp(28px,3.2vw,43px); font-weight: 550; line-height: 1.2; letter-spacing: -1.5px; margin: 15px 0 18px; }
.auth-story h2 span { color: #98acff; }
.auth-story p { max-width: 340px; color: #a2afca; font-size: 13px; line-height: 1.8; }
.auth-story-footer { display: flex; align-items: center; gap: 9px; font-size: 11px; color: #a2afca; margin-top: 35px; }
.auth-art { height: 165px; position: relative; margin-top: 24px; overflow: hidden; }
.auth-building { position: absolute; bottom: -12px; border: 1px solid #52689c; border-radius: 6px 6px 0 0; background: linear-gradient(135deg,#33487588,#18243c); box-shadow: 15px 5px 40px #0003; transform: skewY(-7deg); }
.auth-building::after { content: ""; position: absolute; inset: 15px; background-image: repeating-linear-gradient(0deg,transparent 0 18px,#8bafff44 18px 20px),repeating-linear-gradient(90deg,transparent 0 23px,#8bafff44 23px 25px); }
.auth-building:nth-child(1) { width: 110px; height: 105px; left: 15px; }
.auth-building:nth-child(2) { width: 145px; height: 155px; left: 107px; }
.auth-building:nth-child(3) { width: 115px; height: 120px; left: 231px; }
.auth-card { width: min(420px,100%); padding: 32px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; box-shadow: var(--shadow); }
.auth-layout>.auth-card { display: flex; flex-direction: column; justify-content: center; width: auto; border: 0; border-radius: 0; padding: 60px 54px; background: #11151e; }
.auth-card h1 { font-size: 29px; letter-spacing: -.9px; font-weight: 600; margin: 20px 0 8px; }
.auth-card>p { color: var(--color-muted); font-size: 13px; margin: 0 0 30px; }
.auth-card form { display: grid; gap: 21px; }
.auth-card .field { gap: 9px; }
.auth-card .field input { min-height: 48px; }
.auth-card .button { min-height: 47px; }
.auth-card .button .icon { margin-left: auto; }
.auth-card .button>span { margin-right: auto; }
.auth-mobile-brand { display: none; }
.auth-welcome-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #353f56; border-radius: 13px; color: #a8b9fc; background: #20293d; }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-toggle { position: absolute; right: 6px; top: 5px; border: 0; }
.password-toggle[aria-pressed=true] { color: #bac8ff; background: #26314a; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--color-border); color: var(--color-muted); font-size: 10px; }
.auth-security .icon { width: 14px; height: 14px; }
@media (min-width: 769px) and (max-height: 850px) { .sidebar { padding-top: 20px; } .workspace-label { margin-bottom: 18px; } .nav-group + .nav-group { margin-top: 16px; } .sidebar nav a { min-height: 36px; padding-block: 8px; } }
@media (max-width: 1180px) { .app-shell { grid-template-columns: 224px minmax(0,1fr); } .content { padding: 28px 24px 20px; } .topbar { padding: 0 24px; } .stat-card { padding: 18px; } .auth-layout>.auth-card { padding-inline: 36px; } }
@media (max-width: 1000px) { .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .page-heading { align-items: flex-start; } .page-heading>.actions { flex-shrink: 0; } }
@media (max-width: 768px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 280px; max-width: calc(100vw - 32px); transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility .22s; }
    .sidebar.is-open { transform: translateX(0); visibility: visible; }
    body.menu-is-open { overflow: hidden; }
    .menu-toggle, .sidebar-close { display: inline-flex; }
    .sidebar-close { width: 30px; height: 30px; border: 0; }
    .sidebar-brand { padding: 0 6px; }
    .topbar { padding: 0 20px; height: 68px; gap: 12px; }
    .topbar-context { gap: 12px; }
    .topbar-workspace, .breadcrumb-divider { display: none; }
    .user-identity { display: none; }
    .user-menu { gap: 6px; }
    .logout-button { margin-left: 0; }
    .content { padding: 26px 20px 20px; }
    .auth-page { padding: 24px; }
    .auth-layout { grid-template-columns: 1fr; width: min(480px,100%); min-height: auto; }
    .auth-story { display: none; }
    .auth-layout>.auth-card { padding: 36px; }
    .auth-mobile-brand { display: inline-flex; margin-bottom: 30px; }
    .auth-welcome-icon { display: none; }
    .auth-card h1 { margin-top: 0; }
}
@media (max-width: 520px) {
    .card-grid { grid-template-columns: 1fr; }
    .page-heading { flex-direction: column; align-items: stretch; gap: 16px; }
    .page-heading>.button { align-self: flex-start; }
    .content { padding: 24px 16px 18px; }
    .topbar { padding-inline: 16px; }
    .content-footer { margin-top: 30px; }
    .content-footer>span:last-child { display: none; }
    .panel { padding: 18px; }
    .stat-card { padding: 20px; }
    th, td { padding: 14px 16px; }
    .auth-page { padding: 16px; }
    .auth-layout { border-radius: 16px; }
    .auth-layout>.auth-card { padding: 30px 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
