:root {
  --bg: #f7f7f2;
  --panel: #ffffff;
  --ink: #17211c;
  --muted: #65706a;
  --line: #dfe5dc;
  --accent: #0f8b6f;
  --blue: #2457a7;
  --warn: #b7791f;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .68; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(135deg, rgba(15,139,111,.13), transparent 38%), linear-gradient(315deg, rgba(36,87,167,.12), transparent 34%), var(--bg);
}
.login-panel { width: min(100%, 920px); display: grid; gap: 14px; }
.login-copy, .login-card, .panel, .metric, .table-panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.login-copy { min-height: 250px; padding: 24px; color: #fff; background: #111916; display: grid; align-content: end; }
.login-copy h1 { font-size: 34px; margin: 0 0 10px; }
.login-copy p { margin: 0; color: #d9eee8; line-height: 1.5; }
.login-mark { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); margin-bottom: 18px; }
.login-card { padding: 24px; }
.login-card h2 { margin: 0 0 8px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.sidebar { position: sticky; top: 0; z-index: 5; background: #111916; color: white; padding: 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand strong { font-size: 17px; }
.nav { display: flex; overflow-x: auto; gap: 8px; padding-top: 12px; }
.nav button, .primary, .secondary, .danger { min-height: 38px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; white-space: nowrap; }
.nav button { color: #d9eee8; background: rgba(255,255,255,.08); }
.nav button.active { color: white; background: var(--accent); }
.main { padding: 16px; }
.topbar { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; margin-bottom: 14px; }
.topbar h1 { font-size: 22px; margin: 0; }
.subtle { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 12px; }
.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric { padding: 14px; min-height: 92px; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 8px; font-size: 22px; }
.split { display: grid; gap: 12px; }
.panel, .table-panel { padding: 14px; }
.panel h2, .table-panel h2 { font-size: 17px; margin: 0 0 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: var(--muted); font-weight: 700; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #edf7f4; color: #08735b; font-size: 12px; font-weight: 700; }
.badge.warn { background: #fff6df; color: var(--warn); }
.badge.danger { background: #fff0ed; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--ink); background: white; }
textarea { min-height: 86px; resize: vertical; }
.primary { background: var(--accent); color: white; text-decoration: none; }
.secondary { background: #eef2f7; color: var(--ink); border-color: var(--line); }
.danger { background: #fff0ed; color: var(--danger); border-color: #ffd5cd; }
.link-button { border: 0; background: transparent; color: var(--blue); padding: 10px 0 0; font-weight: 700; }
.alert { margin-top: 12px; border-radius: 8px; padding: 10px; font-size: 13px; }
.alert.success { background: #edf7f4; color: #08735b; border: 1px solid #b8e1d6; }
.alert.error { background: #fff0ed; color: var(--danger); border: 1px solid #ffd5cd; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cards { display: grid; gap: 10px; }
.card { padding: 12px; }
.reminder-card { display: grid; gap: 12px; }

@media (min-width: 860px) {
  .login-panel { grid-template-columns: 1.1fr .9fr; align-items: stretch; }
  .login-copy, .login-card { padding: 28px; }
  .app-shell { grid-template-columns: 250px 1fr; }
  .sidebar { min-height: 100vh; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.12); }
  .nav { display: grid; overflow: visible; }
  .nav button { justify-content: flex-start; }
  .main { padding: 24px; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .wide { grid-column: 1 / -1; }
  .reminder-card { grid-template-columns: 1fr auto; align-items: center; }
}
