:root {
  color-scheme: light;
  --ink-950: #08151d;
  --ink-900: #0b1c26;
  --ink-800: #15303e;
  --ink-700: #294654;
  --ink-600: #4d6570;
  --ink-500: #71858d;
  --ink-400: #9aabb0;
  --ink-300: #c3ced1;
  --ink-200: #dce3e4;
  --ink-100: #edf1f1;
  --ink-50: #f6f8f8;
  --paper: #ffffff;
  --canvas: #f3f6f5;
  --accent-700: #0b6b5e;
  --accent-600: #0d8070;
  --accent-500: #14a18c;
  --accent-200: #a9e5da;
  --accent-100: #dff5f0;
  --accent-50: #effaf7;
  --blue-600: #2866a7;
  --blue-100: #e8f2fc;
  --amber-700: #9b5b06;
  --amber-500: #d88916;
  --amber-100: #fff2d9;
  --red-700: #a72f34;
  --red-500: #d55258;
  --red-100: #fde8e9;
  --violet-600: #6751a6;
  --violet-100: #eeeafd;
  --shadow-sm: 0 1px 2px rgba(8, 21, 29, .06), 0 1px 7px rgba(8, 21, 29, .04);
  --shadow-md: 0 10px 30px rgba(8, 21, 29, .09), 0 2px 8px rgba(8, 21, 29, .05);
  --shadow-lg: 0 24px 70px rgba(5, 20, 28, .20);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 19px;
  --sidebar-width: 256px;
  --topbar-height: 76px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink-900); background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-size: 18px; letter-spacing: -.4px; }
