:root {
  --bg: #f5f6f8; --surface: #fff; --text: #1d2330; --muted: #6b7385; --border: #e2e5ec;
  --accent: #e4572e; --accent-ink: #fff; --danger: #c73e1d; --ok: #2f855a; --sidebar: #161b26;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151d; --surface: #1a202c; --text: #e6e9f0; --muted: #98a1b5; --border: #2a3242; --sidebar: #0c0f15; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; } h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .right { text-align: right; }
.accent { color: var(--accent); } .prewrap { white-space: pre-wrap; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: #cfd5e3; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 1.3rem; color: #fff; } .brand span { color: var(--accent); }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.sidebar nav a { color: #cfd5e3; padding: .55rem .75rem; border-radius: 8px; } .sidebar nav a:hover { background: #ffffff14; text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: var(--accent-ink); }
.who { display: flex; flex-direction: column; gap: .5rem; } .who .muted { color: #8f98ad; word-break: break-all; }
.content { padding: 1.75rem 2rem; max-width: 1200px; width: 100%; }
.content.solo { margin: 0 auto; display: grid; place-items: center; min-height: 100vh; max-width: 480px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; } .head h1 { margin: 0; }
.head { margin-bottom: 1rem; } .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; } .stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.charts { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } .cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stat { display: flex; flex-direction: column; margin: 0; } .stat strong { font-size: 2rem; line-height: 1.2; }
.program { color: inherit; margin: 0; display: flex; flex-direction: column; gap: .5rem; } .program:hover { border-color: var(--accent); text-decoration: none; }
.program h2 { margin: 0; } .meta { display: flex; gap: .75rem; align-items: center; margin-top: auto; color: var(--muted); font-size: .9rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.hero { max-width: 100%; max-height: 260px; border-radius: 8px; margin-bottom: 1rem; object-fit: cover; }

.btn { display: inline-block; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: .5rem .9rem; border-radius: 8px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; } .btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-ghost { background: transparent; } .btn-small { padding: .25rem .6rem; font-size: .85rem; }
.sidebar .btn-ghost { color: #cfd5e3; border-color: #ffffff30; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); } label input, label select, label textarea { color: var(--text); }
.check { flex-direction: row; align-items: center; gap: .5rem; } .check input { width: auto; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .form-grid .wide { grid-column: 1 / -1; }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; } .filters > * { width: auto; min-width: 160px; flex: 1 1 160px; } .filters .btn { flex: 0 0 auto; min-width: 0; }
.inline-label { flex: 1 1 200px; } .inline { display: inline; margin: 0; } .inline select { width: auto; padding: .25rem .4rem; }

.table-wrap { overflow-x: auto; padding: .5rem 1rem; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; } tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; background: var(--border); color: var(--text); }
.badge-beginner, .badge-free, .badge-local { background: #d9f2e3; color: #1e6b47; } .badge-intermediate, .badge-premium, .badge-google { background: #fdebc8; color: #8a5a00; }
.badge-advanced, .badge-coach, .badge-apple { background: #fbdcd4; color: #a13319; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: .5rem 1rem; margin: 0 0 1rem; } .facts dt { color: var(--muted); } .facts dd { margin: 0; }
.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert-error { background: #fdecea; border-color: #f5b5ab; color: #8c2a17; } .alert-success { background: #e6f6ec; border-color: #a5dabb; color: #1e6b47; }
.alert-warning { background: #fff4d6; border-color: #f0d58a; color: #7a5600; }
.login-card { width: 100%; max-width: 400px; padding: 2rem; } .login-card h1 { text-align: center; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; } .content { padding: 1rem; } .form-grid { grid-template-columns: 1fr; }
}

.steps { padding-left: 1.25rem; margin: .25rem 0 1rem; } .steps li { margin: .35rem 0; }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: .35rem 0; }
.filters input[type=search] { min-width: 12rem; }
