/* Sri Sai Foundation CMS — admin styles
   Design: authority navy sidebar + trust gold accent, light content.
   Follows ui-ux-pro-max rules: 4.5:1 contrast, visible focus, 200ms transitions,
   44px touch targets, visible borders, no emoji icons (inline SVG used in markup). */

:root {
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --gold: #a9812a;
  --gold-dark: #8c6b20;
  --gold-soft: #f6f1e7;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --sidebar-w: 264px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ── Layout ── */
.cms-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-900);
  color: #cbd5e1;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 16px;
}
.sidebar-brand .logo {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--gold); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; flex-shrink: 0;
}
.sidebar-brand b { color: #fff; font-size: 15px; display: block; line-height: 1.2; }
.sidebar-brand span { font-size: 11.5px; color: #94a3b8; }

.nav-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; padding: 14px 12px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 9px;
  color: #cbd5e1; font-size: 14.5px; font-weight: 500;
  cursor: pointer; transition: background .2s, color .2s;
  min-height: 44px;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: var(--gold); color: #fff; }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link .badge-count {
  margin-left: auto; background: var(--gold); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.nav-link.active .badge-count { background: rgba(255,255,255,.25); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }

/* ── Main ── */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 16px 28px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar .user-chip {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted);
}
.topbar .user-chip .av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.menu-toggle { display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; width: 40px; height: 40px; cursor: pointer; color: var(--text);
  align-items: center; justify-content: center; }

.content { padding: 28px; max-width: 1200px; width: 100%; }

/* ── Flash ── */
.flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; }
.flash.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Stat cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.stat-card .ic { width: 46px; height: 46px; border-radius: 11px; background: var(--gold-soft);
  color: var(--gold); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.stat-card .ic svg { width: 24px; height: 24px; }
.stat-card .num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat-card .lbl { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* ── Card / panel ── */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; }
.panel-head h2 { font-size: 16px; font-weight: 700; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 22px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 13px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfc; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfc; }
.thumb { width: 54px; height: 40px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.green { background: #dcfce7; color: #166534; }
.pill.gray { background: #f1f5f9; color: var(--muted); }
.pill.new { background: #fef3c7; color: #92400e; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 9px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s; min-height: 42px; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-dark); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 7px 12px; font-size: 13px; min-height: 36px; }

/* ── Forms ── */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 14.5px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .2s, box-shadow .2s; min-height: 44px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169,129,42,.15);
}
.textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* Accessible focus ring for all interactive elements (keyboard nav) */
a:focus-visible, button:focus-visible, .nav-link:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 14px; color: #cbd5e1; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #1e293b, var(--navy-900)); }
.login-card { background: var(--card); border-radius: 16px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; }
.login-head { text-align: center; padding: 34px 30px 10px; }
.login-head .logo { width: 58px; height: 58px; border-radius: 14px; background: var(--gold); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; margin: 0 auto 16px; }
.login-head h1 { font-size: 20px; }
.login-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.login-body { padding: 22px 30px 32px; }
.login-body .btn-primary { width: 100%; justify-content: center; margin-top: 4px; }
.login-note { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 35; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
}
