/* Portal shell, on top of Extended Day's stylesheet (css/ed.css, unchanged so its pages look exactly as before). */

/* ---- the coloured top bar: one colour per view (Extended Day's sign-in page backgrounds) */
.pbar { display: flex; align-items: center; gap: 1.25rem; padding: .7rem 2rem; color: #fff; position: sticky; top: 0; z-index: 20;
        background: #0f172a; }
.pbar-parent { background: linear-gradient(100deg, #312e81, #0f172a 70%); }
.pbar-staff  { background: linear-gradient(100deg, #166534, #052e16 70%); }
.pbar-admin  { background: linear-gradient(100deg, #a16207, #111111 70%); }
.pbar .brand { color: #fff; font-weight: 750; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.pbar .brand:hover { text-decoration: none; }
.pbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.pbar .btn-ghost { background: transparent; color: #e2e8f0; border-color: rgba(255,255,255,.25); }
.pbar .btn-ghost:hover { background: rgba(255,255,255,.1); }

/* which view: a label that is always there, plus a switch when there is more than one */
.view-picker { position: relative; display: flex; align-items: center; gap: .6rem; }
.view-label { font: inherit; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff;
              padding: .3rem .7rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.14); }
.view-label:disabled { cursor: default; opacity: 1; }
.view-label .caret { display: none; }
.view-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0,0,0,.28); }
.view-switch button { font: inherit; font-size: .85rem; font-weight: 650; color: #e2e8f0; background: transparent; border: 0;
                      padding: .3rem .85rem; border-radius: 999px; cursor: pointer; }
.view-switch button:hover { color: #fff; background: rgba(255,255,255,.1); }
.view-switch button.active { background: #fff; color: #0f172a; }
.view-menu { position: absolute; top: calc(100% + .5rem); left: 0; min-width: 190px; background: #fff; color: var(--ink);
             border-radius: 12px; box-shadow: var(--shadow), 0 12px 32px rgba(15,23,42,.25); padding: .35rem; z-index: 30; }
.view-menu button { display: flex; align-items: center; gap: .55rem; width: 100%; font: inherit; font-weight: 600; text-align: left;
                    padding: .65rem .75rem; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.view-menu button:hover { background: var(--bg); }
.dot-view { width: 12px; height: 12px; border-radius: 50%; }
.dot-parent { background: #312e81; } .dot-staff { background: #166534; } .dot-admin { background: #a16207; }

/* ---- section tabs (Extended Day | Lunch | Attendance | Classroom), underlined in the view's colour */
.sections { --accent: #4f46e5; display: flex; gap: .25rem; padding: 0 2rem; background: #fff; border-bottom: 1px solid var(--line);
            overflow-x: auto; scrollbar-width: none; }
.sections::-webkit-scrollbar { display: none; }
.sections-staff { --accent: #16a34a; }
.sections-admin { --accent: #ca8a04; }
.sections a { padding: .85rem 1rem .7rem; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.sections a:hover { color: var(--ink); text-decoration: none; }
.sections a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- the section's own tabs (Extended Day's admin pages): smaller, second row */
.subtabs { display: flex; gap: .15rem; padding: .45rem 2rem; background: var(--bg); border-bottom: 1px solid var(--line);
           overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { padding: .35rem .75rem; border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.subtabs a:hover { background: var(--line); text-decoration: none; }
.subtabs a.active { background: var(--ink); color: #fff; }

.coming-soon { max-width: 640px; margin: 2rem auto; text-align: center; }
.login-alt { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---- which install is this? (bottom-right on every page) */
.version-badge { position: fixed; right: 8px; bottom: 8px; font: 11px/1 ui-monospace, monospace; padding: 4px 7px; border-radius: 4px;
                 background: rgba(15,23,42,.06); color: var(--muted); pointer-events: none; z-index: 5; }
.version-badge.is-dev { background: #fef3c7; color: #b45309; border: 1px solid #d97706; font-weight: 700; }
.dev-strip { background: #fef3c7; color: #b45309; border-bottom: 2px solid #d97706; padding: 5px 16px; font-size: .8rem; font-weight: 650; }
.update-banner { display: flex; align-items: center; justify-content: center; gap: .75rem; background: #dbeafe; color: #1e3a8a;
                 padding: .5rem 1rem; font-size: .9rem; border-bottom: 1px solid #93c5fd; }

@media (max-width: 900px) {
  .pbar { padding: .6rem 1rem; gap: .75rem; }
  .sections, .subtabs { padding-left: .75rem; padding-right: .75rem; }
}
@media (max-width: 700px) {
  .pbar .brand-name, .pbar .topbar-user, .pbar a.btn { display: none; }
  .view-switch { display: none; }                    /* phones: the label itself opens the view menu */
  .view-label .caret { display: inline; }
  .view-label:not(:disabled) { cursor: pointer; }
  .sections a { padding: .75rem .8rem .6rem; }
}
@media print { .pbar, .sections, .subtabs, .dev-strip, .version-badge { display: none !important; } }

/* ---- Lunch */
.text-green { color: var(--green); } .text-amber { color: var(--amber); }
tr.voided td, .list-row.voided { text-decoration: line-through; opacity: .55; }
.scan-hint { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.scan-hint .card-icon { transform: scale(.6); margin: -12px; }
.lunch-search { width: 100%; max-width: none; font-size: 1.15rem; padding: .8rem 1rem; }
.lunch-pick { display: flex; align-items: center; gap: .6rem; width: 100%; font: inherit; text-align: left; padding: .9rem 1rem; margin-top: .5rem;
              border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.lunch-pick:hover { border-color: var(--primary); }
.lunch-who { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; }
.lunch-avail { text-align: right; padding: .5rem .9rem; border-radius: 12px; }
.lunch-avail b { display: block; font-size: 1.7rem; }
.lunch-avail small { display: block; color: var(--muted); }
.lunch-avail.ok { background: var(--green-l); } .lunch-avail.ok b { color: var(--green); }
.lunch-avail.none { background: var(--red-l); } .lunch-avail.none b { color: var(--red); }
.lunch-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.lunch-item { position: relative; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.lunch-item.on { border-color: var(--primary); background: var(--primary-l); }
.lunch-item-main { display: flex; flex-direction: column; gap: .2rem; width: 100%; min-height: 84px; padding: .9rem; font: inherit; text-align: left;
                   border: 0; background: transparent; cursor: pointer; }
.lunch-item-main span { color: var(--muted); }
.lunch-qty { position: absolute; top: .4rem; right: .4rem; display: flex; align-items: center; gap: .35rem; }
.lunch-qty b { min-width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 999px; background: var(--primary); color: #fff; font-size: .9rem; }
.lunch-qty button { width: 1.8rem; height: 1.8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 1.1rem; cursor: pointer; }
.lunch-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.lunch-total { font-size: 1.1rem; }
.lunch-balance b { display: block; font-size: 2.2rem; margin: .1rem 0; }
.lunch-amounts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lunch-amounts input { max-width: 9rem; }
.lunch-menu-row { align-items: flex-end; } .lunch-menu-row .field { margin-bottom: .5rem; }
.inactive { opacity: .6; }
