:root {
  --primary: #0e9f8e;
  --primary-dark: #0b7f72;
  --primary-light: #e6f7f4;
  --ink: #182226;
  --muted: #5b6a72;
  --bg: #f4f7f8;
  --card: #ffffff;
  --line: #dde7e9;
  --danger: #d64545;
  --warning: #c98a12;
  --success: #1a9d62;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 40, 46, .08), 0 6px 24px rgba(16, 40, 46, .06);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

/* ---------- Landing ---------- */
.hero {
  background: linear-gradient(135deg, #0b625c 0%, #0e9f8e 55%, #18b6a2 100%);
  color: #fff;
  padding: 72px 24px 96px;
  text-align: center;
}
.hero-badge {
  display: inline-block; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.25); padding: 6px 14px; border-radius: 999px;
  font-size: 13px; letter-spacing: .02em; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 720px; margin: 0 auto .8rem; }
.hero p { font-size: 1.1rem; max-width: 640px; margin: 0 auto 26px; opacity: .92; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  font-weight: 600; border: none; cursor: pointer; font-size: 15px;
  background: var(--primary); color: #fff; transition: filter .15s;
}
.btn:hover { filter: brightness(.94); text-decoration: none; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); filter: none; }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-danger { background: var(--danger); }
.btn-ghost { background: #eef3f4; color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; max-width: 1080px; margin: -48px auto 0; padding: 0 24px 48px; position: relative; }
.feature { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.feature .icon { font-size: 26px; }
.feature h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

.steps { max-width: 1080px; margin: 0 auto; padding: 24px 24px 64px; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h2 { font-size: 1.7rem; }
.section-title p { color: var(--muted); }
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; counter-reset: step; }
.step { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); position: relative; }
.step .num { font-size: 2.2rem; font-weight: 800; color: var(--primary-light); }
.step h3 { margin: 8px 0 4px; }

.landing-footer { background: #10221f; color: #9fc0bb; padding: 48px 24px; margin-top: 48px; }
.landing-footer .inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.landing-footer a { color: #cfe8e4; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 17px; color: var(--primary-dark); }
.brand span { color: var(--primary); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0b625c, #0e9f8e 70%); }
.auth-card { background: #fff; border-radius: 18px; padding: 34px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.45rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: #33464d; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: 9px; font-size: 15px; font-family: inherit; background: #fbfdfd; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.field .hint { font-size: 12.5px; color: var(--muted); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.aside { background: #0f2320; color: #d5ebe7; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.aside .brand { color: #fff; padding: 6px 12px 18px; font-size: 18px; }
.aside a {
  color: #b5d3ce; padding: 10px 12px; border-radius: 9px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; transition: background .12s;
}
.aside a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.aside a.active { background: var(--primary); color: #fff; }
.aside .spacer { flex: 1; }
.aside .user-chip { padding: 10px 12px; font-size: 13px; color: #8fb1ac; border-top: 1px solid rgba(255,255,255,.1); }

.main { padding: 26px 30px 60px; max-width: 1180px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 1.5rem; margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card .k { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card .v { font-size: 1.8rem; font-weight: 800; margin-top: 6px; }
.card .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-head h2 { font-size: 1.05rem; margin: 0; }
.panel-body { padding: 20px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f7fbfa; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e0f5ea; color: var(--success); }
.badge.warn { background: #fdf1dd; color: var(--warning); }
.badge.err { background: #fbe7e7; color: var(--danger); }
.badge.neutral { background: #eef3f4; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .aside { flex-direction: row; flex-wrap: wrap; } }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #12282c; color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: var(--shadow); z-index: 100; opacity: 0; transition: opacity .2s; font-size: 14px; max-width: 90vw;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big { font-size: 34px; margin-bottom: 8px; }

.exer-row { display: grid; grid-template-columns: 1fr 80px 80px 90px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 700px) { .exer-row { grid-template-columns: 1fr 1fr; } }

.muted { color: var(--muted); }
.right { text-align: right; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,20,22,.55);
  display: none; place-items: center; z-index: 50; padding: 20px;
}
.modal-backdrop.open { display: grid; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal h3 { margin-top: 0; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 9px; font-size: 14.5px; font-family: inherit; background: #fff; }

.pill-nav { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.pill-nav a { padding: 8px 14px; border-radius: 999px; background: #eaf1f2; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.pill-nav a.active { background: var(--primary); color: #fff; }