:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #f7f8fb;
  --white: #fff;
  --navy: #031c2b;
  --navy-2: #073b55;
  --blue: #0b94bc;
  --aqua: #00c879;
  --gold: #d49a24;
  --red: #d92d20;
  --shadow: 0 18px 45px rgba(16, 24, 40, .10);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .3; }
.ambient-one { width: 420px; height: 420px; background: #08b8df; top: -180px; right: -100px; }
.ambient-two { width: 380px; height: 380px; background: #00d57e; bottom: -220px; left: 10%; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 70% 12%, #0b4b68 0, var(--navy) 42%, #01080d 100%); }
.login-card { width: min(480px, 100%); padding: 42px; background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.3); border-radius: 26px; box-shadow: 0 40px 100px rgba(0,0,0,.38); }
.brand-logo { display: block; object-fit: cover; border-radius: 15px; box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.login-logo { width: 96px; height: 96px; margin-bottom: 6px; }
.sidebar-logo { width: 52px; height: 52px; border: 1px solid rgba(67,205,236,.28); border-radius: 14px; }
.eyebrow { margin: 22px 0 6px; color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; }
h2 { margin-bottom: 6px; font-size: 21px; letter-spacing: -.02em; }
h3 { margin-bottom: 5px; }
.muted, .panel-heading p, .section-lead p { color: var(--muted); line-height: 1.55; }
label { display: grid; gap: 8px; color: #344054; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #d0d5dd; border-radius: 11px; padding: 11px 13px; color: var(--ink); background: white; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: #24acd0; box-shadow: 0 0 0 4px rgba(11,148,188,.12); }
.login-card label { margin: 28px 0 18px; }
.button { border: 0; border-radius: 11px; padding: 10px 15px; font-weight: 750; color: #344054; background: white; box-shadow: inset 0 0 0 1px #d0d5dd; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: linear-gradient(135deg, #00be73, #008e5d); box-shadow: 0 10px 20px rgba(0,190,115,.22); }
.button.ghost { background: rgba(255,255,255,.8); }
.button.wide { width: 100%; padding: 13px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
.microcopy { margin: 15px 0 0; color: #98a2b3; font-size: 12px; text-align: center; }
.app-shell { position: relative; display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 2; display: flex; flex-direction: column; padding: 24px 17px 18px; color: white; background: radial-gradient(circle at 0 0, rgba(8,184,223,.14), transparent 28%), linear-gradient(180deg, var(--navy) 0%, #010c13 100%); }
.brand-row { display: flex; align-items: center; gap: 12px; padding: 0 8px 27px; }
.brand-row strong, .brand-row span { display: block; }
.brand-row span { margin-top: 3px; color: #8ea4c8; font-size: 12px; }
nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 0; border-radius: 11px; color: #b8c6dc; background: transparent; font-weight: 650; text-align: left; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(104,137,190,.17); }
.nav-item.active { box-shadow: inset 3px 0 0 #00df82; }
.nav-item span { width: 20px; color: #23c4e5; font-size: 18px; }
.boundary-card { margin-top: auto; padding: 16px; border: 1px solid rgba(100,190,181,.23); border-radius: 14px; background: rgba(20,132,125,.1); }
.boundary-card strong { font-size: 12px; }
.boundary-card p { margin: 7px 0 0; color: #92bcb8; font-size: 11px; line-height: 1.5; }
.boundary-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #00df82; box-shadow: 0 0 0 4px rgba(0,223,130,.12); }
.operator-card { margin-top: 14px; padding: 13px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.operator-card span, .operator-card small { display: block; }
.operator-card small { margin-top: 3px; color: #8ea4c8; }
.text-button { margin: 9px 0 0; padding: 0; border: 0; color: #66d6c7; background: none; font-size: 12px; }
main { min-width: 0; padding: 0 30px 40px; }
.topbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; min-height: 108px; padding: 20px 0; border-bottom: 1px solid rgba(208,213,221,.8); background: rgba(247,248,251,.88); backdrop-filter: blur(16px); }
.topbar .eyebrow { margin: 0 0 5px; }
.topbar h1 { margin: 0; font-size: 29px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; margin-right: 5px; color: #16675e; font-size: 12px; font-weight: 700; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #22b7a0; box-shadow: 0 0 0 4px rgba(34,183,160,.12); }
.view { padding-top: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric { position: relative; overflow: hidden; min-height: 130px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 7px 18px rgba(16,24,40,.04); }
.metric::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -35px; top: -35px; background: var(--accent, #dfe6ff); opacity: .45; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; margin-top: 16px; font-size: 30px; letter-spacing: -.04em; }
.metric small { color: #98a2b3; }
.portfolio-grid { display: grid; grid-template-columns: minmax(680px, 1fr) 380px; gap: 18px; align-items: start; }
.panel, .detail-panel { border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 28px rgba(16,24,40,.05); }
.panel-heading, .section-lead { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 21px; border-bottom: 1px solid var(--line); }
.panel-heading p, .section-lead p { margin: 0; font-size: 13px; }
.search { width: 265px; padding-left: 36px; background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2398a2b3' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 12px center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #eef0f3; text-align: left; font-size: 13px; }
th { color: #667085; background: #fafbfc; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: #98a2b3; }
tbody tr { transition: background .15s; }
tbody tr:hover, tbody tr.selected { background: #f6f8ff; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 8px; color: #344054; background: #f2f4f7; font-size: 11px; font-weight: 750; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #98a2b3; }
.status.active::before, .status.trialing::before { background: var(--aqua); }
.status.active { color: #087568; background: #e7f8f4; }
.status.trialing { color: #2457a7; background: #edf3ff; }
.status.past_due, .status.suspended { color: #9a6700; background: #fff7df; }
.status.past_due::before, .status.suspended::before { background: var(--gold); }
.status.closed, .status.canceled, .status.unpaid { color: #a2251a; background: #fff0ee; }
.status.closed::before, .status.canceled::before, .status.unpaid::before { background: var(--red); }
.row-action { border: 0; color: var(--blue); background: none; font-weight: 750; }
.empty { display: grid; place-items: center; gap: 5px; padding: 55px; color: var(--muted); }
.detail-panel { position: sticky; top: 130px; overflow: hidden; }
.empty-detail { min-height: 420px; display: grid; place-items: center; }
.detail-placeholder { max-width: 250px; color: var(--muted); text-align: center; }
.detail-placeholder span { display: block; color: #8aa0ed; font-size: 45px; }
.detail-head { padding: 21px; color: white; background: linear-gradient(145deg, #07506b, #031c2b); }
.detail-head .eyebrow { margin: 0 0 8px; color: #65d8c9; }
.detail-head h2 { font-size: 24px; }
.detail-head p { margin: 0; color: #aebed7; font-size: 12px; }
.detail-tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.detail-tabs button { padding: 9px 8px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: none; font-size: 11px; font-weight: 750; }
.detail-tabs button.active { color: var(--blue); border-color: var(--blue); }
.detail-content { max-height: calc(100vh - 300px); overflow-y: auto; padding: 18px 20px 22px; }
.detail-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-stat { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.detail-stat span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.detail-stat strong { display: block; margin-top: 5px; font-size: 13px; }
.subsection { margin-top: 18px; }
.subsection-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.subsection-head h3 { font-size: 13px; }
.mini-button { border: 0; color: var(--blue); background: none; font-size: 11px; font-weight: 800; }
.mini-button.danger { color: #fb7185; margin-left: 8px; }
.enrollment-code { margin: 0 0 18px; padding: 15px; border: 1px solid rgba(45,212,191,.35); border-radius: 14px; background: linear-gradient(135deg,rgba(45,212,191,.12),rgba(56,189,248,.08)); }
.enrollment-code span,.enrollment-code small { display: block; color: var(--muted); font-size: 10px; }
.enrollment-code strong { display: block; margin: 8px 0; color: #99f6e4; font: 800 14px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; overflow-wrap: anywhere; }
.list-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef0f3; }
.list-card strong, .list-card small { display: block; }
.list-card strong { font-size: 12px; }
.list-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.role-chip, .entitlement-chip { display: inline-block; margin: 3px 3px 0 0; padding: 4px 6px; border-radius: 6px; color: #3b5db0; background: #eef3ff; font-size: 9px; font-weight: 750; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.detail-actions .button { padding: 9px; font-size: 11px; }
.section-lead { margin-bottom: 17px; padding: 0; border: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 17px; }
.plan-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 26px rgba(16,24,40,.05); }
.plan-card .plan-code { color: var(--blue); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .13em; }
.plan-price { margin: 22px 0; font-size: 31px; font-weight: 850; letter-spacing: -.04em; }
.plan-price small { color: var(--muted); font-size: 12px; font-weight: 500; }
.entitlement-list { margin: 17px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.entitlement-list div { margin: 8px 0; color: #475467; font-size: 12px; }
.entitlement-list div::before { content: "✓"; margin-right: 8px; color: var(--aqua); font-weight: 900; }
.audit-list { padding: 8px 20px 20px; }
.audit-event { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.audit-event time, .audit-event small { color: var(--muted); font-size: 11px; }
.audit-event strong { display: block; font-size: 13px; }
.audit-event p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
dialog { width: min(720px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(6,16,31,.7); backdrop-filter: blur(5px); }
.dialog-form { padding: 25px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 21px; }
.dialog-head .eyebrow { margin: 0 0 6px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 10px; color: #667085; background: #f2f4f7; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-two { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.checkbox-grid { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.checkbox-grid label { display: flex; align-items: center; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; }
.checkbox-grid input { width: auto; }
.toast { position: fixed; right: 26px; bottom: 26px; z-index: 20; transform: translateY(20px); opacity: 0; padding: 13px 17px; border-radius: 12px; color: white; background: #12284a; box-shadow: var(--shadow); transition: .2s; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 1180px) { .portfolio-grid { grid-template-columns: 1fr; } .detail-panel { position: static; } .metric-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 780px) { .app-shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .boundary-card, .operator-card { display: none; } nav { grid-template-columns: repeat(3,1fr); } .nav-item { justify-content: center; font-size: 0; } .nav-item span { font-size: 18px; } main { padding: 0 16px 30px; } .topbar { align-items: flex-start; gap: 12px; } .live-pill, #refresh { display: none; } .metric-grid { grid-template-columns: 1fr 1fr; } .panel-heading { align-items: flex-start; flex-direction: column; } .search { width: 100%; } .form-grid { grid-template-columns: 1fr; } .span-two { grid-column: auto; } }
@media (max-width: 520px) { .metric-grid { grid-template-columns: 1fr; } .topbar { position: static; } .top-actions { align-self: center; } .topbar h1 { font-size: 23px; } th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5) { display: none; } .checkbox-grid { grid-template-columns: 1fr 1fr; } }
