/* ============================================================
 * Educo London — educo-theme.css (Phase G24)
 * Brand theme. Loaded AFTER main.css on every page so it wins
 * the cascade. Presentation only — no layout logic lives here.
 *
 * ── REBRANDING = EDIT THE VARIABLE BLOCK BELOW, NOTHING ELSE ──
 * Every brand colour on the site resolves to one of these lines.
 * The SEMANTIC block (--rate-*, --cap-*) carries meaning
 * (traffic-light ratings, capacity states) and must NOT be
 * rebranded — red/amber/green stay red/amber/green.
 * ============================================================ */
:root {
  --educo-ink:        #181818; /* brand charcoal — from the Educo logo */
  --educo-paper:      #FAF9F7; /* warm white page background */
  --educo-surface:    #FFFFFF; /* cards */
  --educo-accent:     #C9A227; /* gold — primary buttons, active nav */
  --educo-accent-ink: #FFFFFF; /* text on gold fills */
  --educo-line:       #E7E3DC; /* borders */
  --educo-muted:      #6B6B6B; /* secondary text */
  /* darker gold for TEXT-level accents (links, outline buttons) —
     WCAG AA on white (~4.9:1); raw gold is fills-only, never small
     text on white */
  --educo-accent-deep:#8C6D14;
  /* semantic — DO NOT rebrand these; they carry meaning: */
  --rate-secure:  #16A34A;
  --rate-okay:    #D97706;
  --rate-needs:   #DC2626;
  --cap-ok:       #16A34A;
  --cap-low:      #D97706;
  --cap-full:     #DC2626;

  /* Remap the main.css design tokens onto the brand (everything
     already built with var(--bg/--surface/--border/--muted/--text/
     --primary) re-skins automatically): */
  --bg:           var(--educo-paper);
  --surface:      var(--educo-surface);
  --border:       var(--educo-line);
  --muted:        var(--educo-muted);
  --text:         var(--educo-ink);
  --primary:      var(--educo-accent);   /* FILLS: buttons, active pills, chart lines */
  --primary-dark: #A8861F;               /* gold hover */
}

/* ── Base ── */
body { background: var(--educo-paper); color: var(--educo-ink); }
a { color: var(--educo-accent-deep); }           /* AA text gold, not raw gold */
.page-title, .card-title { color: var(--educo-ink); }

/* ── Cards ── */
.card { background: var(--educo-surface); border-color: var(--educo-line); }

/* ── Buttons — gold fills with the accent-ink variable ── */
.btn { background: var(--educo-accent); color: var(--educo-accent-ink); font-weight: 700; }
.btn:hover { background: var(--primary-dark); }
.btn-outline { background: var(--educo-surface); color: var(--educo-accent-deep); border: 1px solid var(--educo-accent); }
.btn-outline:hover { background: #FBF6E9; }
.btn-muted { background: var(--educo-surface); color: var(--educo-ink); border: 1px solid var(--educo-line); }
.btn-muted:hover { background: var(--educo-paper); }
/* semantic buttons keep their meaning colours */
.btn-success { background: var(--cap-ok); color: #fff; }
.btn-danger  { background: var(--rate-needs); color: #fff; }

/* ── Top nav — ink bar, white text, gold active (mobile-first) ── */
.nav {
  background: var(--educo-ink);
  border-bottom: none;
  padding: var(--space-2) var(--space-4);
}
.nav-brand { color: #fff; }
.nav-brand::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--educo-accent); margin-left: 7px; vertical-align: middle; }
.nav-burger {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap-min); min-height: var(--tap-min);
  margin-left: auto;
  background: transparent; border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm); color: #fff; font-size: 18px;
}
/* Mobile: menu hidden until the hamburger opens it (full-height list) */
.nav-links { display: none; }
.nav.nav-open .nav-links { display: flex; flex-direction: column; width: 100%; gap: 2px; padding: var(--space-2) 0; }
.nav-link {
  color: #D9D5CD; width: 100%;
  min-height: var(--tap-min);        /* ≥44px touch targets in the menu */
  font-size: 15px;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,0.06); color: #fff; box-shadow: inset 3px 0 0 var(--educo-accent); }
