/* UnifyNG web — "Naija Modern" design system (see Design/main/DESIGN.md).
   One stylesheet for admin, restaurant-manager and student pages. */

:root {
  --green-900: #00351f; --green-800: #0b4a2f; --green-700: #00522f; --green-600: #006b3f;
  --green-500: #008751; --green-100: #d6f5e2; --green-50: #eef8f1;
  --gold-500: #feb700; --gold-200: #ffdea8; --gold-ink: #271900; --gold-text: #5e4200;
  --clay-600: #9d3d43; --clay-700: #80272e; --clay-100: #ffdad9;
  --ink: #171d19; --ink-2: #3e4a41; --ink-3: #5b665d;
  --bg: #f5fbf3; --surface: #ffffff; --surface-2: #f0f5ee; --line: #e4eae2; --line-2: #dee4dd;
  --danger: #ba1a1a; --danger-bg: #ffdad6; --info: #1d4ed8; --info-bg: #dbe7ff;
  --radius-sm: 12px; --radius: 16px; --radius-lg: 24px; --radius-xl: 32px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.04); --shadow-lift: 0 8px 30px rgba(0, 135, 81, 0.15);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid rgba(0, 135, 81, 0.45); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Layout helpers ---------- */
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr)); }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .main { flex: 2 1 520px; min-width: 0; }
.split > .side { flex: 1 1 300px; min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-600); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius); border: 2px solid transparent; font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
  background: var(--surface-2); color: var(--ink); }
