:root {
    --ink: #171717;
    --muted: #6b7280;
    --line: #e5e7eb;
    --panel: #ffffff;
    --surface: #f6f7f9;
    --accent: #0f766e;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--surface); }
a { color: inherit; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { background: #111827; color: white; padding: 20px 16px; }
.brand-panel { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-mark { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); font-weight: 800; }
.brand-title { font-weight: 800; }
.brand-subtitle { color: #9ca3af; font-size: .85rem; }
.nav-stack { display: grid; gap: 6px; }
.nav-group { display: grid; gap: 4px; }
.nav-group-button { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 8px; background: transparent; color: #f9fafb; cursor: pointer; font: inherit; font-weight: 800; padding: 10px 12px; text-align: left; }
.nav-group-button:hover { background: #1f2937; }
.nav-chevron { color: #94a3b8; font-size: .78rem; }
.nav-submenu { display: grid; gap: 4px; padding: 0 0 8px 10px; }
.nav-link { padding: 9px 12px; border-radius: 8px; color: #d1d5db; text-decoration: none; }
.nav-link.active, .nav-link:hover { background: #1f2937; color: white; }
.content-shell { min-width: 0; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: white; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.page-content { padding: 28px; }
h1 { margin: 0 0 20px; font-size: 2rem; }
h2 { margin-top: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card, .work-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metric-card { display: grid; gap: 10px; }
.metric-card span { color: var(--muted); }
.metric-card strong { font-size: 1.35rem; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { font-size: .78rem; text-transform: uppercase; color: var(--muted); background: #f9fafb; }
.status-badge, .plan-badge { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-size: .8rem; font-weight: 700; }
.status-badge.good { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.status-badge.warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.status-badge.bad { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.button { border: 0; border-radius: 8px; background: var(--accent); color: white; font-weight: 800; padding: 9px 12px; }
.button.secondary { background: #374151; }
.button[disabled] { opacity: .5; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; color: #374151; background: #fff; text-decoration: none; }
.icon-button:hover { background: #f3f4f6; color: var(--accent); border-color: #c7d2fe; }
.icon-button svg { width: 18px; height: 18px; fill: currentColor; }
.form-control { width: 100%; max-width: 360px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea.form-control { min-height: 128px; max-width: none; resize: vertical; font: inherit; }
.note-form { display: grid; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; }
.state-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; color: var(--muted); }
.success-panel { margin-top: 12px; color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.error-panel { margin-top: 12px; color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.workflow-list { margin: 14px 0 0; padding-left: 18px; color: var(--muted); }
.workflow-list li { margin: 7px 0; }
.usage-bar { height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); }
.chart-bars { display: flex; align-items: end; gap: 8px; height: 140px; }
.chart-bar { flex: 1; min-width: 10px; background: var(--accent); border-radius: 6px 6px 0 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.admin-definition-list { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; margin: 0; }
.admin-definition-list dt { color: var(--muted); font-weight: 700; }
.admin-definition-list dd { margin: 0; overflow-wrap: anywhere; }
.status-row { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #f3f4f6; }
.login-panel { width: min(440px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 20px 45px rgba(17, 24, 39, .08); }
.brand-panel.dark { color: var(--ink); margin-bottom: 22px; }
.login-form { display: grid; gap: 12px; margin: 18px 0; }
.login-form .form-control { max-width: none; }
@media (max-width: 760px) { .admin-shell { grid-template-columns: 1fr; } .sidebar { position: static; } .metric-grid, .detail-grid { grid-template-columns: 1fr; } }
