@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,560;9..144,700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --bg: #f3f0ea;
  --bg-accent: #e7eef2;
  --ink: #1c2430;
  --muted: #5c6775;
  --brand: #0b5f6d;
  --brand-dark: #084852;
  --line: #d5d0c6;
  --card: #fffdf8;
  --ok: #1f6b3a;
  --bad: #9b2c2c;
  --warn: #8a6d1d;
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.08);
  --radius: 14px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9e8ec 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #efe6d4 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eee8dc; padding: 0.1rem 0.35rem; border-radius: 4px; }

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0b5f6d, #0a3f4a);
  color: #f4fbfc;
  padding: 1.4rem 1rem 2rem;
}
.sidebar .brand {
  font-family: var(--display);
  font-size: 1.45rem;
  margin: 0 0 0.25rem;
}
.sidebar .brand-sub { opacity: 0.75; font-size: 0.85rem; margin-bottom: 1.5rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar a {
  color: #e7f4f6;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
}
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,0.12); text-decoration: none; }
.sidebar .userbox { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.2); font-size: 0.9rem; }

.content { padding: 1.5rem 1.75rem 3rem; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.topbar h1 { font-family: var(--display); font-size: 1.9rem; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--muted); margin: 0 0 0.35rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.85rem; }
.stat { padding: 1rem; }
.stat .label { color: var(--muted); font-size: 0.85rem; }
.stat .value { font-family: var(--display); font-size: 1.6rem; margin-top: 0.2rem; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table tr:hover td { background: rgba(11,95,109,0.04); }

.btn, button.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
}
.btn:hover { background: var(--brand-dark); }
.btn-secondary { background: transparent; color: var(--brand) !important; border: 1px solid var(--brand); }
.btn-secondary:hover { background: rgba(11,95,109,0.08); }
.btn-danger { background: var(--bad); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.form { display: grid; gap: 0.75rem; max-width: 720px; }
.form.wide { max-width: none; }
.form label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
.form input, .form select, .form textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.form textarea { min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }

.alert { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.alert-error { background: #fde8e8; color: var(--bad); border: 1px solid #f2c1c1; }
.alert-ok, .alert-success { background: #e7f6ec; color: var(--ok); border: 1px solid #bfe5cb; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge.ok { background: #e7f6ec; color: var(--ok); }
.badge.bad { background: #fde8e8; color: var(--bad); }
.badge.warn { background: #fff4d6; color: var(--warn); }
.badge.neutral { background: #eceff3; color: var(--muted); }

.auth-body, .install-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth-card, .install-card {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.install-card { width: min(640px, 100%); }
.steps { display: flex; gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 1.2rem; flex-wrap: wrap; }
.steps li { font-size: 0.8rem; padding: 0.25rem 0.55rem; border-radius: 999px; background: #ece8df; color: var(--muted); }
.steps li.on { background: var(--brand); color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: end; }
.filters input, .filters select { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { padding-bottom: 1rem; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
}
