:root {
    --ink: #16221f;
    --muted: #6d7b77;
    --line: #e3ebe8;
    --panel: #ffffff;
    --canvas: #f3f7f5;
    --brand: #10b981;
    --brand-dark: #087f5b;
    --nav: #10231e;
    --shadow: 0 18px 45px rgba(24, 59, 49, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; color: #d8e7e1; background: radial-gradient(circle at 20% 0, #1b493b 0, var(--nav) 42%); display: flex; flex-direction: column; }
.brand { display: flex; gap: 13px; align-items: center; padding: 0 10px 34px; }
.brand-mark, .promo-badge { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #20d59a, #059669); font-weight: 900; box-shadow: 0 10px 30px rgba(16,185,129,.28); }
.brand strong { display: block; color: #fff; font-size: 17px; }
.brand span { display: block; margin-top: 3px; font-size: 9px; letter-spacing: 1.7px; opacity: .55; }
nav { display: grid; gap: 8px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 12px; color: #9fb8af; font-size: 14px; transition: .2s; }
nav a:hover, nav a.active { color: #fff; background: rgba(255,255,255,.09); }
nav a.active { box-shadow: inset 3px 0 var(--brand); }
nav a span { font-size: 20px; color: #54deb1; }
.sidebar-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
.admin-chip { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.admin-chip i, .live-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #2ee5aa; box-shadow: 0 0 0 5px rgba(46,229,170,.12); }
.link-button { padding: 10px 0 0; border: 0; color: #86a39a; background: none; cursor: pointer; }
.main { min-width: 0; padding: 44px clamp(24px, 4vw, 64px) 70px; }
.page-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 30px; }
.header-actions { display: flex; gap: 10px; }
.eyebrow { color: var(--brand-dark); font-size: 11px; font-weight: 800; letter-spacing: 2px; }
h1 { margin: 7px 0 4px; font-size: 34px; letter-spacing: -.8px; }
h2 { margin: 0; font-size: 18px; }
p { color: var(--muted); }
.page-header p, .panel-head p { margin: 5px 0 0; font-size: 13px; }
.primary, .secondary { border: 0; border-radius: 11px; padding: 12px 19px; cursor: pointer; font-weight: 700; }
.primary { color: #fff; background: linear-gradient(135deg, #16bd84, #079767); box-shadow: 0 9px 22px rgba(16,185,129,.22); }
.secondary { color: #285248; background: #e8f2ef; }
.button { display: inline-block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.metric { position: relative; overflow: hidden; padding: 22px; border: 1px solid rgba(255,255,255,.8); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.metric::after { content: ""; position: absolute; width: 80px; height: 80px; right: -22px; top: -25px; border-radius: 50%; background: currentColor; opacity: .08; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin: 9px 0 3px; color: var(--ink); font-size: 34px; }
.metric small { color: #93a19d; }
.metric.cyan { color: #0891b2; }.metric.green { color: #059669; }.metric.orange { color: #ea580c; }.metric.red { color: #dc2626; }
.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .72fr); gap: 20px; }
.panel { padding: 24px; border: 1px solid rgba(216,228,224,.9); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 20px; }
.panel-head a { color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 14px; color: #84928e; background: #f6f9f8; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
td { padding: 15px 14px; border-bottom: 1px solid #edf2f0; white-space: nowrap; }
.diagnostic-message { min-width: 280px; max-width: 560px; white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
tr:last-child td { border-bottom: 0; }
code { color: #176650; padding: 4px 7px; border-radius: 6px; background: #eaf6f2; font-family: "Cascadia Code", Consolas, monospace; }
.status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status.new { color: #0e7490; background: #e1f5fa; }.status.active { color: #087451; background: #dcf8ed; }.status.expired { color: #a94b11; background: #fff0df; }.status.disabled { color: #b42333; background: #fee9ec; }
.empty { padding: 50px; color: #91a09b; text-align: center; }
.activity-card .big-number { margin-top: 38px; font-size: 58px; font-weight: 850; letter-spacing: -3px; }
.activity-card > p { margin-top: 0; }
.service-line { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); font-size: 13px; }
.service-line span { color: var(--muted); }.service-line strong { color: #157c5e; }
.generate-form { display: flex; align-items: end; gap: 14px; }
label { display: grid; gap: 7px; color: #53635e; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #d8e3df; border-radius: 10px; padding: 11px 12px; outline: none; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.1); }
.generate-form label { min-width: 160px; }.generate-form .grow { flex: 1; }
.filters { display: flex; gap: 9px; }.filters select { min-width: 125px; padding: 8px 10px; }
.sub { display: block; margin-top: 6px; color: #94a19d; }
.muted { color: #91a09b; }
.actions { display: flex; gap: 6px; }
.actions button { padding: 5px 8px; border: 1px solid #dce6e2; border-radius: 7px; color: #48635a; background: #fff; cursor: pointer; font-size: 11px; }
.pagination { display: flex; justify-content: center; gap: 18px; align-items: center; padding-top: 20px; color: var(--muted); font-size: 13px; }
.pagination a { color: var(--brand-dark); font-weight: 700; }
.result-panel { max-width: 920px; text-align: center; }
.success-icon { width: 54px; height: 54px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-size: 28px; }
.result-panel textarea { min-height: 330px; margin: 20px 0; padding: 18px; resize: vertical; line-height: 1.7; font-family: "Cascadia Code", Consolas, monospace; text-align: left; }
.result-actions { display: flex; justify-content: center; gap: 10px; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #f7faf9; }
.login-promo { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 9vw; color: #fff; background: radial-gradient(circle at 20% 15%, #1d755b 0, #112c25 38%, #0a1c17 100%); }
.login-promo::after { content: ""; position: absolute; width: 520px; height: 520px; right: -240px; bottom: -230px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.018); }
.promo-badge { width: 55px; height: 55px; margin-bottom: 40px; font-size: 24px; }
.login-promo h1 { max-width: 620px; font-size: clamp(38px, 4.2vw, 66px); line-height: 1.12; letter-spacing: -2px; }
.login-promo > p { max-width: 580px; color: #a9c4bb; font-size: 16px; line-height: 1.8; }
.promo-stats { display: flex; gap: 50px; margin-top: 55px; }
.promo-stats strong { display: block; font-size: 25px; }.promo-stats span { color: #8daaa1; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(420px, 100%); padding: 42px; border: 1px solid #e5ece9; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(27,65,54,.11); }
.login-card h2 { margin-top: 8px; font-size: 30px; }.login-card > p { margin: 8px 0 28px; }
.login-card label { margin-bottom: 17px; }.wide { width: 100%; margin-top: 5px; }
.login-card small { display: block; margin-top: 18px; color: #9aa7a3; text-align: center; }
.alert { margin-bottom: 18px; padding: 11px 13px; border-radius: 9px; color: #a52535; background: #fff0f2; font-size: 13px; }
.table-link { color: var(--brand-dark); font-weight: 800; }
.chart-panel { padding-bottom: 18px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.chart-legend .trial, .bar-segment.trial { background: #28cda0; }
.chart-legend .week, .bar-segment.week { background: #2f9ee8; }
.chart-legend .month, .bar-segment.month { background: #f59e54; }
.bar-chart { height: 268px; display: flex; align-items: end; gap: clamp(2px, .55vw, 8px); padding: 24px 5px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 53px, #eef3f1 54px); }
.bar-column { min-width: 0; height: 100%; flex: 1; display: grid; grid-template-rows: 18px 1fr 24px; align-items: end; text-align: center; }
.bar-value { min-height: 18px; color: #81908b; font-size: 9px; }
.bar-stack { width: min(18px, 78%); height: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: end; overflow: hidden; border-radius: 5px 5px 2px 2px; }
.bar-segment { display: block; width: 100%; min-height: 2px; }
.bar-label { padding-top: 6px; color: #8b9994; font-size: 9px; white-space: nowrap; }
.plan-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.plan-summary div { padding: 13px 16px; background: #fbfcfc; }
.plan-summary span { display: block; color: var(--muted); font-size: 11px; }
.plan-summary strong { display: block; margin-top: 5px; font-size: 20px; }
.dealer-create-form { display: grid; grid-template-columns: 1.2fr .8fr .8fr 1.5fr auto; align-items: end; gap: 14px; }
.dealer-create-form small { color: #95a39f; font-weight: 400; }
.plan-checks { min-width: 0; margin: 0; padding: 8px 12px 10px; border: 1px solid #d8e3df; border-radius: 10px; }
.plan-checks legend { padding: 0 5px; color: #53635e; font-size: 11px; font-weight: 700; }
.plan-checks label { display: inline-flex; grid: none; align-items: center; gap: 5px; margin-right: 10px; font-size: 11px; white-space: nowrap; }
.plan-checks input { width: auto; accent-color: var(--brand); }
.api-guide pre { overflow-x: auto; margin: 0; padding: 18px; border-radius: 13px; color: #d9f8ed; background: #12241f; line-height: 1.7; }
.api-guide pre code { padding: 0; color: inherit; background: transparent; }
.guide-note { margin-bottom: 0; font-size: 13px; }
.dealer-actions { display: flex; align-items: center; gap: 5px; }
.dealer-actions form { margin: 0; }
.dealer-actions button, .dealer-actions summary { padding: 5px 8px; border: 1px solid #dce6e2; border-radius: 7px; color: #48635a; background: #fff; cursor: pointer; font-size: 11px; }
.dealer-actions details { position: relative; }
.dealer-actions summary { list-style: none; }
.limit-form { position: absolute; z-index: 5; right: 0; top: 34px; width: 220px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.limit-form label { margin-bottom: 8px; }
.limit-form input { padding: 7px; }
.api-key-output { min-height: 88px !important; text-align: center !important; font-size: 17px; }
.metric strong.metric-text { margin-top: 14px; font-size: 18px; letter-spacing: 0; word-break: break-all; }
.batch-metrics .metric small { display: block; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1050px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } .content-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }.sidebar { position: static; width: 100%; height: auto; padding: 18px; }.brand { padding-bottom: 16px; }nav { grid-template-columns: repeat(4, 1fr); }nav a { justify-content: center; padding: 10px 5px; font-size: 11px; }.sidebar-footer { display: none; }
    .main { padding: 26px 16px 50px; }.metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.generate-form { align-items: stretch; flex-direction: column; }.generate-form label { min-width: 0; }.login-shell { grid-template-columns: 1fr; }.login-promo { display: none; }.login-panel { padding: 18px; }
    .page-header { align-items: flex-start; flex-direction: column; }.header-actions { width: 100%; }.header-actions a { flex: 1; text-align: center; }.dealer-create-form { grid-template-columns: 1fr; align-items: stretch; }.plan-summary { grid-template-columns: 1fr 1fr; }.bar-chart { gap: 2px; }.bar-stack { width: 8px; }.chart-legend { display: none; }
}
