:root {
    --blue-950: #082f49;
    --blue-900: #0c4a6e;
    --blue-800: #075985;
    --blue-700: #0369a1;
    --blue-100: #e0f2fe;
    --blue-50: #f0f9ff;
    --green-800: #166534;
    --green-700: #15803d;
    --green-600: #16a34a;
    --green-100: #dcfce7;
    --green-50: #f0fdf4;
    --amber-700: #b45309;
    --amber-100: #fef3c7;
    --red-700: #b91c1c;
    --red-100: #fee2e2;
    --slate-950: #0f172a;
    --slate-900: #172033;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --white: #fff;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 12px 35px rgba(15, 23, 42, .09);
    --shadow-lg: 0 28px 80px rgba(8, 47, 73, .2);
    --sidebar-width: 270px;
    --transition: 160ms ease;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--slate-900);
    background: var(--slate-50);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--slate-50); }
body { min-height: 100vh; margin: 0; color: var(--slate-900); background: var(--slate-50); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(14, 165, 233, .32); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--blue-950); }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 20px; letter-spacing: -.5px; }
.brand small { margin-top: 5px; color: var(--slate-500); font-size: 9px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.brand-light, .brand-light small { color: var(--white); }
.brand-light small { opacity: .66; }
.brand-mark { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: var(--white); background: linear-gradient(145deg, #0ea5e9, #16a34a); box-shadow: 0 8px 20px rgba(3, 105, 161, .25); font-size: 12px; font-weight: 900; letter-spacing: -.4px; }
.eyebrow { display: inline-block; color: #bae6fd; font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.eyebrow-dark { color: var(--blue-700); }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition); }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.button-primary { color: var(--white); background: linear-gradient(135deg, var(--blue-700), var(--blue-800)); box-shadow: 0 8px 20px rgba(3, 105, 161, .2); }
.button-primary:hover { box-shadow: 0 11px 25px rgba(3, 105, 161, .28); }
.button-secondary { color: var(--slate-700); border-color: var(--slate-300); background: var(--white); }
.button-secondary:hover { border-color: var(--blue-700); color: var(--blue-800); }
.button-danger { color: var(--red-700); border-color: #fecaca; background: #fffafa; }
.button-success { color: var(--white); background: var(--green-700); }
.button-light { color: var(--blue-950); background: var(--white); box-shadow: var(--shadow); }
.button-ghost-light { color: var(--white); border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.button-small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.button-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.text-button { padding: 0; border: 0; color: var(--blue-700); background: transparent; font-weight: 700; }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--slate-200); border-radius: 11px; color: var(--slate-600); background: var(--white); font-size: 20px; line-height: 1; }
.icon-button:hover { border-color: var(--slate-300); color: var(--blue-800); background: var(--blue-50); }

.field { display: grid; gap: 7px; color: var(--slate-700); font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea, .control { width: 100%; min-height: 45px; padding: 11px 13px; border: 1px solid var(--slate-300); border-radius: 10px; color: var(--slate-900); background: var(--white); font-weight: 500; transition: border var(--transition), box-shadow var(--transition); }
.field textarea { min-height: 98px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .control:focus { border-color: #38bdf8; outline: 0; box-shadow: 0 0 0 4px rgba(14,165,233,.12); }
.field input::placeholder, .field textarea::placeholder { color: var(--slate-400); }
.field-hint { color: var(--slate-500); font-size: 11px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-error { margin: 0; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 9px; color: var(--red-700); background: #fff7f7; font-size: 13px; line-height: 1.45; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 74px; }
.field-action { position: absolute; top: 5px; right: 6px; min-height: 35px; padding: 6px 9px; border: 0; border-radius: 7px; color: var(--blue-700); background: transparent; font-size: 12px; font-weight: 800; }

/* Authentication */
.auth-body { background: var(--white); }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.05fr) minmax(460px, .95fr); }
.auth-story { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 42px clamp(38px, 6vw, 92px); color: var(--white); background: linear-gradient(145deg, rgba(8,47,73,.97), rgba(3,105,161,.93) 58%, rgba(21,128,61,.91)), radial-gradient(circle at 80% 20%, #38bdf8, transparent 50%); }
.auth-story::before, .auth-story::after { position: absolute; content: ""; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.auth-story::before { width: 520px; height: 520px; right: -260px; bottom: -80px; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.auth-story::after { width: 220px; height: 220px; top: 22%; left: -145px; box-shadow: 0 0 0 65px rgba(255,255,255,.025); }
.auth-story > * { position: relative; z-index: 1; }
.auth-story-copy { max-width: 640px; }
.auth-story-copy h1 { max-width: 620px; margin: 15px 0 20px; font-size: clamp(38px, 4.2vw, 67px); line-height: 1.04; letter-spacing: -2.7px; }
.auth-story-copy > p { max-width: 570px; margin: 0; color: rgba(255,255,255,.77); font-size: 17px; line-height: 1.75; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.trust-row span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: rgba(255,255,255,.82); background: rgba(255,255,255,.07); font-size: 11px; font-weight: 700; }
.auth-version { margin: 0; color: rgba(255,255,255,.52); font-size: 11px; letter-spacing: .5px; }
.auth-panel { display: grid; min-height: 100vh; place-items: center; padding: 34px; background: linear-gradient(180deg, #fff, #f8fafc); }
.auth-card { width: min(430px, 100%); }
.auth-heading { margin-bottom: 28px; }
.auth-heading h2 { margin: 12px 0 8px; font-size: 31px; letter-spacing: -1px; }
.auth-heading p { margin: 0; color: var(--slate-500); line-height: 1.6; }
.auth-heading-centered { text-align: center; }
.surface-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; color: var(--blue-800); background: var(--blue-50); font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.surface-pill::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.stack-form { display: grid; gap: 17px; }
.auth-security-note { display: flex; gap: 11px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--slate-200); color: var(--slate-500); font-size: 11px; line-height: 1.55; }
.auth-security-note > span { color: var(--green-600); font-size: 20px; }
.auth-security-note p { margin: 0; }
.auth-security-note strong { display: block; color: var(--slate-700); }
.back-button { justify-self: start; margin-bottom: 4px; }
.verification-icon { display: grid; width: 56px; height: 56px; margin: 0 auto -7px; place-items: center; border: 7px solid var(--blue-100); border-radius: 17px; color: var(--blue-800); background: var(--white); box-shadow: var(--shadow-sm); font-size: 20px; font-weight: 900; }

/* MFA setup */
.setup-body { background: linear-gradient(155deg, var(--blue-50), var(--white) 48%, var(--green-50)); }
.setup-layout { display: grid; width: min(760px, calc(100% - 34px)); min-height: 100vh; margin: 0 auto; grid-template-rows: auto 1fr auto; gap: 22px; padding: 28px 0 20px; }
.setup-card { align-self: center; padding: clamp(26px, 5vw, 48px); border: 1px solid var(--slate-200); border-radius: var(--radius-lg); background: rgba(255,255,255,.95); box-shadow: var(--shadow-lg); }
.setup-card > h1 { margin: 11px 0 12px; font-size: clamp(28px, 4vw, 41px); letter-spacing: -1.5px; }
.setup-intro { margin: 0 0 28px; color: var(--slate-600); line-height: 1.7; }
.setup-progress { display: flex; align-items: center; margin-bottom: 28px; }
.setup-progress span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--slate-300); border-radius: 50%; color: var(--slate-500); background: var(--white); font-size: 11px; font-weight: 800; }
.setup-progress span.is-active { border-color: var(--blue-700); color: var(--white); background: var(--blue-700); }
.setup-progress i { width: 50px; height: 1px; background: var(--slate-300); }
.state-panel { display: grid; min-height: 170px; place-items: center; align-content: center; gap: 13px; color: var(--slate-500); }
.state-panel p { margin: 0; }
.spinner { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--slate-200); border-top-color: var(--blue-700); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.secret-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid #bae6fd; border-radius: 12px; background: var(--blue-50); }
.secret-card > div { min-width: 0; }
.secret-card .label { display: block; margin-bottom: 7px; color: var(--blue-800); font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.secret-card code { overflow-wrap: anywhere; color: var(--slate-950); font-size: 17px; font-weight: 800; letter-spacing: 2px; }
.uri-details { margin: 12px 0 22px; color: var(--slate-500); font-size: 12px; }
.uri-details summary { cursor: pointer; font-weight: 700; }
.uri-details code { display: block; max-height: 75px; overflow: auto; margin-top: 8px; padding: 10px; border-radius: 8px; background: var(--slate-100); overflow-wrap: anywhere; }
.setup-steps { display: grid; gap: 10px; margin: 20px 0 25px; padding-left: 22px; color: var(--slate-600); font-size: 13px; line-height: 1.5; }
.confirm-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; }
.success-symbol { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 50%; color: var(--green-800); background: var(--green-100); font-size: 27px; font-weight: 900; }
#recovery-content h2 { margin: 18px 0 8px; font-size: 28px; }
#recovery-content > p { color: var(--slate-600); line-height: 1.6; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 22px 0; padding: 16px; border: 1px dashed var(--slate-300); border-radius: 12px; background: var(--slate-50); }
.recovery-grid code { padding: 7px; border-radius: 7px; text-align: center; background: var(--white); font-size: 13px; font-weight: 800; letter-spacing: .7px; }
.setup-footer { margin: 0; color: var(--slate-500); text-align: center; font-size: 11px; }

/* Main admin shell */
.app-body { overflow: hidden; }
.app-layout { display: grid; min-height: 100vh; grid-template-columns: var(--sidebar-width) 1fr; }
.sidebar { position: relative; z-index: 30; display: flex; height: 100vh; flex-direction: column; overflow: hidden; color: rgba(255,255,255,.8); background: linear-gradient(180deg, var(--blue-950), #093f5d 64%, #0f5132); box-shadow: 8px 0 30px rgba(8,47,73,.1); }
.sidebar::after { position: absolute; right: -120px; bottom: -130px; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; box-shadow: 0 0 0 55px rgba(255,255,255,.025); pointer-events: none; }
.sidebar-brand-row { display: flex; min-height: 82px; align-items: center; justify-content: space-between; padding: 19px 21px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-close { display: none; color: var(--white); border-color: transparent; background: transparent; }
.main-nav { position: relative; z-index: 1; display: flex; flex: 1; flex-direction: column; gap: 3px; overflow-y: auto; padding: 15px 13px 20px; }
.main-nav .nav-label { margin: 14px 11px 5px; color: rgba(255,255,255,.4); font-size: 9px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase; }
.main-nav a { display: flex; min-height: 43px; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 650; transition: background var(--transition), color var(--transition); }
.main-nav a > span { display: grid; width: 23px; place-items: center; color: #7dd3fc; font-size: 17px; }
.main-nav a:hover { color: var(--white); background: rgba(255,255,255,.07); }
.main-nav a.is-active { color: var(--white); background: linear-gradient(90deg, rgba(14,165,233,.24), rgba(34,197,94,.14)); box-shadow: inset 3px 0 #38bdf8; }
.sidebar-status { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 10px 13px 17px; padding: 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; background: rgba(255,255,255,.05); }
.sidebar-status .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.12); }
.sidebar-status div { display: grid; }
.sidebar-status strong { color: var(--white); font-size: 11px; }
.sidebar-status small { margin-top: 3px; color: rgba(255,255,255,.44); font-size: 9px; }
.app-main { min-width: 0; height: 100vh; overflow: auto; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 18px; padding: 13px clamp(18px, 3vw, 38px); border-bottom: 1px solid var(--slate-200); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 13px; }
.breadcrumb { margin: 0 0 3px; color: var(--slate-400); font-size: 10px; font-weight: 650; }
.topbar h1 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.menu-toggle { display: none; }
.notification-button { position: relative; }
.notification-button > span { position: absolute; top: -5px; right: -5px; display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border: 2px solid var(--white); border-radius: 10px; color: var(--white); background: var(--red-700); font-size: 9px; font-weight: 900; }
.user-menu-wrap { position: relative; }
.user-button { display: flex; min-width: 210px; align-items: center; gap: 10px; padding: 5px 8px 5px 6px; border: 1px solid transparent; border-radius: 12px; color: var(--slate-700); background: transparent; text-align: left; }
.user-button:hover { border-color: var(--slate-200); background: var(--slate-50); }
.user-button > span:nth-child(2) { display: grid; min-width: 0; flex: 1; }
.user-button strong { overflow: hidden; max-width: 170px; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.user-button small { margin-top: 2px; color: var(--slate-400); font-size: 9px; }
.user-button b { color: var(--slate-400); font-size: 12px; }
.avatar { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; color: var(--blue-800); background: var(--blue-100); font-size: 12px; font-weight: 900; }
.user-dropdown { position: absolute; top: calc(100% + 9px); right: 0; width: 210px; overflow: hidden; border: 1px solid var(--slate-200); border-radius: 11px; background: var(--white); box-shadow: var(--shadow); }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; padding: 12px 14px; border: 0; color: var(--slate-700); background: var(--white); text-align: left; font-size: 12px; font-weight: 650; }
.user-dropdown a:hover, .user-dropdown button:hover { color: var(--blue-800); background: var(--blue-50); }
.user-dropdown button { border-top: 1px solid var(--slate-100); color: var(--red-700); }
.content { min-height: calc(100vh - 82px); padding: clamp(20px, 3vw, 38px); }
.page-loading { display: grid; min-height: 240px; place-items: center; align-content: center; gap: 13px; color: var(--slate-500); }
.page-loading p { margin: 0; font-size: 13px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h2 { margin: 5px 0 5px; font-size: clamp(23px, 3vw, 32px); letter-spacing: -1px; }
.page-head p { max-width: 760px; margin: 0; color: var(--slate-500); font-size: 13px; line-height: 1.55; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric-card { position: relative; min-height: 128px; overflow: hidden; padding: 19px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
.metric-card::after { position: absolute; right: -22px; bottom: -30px; width: 85px; height: 85px; border-radius: 50%; content: ""; background: var(--blue-50); }
.metric-card.is-alert::after { background: var(--red-100); }
.metric-card.is-success::after { background: var(--green-100); }
.metric-card .metric-label { display: block; max-width: 80%; color: var(--slate-500); font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 13px; color: var(--slate-950); font-size: 29px; letter-spacing: -1px; }
.metric-card small { display: block; margin-top: 4px; color: var(--slate-400); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 17px; margin-top: 17px; }
.panel { min-width: 0; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 13px; padding: 14px 17px; border-bottom: 1px solid var(--slate-100); }
.panel-header h3 { margin: 0; font-size: 14px; }
.panel-header p { margin: 3px 0 0; color: var(--slate-400); font-size: 10px; }
.panel-body { padding: 17px; }
.panel-flush { padding: 0; }
.section-gap { height: 17px; }
.health-list { display: grid; gap: 9px; }
.health-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 10px; background: var(--slate-50); }
.health-item div { display: grid; gap: 2px; }
.health-item strong { font-size: 12px; }
.health-item small { color: var(--slate-500); font-size: 10px; }
.health-light { width: 10px; height: 10px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 4px var(--green-100); }
.health-light.is-warning { background: #f59e0b; box-shadow: 0 0 0 4px var(--amber-100); }
.fx-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--slate-100); font-size: 12px; }
.fx-row:last-child { border-bottom: 0; }
.fx-row strong { font-variant-numeric: tabular-nums; }

.data-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { min-height: 35px; padding: 7px 12px; border: 1px solid var(--slate-200); border-radius: 999px; color: var(--slate-600); background: var(--white); font-size: 11px; font-weight: 750; }
.filter-chip:hover, .filter-chip.is-active { border-color: #7dd3fc; color: var(--blue-800); background: var(--blue-50); }
.search-control { width: min(270px, 100%); min-height: 38px; padding: 8px 12px; border: 1px solid var(--slate-300); border-radius: 9px; background: var(--white); font-size: 12px; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
.data-table th { padding: 11px 13px; border-bottom: 1px solid var(--slate-200); color: var(--slate-500); background: var(--slate-50); text-align: left; font-size: 9px; font-weight: 850; letter-spacing: .65px; text-transform: uppercase; }
.data-table td { max-width: 330px; padding: 12px 13px; border-bottom: 1px solid var(--slate-100); color: var(--slate-600); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfdff; }
.data-table .primary-cell { color: var(--slate-900); font-weight: 750; }
.data-table .wrap-cell { min-width: 210px; white-space: normal; line-height: 1.45; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-button { min-height: 31px; padding: 5px 9px; border: 1px solid var(--slate-200); border-radius: 7px; color: var(--blue-800); background: var(--white); font-size: 10px; font-weight: 750; }
.row-button:hover { border-color: #7dd3fc; background: var(--blue-50); }
.badge { display: inline-flex; min-height: 23px; align-items: center; padding: 4px 8px; border-radius: 999px; color: var(--slate-700); background: var(--slate-100); font-size: 9px; font-weight: 850; letter-spacing: .3px; text-transform: uppercase; }
.badge-success { color: var(--green-800); background: var(--green-100); }
.badge-info { color: var(--blue-800); background: var(--blue-100); }
.badge-warning { color: var(--amber-700); background: var(--amber-100); }
.badge-danger { color: var(--red-700); background: var(--red-100); }
.empty-state { display: grid; min-height: 240px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.empty-state .empty-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; color: var(--blue-800); background: var(--blue-50); font-size: 22px; }
.empty-state h3 { margin: 15px 0 6px; font-size: 16px; }
.empty-state p { max-width: 430px; margin: 0; color: var(--slate-500); font-size: 12px; line-height: 1.6; }
.error-state .empty-icon { color: var(--red-700); background: var(--red-100); }
.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 17px; }
.summary-item { padding: 14px; border: 1px solid var(--slate-200); border-radius: 11px; background: var(--white); }
.summary-item span { display: block; color: var(--slate-500); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.summary-item strong { display: block; margin-top: 7px; font-size: 22px; }
.tabs { display: flex; gap: 3px; overflow-x: auto; padding: 4px; border: 1px solid var(--slate-200); border-radius: 11px; background: var(--white); }
.tabs button { min-height: 35px; padding: 7px 12px; border: 0; border-radius: 8px; color: var(--slate-500); background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.tabs button.is-active { color: var(--blue-800); background: var(--blue-50); }

.mobile-overlay { position: fixed; z-index: 25; inset: 0; background: rgba(15,23,42,.48); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 55; top: 0; right: 0; width: min(430px, 100%); height: 100vh; overflow: auto; border-left: 1px solid var(--slate-200); background: var(--white); box-shadow: -20px 0 60px rgba(15,23,42,.14); transform: translateX(105%); transition: transform 220ms ease; }
.drawer.is-open { transform: translateX(0); }
.drawer-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px; border-bottom: 1px solid var(--slate-200); background: rgba(255,255,255,.95); }
.drawer-header h2 { margin: 5px 0 0; font-size: 24px; }
.drawer-content { padding: 13px; }
.notification-item { display: grid; grid-template-columns: 9px 1fr auto; gap: 11px; padding: 14px 9px; border-bottom: 1px solid var(--slate-100); }
.notification-item.is-read { opacity: .6; }
.notification-severity { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--blue-700); }
.notification-severity.warning { background: #f59e0b; }
.notification-severity.critical { background: var(--red-700); }
.notification-item h3 { margin: 0 0 5px; font-size: 12px; }
.notification-item p { margin: 0; color: var(--slate-500); font-size: 11px; line-height: 1.5; }
.notification-item time { color: var(--slate-400); font-size: 9px; white-space: nowrap; }
.notification-item button { grid-column: 2; justify-self: start; }

.modal { width: min(650px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: var(--radius-lg); background: transparent; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(15,23,42,.58); backdrop-filter: blur(3px); }
.modal-shell { overflow: hidden; border-radius: var(--radius-lg); background: var(--white); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 21px 23px; border-bottom: 1px solid var(--slate-200); }
.modal-header h2 { margin: 5px 0 0; font-size: 21px; }
.modal-body { max-height: calc(100vh - 220px); overflow: auto; padding: 23px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 15px 23px; border-top: 1px solid var(--slate-200); background: var(--slate-50); }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; width: min(360px, calc(100% - 40px)); gap: 9px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--slate-200); border-left: 4px solid var(--green-600); border-radius: 10px; color: var(--slate-700); background: var(--white); box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; animation: toast-in 180ms ease; }
.toast.is-error { border-left-color: var(--red-700); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Field operations */
.ops-body { background: #f4f8fa; }
.ops-header { position: sticky; z-index: 15; top: 0; display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 18px; padding: 14px clamp(18px, 4vw, 55px); background: var(--blue-950); box-shadow: 0 6px 20px rgba(8,47,73,.14); }
.ops-user { display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,.72); font-size: 11px; }
.ops-main { width: min(1450px, calc(100% - 36px)); margin: 0 auto; padding: 27px 0 50px; }
.ops-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; padding: 27px; border-radius: var(--radius-lg); color: var(--white); background: linear-gradient(135deg, var(--blue-800), #0e7490 63%, var(--green-700)); box-shadow: var(--shadow); }
.ops-hero h1 { margin: 8px 0 6px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -1.5px; }
.ops-hero p { max-width: 680px; margin: 0; color: rgba(255,255,255,.73); font-size: 13px; line-height: 1.55; }
.ops-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.ops-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.ops-card { display: flex; min-height: 265px; flex-direction: column; padding: 18px; border: 1px solid var(--slate-200); border-top: 4px solid var(--blue-700); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
.ops-card.is-emergency { border-top-color: var(--red-700); }
.ops-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ops-card h2 { margin: 8px 0 6px; font-size: 16px; line-height: 1.35; }
.ops-card .order-no { color: var(--slate-400); font-size: 9px; font-weight: 850; letter-spacing: .8px; }
.ops-card-description { display: -webkit-box; overflow: hidden; margin: 5px 0 15px; color: var(--slate-500); font-size: 11px; line-height: 1.55; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ops-meta { display: grid; gap: 7px; margin-bottom: 15px; }
.ops-meta div { display: flex; justify-content: space-between; gap: 12px; color: var(--slate-500); font-size: 10px; }
.ops-meta strong { color: var(--slate-700); text-align: right; }
.ops-card-actions { display: flex; gap: 8px; margin-top: auto; }
.ops-card-actions .button { flex: 1; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-story { min-height: 310px; padding: 29px; }
    .auth-story-copy { margin-top: 45px; }
    .auth-story-copy h1 { font-size: 39px; letter-spacing: -1.5px; }
    .auth-story-copy > p, .trust-row { display: none; }
    .auth-panel { min-height: auto; padding: 45px 24px 60px; }
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: 0; left: 0; width: min(var(--sidebar-width), calc(100% - 54px)); transform: translateX(-105%); transition: transform 220ms ease; }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-close, .menu-toggle { display: grid; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .auth-story { min-height: 255px; }
    .auth-story-copy { margin-top: 28px; }
    .auth-story-copy h1 { font-size: 30px; }
    .auth-version { display: none; }
    .auth-panel { padding: 35px 20px 50px; }
    .auth-heading h2 { font-size: 27px; }
    .setup-card { padding: 24px 20px; }
    .secret-card, .confirm-row { align-items: stretch; grid-template-columns: 1fr; }
    .secret-card { flex-direction: column; }
    .recovery-grid { grid-template-columns: 1fr; }
    .topbar { min-height: 68px; padding: 10px 13px; }
    .breadcrumb { display: none; }
    .topbar h1 { font-size: 15px; }
    .user-button { min-width: 0; padding: 4px; }
    .user-button > span:nth-child(2), .user-button b { display: none; }
    .notification-button, .icon-button { width: 39px; height: 39px; }
    .content { min-height: calc(100vh - 68px); padding: 18px 13px 35px; }
    .page-head { align-items: stretch; flex-direction: column; }
    .page-actions { justify-content: flex-start; }
    .page-actions .button { flex: 1; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .metric-card { min-height: 110px; padding: 14px; }
    .metric-card strong { font-size: 25px; }
    .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .form-grid { grid-template-columns: 1fr; }
    .modal-body { padding: 19px 16px; }
    .modal-header, .modal-footer { padding-right: 16px; padding-left: 16px; }
    .ops-header { padding: 12px 15px; }
    .ops-user > span { display: none; }
    .ops-main { width: calc(100% - 24px); padding-top: 15px; }
    .ops-hero { align-items: stretch; flex-direction: column; padding: 20px; }
    .ops-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
