/* BVU CMS Studio — standalone admin styling (no framework dependency). */

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e2e8f0;
  --brand: #047857;
  --brand-soft: #ecfdf5;
  --brand-line: #a7f3d0;
  --dark: #0f172a;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

.ico { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--dark); color: #e2e8f0;
  padding: 10px 20px;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #ff5722, #b71c1c);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; font-weight: 800; line-height: 1.1; }
.brand-text small { font-weight: 500; font-size: 10px; color: #94a3b8; letter-spacing: .06em; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 12px; color: #cbd5e1; }
.who em { font-style: normal; color: #6ee7b7; text-transform: uppercase; font-size: 10px; font-weight: 700; margin-left: 4px; }

/* ---------- shell ---------- */
.shell { display: flex; align-items: flex-start; gap: 20px; max-width: 1400px; margin: 20px auto; padding: 0 20px; }

.sidebar {
  width: 210px; flex: 0 0 210px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow);
  position: sticky; top: 74px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px;
  color: var(--ink-soft); font-weight: 600; font-size: 13px;
}
.nav-item:hover { background: #f8fafc; color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--brand-soft); color: #065f46; border: 1px solid var(--brand-line); }

.content { flex: 1 1 auto; min-width: 0; }

.pagefoot { text-align: center; color: var(--ink-faint); font-size: 12px; padding: 24px 0 36px; }

/* ---------- page header ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: 13px; }

/* ---------- cards / tables ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 15px; margin: 0 0 12px; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); background: #f8fafc; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:hover td { background: #fafafa; }
.cell-muted { color: var(--ink-faint); font-size: 12px; }
.cell-actions { white-space: nowrap; text-align: right; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile .n { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.tile .l { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 700; margin-top: 2px; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 12px; margin-bottom: 5px; color: var(--ink); }
.field .hint { font-weight: 500; color: var(--ink-faint); font-size: 11px; margin-left: 6px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(4, 120, 87, .1); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.check input { width: 16px; height: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #065f46; }
.btn-soft { background: #f1f5f9; color: var(--ink); border-color: var(--line); }
.btn-soft:hover { background: #e2e8f0; }
.btn-ghost { background: transparent; color: #cbd5e1; border-color: rgba(255,255,255,.18); font-size: 12px; padding: 6px 11px; }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecdd3; }
.btn-danger:hover { background: #ffe4e6; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- misc ---------- */
.flash { padding: 11px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: var(--brand-soft); color: #065f46; border-color: var(--brand-line); }
.flash-err { background: var(--danger-soft); color: var(--danger); border-color: #fecdd3; }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: var(--ink-soft); }
.pill-ok { background: var(--brand-soft); color: #065f46; }
.pill-off { background: #f1f5f9; color: var(--ink-faint); }
.pill-new { background: #eff6ff; color: #1d4ed8; }

.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 700; }
.pager .on { background: var(--brand); color: #fff; border-color: var(--brand); }

.search-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.search-bar input[type=text], .search-bar select { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13px; }

.empty { text-align: center; color: var(--ink-faint); padding: 32px 12px; font-size: 13px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, #134e4a 0%, #0f172a 60%); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px; padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-card h1 { font-size: 19px; margin: 14px 0 2px; }
.login-card p.sub { margin: 0 0 18px; color: var(--ink-soft); font-size: 13px; }
.login-card .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; color: #fff; }

@media (max-width: 860px) {
  .shell { flex-direction: column; padding: 0 12px; }
  .sidebar { width: 100%; flex: 1 1 auto; position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
