:root {
  color-scheme: light;
  --bg: #f1f8f5;
  --sidebar: #047857;
  --panel: #ffffff;
  --panel-2: #dff7ed;
  --line: #c6e4d7;
  --text: #18332a;
  --muted: #557267;
  --accent: #10b981;
  --accent-2: #047857;
  --danger: #be123c;
  --warning: #b45309;
  --shadow: 0 16px 40px rgba(4, 120, 87, .12);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0 0 12px; }
h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
h2 { font-size: 20px; letter-spacing: -.025em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 23px; font-weight: 800; letter-spacing: -.055em; }
.brand b { display: inline-flex; color: var(--accent); }
.icon { display: inline-block; width: 1.1em; height: 1.1em; flex: 0 0 auto; vertical-align: -0.16em; stroke: currentColor; }
.brand .icon { width: 1.05em; height: 1.05em; stroke-width: 2.1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow, .sidebar-caption { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.muted, .hint, footer { color: var(--muted); }
.auth-shell { display: grid; gap: 28px; width: min(480px, calc(100% - 32px)); margin: 11vh auto; }
.auth-card, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card { padding: 28px; }
.auth-card h1 { margin-top: 8px; }
.auth-card form { margin-top: 26px; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 250px; padding: 26px 16px 18px; background: var(--sidebar); border-right: 1px solid var(--line); z-index: 5; }
.sidebar-caption { margin: 38px 12px 12px; }
.sidebar nav { display: grid; gap: 4px; overflow: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; color: rgba(239, 255, 248, .78); border-radius: 10px; }
.sidebar nav a span { display: inline-flex; align-items: center; justify-content: center; width: 20px; color: var(--accent); text-align: center; }
.sidebar nav a .icon { width: 19px; height: 19px; }
.sidebar nav a label { color: inherit; font-size: 13px; cursor: pointer; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(16, 185, 129, .22); color: #ecfdf5; text-decoration: none; }
.logout { margin-top: auto; }
.app { max-width: 1700px; margin-left: 250px; padding: 32px clamp(18px, 4vw, 52px); }
.topbar, .section-title, .project-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar { margin-bottom: 28px; }
.top-actions, .hero-actions, .inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.menu-button { display: none; }
.top-actions .icon, .ghost .icon, .primary .icon { width: 17px; height: 17px; }
.ghost, .primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.ghost { background: transparent; color: var(--text); }
.ghost:hover { background: var(--panel-2); text-decoration: none; }
.primary { background: var(--accent); color: #063b2a; border-color: var(--accent); font-weight: 750; }
.primary:hover { background: var(--accent-2); text-decoration: none; }
.danger-text { color: var(--danger); }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 18px; padding: 28px; background: linear-gradient(120deg, #047857, #065f46); border: 1px solid #10b981; border-radius: 20px; color: #effff8; }
.hero h2 { font-size: clamp(22px, 3vw, 32px); margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.summary-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.two-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 16px; }
.card { min-width: 0; padding: 22px; margin-bottom: 16px; }
.metric { display: grid; align-content: start; gap: 9px; min-height: 150px; }
.metric strong { display: block; font-size: 30px; letter-spacing: -.06em; }
.metric strong small { font-size: 13px; color: var(--muted); letter-spacing: 0; }
.metric.unavailable { border-style: dashed; opacity: .82; }
.info-card { display: grid; align-content: start; gap: 7px; min-height: 112px; }
.info-card strong { font-size: 22px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { margin-bottom: 16px; }
.usage-chart { display: block; width: 100%; height: 180px; margin-top: 15px; overflow: visible; }
.usage-chart .chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.chart-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.entity-grid { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.entity-card { display: grid; align-content: start; gap: 10px; }
.entity-head, .project-title { display: flex; align-items: flex-start; gap: 11px; }
.entity-icon, .project-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 38px; height: 38px; color: var(--accent); background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; }
.entity-icon .icon, .project-icon .icon { width: 21px; height: 21px; }
.entity-card h2, .project h2 { overflow-wrap: anywhere; }
.mini-grid { margin: 20px 0 0; }
.raw-data { margin-top: 16px; }
.raw-data summary, details > summary { color: var(--accent-2); cursor: pointer; }
.compact-form { margin-top: 16px; }
progress { width: 100%; height: 7px; accent-color: var(--accent); }
.status-dot, .big-status { color: var(--accent); font-size: 12px; }
.history-list { display: grid; gap: 10px; }
.history-list div { display: flex; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; margin: 12px 0; color: var(--muted); font-size: 13px; }
input, textarea, select { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
textarea { min-height: 92px; resize: vertical; }
.project-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.project { display: flex; flex-direction: column; gap: 12px; }
.project-head { align-items: start; }
.badge { display: inline-flex; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.badge.ok { color: var(--accent-2); border-color: #75c9aa; }
.badge.bad { color: var(--danger); border-color: #7d4050; }
.details { display: grid; grid-template-columns: 100px 1fr; gap: 5px 10px; margin: 3px 0; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.alert { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; }
.alert.danger { color: #9f1239; background: #fff1f2; border: 1px solid #fda4af; }
.alert.success { color: #166534; background: #ecfdf5; border: 1px solid #86efac; }
.alert.warning { color: #92400e; background: #fffbeb; border: 1px solid #fcd34d; }
pre { max-height: 420px; margin: 10px 0 0; padding: 14px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.activity-table { overflow: auto; }
.activity-row { display: grid; grid-template-columns: 150px 180px minmax(220px, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity-row.header { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.amount { color: var(--accent); white-space: nowrap; }
footer { margin-top: 26px; font-size: 12px; }
code { color: var(--accent); }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .menu-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  .app { margin-left: 0; padding: 22px 16px; }
  .menu-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
  .menu-button .icon { width: 20px; height: 20px; }
  .topbar { align-items: start; }
}
@media (max-width: 680px) {
  .hero, .topbar, .section-title { align-items: stretch; flex-direction: column; }
  .hero-actions, .top-actions { justify-content: flex-start; }
  .two-columns, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .card { padding: 17px; }
  .activity-row { grid-template-columns: 120px 1fr; }
  .activity-row span:last-child { grid-column: 1 / -1; }
}
