:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #172033;
  --muted: #687184;
  --line: #dfe4ea;
  --brand: #1666a4;
  --danger: #a32121;
  --ok: #157347;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.admin-shell { width: min(1120px, calc(100% - 32px)); margin: 24px auto; }
.hidden { display: none !important; }
.panel, .tab-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.06);
}
.login-panel { min-height: 86vh; display: grid; place-items: center; }
.login-panel .panel { width: min(420px, 100%); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.topbar h1, .panel h1, .panel-head h2 { margin: 0; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
nav, .actions, .panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.panel-head { justify-content: space-between; margin-bottom: 16px; }
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 0.58rem 0.86rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary, .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--danger); border-color: rgba(163, 33, 33, 0.35); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.stack, .settings-grid { display: grid; gap: 12px; }
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: end; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 0.9rem; font-weight: 650; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.68rem 0.78rem;
  font: inherit;
  color: var(--text);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.summary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.summary-grid span, .invoice small { display: block; color: var(--muted); font-size: 0.82rem; }
.summary-grid strong { display: block; margin-top: 4px; font-size: 1.1rem; }
.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f0c36d;
  background: #fff7e6;
  border-radius: 6px;
}
.list { display: grid; gap: 10px; }
.invoice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.invoice.overdue { border-color: #d77923; background: #fff8ef; }
.invoice-actions { text-align: right; display: grid; gap: 8px; justify-items: end; }
.status { min-height: 1.25rem; color: var(--muted); }
.status.error { color: var(--danger); }
@media (max-width: 720px) {
  .topbar, .invoice { align-items: stretch; flex-direction: column; }
  nav, .actions { align-items: stretch; }
  .btn { width: 100%; }
  .invoice-actions { text-align: left; justify-items: start; }
}
