/* ==========================================================================
   Preschool ERP — app-only additions on top of css/kit/ (tokens + components).
   Kept separate so the kit stays 1:1 with ui-kit/index.html. Tokens only.
   ========================================================================== */

[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.grid { display: grid; gap: var(--sp-5); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.stack { display: grid; gap: var(--sp-4); }

/* ---- Full-page app shell (the kit's .shell is a framed demo) ---------- */
.app-shell { min-height: 100vh; border-radius: 0; box-shadow: none; background: transparent; }
.app-shell .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.app-shell .content { min-width: 0; display: flex; flex-direction: column; }
.app-shell .topbar { position: sticky; top: 0; z-index: 20; }
.topbar .menu-toggle { display: none; }
.campus-switch { height: 42px; width: 160px; }
.user-menu { position: relative; }
.user-menu > button { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 40; padding: var(--sp-2);
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.dropdown .who { padding: var(--sp-2) var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-2); }
.dropdown .who b { display: block; }
.dropdown .who span { font-size: var(--fs-xs); color: var(--text-muted); }
.dropdown form { margin: 0; }
.dropdown .nav-item { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.sidebar-backdrop { display: none; }

@media (max-width: 960px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: 1fr; }
  .app-shell .sidebar { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 50;
    transform: translateX(-100%); transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-lg); }
  .app-shell.is-nav-open .sidebar { transform: none; }
  .app-shell.is-nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(20, 30, 45, .35); }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
  .topbar .campus-switch { display: none; }
  .main { padding: var(--sp-4); }
}
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ---- Tabs rendered as links ------------------------------------------ */
.tabs a.tab-link { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); padding: 8px 18px;
  border-radius: var(--radius-pill); text-decoration: none; }
.tabs a.tab-link[aria-selected="true"] { background: var(--surface); color: var(--brand-primary-deep); box-shadow: var(--shadow-sm); }

/* ---- Modal overlay ---------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--sp-4);
  background: rgba(20, 30, 45, .45); backdrop-filter: blur(2px); }

/* ---- Guest (login) ---------------------------------------------------- */
.guest { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6) var(--sp-4);
  background: var(--brand-grad-soft); }
.guest-card { width: min(420px, 100%); padding: var(--sp-8); }
.guest-logo { display: flex; justify-content: center; margin-bottom: var(--sp-5); }
.guest-logo img { max-height: 72px; max-width: 100%; }
.guest-title { margin: 0 0 var(--sp-5); text-align: center; font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
.guest-foot { margin-top: var(--sp-5); text-align: center; font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---- Print documents ------------------------------------------------- */
.print-page { max-width: 210mm; margin: var(--sp-6) auto; }
.print-bar { display: flex; justify-content: flex-end; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.doc-legal .pending { color: #999; }
@page { size: A4 portrait; margin: 12mm; }
@media print {
  .print-bar { display: none !important; }
  .print-page { margin: 0; max-width: none; }
  .doc { padding: 0; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
