/* FLA Event & Awards Platform — app.css (v0.1.0)
   Brand color is injected via CSS var --brand from the settings table. */
:root {
  --brand: #4f46e5;
  --ink: #17202a;
  --muted: #64748b;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e2e8f0;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.main { padding: 32px 20px 64px; min-height: 60vh; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: "DejaVu Sans Mono", ui-monospace, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* — Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800;
}
.site-nav { margin-left: auto; display: flex; gap: 18px; }
.site-nav a { color: var(--ink); font-weight: 500; padding: 6px 2px; border-bottom: 2px solid transparent; }
.site-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.site-nav a:hover { text-decoration: none; color: var(--brand); }
.nav-toggle { display: none; margin-left: auto; font-size: 1.3rem; background: none; border: 0; cursor: pointer; }

/* — Hero */
.hero { text-align: center; padding: 56px 16px 40px; }
.hero.slim { padding: 24px 16px 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 8px 0; letter-spacing: -.02em; }
.hero-kicker { color: var(--brand); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .12em; }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* — Buttons */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: transform .06s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.pill {
  display: inline-block; background: #eef2ff; color: var(--brand); font-size: .75rem;
  font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em;
}

/* — Cards & panels */
.grid { display: grid; gap: 16px; margin: 28px 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; border-color: var(--brand); }
.panel { margin: 28px 0; }
.steps li { margin-bottom: 10px; }

/* — Docs */
.docs-group { margin: 30px 0 4px; font-size: 1.15rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.doc-card h3 { margin-bottom: 6px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: .9rem; color: var(--muted); flex-wrap: wrap; }
.docs-layout { display: grid; grid-template-columns: 1fr 240px; gap: 28px; align-items: start; }
.docs-content {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); overflow-wrap: break-word;
}
.docs-content h1 { margin-top: 0; font-size: 1.7rem; }
.docs-content h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 34px; }
.docs-content h3 { margin-top: 26px; }
.docs-content pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; }
.docs-content pre.mermaid { background: #fff; color: inherit; text-align: center; border: 1px dashed var(--line); }
.docs-content code:not(pre code) { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; }
.docs-content blockquote { border-left: 3px solid var(--brand); margin: 14px 0; padding: 8px 14px; background: #f8faff; color: #334155; }
.docs-content img { max-width: 100%; }
.docs-toc { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; max-height: 80vh; overflow: auto; }
.docs-toc .toc-title { font-weight: 700; margin: 4px 0 10px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc li { margin: 6px 0; }
.docs-toc li.lvl-2 { padding-left: 14px; }
.docs-toc li.lvl-3 { padding-left: 28px; color: var(--muted); }

/* — Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 22px 0; font-size: .9rem; color: var(--muted); }
.site-footer p { margin: 4px 0; }

/* — Forms */
.form { display: grid; gap: 14px; text-align: left; margin: 18px 0; }
.form label { font-weight: 600; display: grid; gap: 6px; font-size: .95rem; }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="number"], .form input[type="date"], .form input[type="color"],
.form input[type="url"], .form select, .form textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; width: 100%; background: #fff;
}
.form textarea { min-height: 96px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form .check input { width: auto; }
.form-hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
input[type="file"] { font: inherit; }

/* — Alerts */
.alert { border-radius: 10px; padding: 10px 14px; margin: 10px 0; border: 1px solid; }
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.ok, .alert.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* — Data tables */
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .95rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { background: #f8fafc; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.data-table tr:last-child td { border-bottom: 0; }
.table-wrap-scroll { overflow-x: auto; }

/* — Badges & chips */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef2ff; color: var(--brand); }
.badge.green { background: #dcfce7; color: #166534; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.amber { background: #fef3c7; color: #92400e; }
.badge.gray { background: #e5e7eb; color: #374151; }
.chip { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; background: #fff; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* — KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 18px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.kpi .kpi-label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.kpi .kpi-trend { font-size: .8rem; margin-top: 4px; }
.kpi .kpi-trend.up { color: #15803d; }
.kpi .kpi-trend.down { color: #b91c1c; }

/* — Admin shell */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side { background: #0f172a; color: #cbd5e1; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.admin-brand { color: #fff; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.admin-brand:hover { text-decoration: none; }
.admin-nav { display: grid; gap: 2px; }
.admin-nav a { color: #cbd5e1; padding: 8px 12px; border-radius: 8px; font-size: .92rem; }
.admin-nav a:hover { background: #1e293b; text-decoration: none; color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; }
.admin-side-foot { margin-top: auto; font-size: .85rem; }
.admin-side-foot a { color: #94a3b8; }
.admin-main { padding: 26px; max-width: 1200px; width: 100%; }

/* — Filters & utils */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 14px 0 18px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.filterbar label { font-size: .8rem; color: var(--muted); display: grid; gap: 4px; font-weight: 600; }
.filterbar input, .filterbar select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e2e8f0; }
.avatar.lg { width: 88px; height: 88px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* — Responsive */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; order: -1; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .form .row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--card); padding: 12px 20px 18px; border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
}