/* ArcAngel School Manager — base theme.
   Brand: navy #1B2A4A / gold #C8A44A (matches the desktop app). */
:root {
  --navy: #1B2A4A;
  --navy-dark: #131f38;
  --gold: #C8A44A;
  --gold-light: #e3cf96;
  /* White-label accent. Defaults to gold, so schools that set nothing look
     exactly as before. A school override (a validated #rrggbb) is injected by
     base.html. Used ONLY for decorative borders/strips — never behind text —
     so any color the school picks stays safe and readable. */
  --brand-accent: var(--gold);
  /* White-label header bar. All default to today's navy palette, so an unset
     school is pixel-identical. When a school sets a header color, base.html
     injects these with server-computed, contrast-safe text/hover shades. */
  --header-bg: var(--navy);
  --header-ink: #fff;
  --header-ink-dim: #dfe5ef;
  --header-muted: #b9c3d4;
  --header-active: var(--gold-light);
  --header-hover: var(--navy-dark);
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --text: #1c2430;
  --muted: #68727f;
  --danger: #b3372e;
  --ok: #2e7d4f;
  --warn: #a8721c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--navy); }

/* Attendance roster — fast tap-to-mark */
.att-daybar { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; margin-bottom:1rem; }
.att-saved-note { color:var(--muted); font-size:.88rem; }
.att-toolbar { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.att-counts { color:var(--muted); font-size:.9rem; font-variant-numeric:tabular-nums; }
.att-roster { border-collapse:collapse; width:100%; max-width:600px; margin:.75rem 0; }
.att-roster td { padding:.5rem .35rem; border-bottom:1px solid var(--line); vertical-align:middle; }
.att-name { font-weight:500; }
.att-roster tr td:last-child { text-align:right; }
.att-seg { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.att-seg input { position:absolute; opacity:0; pointer-events:none; }
.att-seg label { padding:.5rem .9rem; cursor:pointer; font-size:.9rem; background:var(--card);
                 color:var(--muted); user-select:none; line-height:1; }
.att-seg label + input + label, .att-seg input + label { border-left:1px solid var(--line); }
.att-seg label:first-of-type { border-left:0; }
.att-seg input:focus-visible + label { outline:2px solid var(--navy); outline-offset:-2px; }
.att-seg input:checked + label.att-present { background:#1f7a4d; color:#fff; }
.att-seg input:checked + label.att-absent  { background:var(--danger); color:#fff; }
.att-seg input:checked + label.att-excused { background:#b5892a; color:#fff; }

/* Header */
.topbar {
  background: var(--header-bg); color: var(--header-ink);
  display: flex; align-items: center; gap: 1.25rem;
  padding: .65rem 1.25rem;
  border-bottom: 3px solid var(--brand-accent);
}
.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem; color: var(--header-ink); text-decoration: none;
  letter-spacing: .02em; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .55rem;
}
.brand .accent { color: var(--gold); }
.brand-logo { height: 30px; width: auto; max-width: 180px; display: block; border-radius: 3px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a {
  color: var(--header-ink-dim); text-decoration: none; padding: .35rem .7rem;
  border-radius: 6px; font-size: .95rem;
}
.topbar nav a:hover { background: var(--header-hover); color: var(--header-ink); }
.topbar nav a.active { background: var(--header-hover); color: var(--header-active); }
.topbar .spacer { flex: 1; }
/* Collapsible wrapper + hamburger (hamburger hidden until mobile) */
.topbar-collapse { display: flex; align-items: center; gap: 1.25rem; flex: 1; }
.nav-toggle { display: none; }

/* Utilities dropdown */
.menu { position: relative; display: inline-block; }
.menu summary {
  list-style: none; cursor: pointer; color: var(--header-ink-dim);
  padding: .35rem .7rem; border-radius: 6px; font-size: .95rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--header-hover); color: var(--header-ink); }
.menu[open] summary { background: var(--header-hover); color: var(--header-active); }
.menu .menu-items {
  position: absolute; top: 100%; left: 0; margin-top: .25rem;
  background: #fff; border-radius: 8px; box-shadow: var(--shadow);
  min-width: 170px; padding: .3rem; z-index: 20;
}
.menu .menu-items a {
  display: block; color: var(--text); padding: .45rem .6rem;
  border-radius: 6px; text-decoration: none; font-size: .92rem;
}
.menu .menu-items a:hover { background: var(--navy); color: #fff; }

/* Profile menu (right side of the header) */
.profile-menu { margin-left: auto; }
.profile-trigger { display: inline-flex; align-items: center; gap: .5rem; }
.profile-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis;
                white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--header-hover); color: var(--header-ink);
  font-size: .8rem; font-weight: 700; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-menu .menu-items { left: auto; right: 0; min-width: 230px; }
.profile-items .profile-head { padding: .5rem .6rem .4rem; }
.profile-items .profile-head strong { color: var(--navy); }
.profile-items .profile-head .muted { color: var(--muted); font-size: .82rem; }
.profile-items hr { border: 0; border-top: 1px solid var(--line); margin: .35rem 0; }
.profile-switch { padding: .2rem .6rem .4rem; }
.profile-switch label { display: block; color: var(--muted); font-size: .78rem;
                        text-transform: uppercase; letter-spacing: .03em; }
.profile-switch select { width: 100%; margin-top: .2rem; padding: .35rem .4rem;
                         border: 1px solid var(--line); border-radius: 6px; }
.profile-signout { padding: .1rem; }
.profile-signout button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); padding: .45rem .6rem; border-radius: 6px; cursor: pointer;
  font-size: .92rem;
}
.profile-signout button:hover { background: var(--navy); color: #fff; }

/* Emergency banners */
.emergency-banner { padding: .6rem 1rem; font-size: .95rem; }
.emergency-inner { max-width: 1100px; margin: 0 auto; display: flex;
                   align-items: center; gap: 1rem; }
.emergency-body { flex: 1; }
.emergency-dismiss { background: none; border: 0; color: inherit; font-size: 1.4rem;
                     line-height: 1; cursor: pointer; opacity: .75; padding: 0 .25rem; }
.emergency-dismiss:hover { opacity: 1; }
.emergency-info { background: #e8eef8; color: #1c2b4a; border-bottom: 2px solid #3b5b9a; }
.emergency-warning { background: #fff4e0; color: #6b4e12; border-bottom: 2px solid #b5892a; }
.emergency-critical { background: var(--danger); color: #fff; border-bottom: 2px solid #7d221b; }

/* Impersonation banner */
.impersonate-bar {
  background: #7a3d12; color: #fff; text-align: center;
  padding: .5rem 1rem; font-size: .92rem;
}
.topbar .whoami { color: var(--header-muted); font-size: .85rem; }
.topbar form { margin: 0; }
.btn-link {
  background: none; border: 1px solid var(--gold); color: var(--gold-light);
  padding: .3rem .8rem; border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.btn-link:hover { background: var(--gold); color: var(--navy); }

/* Layout */
main.container {
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
  flex: 1;
}
h1 { font-family: Georgia, serif; font-weight: 600; font-size: 1.6rem;
     margin: .25rem 0 1rem; }
h1 .sub { color: var(--muted); font-size: 1rem; font-family: inherit; }
h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em;
     color: var(--navy); margin: 1.75rem 0 .6rem; }
h2:first-of-type { margin-top: .5rem; }

/* Cards & grids */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
         gap: 1rem; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
}
.card .big { font-size: 1.9rem; font-weight: 700; color: var(--navy); }
.card .label { color: var(--muted); font-size: .85rem; text-transform: uppercase;
               letter-spacing: .05em; }
.card.gold { border-top: 3px solid var(--brand-accent); }

/* Tables */
table.data { width: 100%; border-collapse: collapse; background: var(--card);
             border-radius: var(--radius); box-shadow: var(--shadow);
             overflow: hidden; }
table.data th {
  background: var(--navy); color: #fff; text-align: left;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  padding: .55rem .8rem;
}
table.data td { padding: .55rem .8rem; border-top: 1px solid #eef0f3;
                font-size: .95rem; }
table.data tr:hover td { background: #f8f9fb; }
td.num, th.num { text-align: right; }
/* Beat `table.data th`'s left-align (higher specificity) so numeric headers
   line up over their number columns. */
table.data th.num { text-align: right; }

/* Badges */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px;
         font-size: .78rem; font-weight: 600; }
.badge.missing { background: #fbe9e7; color: var(--danger); }
.badge.due { background: #fff7e0; color: var(--warn); }
.badge.ok { background: #e6f4ec; color: var(--ok); }
.badge.muted { background: #eef0f3; color: var(--muted); }

/* Messages */
.messages { list-style: none; margin: 0 0 1rem; padding: 0; }
.messages li { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .5rem; }
.messages .success { background: #e6f4ec; color: var(--ok); }
.messages .error { background: #fbe9e7; color: var(--danger); }
.messages .info { background: #e8eef8; color: var(--navy); }

/* Collapsible grade-level groups on the Classes page */
.grade-group { margin-bottom: 1rem; border: 1px solid #e0e5ec;
               border-radius: var(--radius); overflow: hidden;
               background: var(--card); box-shadow: var(--shadow); }
.grade-group > summary { cursor: pointer; list-style: none; padding: .7rem 1rem;
                         display: flex; align-items: center; gap: .75rem;
                         background: var(--navy); color: #fff; font-weight: 600; }
.grade-group > summary::-webkit-details-marker { display: none; }
.grade-group > summary::before { content: "\25B8"; transition: transform .15s ease;
                                 font-size: .9em; opacity: .85; }
.grade-group[open] > summary::before { transform: rotate(90deg); }
.grade-group .grade-count { margin-left: auto; font-weight: 400; opacity: .85;
                            font-size: .85rem; }
.grade-group > table { margin: 0; }

/* Attention banner (e.g. "confirm re-enrollment") */
.notice-banner { display: flex; align-items: center; justify-content: space-between;
                 gap: 1rem; flex-wrap: wrap; padding: .8rem 1.1rem; margin: 0 0 1.25rem;
                 background: #fff7e6; border: 1px solid var(--gold);
                 border-radius: 10px; color: var(--navy); }

/* Forms (login etc.) */
.auth-wrap { max-width: 400px; margin: 8vh auto 0; }
.auth-card { background: var(--card); border-radius: var(--radius);
             box-shadow: var(--shadow); padding: 2rem;
             border-top: 4px solid var(--gold); }
.auth-card h1 { text-align: center; margin-bottom: 1.25rem; }
form.stack p { margin: 0 0 1rem; }
form.stack label { display: block; font-size: .85rem; font-weight: 600;
                   color: var(--muted); margin-bottom: .25rem; }
form.stack input[type=text], form.stack input[type=password],
form.stack input[type=email] {
  width: 100%; padding: .55rem .7rem; border: 1px solid #d4d9e0;
  border-radius: 8px; font-size: 1rem;
}
form.stack input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.btn-primary {
  display: block; width: 100%; background: var(--navy); color: #fff;
  border: none; padding: .65rem; border-radius: 8px; font-size: 1rem;
  cursor: pointer; font-weight: 600;
}
.btn-primary:hover { background: var(--navy-dark); }
.btn-secondary {
  display: block; width: 100%; background: transparent; color: var(--navy);
  border: 1.5px solid var(--navy); padding: .65rem; border-radius: 8px;
  font-size: 1rem; cursor: pointer; font-weight: 600;
}
.btn-secondary:hover { background: var(--navy); color: #fff; }
/* Grouped section headers on the Configuration (admin) hub. */
.admin-section { font-size: 1.05rem; margin: 1.6rem 0 .5rem; color: var(--navy);
  border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.admin-section:first-of-type { margin-top: 1rem; }
.btn-danger { display: block; width: 100%; background: var(--danger); color: #fff;
  border: none; padding: .65rem; border-radius: 8px; font-size: 1rem;
  cursor: pointer; font-weight: 600; }
.btn-danger:hover { background: #922c25; }
/* Inline per-row actions in data tables (Edit · Archive · Delete). */
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions form { margin-right: .7rem; }
.row-actions a:last-child, .row-actions form:last-child { margin-right: 0; }
a.danger-link { color: var(--danger); }
tr.row-muted td { opacity: .62; }
span.muted { color: var(--muted); }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 0 0 .5rem;
             font-size: .9rem; }
.agree-label { display: flex; gap: .5rem; align-items: flex-start;
               font-weight: 400; color: var(--text); font-size: .85rem; }
.agree-label input { margin-top: .2rem; }

/* Top-bar CTA (anonymous) */
.topbar nav a.nav-cta {
  background: var(--gold); color: var(--navy); font-weight: 700;
}
.topbar nav a.nav-cta:hover { background: var(--gold-light); color: var(--navy); }

/* ===== Marketing landing ===== */
.hero { text-align: center; padding: 2rem 1rem 2.5rem; }
.hero-logo { width: 190px; max-width: 55vw; height: auto; margin: 0 auto .5rem; display: block; }
.hero-title { font-family: Georgia, serif; font-size: 2.3rem; line-height: 1.15;
              margin: .5rem 0 1rem; color: var(--navy); }
.hero-title .accent-text { font-size: 1.4rem; color: var(--muted); font-weight: 400;
                           display: inline-block; margin-top: .4rem; }
.hero-sub { max-width: 640px; margin: 0 auto 1.5rem; font-size: 1.1rem; color: var(--text); }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.hero-note { color: var(--muted); font-size: .85rem; margin-top: 1rem; }

.btn-cta {
  display: inline-block; background: var(--gold); color: var(--navy);
  font-weight: 700; padding: .8rem 1.8rem; border-radius: 10px;
  text-decoration: none; font-size: 1.05rem; box-shadow: var(--shadow);
}
.btn-cta:hover { background: var(--gold-light); }
.btn-ghost {
  display: inline-block; border: 1.5px solid var(--navy); color: var(--navy);
  padding: .8rem 1.6rem; border-radius: 10px; text-decoration: none; font-weight: 600;
}
.btn-ghost:hover { background: var(--navy); color: #fff; }

.band { background: var(--navy); color: #fff; border-radius: var(--radius);
        padding: 2rem 1.75rem; margin: 1.5rem 0; text-align: center; }
.band-title { font-family: Georgia, serif; color: var(--gold-light); font-size: 1.6rem;
              margin: 0 0 .75rem; text-transform: none; letter-spacing: 0; }
.band-text { max-width: 720px; margin: 0 auto; color: #e4e8f0; font-size: 1.05rem; line-height: 1.6; }
.band-text strong { color: #fff; }
.promise-grid { list-style: none; padding: 0; margin: 1.5rem auto 0; max-width: 640px;
                display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.promise-grid li { position: relative; padding: .55rem .5rem .55rem 1.9rem;
                   background: rgba(255,255,255,.06); border-radius: 8px;
                   color: #eef1f6; font-size: .95rem; text-align: left; }
.promise-grid li::before { content: "✕"; position: absolute; left: .7rem;
                           color: var(--gold-light); font-weight: 700; }
@media (max-width: 560px) { .promise-grid { grid-template-columns: 1fr 1fr; } }
.weekday-picker ul { list-style: none; display: flex; flex-wrap: wrap;
                     gap: .4rem .8rem; padding: 0; margin: .3rem 0 0; }
.weekday-picker li { margin: 0; }
.weekday-picker label { display: flex; align-items: center; gap: .3rem;
                        font-weight: 400; margin: 0; }

.section-head { text-align: center; font-family: Georgia, serif; color: var(--navy);
                font-size: 1.7rem; text-transform: none; letter-spacing: 0;
                margin: 2.25rem 0 1.25rem; scroll-margin-top: 1rem; }

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tier { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 1.25rem 1.35rem; border-top: 4px solid var(--gold); }
.tier-tag { display: inline-block; background: var(--navy); color: var(--gold-light);
            font-size: .72rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: .06em; padding: .2rem .6rem; border-radius: 99px; }
.tier h3 { font-family: Georgia, serif; color: var(--navy); margin: .6rem 0 .4rem; font-size: 1.2rem; }
.tier p { color: var(--text); font-size: .95rem; margin: .4rem 0; }
.tier-price { color: var(--warn); font-weight: 600; font-size: .9rem !important; }

.highlight { background: #fff8e6; border-left: 4px solid var(--gold);
             border-radius: var(--radius); padding: 1.75rem; margin: 2rem 0; }
.highlight-lead { max-width: 760px; margin: 0 auto; text-align: center; font-size: 1.08rem; line-height: 1.6; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.feature { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.feature h4 { color: var(--navy); margin: 0 0 .35rem; font-size: 1.05rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }

.freedom { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
           gap: .9rem; margin-top: 1.25rem; }
.freedom-item { background: #fff; border-radius: var(--radius); padding: 1rem 1.15rem;
                font-size: .95rem; color: var(--text); box-shadow: var(--shadow); }
.freedom-item strong { color: var(--navy); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.step { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 1.25rem; text-align: center; }
.step-num { width: 2.4rem; height: 2.4rem; margin: 0 auto .6rem; border-radius: 50%;
            background: var(--navy); color: var(--gold-light); font-weight: 700;
            font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.step h4 { color: var(--navy); margin: 0 0 .35rem; }
.step p { color: var(--muted); font-size: .92rem; margin: 0; }

.faq { max-width: 780px; margin: 0 auto; }
.faq details { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
               padding: .9rem 1.15rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; color: var(--gold); font-weight: 700; margin-right: .5rem; }
.faq details[open] summary::before { content: "－"; }
.faq details p { color: var(--text); font-size: .95rem; margin: .7rem 0 .2rem; }

.contact { max-width: 620px; margin: 0 auto; }
.contact-lead { text-align: center; color: var(--muted); margin-bottom: 1rem; }

.closing { text-align: center; background: var(--navy); color: #fff;
           border-radius: var(--radius); padding: 2.5rem 1.5rem; margin: 2.5rem 0 1rem; }
.closing h2 { font-family: Georgia, serif; color: #fff; font-size: 1.8rem; margin: 0 0 .5rem; }
.closing p { color: #d7deea; margin: 0 0 1.5rem; }

/* Landing anchor nav (anonymous header) */
.topbar nav.landing-nav a { color: #cfd8e8; }
.topbar nav.landing-nav a:hover { background: var(--navy-dark); color: #fff; }

/* Pricing */
.pricing-lead { max-width: 720px; margin: -.4rem auto 1.5rem; text-align: center;
                color: var(--ink, #33404f); line-height: 1.55; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
           gap: 1.1rem; align-items: start; }
.price-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
              padding: 1.5rem 1.4rem; border: 1px solid #e5e9f0; display: flex;
              flex-direction: column; }
.price-card.featured { border: 2px solid var(--gold); box-shadow: 0 8px 26px rgba(20,35,65,.16);
                       position: relative; }
.price-badge { position: absolute; top: -.75rem; left: 50%; transform: translateX(-50%);
               background: var(--gold); color: var(--navy); font-weight: 700;
               font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
               padding: .2rem .7rem; border-radius: 99px; white-space: nowrap; }
.price-amount { font-family: Georgia, serif; color: var(--navy); font-size: 2.6rem;
                font-weight: 700; margin: .5rem 0 0; line-height: 1; }
.price-per { font-size: .95rem; font-weight: 400; color: #6b7686; }
.price-plus { color: #6b7686; font-size: .9rem; margin: .2rem 0 0; }
.price-desc { color: #465264; margin: .6rem 0 .9rem; }
.price-feat { list-style: none; padding: 0; margin: 0 0 1.25rem; flex: 1; }
.price-feat li { position: relative; padding: .3rem 0 .3rem 1.4rem; color: #33404f;
                 font-size: .95rem; border-top: 1px solid #eef1f5; }
.price-feat li:first-child { border-top: none; }
.price-feat li::before { content: "✓"; position: absolute; left: 0; color: var(--gold);
                         font-weight: 700; }
.price-card .btn-cta, .price-card .btn-ghost { text-align: center; }
.pricing-foot { text-align: center; color: #6b7686; font-size: .9rem; margin: 1.25rem 0 0; }

@media (max-width: 640px) {
  .hero-title { font-size: 1.8rem; }
  .hero-title .accent-text { font-size: 1.15rem; }
}

/* Footer */
footer { text-align: center; color: var(--muted); font-size: .8rem;
         padding: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem;
                justify-content: center; margin-bottom: .5rem; }
.footer-links a { color: var(--navy); text-decoration: none; font-size: .82rem; }
.footer-links a:hover { text-decoration: underline; }

/* Legal / policy pages */
.legal { max-width: 780px; margin: 0 auto; }
.legal h1 { margin-bottom: .25rem; }
.legal h2 { font-size: 1.05rem; margin: 1.6rem 0 .5rem; }
.legal p, .legal li { color: var(--text); line-height: 1.65; }
.legal ul { margin: .4rem 0 .8rem; padding-left: 1.25rem; }
.legal li { margin: .3rem 0; }
.legal-meta { color: var(--muted); font-size: .9rem; margin-top: 0; }
.legal-draft { background: #fff7e0; border: 1px solid var(--gold);
               border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1.25rem;
               font-size: .9rem; color: #5b4a1a; }
.legal-draft .ph, .legal .ph { background: #ffe9a8; color: #6b5310;
               padding: 0 .25rem; border-radius: 4px; font-style: normal;
               white-space: nowrap; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 0 0 1.5rem;
             padding-bottom: .75rem; border-bottom: 1px solid #e5e9f0; }
.legal-nav a { font-size: .88rem; color: var(--navy); text-decoration: none; }
.legal-nav a:hover { text-decoration: underline; }
.legal-contact { color: var(--muted); font-size: .9rem; }
.legal hr { border: none; border-top: 1px solid #e5e9f0; margin: 1.75rem 0 1rem; }
.empty { color: var(--muted); font-style: italic; padding: .75rem 0; }
.notice { background: #fff8e6; border-left: 4px solid var(--gold);
          padding: .6rem .9rem; border-radius: 6px; margin: 0 0 1rem; }

/* ===== Staff dashboard ===== */
.dash-head { display: flex; align-items: center; justify-content: space-between;
             gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-clock { text-align: right; }
.dash-time { font-family: Georgia, serif; font-size: 1.9rem; font-weight: 700;
             color: var(--navy); line-height: 1; letter-spacing: .01em; }
.dash-date { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.dash-actions { margin-bottom: 1.25rem; }
.dash-actions .card { text-decoration: none; }
.dash-actions .big { font-size: 1.15rem; }

.dash-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
                gap: .9rem; margin-bottom: 1.5rem; }
.dash-summary .stat { background: var(--card); border-radius: var(--radius);
                      box-shadow: var(--shadow); padding: 1rem 1.1rem; text-align: center; }
.stat-num { font-family: Georgia, serif; font-size: 2rem; font-weight: 700;
            color: var(--navy); line-height: 1; }
.stat-num.bad { color: var(--danger); }
.stat-num.good { color: var(--ok); }
.stat-lbl { color: var(--muted); font-size: .82rem; margin-top: .35rem; }
/* A clickable summary stat (e.g. Missing assignments -> grade them). */
a.stat-link { display: block; text-decoration: none; transition: box-shadow .12s, transform .12s; }
a.stat-link:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); transform: translateY(-1px); }

/* Context switcher in the top bar (users in more than one school). */
.school-switch { display: inline; }
.school-switch select { font-size: .82rem; padding: .1rem .3rem; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
  color: #fff; max-width: 12rem; }
.school-switch select option { color: var(--ink, #1c2531); }

/* Forms engine: fill + review rendering. */
.form-section { font-family: Georgia, serif; color: var(--navy); font-size: 1.05rem;
  margin: 1.3rem 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid #e6e9ee; }
.form-section:first-child { margin-top: .2rem; }
.consent-note { background: var(--accent-soft, #f6ecd0); border-left: 3px solid var(--gold, #C8A44A);
  padding: .6rem .8rem; border-radius: 6px; font-size: .9rem; margin: .6rem 0; }
.cb-label { display: flex; gap: .5rem; align-items: flex-start; }
.review-row { display: flex; gap: 1rem; padding: .4rem 0; border-top: 1px solid #eef0f3; }
.review-label { flex: 0 0 40%; color: var(--muted); font-size: .9rem; }
.review-value { flex: 1; white-space: pre-wrap; }
.sig-value { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 1.2rem;
  color: var(--navy); }
.sig-field label { font-weight: 600; }

/* Form builder: editor + live preview side by side. */
.builder-cols { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.builder-edit { flex: 1 1 440px; min-width: 0; }
.builder-preview { flex: 1 1 340px; min-width: 0; position: sticky; top: 1rem; }
.preview-pane { border: 1px dashed var(--gold, #C8A44A); }
.preview-pane input, .preview-pane textarea, .preview-pane select { pointer-events: none; background: #fbfbfc; }

/* School Admin hub: tool cards. */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
              gap: 1rem; margin-top: 1.2rem; }
.admin-card { display: block; text-decoration: none; color: inherit;
              background: var(--card); border: 1px solid #e6e9ee; border-radius: var(--radius);
              padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
              transition: box-shadow .12s, transform .12s; }
.admin-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-2px); }
.admin-card .admin-ico { font-size: 1.6rem; line-height: 1; }
.admin-card h3 { font-family: Georgia, serif; color: var(--navy); margin: .5rem 0 .3rem;
                 font-size: 1.12rem; }
.admin-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }

/* Grading-settings: per-grade scale-type grid. */
.grade-scale-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
                    gap: .7rem; }
.gs-cell { display: flex; flex-direction: column; gap: .2rem; }
.gs-lbl { font-size: .8rem; font-weight: 600; color: var(--muted); }
.gs-cell select { width: 100%; }
.help { display: block; color: var(--muted); font-size: .82rem; margin-top: .15rem; }

.dash-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem;
               align-items: start; }
.dash-h2 { font-family: Georgia, serif; color: var(--navy); font-size: 1.3rem;
           margin: 0 0 .8rem; }

.stu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 1rem; }
.stu-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
            overflow: hidden; display: block; color: inherit; text-decoration: none;
            transition: box-shadow .12s, transform .12s; }
a.stu-card:hover { box-shadow: 0 6px 18px rgba(16,24,40,.14); transform: translateY(-2px); }
.stu-head { background: var(--navy); color: #fff; padding: .7rem .9rem; }
.stu-name { font-weight: 700; }
.stu-grade { color: var(--gold-light); font-size: .82rem; }
.stu-stats { padding: .5rem .9rem; }
.sr { display: flex; justify-content: space-between; align-items: baseline;
      padding: .3rem 0; border-top: 1px solid #eef1f5; font-size: .9rem; }
.sr:first-child { border-top: none; }
.sr span { color: var(--muted); }
.sr b { color: var(--navy); }
.sr b.bad { color: var(--danger); }
.sr b.good { color: var(--ok); }
.grad { padding: .5rem .9rem .9rem; }
.grad-lbl { display: flex; justify-content: space-between; font-size: .8rem;
            color: var(--muted); margin-bottom: .3rem; }
.grad-bar { height: 7px; background: #e6e9ee; border-radius: 99px; overflow: hidden; }
.grad-fill { height: 100%; background: var(--gold); border-radius: 99px; }
.grad-fill.full { background: var(--ok); }

/* Sidebar widgets */
.dash-side { display: flex; flex-direction: column; gap: 1.25rem; }
.widget { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
          padding: 1rem; }
.widget-hd { font-weight: 700; color: var(--navy); margin-bottom: .6rem; }
.widget-hd .muted { color: var(--muted); font-weight: 400; font-size: .82rem; }

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cal-title { font-family: Georgia, serif; font-weight: 700; color: var(--navy); }
.cal-arrow { text-decoration: none; color: var(--navy); padding: .1rem .5rem;
             border-radius: 6px; }
.cal-arrow:hover { background: var(--bg); }
.mini-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mini-cal th { color: var(--muted); font-size: .7rem; font-weight: 700; padding: .2rem 0; }
.mini-cal td { text-align: center; font-size: .82rem; padding: .3rem 0; color: var(--navy);
               border-radius: 6px; }
.mini-cal td.wknd { color: var(--muted); }
.mini-cal td.pad { color: transparent; }
.mini-cal td.active { position: relative; font-weight: 700; }
.mini-cal td.active::after { content: ""; position: absolute; left: 50%; bottom: 2px;
    transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.mini-cal td .cal-day { display: block; color: inherit; text-decoration: none;
                        border-radius: 6px; }
.mini-cal td .cal-day:hover { background: var(--navy); color: #fff; }
.mini-cal td.today { background: var(--gold); color: var(--navy); font-weight: 700; }
.mini-cal td.today .cal-day:hover { background: var(--navy-dark); color: #fff; }
.mini-cal td.today.active::after { background: var(--navy); }
.mini-cal td .cal-day { position: relative; }
.cal-note-dot { position: absolute; top: 3px; right: 4px; width: 5px; height: 5px;
                border-radius: 50%; background: var(--gold); }
.mini-cal td.holiday { background: rgba(200, 164, 74, .16); }
.mini-cal td.holiday .cal-day { font-weight: 700; }
.day-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .25rem; }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
               margin-top: 1rem; }
@media (max-width: 700px) { .export-grid { grid-template-columns: 1fr; } }
.setup-panel { background: var(--card); border: 1px solid var(--gold);
               border-radius: 10px; padding: .9rem 1.1rem; margin: 1rem 0;
               box-shadow: var(--shadow); }
.setup-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
              margin-bottom: .5rem; }
.setup-steps { list-style: none; padding: 0; margin: 0;
               display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .9rem; }
@media (max-width: 640px) { .setup-steps { grid-template-columns: 1fr; } }
.setup-steps li { display: flex; align-items: center; gap: .55rem;
                  font-size: .95rem; }
.setup-check { display: inline-flex; align-items: center; justify-content: center;
               width: 1.4rem; height: 1.4rem; border-radius: 50%; flex: none;
               background: var(--bg); color: var(--muted); font-size: .8rem;
               font-weight: 700; }
.setup-steps li.done { color: var(--muted); }
.setup-steps li.done .setup-check { background: var(--good, #2e7d4f); color: #fff; }
.setup-steps li a { font-weight: 600; }
.table-wrap { overflow-x: auto; }
.stu-list td { font-variant-numeric: tabular-nums; }
.stu-list .bad { color: var(--danger); font-weight: 700; }
.trial-lock-bar { background: #fbeae8; color: #7a241c; border-bottom: 2px solid #c0392b;
                  padding: .6rem 1rem; text-align: center; font-size: .92rem; }
.trial-lock-bar a { color: #7a241c; text-decoration: underline; }
.trial-lock-cta { display: inline-block; margin-left: .5rem; background: #c0392b;
                  color: #fff !important; text-decoration: none !important;
                  padding: .2rem .7rem; border-radius: 6px; font-weight: 700;
                  white-space: nowrap; }

/* --- Attendance calendar --- */
.cal-controls { display: flex; align-items: center; gap: .4rem; margin: .5rem 0;
                flex-wrap: wrap; }
.cal-controls .btn-ghost.active { background: var(--navy); color: #fff; }
.cal-month-title { min-width: 11rem; text-align: center; }
.att-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1rem;
              align-items: start; }
@media (max-width: 900px) { .att-layout { grid-template-columns: 1fr; } }
.att-grid-wrap { overflow-x: auto; }
.att-cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed;
                min-width: 560px; }
.att-cal-grid th { background: var(--navy); color: #fff; font-size: .72rem;
                   padding: .3rem; font-weight: 700; }
.att-day { border: 1px solid var(--line); vertical-align: top; height: 96px;
           padding: 2px 3px; cursor: pointer; }
.att-day.outside { background: var(--bg); color: var(--muted); }
.att-day.today { outline: 2px solid var(--gold); outline-offset: -2px; }
.att-day.wknd { background: rgba(20, 35, 65, .03); }
.att-day.drop { background: rgba(200, 164, 74, .18); }
.att-day-num { font-size: .75rem; font-weight: 700; color: var(--navy); }
.att-day-entries { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.att-entry { display: flex; align-items: center; gap: 2px;
             background: var(--surface-2, #eef1f6); border-radius: 4px;
             padding: 1px 3px; font-size: .7rem; }
.att-entry.done { background: var(--good-soft, #e7f4ec); }
.att-entry .att-subj { flex: 1; overflow: hidden; text-overflow: ellipsis;
                       white-space: nowrap; }
.att-entry .att-hours { width: 2.6rem; font-size: .7rem; text-align: right;
                        border: 1px solid var(--line); border-radius: 3px; }
.att-entry .att-x { border: none; background: none; color: #b3372f;
                    cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 2px; }
.att-side { background: var(--card); border: 1px solid var(--line);
            border-radius: 8px; padding: .75rem; }
.att-side h3 { margin: .75rem 0 .3rem; color: var(--navy); font-size: 1rem; }
.lib-group { margin-bottom: .4rem; }
.lib-grade { font-weight: 700; color: var(--navy); font-size: .8rem; margin: .3rem 0; }
.lib-subj { display: flex; align-items: center; gap: .3rem; padding: .3rem .4rem;
            border: 1px solid var(--line); border-radius: 6px; margin-bottom: 3px;
            cursor: grab; background: var(--card); }
.lib-subj.sel { border-color: var(--gold); background: rgba(200, 164, 74, .16); }
.lib-subj .lib-name { flex: 1; font-size: .85rem; }
.lib-subj .lib-hours { width: 3rem; font-size: .8rem; text-align: right;
                       border: 1px solid var(--line); border-radius: 4px; }
.att-totals { list-style: none; padding: 0; margin: .3rem 0; }
.att-totals li { display: flex; justify-content: space-between; font-size: .85rem;
                 padding: .15rem 0; border-bottom: 1px solid var(--line); }
.att-grand { margin-top: .4rem; font-weight: 700; }
.att-day.no-school { box-shadow: inset 0 0 0 2px #c0392b; }
.att-mini { font-size: .62rem; line-height: 1.3; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; border-radius: 3px;
            padding: 0 3px; margin-bottom: 1px; }
.att-mini-holiday { background: #fbeae8; color: #9b2d22; font-weight: 600; }
.att-mini-note { background: rgba(200, 164, 74, .18); color: #5b4708; }
.att-sched { display: block; width: 100%; text-align: left; font-size: .68rem;
             color: #4a5568; border: 1px dashed var(--line); border-radius: 4px;
             padding: 1px 3px; margin-top: 2px; cursor: pointer;
             background: transparent; }
.att-sched:hover { background: var(--surface-2, #eef1f6); color: var(--navy); }
.att-status { font-size: .85rem; color: var(--ink-soft, #3a4656);
              margin: .3rem 0; min-height: 1.2rem; }
.att-status.on { background: rgba(200, 164, 74, .16); color: var(--navy);
                 font-weight: 600; padding: .35rem .6rem; border-radius: 6px; }
.att-cal.armed .att-day { cursor: copy; }
.cal-att-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%;
               background: var(--navy); vertical-align: middle; }
.cal-full-link { display: block; text-align: center; margin-top: .5rem;
                 font-size: .8rem; }

/* --- Full-page calendar --- */
.fc-grid { width: 100%; border-collapse: collapse; table-layout: fixed;
           min-width: 640px; }
.fc-grid th { background: var(--navy); color: #fff; font-size: .72rem;
              padding: .3rem; font-weight: 700; }
.fc-cell { border: 1px solid var(--line); vertical-align: top; height: 112px;
           padding: 0; }
.fc-cell.outside { background: var(--bg); }
.fc-cell.today { outline: 2px solid var(--gold); outline-offset: -2px; }
/* No-school days (weekends + holidays) get a red outline — a shape cue that
   works independently of color perception. */
.fc-cell.no-school { box-shadow: inset 0 0 0 2px #c0392b; }
.full-cal-day { display: block; height: 100%; text-decoration: none;
                color: inherit; padding: 3px 4px; overflow: hidden; }
.full-cal-day:hover { background: rgba(20, 35, 65, .04); }
.fc-head { display: flex; justify-content: space-between; align-items: center; }
.fc-num { font-size: .78rem; font-weight: 700; color: var(--navy); }
.fc-item { font-size: .68rem; line-height: 1.35; white-space: nowrap;
           overflow: hidden; text-overflow: ellipsis; border-radius: 3px;
           padding: 0 3px; margin-top: 2px; }
.fc-holiday { background: #fbeae8; color: #9b2d22; font-weight: 600; }
.fc-note { background: rgba(200, 164, 74, .18); color: #5b4708; }
.fc-class { background: var(--surface-2, #eef1f6); color: var(--navy); }
.fc-key { display: inline-block; width: 11px; height: 11px; border-radius: 3px;
          vertical-align: middle; }
.fc-noschool-key { background: transparent; box-shadow: inset 0 0 0 2px #c0392b; }
.cal-legend { font-size: .72rem; color: var(--muted); margin-top: .6rem; }
.cal-legend .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%;
                   background: var(--gold); vertical-align: middle; margin-right: .2rem; }

.todo-add { display: flex; gap: .4rem; margin-bottom: .7rem; }
.todo-add input { flex: 1; padding: .45rem .6rem; border: 1px solid #d4d9e0;
                  border-radius: 8px; font-size: .9rem; }
.todo-add .btn-cta { padding: .35rem .8rem; border: none; cursor: pointer; }
.todo-list { list-style: none; padding: 0; margin: 0; }
.todo-list li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0;
                border-top: 1px solid #eef1f5; }
.todo-list li:first-child { border-top: none; }
.todo-check button, .todo-del button { background: none; border: none; cursor: pointer;
    font-size: 1.1rem; line-height: 1; padding: 0; }
.todo-check button { color: var(--gold); }
.todo-check button:hover { color: var(--ok); }
.todo-text { flex: 1; font-size: .9rem; color: var(--navy); }
.todo-del button { color: #c3ccd6; }
.todo-del button:hover { color: var(--danger); }
.todo-clear { color: var(--ok); font-size: .9rem; margin: .3rem 0; }
.todo-check form, .todo-del form { margin: 0; display: inline; }

/* Student profile */
.profile-links{font-size:.9rem; margin-top:-.3rem;}
.alert-list{list-style:none; padding:0; margin:0;}
.alert-row{display:flex; align-items:flex-start; justify-content:space-between;
           gap:.75rem; padding:.55rem 0; border-top:1px solid #eef1f5;}
.alert-list .alert-row:first-child{border-top:none;}
.alert-row.sev-critical{border-left:3px solid var(--danger); padding-left:.6rem;}
.alert-action{font-size:.88rem; color:var(--ink-soft,var(--text)); margin-top:.15rem;}
.lock{font-size:.7rem; font-weight:600; color:var(--warn); background:#fff7e0;
      border-radius:99px; padding:.1rem .5rem; vertical-align:middle;}
.stack-form{margin-top:.7rem;}
.stack-form .grid2{display:grid; grid-template-columns:1fr 1fr; gap:.6rem .9rem;}
.stack-form label{display:block; font-size:.82rem; color:var(--muted);}
.stack-form label.span2{grid-column:1 / -1;}
.stack-form label.inline{display:flex; align-items:center; gap:.4rem; margin:.5rem 0;
                         color:var(--text); font-size:.9rem;}
.stack-form input, .stack-form select, .stack-form textarea{width:100%; margin-top:.2rem;
  padding:.4rem .5rem; border:1px solid #d4d9e0; border-radius:6px; font-size:.92rem;}
.stack-form .btn-cta{border:none; cursor:pointer; margin-top:.8rem;}
.stack-form .hint{display:block; font-size:.76rem; color:var(--muted); margin-top:.15rem;}
.add-health summary{cursor:pointer; color:var(--navy); font-weight:600; font-size:.9rem;}
hr.soft{border:none; border-top:1px solid #eef1f5; margin:1rem 0;}
h3.mrec{font-family:Georgia,serif; color:var(--navy); font-size:1.05rem; margin:.4rem 0 .5rem;}

@media (max-width:560px){ .stack-form .grid2{grid-template-columns:1fr;} }

/* Gradebook */
.gb-in { padding: .3rem .5rem; border: 1px solid #d4d9e0; border-radius: 6px; }
.gb-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
           margin-bottom: 1rem; }
.gb-head .spacer { flex: 1; }
.sem-tabs { display: inline-flex; gap: .25rem; }
.sem-tabs a { padding: .35rem .9rem; border-radius: 6px; text-decoration: none;
              color: var(--navy); background: #eef1f5; font-size: .9rem; }
.sem-tabs a.active { background: var(--navy); color: #fff; }
.gb-grid th, .gb-grid td { white-space: nowrap; }
.gb-grid .gb-item { min-width: 90px; vertical-align: bottom; }
.gb-item-sub { display: block; font-weight: 400; font-size: .68rem;
               color: var(--gold-light); text-transform: none; letter-spacing: 0; }
.gb-sticky { position: sticky; left: 0; z-index: 2; background: var(--card); }
.gb-grid thead .gb-sticky { background: var(--navy); }
.gb-cell { padding: .2rem .3rem; }
.gb-score { width: 4.5rem; text-align: right; padding: .3rem .4rem;
            border: 1px solid #d4d9e0; border-radius: 6px; }
.gb-score.gb-result { text-align: left; }
.gb-score.gb-ok { border-color: var(--ok); background: #eefaf1; }
.gb-score.gb-err { border-color: var(--danger); background: #fdeceb; }
.gb-grade { background: #f8f9fb; }
.gb-additem { max-width: 640px; margin-top: 1rem; }

/* Daily log */
.day-nav { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem;
           flex-wrap: wrap; }
.day-nav input[type=date] { padding: .35rem .5rem; border: 1px solid #d4d9e0;
           border-radius: 6px; }
.daily-toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.daily-toolbar .spacer { flex: 1; }
.daily-total { color: var(--muted); font-size: .9rem; }
.daily-total strong { color: var(--navy); }
.daily-table .done-box { width: 18px; height: 18px; }

/* Compliance: switch-state disclosure */
.switch-state summary { cursor: pointer; color: var(--navy); font-weight: 600;
                        font-size: .9rem; }
.switch-state[open] summary { margin-bottom: .3rem; }
.switch-state label { font-size: .85rem; color: var(--muted); }

/* Portal-access (invites) */
.access-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.access-row { display: flex; align-items: center; justify-content: space-between;
              gap: .75rem; padding: .5rem 0; border-top: 1px solid #eef1f5; }
.access-list .access-row:first-child { border-top: none; }
.invite-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem;
               align-items: center; }
.invite-form input, .invite-form select { padding: .5rem .6rem;
               border: 1px solid #d4d9e0; border-radius: 8px; font-size: .92rem; }
.invite-form input[type=email], .invite-form input[type=text] { flex: 1; min-width: 180px; }
.invite-form .btn-cta { border: none; cursor: pointer; }
.btn-link.danger { border-color: var(--danger); color: var(--danger); }
.btn-link.danger:hover { background: var(--danger); color: #fff; }
.invite-link-box { border-left: 4px solid var(--gold); background: #fff8e6; }
.invite-link { width: 100%; padding: .55rem .7rem; border: 1px solid var(--gold);
               border-radius: 8px; font-family: monospace; font-size: .85rem;
               background: #fff; }

/* Widget content helpers */
.widget .table-wrap { overflow-x: auto; }
.widget .data { width: 100%; margin: 0; }
.w-sub { font-size: .9rem; color: var(--navy); margin: .6rem 0 .3rem; }
.w-sub.bad { color: var(--danger); }
.muted-note { color: var(--muted); font-size: .82rem; margin: -.2rem 0 .5rem; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { padding: .3rem 0; border-top: 1px solid #eef1f5; font-size: .9rem; }
.mini-list li:first-child { border-top: none; }
.mini-list li.kv { display: flex; justify-content: space-between; align-items: baseline; }
.mini-list li.kv b { color: var(--navy); }

/* Notifications */
.notif-widget .widget-hd { display: flex; align-items: center; gap: .4rem; }
.notif-badge { background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700;
               border-radius: 99px; padding: .05rem .45rem; }
.notif-allread { margin: 0 0 0 auto; }
.btn-link-sm { background: none; border: none; color: var(--navy); cursor: pointer;
               font-size: .78rem; text-decoration: underline; padding: 0; }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { padding: .55rem 0; border-top: 1px solid #eef1f5; }
.notif-list li:first-child { border-top: none; }
.notif-list li.unread { position: relative; padding-left: .7rem; }
.notif-list li.unread::before { content: ""; position: absolute; left: 0; top: .8rem;
    width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.notif-top { display: flex; gap: .4rem; align-items: center; margin-bottom: .2rem; }
.notif-kind { font-size: .66rem; font-weight: 700; text-transform: uppercase;
              letter-spacing: .04em; padding: .1rem .4rem; border-radius: 99px;
              background: var(--navy); color: #fff; }
.notif-kind.kind-assignment { background: var(--warn); }
.notif-kind.kind-message { background: var(--ok); }
.notif-aud { font-size: .72rem; color: var(--muted); }
.notif-title { font-weight: 600; color: var(--navy); font-size: .9rem; }
.notif-body { font-size: .85rem; color: var(--text); margin-top: .15rem; white-space: pre-wrap; }
.notif-foot { display: flex; justify-content: space-between; align-items: center;
              margin-top: .25rem; font-size: .72rem; color: var(--muted); }
.portal-notif { max-width: 520px; margin: 0 0 1.25rem; }
.notif-settings { margin: .6rem 0 0; font-size: .78rem; }
.notif-settings a { color: var(--muted); }
.compose-form .pick[hidden] { display: none; }
.compose-form select, .compose-form input { padding: .5rem; border: 1px solid #d4d9e0;
    border-radius: 8px; width: 100%; }

/* Dashboard customization */
.dash-toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.dash-toolbar .spacer { flex: 1; }
.edit-hint { color: var(--muted); font-size: .9rem; }
.tile { position: relative; }
.tile.editing { outline: 2px dashed var(--gold); outline-offset: 4px;
                border-radius: var(--radius); margin-bottom: 1rem; }
.tile-bar { display: flex; align-items: center; justify-content: space-between;
            gap: .5rem; background: var(--navy); color: #fff;
            padding: .3rem .6rem; border-radius: 6px 6px 0 0; margin-bottom: .4rem;
            cursor: grab; }
.tile-bar:active { cursor: grabbing; }
.drag-grip { opacity: .55; margin-right: .15rem; }
.tile.dragging { opacity: .45; }
.tile.dragging .tile-bar { cursor: grabbing; }
.tile-name { font-size: .82rem; font-weight: 700; }
.tile-tools { display: flex; align-items: center; gap: .25rem; }
.tile-tools form { margin: 0; display: inline; }
.tile-tools button { background: rgba(255,255,255,.15); color: #fff; border: none;
                     border-radius: 5px; width: 24px; height: 24px; cursor: pointer;
                     font-size: .85rem; line-height: 1; }
.tile-tools button:hover { background: rgba(255,255,255,.3); }
.tile-tools .tile-remove:hover { background: var(--danger); }
.tile-pin { font-size: .85rem; opacity: .9; padding: 0 .2rem; }

.add-panel { margin-top: 2rem; border-top: 2px solid var(--gold); padding-top: 1rem; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 1rem; }
.add-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
            padding: 1rem; display: flex; flex-direction: column; justify-content: space-between;
            gap: .6rem; }
.add-card p { color: var(--muted); font-size: .85rem; margin: .25rem 0 0; }
.add-card .btn-cta { border: none; cursor: pointer; align-self: flex-start; }

@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-side { flex-direction: row; flex-wrap: wrap; }
  .dash-side .widget { flex: 1; min-width: 260px; }
}

/* ===== Tablet & mobile ===== */
@media (max-width: 760px) {
  /* Topbar collapses behind a hamburger */
  .topbar { flex-wrap: wrap; gap: .4rem .6rem; padding: .55rem .9rem; }
  .brand { margin-right: auto; }
  .nav-toggle { display: flex; flex-direction: column; justify-content: center;
    gap: 4px; background: none; border: 1px solid rgba(255,255,255,.35);
    border-radius: 7px; padding: 8px 9px; cursor: pointer; }
  .nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--header-ink);
    border-radius: 2px; }
  .topbar-collapse { display: none; flex-basis: 100%; flex-direction: column;
    align-items: stretch; gap: .15rem; padding-top: .3rem; }
  .topbar-collapse.open { display: flex; }
  .topbar-collapse .spacer { display: none; }
  .topbar-collapse nav { flex-direction: column; align-items: stretch;
    width: 100%; gap: .1rem; }
  .topbar-collapse nav a { padding: .6rem .7rem; border-radius: 6px; }
  .topbar-collapse .whoami { padding: .35rem .7rem; font-size: .8rem; }
  .topbar-collapse form { width: 100%; margin: .2rem 0 0; }
  .topbar-collapse .btn-link { width: 100%; padding: .6rem; }
  /* Utilities becomes an inline accordion instead of an overlay */
  .menu { width: 100%; }
  .menu summary { padding: .6rem .7rem; }
  .menu .menu-items { position: static; box-shadow: none; min-width: 0;
    max-width: none; background: rgba(255,255,255,.08); margin: .1rem 0 .2rem; }
  .menu .menu-items a { color: #dfe5ef; }
  .menu .menu-items a:hover { background: var(--navy-dark); color: #fff; }

  main.container { padding: 1rem .9rem 2.5rem; }
  h1 { font-size: 1.35rem; }

  /* Wide data tables scroll inside their own box instead of overflowing */
  table.data { display: block; overflow-x: auto; white-space: nowrap;
               -webkit-overflow-scrolling: touch; }

  /* Bars that were horizontal should wrap */
  .dash-head, .dash-toolbar, .dash-summary { flex-wrap: wrap; }
  .dash-clock { text-align: left; }
  .dash-side { flex-direction: column; }   /* single column on phones */
  .dash-side .widget { min-width: 0; }
  .portal-notif { max-width: none; }
}

/* Very small phones: single-column stat/card grids */
@media (max-width: 430px) {
  .dash-summary { grid-template-columns: 1fr 1fr; }
  .stu-grid, .cards, .add-grid { grid-template-columns: 1fr; }
  .dash-time { font-size: 1.5rem; }
}

/* Self-serve billing extras (school billing page) */
.addon-row { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: .7rem 0; border-top: 1px solid #eef1f5; }
.addon-row:first-of-type { border-top: none; }
.addon-row form { margin: 0; }
@media (max-width: 520px) {
  .addon-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
}

/* Classes list: every grade is its own table, so give them identical column
   widths — otherwise each one self-sizes and "Enrolled" lands somewhere
   different in each group. The table also sits flush inside its group card
   rather than nesting a second rounded, shadowed panel inside it. */
.grade-group > table.data.class-table { border-radius: 0; box-shadow: none;
  table-layout: fixed; }
.class-table .c-count { width: 8rem; }
.class-table .c-actions { width: 15rem; }
.class-table td:last-child { text-align: right; white-space: nowrap; }
.class-table th:last-child { text-align: right; }
@media (max-width: 640px) {
  .class-table { table-layout: auto; }
  .class-table .c-count, .class-table .c-actions { width: auto; }
  .class-table td:last-child { white-space: normal; }
}

/* Attendance roster: per-student hours beside the present/absent control. */
.att-roster .att-hours { white-space: nowrap; text-align: right; padding-left: .6rem; }
.att-roster .att-hours input { width: 5rem; text-align: right; }
.att-roster .att-hours .muted { font-size: .82rem; margin-left: .25rem; }
@media (max-width: 560px) {
  .att-roster .att-hours { text-align: left; padding-left: 0; }
}
/* Visually hidden, still read by screen readers (per-row input labels). */
.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; }