.btn:hover { background: var(--line-2); color: var(--ink); }
.btn-primary { background: var(--green-600); color: #fff; box-shadow: var(--shadow-lift); }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-gold { background: var(--gold-500); color: var(--gold-ink); }
.btn-gold:hover { background: #f0ab00; color: var(--gold-ink); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-light { background: #fff; color: var(--green-600); }
.btn-light:hover { background: var(--green-50); color: var(--green-700); }
.btn-danger { background: var(--danger-bg); color: #93000a; }
.btn-danger:hover { background: #ffc4bd; color: #93000a; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 99px; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.link-strong { font-weight: 700; font-size: 14px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head > h2, .card-head > h3 { flex: 1 1 auto; }
.card-green { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.card-green .muted { color: #cfe9da; }
.card-gold { background: var(--gold-200); border-color: var(--gold-200); color: var(--gold-ink); }
.card-gold .muted { color: var(--gold-text); }
.card-clay { background: var(--clay-600); border-color: var(--clay-600); color: #fff; }
.card-clay .muted { color: var(--clay-100); }
.card-soft { background: var(--bg); border: 0; box-shadow: none; border-radius: 20px; padding: 18px; }
.media-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.media-card .media { aspect-ratio: 16 / 9; background: var(--green-100); object-fit: cover; width: 100%;
  display: flex; align-items: center; justify-content: center; color: var(--green-700); }
.media-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.media-card .foot { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Stats ---------- */
.stats { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; color: var(--ink); display: block; }
a.stat:hover { border-color: var(--green-500); color: var(--ink); }
.stat .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.stat .value { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.stat .hint { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.stat-gold { background: var(--gold-500); border-color: var(--gold-500); }
.stat-gold .label, .stat-gold .hint { color: var(--gold-ink); }
.stat-clay .value { color: var(--clay-600); }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); text-transform: capitalize; }
.badge-gold, .badge-pending { background: var(--gold-200); color: var(--gold-text); }
.badge-green, .badge-success, .badge-approved, .badge-active, .badge-delivered, .badge-completed { background: var(--green-100); color: var(--green-700); }
.badge-clay, .badge-danger, .badge-rejected, .badge-cancelled, .badge-banned, .badge-closed { background: var(--clay-100); color: var(--clay-700); }
.badge-info, .badge-confirmed, .badge-preparing, .badge-ready, .badge-draft { background: var(--info-bg); color: #1e3a8a; }
.badge-solid { background: var(--gold-500); color: var(--gold-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 8px 14px; font-size: 14px; font-weight: 600; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); }
a.chip:hover { border-color: var(--green-500); color: var(--green-700); }
.chip.is-active { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.chip .count { opacity: .75; font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 10px 12px; white-space: nowrap; }
.table td { padding: 14px 12px; border-top: 1px solid #eaefe8; vertical-align: middle; }
.table tbody tr:hover td { background: #fafdf9; }
.table .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* ---------- List rows ---------- */
.list-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid #eaefe8; color: var(--ink); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
a.list-row:hover { color: var(--green-700); }
.tile { width: 44px; height: 44px; border-radius: 14px; background: var(--green-100); color: var(--green-700); display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.tile-lg { width: 64px; height: 64px; border-radius: 16px; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-gold { background: var(--gold-200); color: var(--gold-text); }
.tile-clay { background: var(--clay-100); color: var(--clay-700); }
.avatar { width: 40px; height: 40px; border-radius: 99px; background: var(--clay-600); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 13px; color: var(--ink-3); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, select.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line-2);
  background: #fff; font: inherit; font-size: 15px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field textarea, textarea.input { min-height: 110px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.15); }
.field input[type=file] { font: inherit; font-size: 14px; padding: 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--bg); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green-600); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: 6px; }
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 14px; min-height: 48px; color: var(--ink-3); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; flex: 1; min-width: 0; color: var(--ink); }

/* ---------- Alerts / empty states ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 14px 16px; font-size: 14px; font-weight: 500; background: var(--green-100); color: var(--green-700); }
.alert-error { background: var(--danger-bg); color: #93000a; }
.alert-warn { background: var(--gold-200); color: var(--gold-text); }
.alert-info { background: var(--info-bg); color: #1e3a8a; }
.empty { text-align: center; padding: 48px 24px; color: var(--ink-3); }
.empty .tile { margin: 0 auto 14px; width: 56px; height: 56px; border-radius: 18px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Dialogs ---------- */
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25); color: var(--ink); }
dialog.modal::backdrop { background: rgba(0, 33, 16, 0.45); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 24px; }

/* ---------- Admin shell ---------- */
.admin-shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 0 248px; max-width: 280px; background: var(--green-900); color: #cfe9da; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; }
.sidebar a { color: #cfe9da; }
.sidebar a:hover { color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: inherit; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--gold-500); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; flex: none; }
.brand-name { font-weight: 800; font-size: 18px; color: #fff; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: #9fd3b6; }
.uni-switch { display: flex; align-items: center; gap: 10px; background: var(--green-800); border-radius: var(--radius); padding: 10px 12px; color: #fff; position: relative; }
.uni-switch .code { width: 32px; height: 32px; border-radius: 10px; background: #fff; color: var(--green-600); font-weight: 800; font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.uni-switch select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: #fff; font: inherit; font-size: 14px; font-weight: 600; width: 100%; padding-right: 18px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uni-switch select option { color: var(--ink); }
.uni-switch .hint { display: block; font-size: 12px; color: #9fd3b6; }
.side-nav { display: flex; flex-direction: column; gap: 18px; font-size: 14px; font-weight: 500; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-group-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #8cc7a6; padding: 0 12px 6px; text-transform: uppercase; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); }
.side-link:hover { background: rgba(255, 255, 255, 0.06); }
.side-link.is-active { background: var(--green-500); color: #fff; font-weight: 600; }
.side-link .count { margin-left: auto; background: var(--gold-500); color: var(--gold-ink); font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.side-link .count-clay { background: var(--clay-100); color: var(--clay-700); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--green-800); }
.side-user .name { font-size: 14px; font-weight: 600; color: #fff; }
.side-user .role { font-size: 12px; color: #9fd3b6; }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
.admin-main > * { max-width: 1240px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.page-head .titles { flex: 1 1 320px; min-width: 0; }
.page-head .kicker { font-size: 14px; font-weight: 600; color: var(--green-600); margin-bottom: 4px; }
.page-head .lede { color: var(--ink-3); margin-top: 6px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--green-600); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.menu-toggle { display: none; }

/* ---------- Student site ---------- */
.site-header { background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(20px); }
.site-header .inner { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.site-header .brand { padding: 0; color: var(--ink); }
.site-header .brand-mark { background: var(--green-600); color: var(--gold-500); width: 38px; height: 38px; font-size: 19px; }
.site-header .brand-name { color: var(--ink); font-size: 20px; }
.top-nav { display: flex; flex-wrap: wrap; gap: 4px; font-size: 15px; font-weight: 600; flex: 1 1 auto; }
.top-nav a { padding: 9px 16px; border-radius: 99px; color: var(--ink-2); flex: none; white-space: nowrap; }
.top-nav a:hover { background: var(--surface-2); color: var(--ink); }
.top-nav a.is-active { background: var(--green-600); color: #fff; }
.site-main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.hero { background: var(--green-600); color: #fff; border-radius: var(--radius-xl); padding: 36px 40px; display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 99px; border: 48px solid rgba(254, 183, 0, 0.22); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 42px; line-height: 1.2; margin: 14px 0 6px; }
.hero .lede { color: #cfe9da; font-size: 17px; }
.hero-sm { padding: 28px 32px; }
.hero-sm h1 { font-size: 32px; margin: 8px 0 4px; }
.pill-label { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.14); border-radius: 99px; padding: 6px 14px 6px 6px; font-size: 13px; font-weight: 600; color: #fff; }
.pill-label .code { background: #fff; color: var(--green-600); border-radius: 99px; padding: 2px 8px; font-weight: 800; font-size: 11px; }
.gist-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; background: var(--gold-200); border-radius: var(--radius-lg); padding: 18px 24px; color: var(--gold-ink); }
.gist-strip:hover { color: var(--gold-ink); background: #ffd58f; }
.gist-strip .tag { background: var(--green-600); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .08em; border-radius: 99px; padding: 6px 12px; }
.date-tile { width: 64px; border-radius: 16px; background: var(--green-600); color: #fff; text-align: center; padding: 8px 0; flex: none; }
.date-tile .m { font-size: 12px; font-weight: 700; color: #a9e9c3; text-transform: uppercase; }
.date-tile .d { font-size: 26px; font-weight: 800; line-height: 30px; }
.site-footer { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.site-footer .inner { max-width: 1280px; margin: 0 auto; padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-aside { flex: 1 1 420px; background: var(--green-600); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 380px; height: 380px; border-radius: 99px; border: 56px solid rgba(254, 183, 0, 0.22); }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h1 { font-size: 40px; line-height: 1.15; max-width: 14ch; }
.auth-aside .lede { color: #cfe9da; font-size: 17px; max-width: 40ch; margin-top: 14px; }
.auth-aside .brand-name { color: #fff; }
.auth-main { flex: 1 1 460px; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 22px; }
.auth-card h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar { max-width: none; flex-basis: 100%; padding: 14px 16px; gap: 14px; }
  .sidebar .side-nav, .sidebar .side-user { display: none; }
  .sidebar.is-open .side-nav, .sidebar.is-open .side-user { display: flex; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .sidebar .brand { padding: 0; }
  .admin-main { padding: 24px 18px 48px; }
  .hero, .auth-aside { padding: 28px 24px; }
  .hero h1 { font-size: 32px; }
  .auth-aside h1 { font-size: 30px; }
  .site-header .inner { padding: 10px 16px; }
  .top-nav { order: 3; flex-basis: 100%; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; padding: 2px 0 4px; scrollbar-width: none; font-size: 14px; }
  .top-nav::-webkit-scrollbar { display: none; }
  .top-nav a { padding: 8px 14px; }
  .site-main { padding: 20px 16px 48px; }
}