.nav-user { color: #CFCBC4; display: none; }
.nav-user .btn-muted { background: transparent; color: #D9D5CD; border-color: rgba(255,255,255,0.3); }
.nav-user .btn-muted:hover { background: rgba(255,255,255,0.08); }
.nav-search { display: none; }
.nav.nav-open .nav-search { display: flex; width: 100%; padding: var(--space-2) 0; }
.nav.nav-open .nav-search-input { width: 100%; }
.nav.nav-open .nav-user { display: flex; width: 100%; justify-content: space-between; padding-top: var(--space-2); border-top: 1px solid rgba(255,255,255,0.15); }
.nav-search-input { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); color: #fff; }
.nav-search-input::placeholder { color: #B9B5AE; }
.nav-search-input:focus { border-color: var(--educo-accent); background: rgba(255,255,255,0.15); }

/* Admin dropdown (details/summary — no JS needed) */
.nav-drop { position: relative; width: 100%; }
.nav-drop summary { list-style: none; cursor: pointer; }
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-caret { font-size: 10px; opacity: 0.7; }
.nav-drop-menu { padding-left: var(--space-4); }
.nav-drop-item {
  display: flex; align-items: center; min-height: var(--tap-min);
  padding: 0 var(--space-3); border-radius: var(--radius-sm);
  color: #D9D5CD; font-size: 14px; font-weight: 600;
}
.nav-drop-item:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.nav-drop-item.active { color: #fff; box-shadow: inset 3px 0 0 var(--educo-accent); }

/* Desktop nav: single row, gold underline for the active section */
@media (min-width: 900px) {
  .nav { flex-wrap: nowrap; }
  .nav-burger { display: none; }
  .nav-links {
    display: flex !important; flex-direction: row; flex-wrap: nowrap;
    width: auto; flex: 1; gap: 2px; overflow-x: auto; padding: 0;
  }
  .nav-link { width: auto; white-space: nowrap; min-height: 40px; font-size: 14px; }
  .nav-link.active { background: transparent; box-shadow: inset 0 -3px 0 var(--educo-accent); }
  .nav-search { display: flex; width: auto; padding: 0; }
  .nav-search-input { width: 160px; }
  .nav-user { display: flex; width: auto; border-top: none; padding-top: 0; }
  .nav-drop { width: auto; }
  .nav-drop-menu {
    position: absolute; top: 100%; right: 0; z-index: 300;
    min-width: 170px; padding: var(--space-1);
    background: var(--educo-ink); border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  }
  .nav-drop-item.active { box-shadow: inset 0 -3px 0 var(--educo-accent); }
}

/* ── Section tab bar (directly under the nav) ── */
.section-tabs {
  display: flex; gap: 2px; overflow-x: auto;
  background: var(--educo-surface);
  border-bottom: 1px solid var(--educo-line);
  padding: 0 var(--space-4);
  -webkit-overflow-scrolling: touch;
}
.sec-tab {
  display: inline-flex; align-items: center;
  min-height: var(--tap-min); padding: 0 var(--space-4);
  font-size: 14px; font-weight: 600; color: var(--educo-muted);
  white-space: nowrap; border: none; background: transparent;
  border-bottom: 3px solid transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sec-tab:hover { color: var(--educo-ink); text-decoration: none; }
.sec-tab.active { color: var(--educo-ink); border-bottom-color: var(--educo-accent); }
/* in-card tab row (class cards) reuses .sec-tab */
.card-tabs {
  display: flex; gap: 2px; overflow-x: auto;
  border-bottom: 1px solid var(--educo-line); margin-bottom: var(--space-3);
}

/* ── Breadcrumb (wayfinding: always visible, always one click up) ── */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: var(--space-2) var(--space-4) 0;
  font-size: 13px; color: var(--educo-muted);
}
.crumbs a { color: var(--educo-muted); text-decoration: underline; text-underline-offset: 2px; }
.crumbs a:hover { color: var(--educo-ink); }
.crumb-sep { color: #B9B5AE; }

/* ── Capacity badge (SEMANTIC colours — never gold) ── */
.cap-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.cap-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cap-ok   { background: var(--green-bg); color: #15803d; }
.cap-ok::before   { background: var(--cap-ok); }
.cap-low  { background: var(--amber-bg); color: #92400e; }
.cap-low::before  { background: var(--cap-low); }
.cap-full { background: var(--red-bg);  color: #991b1b; }
.cap-full::before { background: var(--cap-full); }

/* ── "Open today's register" shortcut (dashboard) ── */
.quick-register {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--tap-min);
  background: var(--educo-ink); color: #fff;
  border-left: 6px solid var(--educo-accent);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: 17px; font-weight: 700;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow);
}
.quick-register:hover { text-decoration: none; opacity: 0.95; color: #fff; }
.quick-register .qr-arrow { margin-left: auto; color: var(--educo-accent); }

/* One-tap today buttons on the register landing */
.quick-session { width: 100%; justify-content: flex-start; text-align: left; font-size: 16px; }

/* ── Misc polish (colour/type only — no layout changes) ── */
.date-strip { background: var(--educo-paper); border-bottom-color: var(--educo-line); }
/* Phase G26 — clickable dashboard stat cards: whole card is a link,
   cursor pointer, subtle hover lift. Theme tokens only — no new colours. */
a.stat-tile {
  display: block; color: inherit; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
a.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--educo-accent);
  text-decoration: none;
}
.tbl th { background: var(--educo-paper); color: var(--educo-muted); }
.tbl tr:hover td { background: #F5F2EC; }
.toast { background: var(--educo-ink); }
.stat-tile, .tile { border-color: var(--educo-line); }
.tile:hover { border-color: var(--educo-accent); }
.pill.active { background: var(--educo-accent); border-color: var(--educo-accent); color: var(--educo-accent-ink); }

/* ── Print ── */
@media print {
  .section-tabs, .crumbs, .nav-burger, .quick-register { display: none !important; }
  body { background: #fff; }
}