.brand strong { font-weight: 760; }
.brand-large { font-size: 22px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--ink-950); background: linear-gradient(145deg, #d4fff3, #5bd3bd); font-weight: 850; font-size: 17px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 8px 22px rgba(20,161,140,.22); }
.brand-large .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 21px; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(460px, 1.12fr) minmax(420px, .88fr); background: var(--paper); }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 48px clamp(42px, 6vw, 96px); color: white; background:
  radial-gradient(circle at 18% 85%, rgba(28, 190, 159, .28), transparent 32%),
  radial-gradient(circle at 88% 13%, rgba(75, 126, 153, .30), transparent 30%),
  linear-gradient(145deg, #07141c 0%, #0a222b 58%, #0d343a 100%); }
.login-brand-panel::after { content: ""; position: absolute; right: -110px; bottom: -140px; width: 460px; height: 460px; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.login-message { position: relative; z-index: 1; max-width: 720px; margin: auto 0; padding: 80px 0; }
.login-message h1 { margin: 10px 0 22px; max-width: 700px; font-size: clamp(42px, 5vw, 72px); line-height: 1.04; letter-spacing: -3px; font-weight: 720; }
.login-message p:not(.eyebrow) { max-width: 625px; margin: 0; color: #bdd0d5; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.65; }
.eyebrow { margin: 0; color: var(--accent-700); text-transform: uppercase; letter-spacing: 1.8px; font-size: 11px; font-weight: 800; }
.eyebrow.light { color: #74ddca; }
.login-proof { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; border-top: 1px solid rgba(255,255,255,.11); padding-top: 25px; }
.login-proof div { display: grid; gap: 5px; }
.login-proof strong { font-size: 13px; }
.login-proof span { color: #89a2aa; font-size: 12px; line-height: 1.45; }
.login-form-panel { display: grid; place-items: center; padding: 48px; background: linear-gradient(155deg, #fff 0%, #f5f8f7 100%); }
.login-card { width: min(100%, 430px); padding: 42px; background: rgba(255,255,255,.94); border: 1px solid var(--ink-200); border-radius: 22px; box-shadow: var(--shadow-lg); }
.login-card h2 { margin: 8px 0 5px; font-size: 32px; letter-spacing: -1.2px; }
.login-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-note { margin: 18px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.55; text-align: center; }

.field { display: grid; gap: 7px; margin-top: 20px; }
.field > span, .field-label { color: var(--ink-700); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea, .control { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink-900); background: var(--paper); border: 1px solid var(--ink-300); border-radius: var(--radius-sm); outline: 0; transition: border .15s, box-shadow .15s, background .15s; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .control:focus { border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(20,161,140,.13); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-400); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-toggle { position: absolute; right: 5px; top: 5px; }
.form-error { margin-top: 16px; padding: 10px 12px; color: var(--red-700); background: var(--red-100); border-radius: var(--radius-sm); font-size: 12px; }
.field-hint { margin-top: 5px; color: var(--ink-500); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; color: var(--ink-700); }
.check-row input { margin: 3px 0 0; accent-color: var(--accent-600); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 13px; border: 1px solid var(--ink-300); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; font-weight: 700; font-size: 12px; text-decoration: none; transition: transform .12s, background .12s, border .12s, box-shadow .12s; }
.button:hover { background: var(--ink-50); border-color: var(--ink-400); }
.button:active { transform: translateY(1px); }
.button.primary { color: white; background: var(--accent-700); border-color: var(--accent-700); box-shadow: 0 6px 18px rgba(11,107,94,.18); }
.button.primary:hover { background: #075c51; border-color: #075c51; }
.button.danger { color: var(--red-700); background: var(--red-100); border-color: #f8c7ca; }
.button.ghost { background: transparent; border-color: transparent; }
.button.soft { color: var(--accent-700); background: var(--accent-50); border-color: var(--accent-200); }
.button.wide { width: 100%; margin-top: 24px; min-height: 46px; }
.button.small { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(113,133,141,.10); }
.icon-button svg, .button svg, .nav-icon svg, .popover svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 18px 14px; color: #d5e1e4; background: linear-gradient(180deg, #091820 0%, #0b2029 62%, #0b1b23 100%); border-right: 1px solid rgba(255,255,255,.04); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 7px 18px; }
.sidebar-close { display: none; color: white; }
.estate-switcher { display: flex; align-items: center; gap: 10px; min-height: 58px; margin: 0 2px 16px; padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.035); }
.estate-avatar { display: grid; place-items: center; flex: 0 0 33px; height: 33px; border-radius: 9px; color: #bdf5e8; background: rgba(20,161,140,.18); font-size: 11px; font-weight: 800; }
.estate-switcher > span:nth-child(2) { display: grid; min-width: 0; }
.estate-switcher small { color: #77919a; font-size: 10px; }
.estate-switcher strong { overflow: hidden; color: #ecf4f5; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.primary-nav { display: grid; gap: 3px; overflow-y: auto; padding: 0 2px 18px; scrollbar-width: thin; }
.nav-section { margin: 17px 10px 5px; color: #607d87; text-transform: uppercase; letter-spacing: 1.1px; font-size: 9px; font-weight: 800; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 39px; padding: 8px 10px; color: #a9bcc2; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; font-weight: 620; font-size: 12px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: rgba(20,161,140,.16); box-shadow: inset 2px 0 0 #50cfb7; }
.nav-icon { display: inline-grid; place-items: center; width: 20px; }
.nav-badge { margin-left: auto; min-width: 19px; padding: 1px 6px; border-radius: 99px; color: #d2fff4; background: rgba(20,161,140,.25); text-align: center; font-size: 9px; }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.secure-status { display: flex; align-items: center; gap: 7px; padding: 6px 9px 11px; color: #6d8992; font-size: 10px; }
.secure-status span { width: 6px; height: 6px; border-radius: 50%; background: #48c6a8; box-shadow: 0 0 0 4px rgba(72,198,168,.10); }
.sidebar-account { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; color: #dbe6e8; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; }
.sidebar-account:hover { background: rgba(255,255,255,.05); }
.sidebar-account > span:nth-child(2) { display: grid; min-width: 0; }
.sidebar-account strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account small { color: #708b94; font-size: 9px; text-transform: capitalize; }
.user-avatar { display: inline-grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 50%; color: #d9fff6; background: #204c51; font-size: 10px; font-weight: 800; }
.chevron { margin-left: auto; color: var(--ink-400); }

.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: var(--topbar-height); padding: 10px clamp(18px, 3vw, 36px); background: rgba(255,255,255,.88); border-bottom: 1px solid rgba(195,206,209,.75); backdrop-filter: blur(14px); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left h1 { margin: 1px 0 0; font-size: 20px; letter-spacing: -.5px; line-height: 1.2; }
.page-kicker { margin: 0; color: var(--ink-500); font-size: 10px; }
.menu-button { display: none; }
.menu-button::before, .sidebar-close::before { content: ""; width: 17px; height: 12px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; box-shadow: inset 0 4px transparent, inset 0 6px currentColor; }
.sidebar-close::before { width: 15px; height: 15px; border: 0; box-shadow: none; background: linear-gradient(45deg, transparent 45%, currentColor 46%, currentColor 54%, transparent 55%), linear-gradient(-45deg, transparent 45%, currentColor 46%, currentColor 54%, transparent 55%); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.search-trigger { display: flex; align-items: center; gap: 8px; min-width: 210px; height: 36px; padding: 0 9px; color: var(--ink-500); border: 1px solid var(--ink-200); border-radius: 9px; background: var(--ink-50); cursor: pointer; text-align: left; font-size: 11px; }
.search-trigger:hover { border-color: var(--ink-300); background: white; }
.search-trigger kbd { margin-left: auto; padding: 1px 5px; color: var(--ink-500); background: white; border: 1px solid var(--ink-200); border-radius: 4px; font: inherit; font-size: 9px; box-shadow: 0 1px 0 var(--ink-200); }
.search-icon { width: 13px; height: 13px; border: 1.6px solid currentColor; border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.6px; right: -5px; bottom: -2px; background: currentColor; transform: rotate(45deg); border-radius: 2px; }
.alert-button { position: relative; border: 1px solid var(--ink-200); background: white; }
.alert-button::before { content: ""; width: 14px; height: 15px; border: 1.7px solid currentColor; border-radius: 8px 8px 5px 5px; clip-path: polygon(0 0,100% 0,100% 85%,60% 85%,52% 100%,44% 85%,0 85%); }
.notification-dot { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; color: white; background: var(--red-500); border: 2px solid white; border-radius: 99px; font-size: 8px; font-weight: 800; }
.user-chip { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 3px 7px 3px 4px; border: 1px solid var(--ink-200); border-radius: 10px; background: white; cursor: pointer; }
.user-chip:hover { background: var(--ink-50); }
.user-chip-copy { display: grid; min-width: 90px; text-align: left; }
.user-chip-copy strong { font-size: 10px; }
.user-chip-copy small { color: var(--ink-500); font-size: 9px; text-transform: capitalize; }

.view { width: 100%; max-width: 1640px; margin: 0 auto; padding: 27px clamp(18px, 3vw, 36px) 70px; outline: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 5px; font-size: 25px; letter-spacing: -.8px; }
.page-head p { margin: 0; color: var(--ink-600); max-width: 720px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 9px; background: white; border: 1px solid var(--ink-200); border-radius: 11px; box-shadow: var(--shadow-sm); }
.toolbar-search { position: relative; flex: 1 1 260px; }
.toolbar-search .search-icon { position: absolute; left: 12px; top: 13px; color: var(--ink-400); }
.toolbar-search input { width: 100%; min-height: 38px; padding: 8px 12px 8px 36px; border: 0; outline: 0; background: transparent; }
.toolbar select { min-height: 34px; padding: 5px 28px 5px 9px; border: 1px solid var(--ink-200); border-radius: 7px; background: var(--ink-50); color: var(--ink-700); font-size: 11px; }
.toolbar-count { margin-left: auto; padding: 0 7px; color: var(--ink-500); font-size: 10px; white-space: nowrap; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); }
.grid-main-even { grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); }
.stack { display: grid; gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px 12px; }
.card-head h3 { margin: 0; font-size: 13px; letter-spacing: -.15px; }
.card-head p { margin: 2px 0 0; color: var(--ink-500); font-size: 10px; }
.card-head .text-button { margin-left: auto; }
.card-body { padding: 0 18px 18px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--ink-100); }
.text-button { padding: 0; color: var(--accent-700); border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 10px; }
.text-button:hover { text-decoration: underline; }
.empty { display: grid; place-items: center; min-height: 180px; padding: 28px; color: var(--ink-500); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; color: var(--ink-500); background: var(--ink-100); border-radius: 13px; }
.empty strong { color: var(--ink-800); }
.empty p { max-width: 360px; margin: 4px 0 0; font-size: 11px; }

.metric-card { position: relative; overflow: hidden; min-height: 126px; padding: 17px; }
.metric-card::after { content: ""; position: absolute; top: -26px; right: -22px; width: 85px; height: 85px; border-radius: 50%; background: var(--ink-50); }
.metric-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: var(--ink-500); font-size: 10px; font-weight: 700; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; color: var(--accent-700); background: var(--accent-100); border-radius: 9px; }
.metric-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.metric-value { position: relative; z-index: 1; margin-top: 14px; font-size: 27px; line-height: 1; letter-spacing: -1.2px; font-weight: 760; }
.metric-meta { position: relative; z-index: 1; margin-top: 8px; color: var(--ink-500); font-size: 10px; }
.metric-meta strong { color: var(--accent-700); }
.metric-card.critical .metric-icon { color: var(--red-700); background: var(--red-100); }
.metric-card.warning .metric-icon { color: var(--amber-700); background: var(--amber-100); }
.metric-card.info .metric-icon { color: var(--blue-600); background: var(--blue-100); }

.score-layout { display: flex; align-items: center; gap: 26px; }
.score-ring { --score: 0; position: relative; display: grid; place-items: center; flex: 0 0 142px; width: 142px; height: 142px; border-radius: 50%; background: conic-gradient(var(--accent-500) calc(var(--score) * 1%), var(--ink-100) 0); }
.score-ring::before { content: ""; position: absolute; width: 112px; height: 112px; border-radius: 50%; background: white; box-shadow: inset 0 0 0 1px var(--ink-100); }
.score-value { position: relative; display: grid; text-align: center; line-height: 1; }
.score-value strong { font-size: 31px; letter-spacing: -1.5px; }
.score-value span { margin-top: 6px; color: var(--ink-500); font-size: 9px; text-transform: uppercase; letter-spacing: .7px; }
.status-breakdown { flex: 1; display: grid; gap: 11px; }
.status-row { display: grid; grid-template-columns: 100px 1fr 28px; align-items: center; gap: 10px; font-size: 10px; }
.status-row > span:first-child { color: var(--ink-600); text-transform: capitalize; }
.status-bar { height: 7px; overflow: hidden; background: var(--ink-100); border-radius: 99px; }
.status-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent-500); }
.status-row[data-status="overdue"] .status-bar span { background: var(--red-500); }
.status-row[data-status="due_soon"] .status-bar span { background: var(--amber-500); }
.status-row[data-status="not_recorded"] .status-bar span { background: var(--violet-600); }

.table-card { overflow: hidden; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 13px; color: var(--ink-500); background: #f9fbfa; border-top: 1px solid var(--ink-100); border-bottom: 1px solid var(--ink-200); text-align: left; text-transform: uppercase; letter-spacing: .55px; font-size: 8px; font-weight: 800; white-space: nowrap; }
td { padding: 12px 13px; border-bottom: 1px solid var(--ink-100); vertical-align: middle; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
.cell-main { display: grid; gap: 2px; min-width: 150px; }
.cell-main strong { color: var(--ink-900); font-size: 11px; }
.cell-main small, .cell-sub { color: var(--ink-500); font-size: 9px; }
.cell-actions { display: flex; justify-content: flex-end; gap: 5px; }
.truncate { display: block; overflow: hidden; max-width: 340px; text-overflow: ellipsis; white-space: nowrap; }
.row-link { color: var(--accent-700); text-decoration: none; font-weight: 700; }
.row-link:hover { text-decoration: underline; }

.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 3px 7px; border-radius: 99px; background: var(--ink-100); color: var(--ink-700); font-size: 9px; font-weight: 750; text-transform: capitalize; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.compliant, .pill.approved, .pill.sent, .pill.done, .pill.completed, .pill.active, .pill.won { color: var(--accent-700); background: var(--accent-100); }
.pill.due_soon, .pill.medium, .pill.reviewing, .pill.pending, .pill.in_progress, .pill.quoted { color: var(--amber-700); background: var(--amber-100); }
.pill.overdue, .pill.critical, .pill.failed, .pill.error, .pill.expired { color: var(--red-700); background: var(--red-100); }
.pill.high, .pill.unread, .pill.not_recorded { color: var(--red-700); background: #fff0e6; }
.pill.low, .pill.info, .pill.read, .pill.new, .pill.identified { color: var(--blue-600); background: var(--blue-100); }
.pill.dismissed, .pill.disabled, .pill.revoked, .pill.skipped { color: var(--ink-600); background: var(--ink-100); }
.risk-line { width: 3px; height: 30px; border-radius: 5px; background: var(--ink-300); }
.risk-line.critical { background: var(--red-500); }
.risk-line.high { background: #e67c4d; }
.risk-line.medium { background: var(--amber-500); }
.risk-line.low { background: var(--blue-600); }

.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.site-card { padding: 16px; }
.site-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.site-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--accent-700); background: var(--accent-50); border-radius: 11px; }
.site-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.site-score { display: grid; place-items: center; width: 44px; height: 44px; border: 4px solid var(--accent-200); border-radius: 50%; font-size: 10px; font-weight: 800; }
.site-score.bad { border-color: #f2a7ab; color: var(--red-700); }
.site-score.warn { border-color: #f0cf8e; color: var(--amber-700); }
.site-card h3 { margin: 14px 0 2px; font-size: 13px; }
.site-card > p { min-height: 34px; margin: 0; color: var(--ink-500); font-size: 10px; }
.site-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--ink-100); }
.site-stats div { display: grid; gap: 2px; }
.site-stats strong { font-size: 13px; }
.site-stats span { color: var(--ink-500); font-size: 8px; text-transform: uppercase; letter-spacing: .4px; }

.list { display: grid; }
.list-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--ink-100); }
.list-item:first-child { padding-top: 0; }
.list-item:last-child { padding-bottom: 0; border-bottom: 0; }
.list-copy { flex: 1; min-width: 0; }
.list-copy strong { display: block; font-size: 11px; }
.list-copy p { margin: 3px 0 0; color: var(--ink-600); font-size: 10px; line-height: 1.5; }
.list-copy small { display: block; margin-top: 5px; color: var(--ink-500); font-size: 9px; }
.list-value { flex: 0 0 auto; text-align: right; }
.alert-stripe { flex: 0 0 4px; width: 4px; min-height: 42px; border-radius: 4px; background: var(--blue-600); }
.alert-stripe.critical, .alert-stripe.high { background: var(--red-500); }
.alert-stripe.medium { background: var(--amber-500); }

.intel-card { display: grid; gap: 10px; padding: 16px; }
.intel-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.intel-card h3 { margin: 0; font-size: 13px; line-height: 1.35; }
.intel-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--ink-600); font-size: 10px; line-height: 1.55; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.intel-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--ink-100); }
.source-health { display: flex; align-items: center; gap: 7px; color: var(--ink-600); font-size: 9px; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-500); }
.health-dot.bad { background: var(--red-500); }
.health-dot.warn { background: var(--amber-500); }

.sensor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sensor-card { overflow: hidden; }
.sensor-main { padding: 16px; }
.sensor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sensor-head h3 { margin: 0; font-size: 12px; }
.sensor-head p { margin: 2px 0 0; color: var(--ink-500); font-size: 9px; }
.sensor-reading { display: flex; align-items: baseline; gap: 5px; margin-top: 18px; }
.sensor-reading strong { font-size: 31px; line-height: 1; letter-spacing: -1.4px; }
.sensor-reading span { color: var(--ink-500); font-size: 11px; }
.sparkline { width: 100%; height: 62px; margin-top: 8px; }
.sparkline path.line { fill: none; stroke: var(--accent-500); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sparkline path.area { fill: url(#spark-fill); opacity: .26; }
.sparkline .guide { stroke: var(--ink-100); stroke-width: 1; }
.sensor-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 11px 16px; background: var(--ink-50); border-top: 1px solid var(--ink-100); }
.sensor-meta div { display: grid; }
.sensor-meta strong { font-size: 10px; }
.sensor-meta span { color: var(--ink-500); font-size: 8px; text-transform: uppercase; }
.saving-card { position: relative; padding: 16px; }
.saving-value { color: var(--accent-700); font-size: 21px; letter-spacing: -.7px; font-weight: 760; }
.saving-card h3 { margin: 7px 0 4px; font-size: 12px; }
.saving-card p { margin: 0; color: var(--ink-600); font-size: 10px; }
.saving-actions { display: flex; gap: 6px; margin-top: 12px; }
.bar-chart { display: flex; align-items: end; gap: 4px; height: 130px; padding-top: 12px; }
.bar-column { flex: 1; min-width: 5px; position: relative; height: 100%; display: flex; align-items: end; }
.bar-column span { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--accent-500), var(--accent-700)); }
.bar-column:hover::after { content: attr(data-label); position: absolute; left: 50%; bottom: calc(var(--h) + 5px); transform: translateX(-50%); padding: 4px 6px; color: white; background: var(--ink-900); border-radius: 5px; font-size: 8px; white-space: nowrap; z-index: 3; }

.progress { height: 7px; overflow: hidden; background: var(--ink-100); border-radius: 99px; }
.progress span { display: block; height: 100%; background: var(--accent-500); border-radius: inherit; }
.kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--ink-100); }
.kpi-row:last-child { border-bottom: 0; }
.kpi-row strong { font-size: 11px; }
.kpi-row small { display: block; color: var(--ink-500); font-size: 9px; }
.kpi-row > span:last-child { font-weight: 750; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(4,15,21,.66); backdrop-filter: blur(5px); animation: fade-in .14s ease-out; }
.modal { width: min(100%, 610px); max-height: min(90vh, 850px); overflow: hidden; background: white; border-radius: 18px; box-shadow: var(--shadow-lg); animation: modal-in .18s ease-out; }
.modal.wide { width: min(100%, 820px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 19px 21px 15px; border-bottom: 1px solid var(--ink-100); }
.modal-head h2 { margin: 0; font-size: 17px; letter-spacing: -.4px; }
.modal-head p { margin: 3px 0 0; color: var(--ink-500); font-size: 10px; }
.modal-body { max-height: calc(90vh - 145px); overflow-y: auto; padding: 4px 21px 21px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 21px; background: var(--ink-50); border-top: 1px solid var(--ink-100); }
.modal-content-only { padding: 21px; }
.secret-box { padding: 14px; border: 1px dashed var(--accent-500); border-radius: 10px; background: var(--accent-50); }
.secret-box code { display: block; overflow-wrap: anywhere; margin-top: 7px; color: var(--accent-700); font-size: 12px; }
.details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.detail { padding: 11px; background: var(--ink-50); border-radius: 8px; }
.detail span { display: block; color: var(--ink-500); font-size: 8px; text-transform: uppercase; letter-spacing: .6px; }
.detail strong { display: block; margin-top: 3px; font-size: 10px; overflow-wrap: anywhere; }

.popover { position: fixed; z-index: 90; width: 230px; padding: 7px; background: white; border: 1px solid var(--ink-200); border-radius: 11px; box-shadow: var(--shadow-md); animation: fade-in .12s ease-out; }
.popover-user { display: flex; align-items: center; gap: 9px; padding: 8px; border-bottom: 1px solid var(--ink-100); margin-bottom: 5px; }
.popover-user > span:last-child { display: grid; min-width: 0; }
.popover-user strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
.popover-user small { color: var(--ink-500); font-size: 9px; }
.popover button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; font-size: 10px; }
.popover button:hover { background: var(--ink-50); }
.popover button.danger-text { color: var(--red-700); }

.toast-root { position: fixed; z-index: 150; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; color: white; background: var(--ink-900); border-radius: 10px; box-shadow: var(--shadow-md); animation: toast-in .2s ease-out; }
.toast.success { background: var(--accent-700); }
.toast.error { background: var(--red-700); }
.toast strong { display: block; font-size: 10px; }
.toast span { display: block; margin-top: 2px; color: rgba(255,255,255,.78); font-size: 9px; }
.toast button { margin-left: auto; color: white; border: 0; background: transparent; cursor: pointer; }

.skeleton { overflow: hidden; position: relative; min-height: 110px; background: var(--ink-100); border-radius: var(--radius); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.62), transparent); animation: shimmer 1.25s infinite; }
.loading-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; color: var(--ink-700); background: var(--blue-100); border: 1px solid #c8dff5; border-radius: 10px; font-size: 10px; }
.notice.warning { background: var(--amber-100); border-color: #efd49a; }
.notice.danger { color: var(--red-700); background: var(--red-100); border-color: #f3c4c7; }
.code-block { overflow: auto; padding: 13px; color: #d7e5e8; background: var(--ink-950); border-radius: 9px; font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }

.sidebar-overlay { display: none; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .site-grid, .sensor-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 270px; }
  .sidebar { transform: translateX(-101%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .menu-button { display: inline-grid; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(4,15,21,.46); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .app-main { margin-left: 0; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; padding: 28px; }
  .login-mobile-brand { display: flex; }
  .search-trigger { min-width: 40px; width: 40px; justify-content: center; }
  .search-trigger > span:nth-child(2), .search-trigger kbd { display: none; }
}

@media (max-width: 680px) {
  .topbar { padding: 10px 14px; }
  .user-chip-copy, .user-chip .chevron { display: none; }
  .user-chip { padding-right: 4px; border-color: transparent; background: transparent; }
  .view { padding: 20px 13px 55px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions .button { flex: 1; }
  .grid-2, .grid-3, .grid-4, .site-grid, .sensor-grid, .grid-main-even { grid-template-columns: 1fr; }
  .loading-grid { grid-template-columns: repeat(2,1fr); }
  .toolbar { flex-wrap: wrap; }
  .toolbar select { flex: 1; }
  .score-layout { align-items: flex-start; flex-direction: column; }
  .score-ring { align-self: center; }
  .status-breakdown { width: 100%; }
  .login-card { padding: 28px 22px; border-radius: 16px; }
  .login-form-panel { padding: 16px; }
  .form-grid, .details-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-body { max-height: calc(94vh - 145px); }
  td, th { padding-left: 10px; padding-right: 10px; }
}

/* Operations toolkit */
.muted { color: var(--ink-500); font-size: 11px; }
.modal-section-title { margin: 22px 0 9px; font-size: 12px; }
.inspection-checklist { display: grid; gap: 11px; }
.inspection-item { padding: 13px; background: var(--ink-50); border: 1px solid var(--ink-200); border-radius: 10px; }
.inspection-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.inspection-item-head > span:first-child { min-width: 0; }
.inspection-item-head strong { display: block; font-size: 11px; }
.inspection-item-head small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 9px; line-height: 1.5; }
.inspection-item > p { margin: 9px 0 0; color: var(--ink-700); font-size: 10px; }
.compact-form { margin-top: 3px; }
.compact-form .field { margin-top: 12px; }
.energy-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 16px; padding: 12px; background: var(--accent-50); border: 1px solid var(--accent-200); border-radius: 10px; }
.energy-preview div { display: grid; gap: 3px; }
.energy-preview span { color: var(--ink-600); font-size: 8px; text-transform: uppercase; letter-spacing: .5px; }
.energy-preview strong { color: var(--accent-700); font-size: 11px; }
.report-sheet { display: grid; gap: 16px; }
.report-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.report-title h2 { margin: 4px 0 2px; font-size: 28px; letter-spacing: -1px; }
.report-title > div > p:last-child { margin: 0; color: var(--ink-500); font-size: 10px; }
.report-section { margin-top: 0; }
.report-metrics { margin-top: 2px; }
.pill.scheduled, .pill.proposed { color: var(--blue-600); background: var(--blue-100); }
.pill.verified, .pill.resolved, .pill.pass, .pill.yes, .pill.closed { color: var(--accent-700); background: var(--accent-100); }
.pill.cancelled, .pill.rejected, .pill.accepted_risk { color: var(--ink-600); background: var(--ink-100); }
.pill.fail, .pill.no { color: var(--red-700); background: var(--red-100); }

@media (max-width: 680px) {
  .energy-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection-item-head, .report-title { flex-direction: column; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: white; color: #111; font-size: 10px; }
  .sidebar, .topbar, .sidebar-overlay, .toast-root, .modal-backdrop, .no-print { display: none !important; }
  .app-main { margin: 0 !important; }
  .view { width: 100%; max-width: none; padding: 0 !important; }
  .report-sheet { gap: 10px; }
  .report-title h2 { font-size: 22px; }
  .card { box-shadow: none; break-inside: avoid; }
  .metric-card { min-height: 90px; padding: 12px; }
  .metric-value { font-size: 20px; }
  .table-wrap { overflow: visible; }
  table { font-size: 8px; }
  th, td { padding: 6px 7px; }
  .report-section { break-inside: avoid; }
  .notice { break-inside: avoid; }
}

.calendar-range {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.calendar-range label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.calendar-range input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

@media (max-width: 700px) {
  .calendar-range { align-items: stretch; flex-direction: column; }
  .calendar-range label { min-width: 0; }
}
