:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #fffdf8;
  --surface-2: #ffffff;
  --text: #1f1b18;
  --muted: #645c54;
  --line: #ddd6ce;
  --brand: #8a5a2b;
  --brand-2: #155f52;
  --danger: #a33b32;
  --ok: #146c43;
  --shadow: 0 16px 36px rgba(31, 27, 24, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a { color: var(--brand); font-weight: 700; text-decoration: none; }

.login-body {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-row,
.topbar,
.section-head,
.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-2);
  color: #fff;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: 0; }
h2 { font-size: 22px; letter-spacing: 0; }
h3 { font-size: 16px; letter-spacing: 0; }
p, .muted { color: var(--muted); }

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea { min-height: 94px; resize: vertical; }

button,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--brand-2);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  background: #211b17;
  color: #fff;
  padding: 22px;
}

.sidebar a {
  display: block;
  color: #efe9df;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.sidebar a[aria-current="page"],
.sidebar a:hover { background: rgba(255,255,255,.12); }

.main {
  padding: 24px;
}

.topbar {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric,
.panel,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric { padding: 18px; }
.metric strong { display: block; font-size: 26px; margin-top: 6px; }
.panel { padding: 20px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e7efe9;
  color: var(--ok);
  font-weight: 800;
  font-size: 13px;
}

.badge.paused { background: #f4ead9; color: #8a5a2b; }
.badge.cancelled { background: #f3dddd; color: var(--danger); }

.alert {
  padding: 12px 14px;
  border: 1px solid #e3c5c0;
  background: #fff4f2;
  color: var(--danger);
  border-radius: 8px;
  margin-bottom: 14px;
}

.success {
  border-color: #badbcc;
  background: #eef8f2;
  color: var(--ok);
}

.billing-hero {
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 18px;
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metrics,
  .billing-hero,
  .form-grid.two { grid-template-columns: 1fr; }
  .topbar,
  .section-head,
  .actions-row { align-items: flex-start; flex-direction: column; }
}
