/* School Desk — interface theme */
:root {
  --sd-ink: #1c2434;
  --sd-muted: #6b7789;
  --sd-line: #e4e8f0;
  --sd-bg: #f5f7fb;
  --sd-surface: #ffffff;
  --sd-side: #0f1b33;
  --sd-side-2: #16264a;
  --sd-primary: #3454d1;
  --sd-primary-d: #2742b0;
  --sd-primary-soft: #eaeefc;
  --sd-gold: #d9a520;
  --sd-sidebar-w: 268px;
  --sd-radius: .75rem;
  --sd-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --bs-primary: #3454d1;
  --bs-primary-rgb: 52, 84, 209;
  --bs-link-color: #3454d1;
  --bs-link-color-rgb: 52, 84, 209;
  --bs-link-hover-color-rgb: 39, 66, 176;
  --bs-link-hover-color: #2742b0;
  --bs-body-color: #1c2434;
  --bs-border-color: #e4e8f0;
  --bs-body-font-size: .92rem;
}
body { background: var(--sd-bg); color: var(--sd-ink); font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons */
.btn { --bs-btn-border-radius: .55rem; --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .95rem; --bs-btn-font-weight: 500; --bs-btn-font-size: .9rem; }
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .82rem; }
.btn-primary { --bs-btn-bg: var(--sd-primary); --bs-btn-border-color: var(--sd-primary); --bs-btn-hover-bg: var(--sd-primary-d); --bs-btn-hover-border-color: var(--sd-primary-d); --bs-btn-active-bg: var(--sd-primary-d); --bs-btn-active-border-color: var(--sd-primary-d); --bs-btn-disabled-bg: var(--sd-primary); --bs-btn-disabled-border-color: var(--sd-primary); box-shadow: 0 1px 2px rgba(52, 84, 209, .25); }
.btn-outline-primary { --bs-btn-color: var(--sd-primary); --bs-btn-border-color: #c5cff5; --bs-btn-hover-bg: var(--sd-primary); --bs-btn-hover-border-color: var(--sd-primary); }
.btn-outline-secondary { --bs-btn-color: #44506a; --bs-btn-border-color: #d3d9e6; --bs-btn-hover-bg: #eef1f7; --bs-btn-hover-color: var(--sd-ink); --bs-btn-hover-border-color: #c4ccdc; --bs-btn-active-bg: #e4e9f3; --bs-btn-active-color: var(--sd-ink); }
.btn-light { --bs-btn-bg: #eef1f7; --bs-btn-border-color: #eef1f7; --bs-btn-hover-bg: #e2e7f1; --bs-btn-hover-border-color: #e2e7f1; --bs-btn-color: #33405a; }
.btn-gold { --bs-btn-bg: var(--sd-gold); --bs-btn-border-color: var(--sd-gold); --bs-btn-color: #1b1b1b; --bs-btn-hover-bg: #b88b17; --bs-btn-hover-border-color: #b88b17; --bs-btn-hover-color: #fff; }

/* Shell */
.sd-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sd-sidebar-w); background: linear-gradient(180deg, var(--sd-side) 0%, #0b1428 100%); color: #b7c3dc; overflow-y: auto; z-index: 1040; transition: transform .22s ease; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #2a3b63 transparent; }
.sd-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.15rem; color: #fff; }
.sd-brand:hover { text-decoration: none; }
.sd-brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; padding: 2px; flex: none; }
.sd-brand span { min-width: 0; }
.sd-brand strong { display: block; line-height: 1.15; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-brand small { color: var(--sd-gold); font-size: .72rem; letter-spacing: .03em; }
.sd-nav-search { position: relative; margin: 0 .9rem .6rem; }
.sd-nav-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #6f82a6; font-size: .85rem; }
.sd-nav-search input { width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: .6rem; color: #e6ecf8; padding: .45rem .75rem .45rem 2.05rem; font-size: .85rem; outline: none; }
.sd-nav-search input::placeholder { color: #6f82a6; }
.sd-nav-search input:focus { border-color: rgba(143, 165, 235, .6); background: rgba(255, 255, 255, .09); }
.sd-nav { padding: 0 .6rem 1.5rem; flex: 1; }
.sd-group { margin-bottom: .15rem; }
.sd-group-head { width: 100%; display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; background: none; border: 0; border-radius: .55rem; color: #8ea0c4; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; cursor: pointer; }
.sd-group-head > span { flex: 1; }
.sd-group-head i:first-child { font-size: 1rem; color: #7d92bd; width: 1.1rem; text-align: center; }
.sd-group-head:hover { background: rgba(255, 255, 255, .05); color: #dbe4f7; }
.sd-group-head .chev { font-size: .7rem; transition: transform .2s ease; }
.sd-group.open .sd-group-head .chev { transform: rotate(180deg); }
.sd-group[data-active="1"] .sd-group-head { color: #fff; }
.sd-group-items { display: none; padding: .1rem 0 .45rem; }
.sd-group.open .sd-group-items { display: block; }
.sd-group-items a { display: flex; align-items: center; gap: .7rem; padding: .48rem .75rem .48rem 1.05rem; margin: .08rem 0; color: #c3cee4; border-radius: .55rem; font-size: .88rem; position: relative; }
.sd-group-items a i { font-size: .98rem; color: #7d92bd; width: 1.1rem; text-align: center; }
.sd-group-items a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.sd-group-items a.active { background: rgba(86, 116, 235, .22); color: #fff; font-weight: 500; }
.sd-group-items a.active i { color: #a9bbff; }
.sd-group-items a.active::before { content: ""; position: absolute; left: -.6rem; top: 20%; bottom: 20%; width: 3px; border-radius: 0 3px 3px 0; background: var(--sd-gold); }
.sd-nav.filtering .sd-group-items { display: block; }
.sd-nav.filtering .sd-group-head .chev { display: none; }
.sd-nav-empty { padding: 1rem; color: #6f82a6; font-size: .85rem; text-align: center; }

.sd-main { margin-left: var(--sd-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .22s ease; }
.sd-topbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--sd-line); padding: .55rem 1.5rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1030; min-height: 58px; }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: .6rem; color: #44506a; font-size: 1.15rem; cursor: pointer; }
.btn-icon:hover { background: #eef1f7; }
.sd-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--sd-primary-soft); color: var(--sd-primary-d); padding: .3rem .7rem; border-radius: 2rem; font-size: .82rem; font-weight: 500; }
.sd-dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #e5484d; color: #fff; font-size: .65rem; font-weight: 600; display: grid; place-items: center; border: 2px solid #fff; box-sizing: content-box; }
.sd-user { display: flex; align-items: center; gap: .55rem; background: none; border: 1px solid transparent; border-radius: .7rem; padding: .25rem .55rem .25rem .3rem; color: var(--sd-ink); font-size: .85rem; }
.sd-user:hover { background: #eef1f7; }
.sd-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--sd-primary), #6b86f0); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .8rem; }
.sd-menu { border: 1px solid var(--sd-line); border-radius: .75rem; box-shadow: 0 10px 30px rgba(16, 24, 40, .12); padding: .35rem; margin-top: .4rem !important; }
.sd-menu .dropdown-item { border-radius: .5rem; }
.sd-content { padding: 1.6rem 1.5rem 2rem; flex: 1; max-width: 1480px; width: 100%; }
.sd-footer { padding: .9rem 1.5rem; font-size: .8rem; color: var(--sd-muted); border-top: 1px solid var(--sd-line); background: #fff; }
.sd-collapsed .sd-sidebar { transform: translateX(-100%); }
.sd-collapsed .sd-main { margin-left: 0; }

.sd-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--sd-ink); margin: 0; }
.page-sub { color: var(--sd-muted); margin: .2rem 0 0; font-size: .9rem; }
.breadcrumb { font-size: .8rem; --bs-breadcrumb-divider-color: #9aa5b8; }
.breadcrumb a { color: var(--sd-muted); }

@media (max-width: 991.98px) {
  .sd-sidebar { transform: translateX(-100%); }
  .sd-main { margin-left: 0; }
  .sd-open .sd-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); z-index: 1045; }
  .sd-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 27, 51, .45); z-index: 1035; }
  .sd-topbar, .sd-content, .sd-footer { padding-left: 1rem; padding-right: 1rem; }
}

/* Cards */
.sd-card { background: var(--sd-surface); border: 1px solid var(--sd-line); border-radius: var(--sd-radius); box-shadow: var(--sd-shadow); }
.sd-card > .sd-card-head { padding: .9rem 1.2rem; border-bottom: 1px solid var(--sd-line); font-weight: 600; font-size: .95rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.sd-card > .sd-card-body { padding: 1.2rem; }
.sd-card .table-responsive { margin: -.2rem 0; }

/* Stat tiles */
.sd-stat { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; }
.sd-stat .icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: var(--sd-primary-soft); color: var(--sd-primary); flex: none; }
.sd-stat .value { font-size: 1.65rem; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.sd-stat .label { font-size: .8rem; color: var(--sd-muted); margin-top: .2rem; }
.sd-stat.ok .icon { background: #e4f6ec; color: #16905d; }
.sd-stat.warn .icon { background: #fff3d6; color: #b57a00; }
.sd-stat.bad .icon { background: #fde6e7; color: #d6393f; }

/* Tables */
.table { --bs-table-hover-bg: #f6f8fd; margin-bottom: 0; }
.table > :not(caption) > * > * { vertical-align: middle; padding: .7rem .85rem; border-bottom-color: #edf0f6; }
.table > thead > tr > th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--sd-muted); background: #f8f9fc; border-bottom: 1px solid var(--sd-line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: #f6f8fd; }
.table-sm > :not(caption) > * > * { padding: .5rem .7rem; }
.badge { font-weight: 500; padding: .38em .65em; border-radius: .45rem; }
.pagination { --bs-pagination-border-radius: .5rem; --bs-pagination-active-bg: var(--sd-primary); --bs-pagination-active-border-color: var(--sd-primary); gap: .15rem; }
.page-link { border-radius: .5rem !important; }

/* Forms */
.sd-form { max-width: 1000px; }
.form-label { font-size: .82rem; font-weight: 600; color: #3a4660; margin-bottom: .35rem; }
.form-control, .form-select { border-color: #d3d9e6; border-radius: .6rem; padding: .55rem .8rem; background-color: #fff; font-size: .92rem; min-height: 2.45rem; }
.form-control-sm, .form-select-sm { min-height: 2rem; padding: .3rem .6rem; border-radius: .5rem; font-size: .85rem; }
textarea.form-control { min-height: 5rem; }
.form-control::placeholder { color: #a3adbf; }
.form-control:hover, .form-select:hover { border-color: #b9c3d8; }
.form-control:focus, .form-select:focus { border-color: var(--sd-primary); box-shadow: 0 0 0 .22rem rgba(52, 84, 209, .15); }
.form-control:disabled, .form-select:disabled { background: #f3f5f9; color: #7b879b; }
.form-control.is-invalid, .form-select.is-invalid { border-color: #e5484d; background-image: none; padding-right: .8rem; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 .22rem rgba(229, 72, 77, .15); }
.invalid-feedback { font-size: .78rem; }
.form-text { font-size: .76rem; color: var(--sd-muted); }
.form-check-input { border-color: #b9c3d8; }
.form-check-input:checked { background-color: var(--sd-primary); border-color: var(--sd-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(52, 84, 209, .15); border-color: var(--sd-primary); }
input[type=file].form-control { padding: .4rem .6rem; }
.sd-form .sd-card + .sd-card, .sd-form .sd-card { margin-bottom: 1rem; }
.sd-form .sd-card-head { background: #fafbfe; border-radius: var(--sd-radius) var(--sd-radius) 0 0; }
.sd-form .row { --bs-gutter-x: 1.25rem; }
.sd-form-actions { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .85rem 1.2rem; margin-top: 1rem; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border: 1px solid var(--sd-line); border-radius: var(--sd-radius); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
.sd-form-actions .btn-primary { min-width: 120px; }
.alert { border-radius: .7rem; border: 1px solid transparent; font-size: .9rem; }
.alert-danger { background: #fdecec; border-color: #f8cdcf; color: #8c2227; }
.alert-warning { background: #fff6e0; border-color: #f6dfa4; color: #7a5600; }
.alert-success { background: #e6f6ee; border-color: #bfe6d1; color: #17653f; }
.alert-info { background: #e9f1fe; border-color: #c4d7f8; color: #214a8c; }
.modal-content { border: 0; border-radius: 1rem; box-shadow: 0 20px 50px rgba(16, 24, 40, .2); }
.modal-header, .modal-footer { border-color: var(--sd-line); }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--sd-primary); border-bottom-color: var(--sd-line); }
.nav-tabs .nav-link { color: var(--sd-muted); font-weight: 500; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--sd-primary); }
.progress { background: #e9edf5; border-radius: 1rem; }
.progress-bar { background: linear-gradient(90deg, var(--sd-primary), #6b86f0); }
dt { font-weight: 500; color: var(--sd-muted); }
.text-muted { color: var(--sd-muted) !important; }

/* Toasts */
.sd-toast { background: #fff; border-radius: .8rem; box-shadow: 0 10px 30px rgba(16, 24, 40, .15); border-left: 4px solid var(--sd-primary) !important; min-width: 300px; }
.sd-toast .bi:first-child { font-size: 1.15rem; margin-top: .05rem; }
.sd-toast-success { border-left-color: #16905d !important; } .sd-toast-success .bi:first-child { color: #16905d; }
.sd-toast-warning { border-left-color: #e0a100 !important; } .sd-toast-warning .bi:first-child { color: #c88f00; }
.sd-toast-danger { border-left-color: #e5484d !important; } .sd-toast-danger .bi:first-child { color: #e5484d; }

/* Auth */
.sd-auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 16px; background: radial-gradient(1200px 600px at 10% -10%, #2a46a8 0%, transparent 60%), linear-gradient(135deg, #0f1b33 0%, #16264a 100%); }
.sd-auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 1rem; padding: 2.2rem 2rem; box-shadow: 0 25px 60px rgba(0, 0, 0, .35); border-top: 4px solid var(--sd-gold); }
.sd-auth-card img.logo { width: 64px; height: 64px; border-radius: 14px; }

@media print {
  .sd-sidebar, .sd-topbar, .sd-footer, .no-print, .toast-container, .sd-form-actions { display: none !important; }
  .sd-main { margin: 0; }
  body { background: #fff; }
  .sd-card { box-shadow: none; }
}

/* ---- Professional polish ---- */
:focus-visible { outline: 2px solid rgba(52, 84, 209, .55); outline-offset: 2px; }
.table td a:not(.btn) { font-weight: 500; }
.table td, .sd-stat .value, .num { font-variant-numeric: tabular-nums; }
.table td.text-end, .table th.text-end { white-space: nowrap; }

/* Soft status badges */
.badge.text-bg-success { background: #e2f5eb !important; color: #14724a !important; }
.badge.text-bg-danger { background: #fde7e8 !important; color: #b42a30 !important; }
.badge.text-bg-warning { background: #fff2d4 !important; color: #8a5d00 !important; }
.badge.text-bg-primary { background: var(--sd-primary-soft) !important; color: var(--sd-primary-d) !important; }
.badge.text-bg-info { background: #e1f4fb !important; color: #0b6a86 !important; }
.badge.text-bg-secondary, .badge.text-bg-light { background: #eceff5 !important; color: #4a5670 !important; }
.badge.text-bg-dark { background: #dfe4ee !important; color: #232c3f !important; }
.badge { font-size: .74rem; letter-spacing: .01em; }

.sd-card { transition: box-shadow .15s ease, border-color .15s ease; }
a > .sd-card:hover, .sd-card.hoverable:hover { border-color: #c9d2ea; box-shadow: 0 4px 14px rgba(16, 24, 40, .08); }
.sd-card > .sd-card-head { background: #fff; }
.sd-content form.row, .sd-card-body > form.d-flex, .sd-card-body > form.row { align-items: center; }
.dropdown-item.active, .dropdown-item:active { background: var(--sd-primary); }
.list-group-item { border-color: var(--sd-line); }
.sd-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive { border-radius: .5rem; }
::selection { background: rgba(52, 84, 209, .2); }
html { scroll-behavior: smooth; }

/* ---- Tablet ---- */
@media (max-width: 991.98px) {
  .sd-sidebar { width: min(86vw, 300px); }
  .sd-content { padding-top: 1.2rem; }
  .sd-form { max-width: none; }
}

/* ---- Phone ---- */
@media (max-width: 767.98px) {
  body { --bs-body-font-size: .95rem; }
  .sd-topbar { padding: .45rem .75rem; gap: .35rem; min-height: 54px; }
  .sd-chip { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sd-content { padding: 1rem .85rem 1.5rem; }
  .sd-footer { padding: .8rem .85rem; text-align: center; }
  .page-title { font-size: 1.3rem; }
  .sd-page-head { margin-bottom: 1rem; align-items: stretch; }
  .sd-page-head > div:last-child:not(:first-child) { width: 100%; }
  .sd-page-head .btn { flex: 1 1 auto; justify-content: center; }
  .sd-card > .sd-card-head { padding: .75rem .95rem; }
  .sd-card > .sd-card-body { padding: .95rem; }
  .sd-stat { padding: .85rem; gap: .75rem; }
  .sd-stat .icon { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 10px; }
  .sd-stat .value { font-size: 1.35rem; }
  .form-control, .form-select { font-size: 16px; }   /* stops iOS zoom on focus */
  .sd-form .row { --bs-gutter-x: .75rem; }
  .sd-form-actions { position: sticky; bottom: 0; margin: 1rem -.85rem -1.5rem; border-radius: 0; border-left: 0; border-right: 0; padding: .7rem .85rem calc(.7rem + env(safe-area-inset-bottom)); }
  .sd-form-actions .btn { flex: 1; }
  .sd-menu { max-width: 92vw; }
  .modal-dialog { margin: .75rem; }
  .toast-container { left: 0; right: 0; padding: .75rem !important; }
  .sd-toast { min-width: 0; width: 100%; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .nav-tabs, .nav-pills { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }

  /* Lists become cards (tables marked by JS; grids with inputs keep scrolling) */
  table.sd-stack, table.sd-stack tbody, table.sd-stack tr, table.sd-stack td { display: block; width: 100%; }
  table.sd-stack thead { display: none; }
  table.sd-stack tr { border: 1px solid var(--sd-line); border-radius: .8rem; background: #fff; margin: 0 0 .7rem; padding: .3rem 0; box-shadow: var(--sd-shadow); }
  table.sd-stack > :not(caption) > * > * { border: 0; padding: .38rem .9rem; }
  table.sd-stack td { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; text-align: right; }
  table.sd-stack td::before { content: attr(data-label); flex: none; max-width: 40%; text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--sd-muted); padding-top: .15rem; }
  table.sd-stack td[data-label=""]::before { display: none; }
  table.sd-stack td[data-label=""] { justify-content: flex-end; border-top: 1px solid #edf0f6; margin-top: .25rem; padding-top: .55rem; }
  table.sd-stack td:empty { display: none; }
  table.sd-stack td:first-child { display: block; text-align: left; font-weight: 600; font-size: 1rem; padding-bottom: .5rem; margin-bottom: .2rem; border-bottom: 1px solid #edf0f6; }
  table.sd-stack td:first-child::before { display: none; }
  table.sd-stack td:has(> div) { flex-direction: column; align-items: flex-end; gap: .1rem; }
  .table-responsive:has(> table.sd-stack) { overflow: visible; }
  table.sd-stack.table-hover > tbody > tr:hover > * { background: transparent; }
}

/* Prevent wide children (tables, tab bars) from stretching the page */
.sd-main, .sd-content { min-width: 0; }
.row > * { min-width: 0; }
.sd-card { min-width: 0; max-width: 100%; }
.table-responsive { max-width: 100%; }

.sd-stat > div:last-child { min-width: 0; }
.sd-stat .value { overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .sd-stat .value { font-size: 1.15rem; } .sd-stat .label { font-size: .75rem; } }

.badge { white-space: normal; text-align: left; max-width: 100%; }

/* ---- Corporate refinements ---- */
:root { --sd-radius: .6rem; --sd-bg: #f3f5f9; --sd-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.btn { --bs-btn-border-radius: .45rem; }
.sd-card > .sd-card-head { text-transform: none; font-size: .93rem; color: #25324b; }
.table > thead > tr > th { background: #f6f8fc; color: #5a6781; }
.sd-search { position: relative; align-items: center; width: min(420px, 34vw); margin-right: auto; }
.sd-search i { position: absolute; left: .8rem; color: #8a96ab; pointer-events: none; }
.sd-search input { width: 100%; border: 1px solid var(--sd-line); background: #f6f8fc; border-radius: 2rem; padding: .45rem .9rem .45rem 2.3rem; font-size: .88rem; outline: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.sd-search input:focus { background: #fff; border-color: var(--sd-primary); box-shadow: 0 0 0 .2rem rgba(52, 84, 209, .12); }
.sd-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.sd-quick-item { display: flex; align-items: center; gap: .65rem; padding: .7rem .9rem; background: #fff; border: 1px solid var(--sd-line); border-radius: var(--sd-radius); color: var(--sd-ink); font-weight: 500; font-size: .88rem; box-shadow: var(--sd-shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.sd-quick-item i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: .55rem; background: var(--sd-primary-soft); color: var(--sd-primary); font-size: 1.05rem; flex: none; }
.sd-quick-item:hover { text-decoration: none; border-color: #b9c6f3; box-shadow: 0 4px 14px rgba(52, 84, 209, .12); transform: translateY(-1px); }
@media (max-width: 767.98px) { .sd-quick { grid-template-columns: repeat(2, 1fr); } .sd-quick-item { padding: .6rem; font-size: .82rem; } }

/* ---- Parent portal ---- */
.av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3454d1, #6b86f0); color: #fff; display: inline-grid; place-items: center; font-weight: 600; font-size: .85rem; flex: none; }
.av.lg { width: 46px; height: 46px; font-size: 1.1rem; }
.sd-kids { display: flex; gap: .5rem; overflow-x: auto; padding: .15rem .05rem .6rem; margin-bottom: .5rem; scrollbar-width: thin; }
.sd-kid { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .85rem .3rem .35rem; border: 1px solid var(--sd-line); background: #fff; border-radius: 2rem; color: var(--sd-ink); font-weight: 500; font-size: .88rem; white-space: nowrap; }
.sd-kid .av { width: 28px; height: 28px; font-size: .75rem; }
.sd-kid:hover { text-decoration: none; border-color: #b9c6f3; }
.sd-kid.active { background: var(--sd-primary); border-color: var(--sd-primary); color: #fff; }
.sd-kid.active .av { background: rgba(255,255,255,.25); }
.sd-child-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.sd-family-fees { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.3rem; border-radius: var(--sd-radius); margin-bottom: 1rem; color: #fff; }
.sd-family-fees.due { background: linear-gradient(135deg, #b4232a, #d6454c); }
.sd-family-fees.soon { background: linear-gradient(135deg, #b57a00, #d99a14); }
.sd-family-fees.clear { background: linear-gradient(135deg, #14724a, #2a9d6e); }
.sd-kid-card { overflow: hidden; }
.sd-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sd-cal-h { text-align: center; font-size: .72rem; font-weight: 600; color: var(--sd-muted); text-transform: uppercase; letter-spacing: .05em; padding: .2rem 0; }
.sd-cal-d { min-height: 62px; border: 1px solid var(--sd-line); border-radius: .5rem; padding: .3rem .4rem; background: #fff; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.sd-cal-d.out { opacity: .35; background: #f6f8fc; }
.sd-cal-d.off { background: #f3f5f9; color: #9aa5b8; }
.sd-cal-d.today { box-shadow: 0 0 0 2px var(--sd-primary); }
.sd-cal-d .n { font-size: .78rem; font-weight: 600; }
.sd-cal-d .s { align-self: flex-end; font-weight: 700; font-size: .85rem; }
.sd-cal-d.st-ok { background: #e4f6ec; color: #14724a; } .sd-cal-d.st-late { background: #fff3d6; color: #8a5d00; } .sd-cal-d.st-bad { background: #fde6e7; color: #b42a30; }
.sd-cal-d.st-leave { background: #e1f4fb; color: #0b6a86; } .sd-cal-d.st-half { background: #efe8fb; color: #5b3aa8; }
.sd-dot-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.sd-dot-key.st-ok { background: #7fd0a5; } .sd-dot-key.st-late { background: #f0c35a; } .sd-dot-key.st-bad { background: #ee8f94; } .sd-dot-key.st-leave { background: #8bd0e6; } .sd-dot-key.st-half { background: #b9a2ea; }
@media (max-width: 575.98px) { .sd-cal { gap: 3px; } .sd-cal-d { min-height: 50px; padding: .2rem .25rem; } .sd-cal-h { font-size: .62rem; } .sd-family-fees { padding: .9rem 1rem; } }
