:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --ink: #17231c;
  --muted: #718077;
  --line: #e4e9e4;
  --brand: #164b35;
  --brand-2: #247455;
  --lime: #d9f48f;
  --success: #16734b;
  --warning: #9a6500;
  --danger: #b44335;
  --critical: #842e42;
  --shadow: 0 16px 40px rgba(31, 49, 39, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; display: flex; flex-direction: column; color: #edf7f1; background: #123d2c; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 42px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: #a8c5b5; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #123d2c; background: var(--lime); font-weight: 900; letter-spacing: -.08em; box-shadow: 0 10px 24px rgba(17, 58, 42, .18); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; flex: 0 0 auto; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: #b9d0c3; font-size: 14px; font-weight: 650; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255, 255, 255, .09); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--lime); }
.nav-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #cae7d7; background: rgba(255, 255, 255, .07); font-size: 10px; font-weight: 900; }
.sidebar-user { margin-top: auto; padding: 14px 10px 2px; display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 12px; }.sidebar-user small { color: #97b3a3; font-size: 10px; text-transform: uppercase; margin-top: 2px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #32664e; font-weight: 800; }
.icon-button { border: 0; color: #a8c5b5; background: transparent; font-size: 17px; }

.main-content { min-width: 0; padding: 30px 38px 64px; }
.topbar { min-height: 70px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.topbar h1 { margin: 4px 0 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.05; letter-spacing: -.045em; }
.eyebrow { margin: 0; color: var(--brand-2); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.project-picker label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.project-picker select { display: block; min-width: 210px; margin-top: 6px; padding: 10px 34px 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }

.hero-card { min-height: 145px; padding: 28px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-radius: 24px; color: white; background: linear-gradient(118deg, #123d2c 0%, #1c6547 68%, #2b7b59 100%); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero-card::after { content: ''; position: absolute; width: 260px; height: 260px; right: -70px; top: -100px; border: 40px solid rgba(217,244,143,.12); border-radius: 50%; }
.hero-card .eyebrow { color: var(--lime); }.hero-card h2 { margin: 7px 0 5px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }.hero-card p:last-child { margin: 0; color: #bbd5c7; font-size: 13px; }
.sync-pill { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(217,244,143,.12); }
.command-hero { min-height: 170px; }
.hero-stat { position: relative; z-index: 1; min-width: 150px; padding: 18px 22px; border: 1px solid rgba(255,255,255,.17); border-radius: 18px; background: rgba(255,255,255,.09); text-align: center; }
.hero-stat strong, .hero-stat span { display: block; }.hero-stat strong { font-size: 42px; letter-spacing: -.06em; }.hero-stat span { color: #c6dbcf; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 18px 0; }
.metrics-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card, .panel, .finding-card { border: 1px solid var(--line); background: var(--surface); box-shadow: 0 5px 24px rgba(31,49,39,.035); }
.metric-card { min-height: 135px; padding: 20px; border-radius: var(--radius); position: relative; overflow: hidden; }
.metric-card::after { content: ''; width: 8px; height: 8px; position: absolute; top: 18px; right: 18px; border-radius: 50%; background: #b7c2bb; }
.metric-card.accent::after { background: var(--brand-2); }.metric-card.success::after { background: #42ad79; }.metric-card.danger::after { background: #d05b4c; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }.metric-card span { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }.metric-card strong { display: block; margin: 13px 0 8px; font-size: clamp(27px, 3vw, 36px); letter-spacing: -.05em; }.metric-card strong.money { font-size: clamp(20px, 2vw, 29px); }.metric-card small { font-size: 11px; }
.metric-card strong.compact-number { padding-top: 8px; font-size: 15px; letter-spacing: 0; line-height: 1.2; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; margin-bottom: 18px; }
.panel { padding: 22px; border-radius: var(--radius); overflow: hidden; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }.panel-heading h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; }.panel-heading > a { color: var(--brand-2); font-size: 12px; font-weight: 750; }
.status-bars { display: grid; gap: 16px; }.bar-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12px; }.bar-track { height: 7px; border-radius: 999px; background: #edf0ed; overflow: hidden; }.bar-track i { display: block; height: 100%; min-width: 2px; border-radius: inherit; }.bar-track i.safe { background: #3ca678; }.bar-track i.review { background: #dbab45; }.bar-track i.high { background: #b74655; }
.difference-box { margin-top: 21px; padding: 14px; border-radius: 12px; background: #f4f7f4; }.difference-box span, .difference-box small { display: block; color: var(--muted); font-size: 11px; }.difference-box strong { display: block; margin: 4px 0; font-size: 20px; }
.list-stack { display: grid; gap: 3px; }.list-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 11px; padding: 11px 2px; border-bottom: 1px solid #eef1ee; }.list-item:last-child { border-bottom: 0; }.list-item strong, .list-item small { display: block; }.list-item strong { font-size: 12px; }.list-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }.status-dot { width: 7px; height: 7px; border-radius: 50%; }.status-dot.warning { background: #d9a431; }.status-dot.critical { background: #b74655; }
.agent-list, .project-mini-list { display: grid; gap: 5px; }
.agent-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; padding: 10px 2px; border-bottom: 1px solid #edf0ed; }.agent-row:last-child { border-bottom: 0; }.agent-row strong, .agent-row small { display: block; }.agent-row strong { font-size: 12px; }.agent-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.agent-orb, .project-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: #728078; font-size: 12px; font-weight: 900; }.agent-orb.online { background: linear-gradient(145deg,#1a7951,#34a474); }.agent-orb.warning { background: #d18b2c; }.agent-orb.offline { background: #8d9991; }.agent-orb.large { width: 52px; height: 52px; border-radius: 16px; font-size: 17px; }.project-icon { color: var(--brand); background: var(--lime); }
.project-mini-list a { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 2px; border-bottom: 1px solid #edf0ed; }.project-mini-list a:last-child { border-bottom: 0; }.project-mini-list strong, .project-mini-list small { display: block; }.project-mini-list strong { font-size: 12px; }.project-mini-list small, .project-mini-list > a > span { margin-top: 3px; color: var(--muted); font-size: 10px; }.project-mini-list > a > span { text-align: right; }
.entity-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }.entity-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 24px rgba(31,49,39,.035); }.entity-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }.entity-card h2 { margin: 6px 0 8px; font-size: 19px; letter-spacing: -.03em; }.entity-card > p:not(.eyebrow) { min-height: 37px; margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }.entity-card dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 0 0 16px; }.entity-card dl div { padding: 9px; border-radius: 10px; background: #f5f7f5; }.entity-card dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }.entity-card dd { margin: 4px 0 0; font-size: 11px; font-weight: 800; }.entity-key { display: block; overflow: hidden; color: #8a968e; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.project-card { transition: transform .15s ease, box-shadow .15s ease; }.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }.sync-pill.light { color: var(--success); border-color: #d6eadf; background: #ecf7f1; font-size: 9px; }.sync-pill.light i { background: var(--success); box-shadow: none; }

.table-wrap { width: 100%; overflow-x: auto; }.panel > .table-wrap { margin: 0 -22px -22px; width: calc(100% + 44px); }.panel > .panel-heading + .table-wrap { border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }th { padding: 11px 14px; color: #718077; background: #f7f9f7; text-align: left; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; white-space: nowrap; }td { padding: 13px 14px; border-top: 1px solid #edf0ed; vertical-align: middle; }td strong { font-size: 11px; }.cell-subtitle { display: block; max-width: 260px; margin-top: 3px; color: var(--muted); font-size: 9px; }.table-empty { padding: 34px; color: var(--muted); text-align: center; }.nowrap { white-space: nowrap; }
.badge { display: inline-flex; max-width: 180px; padding: 5px 8px; border-radius: 999px; color: #526158; background: #edf0ed; font-size: 8px; font-weight: 850; letter-spacing: .03em; line-height: 1.2; text-align: center; }.badge.success { color: #0f6440; background: #dcf3e7; }.badge.warning { color: #865800; background: #fff0c9; }.badge.danger { color: #9c342d; background: #fee5df; }.badge.critical { color: #7c263b; background: #f9dce4; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; }.filter-bar input { flex: 1; }.filter-bar input, .filter-bar select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 17px; border: 0; border-radius: 11px; font-weight: 750; }.button.primary { color: #fff; background: var(--brand); }.button.primary:hover { background: #0e3425; }.button.secondary { color: var(--brand); background: #e6eee9; }.button.full { width: 100%; margin-top: 10px; }
.tabs { display: inline-flex; gap: 5px; margin-bottom: 16px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }.tabs a { padding: 8px 13px; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 750; }.tabs a.active { color: #fff; background: var(--brand); }
.finding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }.finding-card { padding: 22px; border-radius: var(--radius); border-left: 4px solid #dfad3f; }.finding-card.high { border-left-color: #b74655; }.finding-top { display: flex; align-items: center; justify-content: space-between; }.finding-card h2 { margin: 16px 0 8px; font-size: 17px; }.finding-card > p { min-height: 42px; margin: 0 0 16px; color: #526158; font-size: 12px; line-height: 1.55; }.finding-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }.finding-card dl div { padding: 10px; border-radius: 10px; background: #f5f7f5; }.finding-card dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }.finding-card dd { margin: 4px 0 0; font-size: 11px; font-weight: 750; }.question-box, .decision-box { padding: 12px; border-radius: 11px; background: #fff5dc; }.decision-box { margin-top: 8px; background: #e7f4ec; }.question-box span, .decision-box span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }.question-box p, .decision-box p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }.text-link { display: inline-block; margin-top: 14px; color: var(--brand-2); font-size: 11px; font-weight: 750; }
.system-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }.system-card { display: flex; gap: 14px; align-items: center; }.system-card h2 { margin: 4px 0; font-size: 18px; }.system-card p:last-child { margin: 0; color: var(--muted); font-size: 11px; }.system-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; font-weight: 900; }.system-icon.success { color: var(--success); background: #dcf3e7; }.system-icon.warning { color: var(--warning); background: #fff0c9; }.system-icon.danger { color: var(--danger); background: #fee5df; }.detail-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }.detail-list div { padding: 12px; border-radius: 11px; background: #f6f8f6; }.detail-list dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }.detail-list dd { margin: 5px 0 0; font-size: 11px; font-weight: 700; }
.empty-state { min-height: 420px; display: grid; place-content: center; justify-items: center; text-align: center; border: 1px dashed #ccd5ce; border-radius: 20px; background: rgba(255,255,255,.45); }.empty-state.compact { min-height: 240px; grid-column: 1/-1; }.empty-state h2 { margin: 10px 0 5px; }.empty-state p { max-width: 420px; color: var(--muted); }.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: var(--brand); background: #e2eee7; font-size: 25px; }.muted { color: var(--muted); font-size: 12px; }

.auth-page { min-height: 100vh; padding: 28px; display: grid; place-items: center; background: radial-gradient(circle at 15% 10%, rgba(217,244,143,.35), transparent 27%), linear-gradient(145deg, #eef3ef, #f8f9f7); }
.auth-card { width: min(100%, 420px); padding: 34px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 28px 80px rgba(26,59,41,.12); }.auth-card.install-card { width: min(100%, 620px); }.auth-card .brand-mark { margin-bottom: 24px; }.auth-card h1 { margin: 6px 0 7px; font-size: 30px; letter-spacing: -.04em; }.subtitle { margin: 0 0 24px; color: var(--muted); font-size: 13px; }.auth-card label { display: block; margin: 14px 0; color: #425248; font-size: 11px; font-weight: 750; }.auth-card input { width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid #dce3dd; border-radius: 10px; outline: 0; }.auth-card input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(36,116,85,.1); }.auth-card hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }.form-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.form-hint { margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }.alert { margin: 15px 0; padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.45; }.danger-box { color: #8f342e; background: #fee8e3; }.success-box { color: #125f3e; background: #dcf3e7; }.token-box { padding: 14px; border: 1px dashed #aac7b7; border-radius: 10px; background: #f1f7f3; word-break: break-all; }.token-box code { font-size: 12px; }.mobile-nav { display: none; }

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid.five { grid-template-columns: repeat(3,1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .system-grid { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: repeat(2, 1fr); }
  .entity-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }.sidebar { display: none; }.main-content { padding: 22px 16px 92px; }.topbar { align-items: flex-end; }.topbar h1 { font-size: 29px; }.project-picker label { font-size: 0; }.project-picker select { min-width: 145px; max-width: 170px; margin: 0; font-size: 11px; }
  .hero-card { min-height: 160px; padding: 24px 21px; align-items: flex-start; flex-direction: column; }.hero-card h2 { font-size: 25px; }.sync-pill { align-self: flex-start; }.metrics-grid { gap: 10px; }.metric-card { min-height: 125px; padding: 16px; }.metric-card strong { font-size: 28px; }.metric-card strong.money { font-size: 18px; }
  .panel { padding: 17px; }.panel > .table-wrap { margin: 0 -17px -17px; width: calc(100% + 34px); }.finding-grid { grid-template-columns: 1fr; }.filter-bar { display: grid; grid-template-columns: 1fr 1fr; }.filter-bar input { grid-column: 1/-1; }.form-grid.two { grid-template-columns: 1fr; gap: 0; }
  .metrics-grid.five { grid-template-columns: repeat(2,1fr); }.entity-grid { grid-template-columns: 1fr; }.hero-stat { min-width: 120px; align-self: stretch; }.hero-stat strong { font-size: 34px; }
  .mobile-nav { position: fixed; z-index: 20; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(7, 1fr); padding: 7px 5px; border: 1px solid rgba(255,255,255,.18); border-radius: 17px; background: rgba(18,61,44,.96); box-shadow: 0 12px 40px rgba(18,61,44,.26); backdrop-filter: blur(14px); }.mobile-nav a { display: grid; justify-items: center; gap: 3px; color: #9ab9a8; }.mobile-nav a > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; font-size: 9px; font-weight: 900; }.mobile-nav a small { max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 7px; }.mobile-nav a.active { color: var(--lime); }.mobile-nav a.active > span { color: var(--brand); background: var(--lime); }
}

@media (max-width: 410px) {
  .metrics-grid, .metrics-grid.five { grid-template-columns: 1fr; }.metric-card { min-height: 105px; }.auth-page { padding: 14px; }.auth-card { padding: 25px 20px; }.detail-list { grid-template-columns: 1fr; }
}
