@import "css/tokens.css";

/* Safety net — duplicates the prototype palette from tokens.css inline so
   layout colours never break if the @import above fails to resolve (e.g.
   the linked Content path isn't in wwwroot in a particular deployment).
   Keep these in sync with EduConnect.Shared/Styles/tokens.css. */
:root {
    --ec-bg:          #f7f8fc;
    --ec-panel:       #ffffff;
    --ec-border:      #e7eaf3;
    --ec-border-soft: #eef0f6;
    --ec-text:        #1a2540;
    --ec-sub:         #5b6b8c;
    --ec-muted:       #8b95ad;
    --ec-faint:       #b9c1d4;
    --ec-ink:         #0d1733;
    --ec-blue:        #3b5fc0;
    --ec-blue-dk:     #2944a0;
    --ec-blue-lt:     #e9eefb;
    --ec-blue-gh:     #f4f6fc;
    --ec-pink:        #d63677;
    --ec-pink-dk:     #a02055;
    --ec-pink-lt:     #fce7f3;
    --ec-green:       #16a34a;
    --ec-green-lt:    #dcfce7;
    --ec-amber:       #d97706;
    --ec-amber-lt:    #fef3c7;
    --ec-orange:      #ea7025;
    --ec-orange-lt:   #ffedd5;
    --ec-red:         #dc2626;
    --ec-red-lt:      #fee2e2;
    --ec-purple:      #7c3aed;
    --ec-purple-lt:   #ede9fe;
    --ec-teal:        #0891b2;
    --ec-teal-lt:     #cffafe;
}

/* ============================================================
   Sidebar switcher pill — prototype's active-facility / active-child card.
   Defined globally so both FacilityPicker and ChildPicker can use the
   same class names despite Blazor scoped-CSS isolation.
   ============================================================ */

.ec-sb-switcher-pill {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 9px;
    border: 1px solid transparent;
    padding: 9px 11px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: filter 0.15s;
}

.ec-sb-switcher-pill:hover { filter: brightness(0.98); }

.ec-sb-switcher-pill--empty {
    background: rgba(245, 158, 11, 0.07) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

.ec-sb-switcher-dot {
    display: block;            /* span is inline by default; block lets width/height take */
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ec-green);
    flex-shrink: 0;
    animation: ec-sb-switcher-pulse 2s ease-in-out infinite;
}

.ec-sb-switcher-dot--warn {
    background: var(--ec-amber);
    animation-duration: 1.5s;
}

@keyframes ec-sb-switcher-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.ec-sb-switcher-body {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;        /* keeps the column from being shoved wider by long text */
    display: flex;
    flex-direction: column;
}

.ec-sb-switcher-name {
    display: block;          /* span defaults to inline — block lets ellipsis kick in */
    max-width: 100%;
    font-size: 12px;
    font-weight: 700;
    color: var(--ec-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.ec-sb-switcher-name--empty { color: #92400e; }

.ec-sb-switcher-sub {
    display: block;
    max-width: 100%;
    font-size: 10px;
    color: var(--ec-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ec-sb-switcher-tag {
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.ec-sb-switcher-chevron {
    font-size: 11px;
    color: var(--ec-muted);
    flex-shrink: 0;
}

/* Skeleton state — rendered while FacilityContext.InitializeAsync is in flight
   so the sidebar slot doesn't pop in seconds after page mount. */
.ec-sb-switcher-pill--skeleton {
    cursor: default;
    pointer-events: none;
    opacity: 0.7;
}

.ec-sb-switcher-skeleton-bar {
    display: block;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ec-border-soft) 0%, var(--ec-border) 50%, var(--ec-border-soft) 100%);
    background-size: 200% 100%;
    animation: ec-sb-skeleton-shimmer 1.2s ease-in-out infinite;
}

.ec-sb-switcher-skeleton-bar--sub {
    height: 8px;
    width: 70%;
    margin-top: 5px;
}

@keyframes ec-sb-skeleton-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Customer-wide setup / Back to dashboard — solid grey ghost link.
   <a> defaults to inline; box-sizing + display:flex force it to take its own
   row so .ec-picker-wrap's height includes it (otherwise the dropdown overlaps). */
.ec-sb-setup-link {
    box-sizing: border-box;
    width: 100%;
    margin-top: 8px;
    background: transparent;
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    padding: 8px 9px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ec-sub);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ec-sb-setup-link:hover {
    background: var(--ec-border-soft);
    border-color: var(--ec-faint);
    color: var(--ec-text);
}

.ec-sb-setup-link i {
    font-size: 13px;
    color: var(--ec-sub);
    transition: color 0.15s;
}

.ec-sb-setup-link:hover i { color: var(--ec-text); }

/* Setup-mode sidebar header — yellow card that replaces the facility picker
   when an admin is inside the customer-wide-setup surface. Source: prototype
   EduConnect All Roles.html lines 32466-32477. Lives in global CSS because
   it's slotted into WebSidebar via NavMenu (scoped CSS wouldn't reach). */
.ec-sb-setup-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ec-border-soft);
    background: #fef3c7;
}

.ec-sb-setup-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ec-sb-setup-header-title i {
    font-size: 14px;
    color: #92400e;
}

.ec-sb-setup-header-title span {
    font-size: 11px;
    font-weight: 800;
    color: #92400e;
    letter-spacing: 0.04em;
}

.ec-sb-setup-header-desc {
    font-size: 10.5px;
    color: var(--ec-sub);
    line-height: 1.4;
    margin: 0 0 8px;
}

.ec-sb-setup-header-back {
    box-sizing: border-box;
    width: 100%;
    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ec-text);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.ec-sb-setup-header-back:hover {
    background: var(--ec-bg);
    color: var(--ec-text);
}

/* Sidebar archive-scope chip — only visible to admins when the year context
   has been flipped to an archived year. Surfaces the "this whole UI is
   read-only and historical" affordance everywhere the sidebar is visible.
   Source: prototype EduConnect All Roles.html AdminScopePicker lines
   35787-35803. Slotted into WebSidebar via NavMenu so it lives in global
   CSS (scoped CSS wouldn't reach through the ChildContent boundary). */
.ec-sb-archive-chip {
    /* No extra side margin — the chip is rendered inside .ec-sb-switcher-wrap
       which already pads 12px 14px. Adding margins here double-indents the
       chip and steals horizontal space from the year name (which is how
       "2025-2026" was rendering as "2025-2…" before the fix). */
    margin: 0 0 10px 0;
    background: var(--ec-amber-lt);
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: 9px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ec-sb-archive-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ec-amber);
    flex-shrink: 0;
}
.ec-sb-archive-copy {
    flex: 1;
    min-width: 0;
}
.ec-sb-archive-kicker {
    font-size: 9px;
    font-weight: 800;
    color: var(--ec-amber);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}
.ec-sb-archive-name {
    font-size: 12px;
    font-weight: 800;
    color: #92400e;
    margin: 1px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ec-sb-archive-hint {
    font-size: 10px;
    color: #92400e;
    margin: 1px 0 0 0;
    font-style: italic;
}
.ec-sb-archive-back {
    background: #fff;
    border: 1px solid rgba(217, 119, 6, 0.33);
    border-radius: 7px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 800;
    color: #92400e;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    white-space: nowrap;
}
.ec-sb-archive-back:hover { background: var(--ec-amber-lt); }

/* In-page read-only notice for admin year-scoped pages — rendered by
   ArchivedYearBanner.razor when AcademicYearContextService.IsArchiveView.
   Same amber language as the sidebar archive chip (.ec-sb-archive-*) so the
   context reads consistently across the shell + page body. */
.ec-archive-notice {
    margin: 0 0 16px 0;
    background: var(--ec-amber-lt);
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ec-archive-notice-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ec-amber);
    flex-shrink: 0;
}
.ec-archive-notice-icon {
    color: var(--ec-amber);
    font-size: 15px;
    flex-shrink: 0;
}
.ec-archive-notice-copy {
    flex: 1;
    min-width: 0;
}
.ec-archive-notice-title {
    font-size: 13px;
    font-weight: 800;
    color: #92400e;
    margin: 0;
}
.ec-archive-notice-sub {
    font-size: 12px;
    color: #92400e;
    margin: 1px 0 0 0;
}
.ec-archive-notice-back {
    background: #fff;
    border: 1px solid rgba(217, 119, 6, 0.33);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #92400e;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.ec-archive-notice-back:hover { background: var(--ec-amber-lt); }

:root {
    /* Legacy tokens — hex values copied directly from the prototype palette
       (W.* in prototype/web-shell.jsx). Using literal hexes (not var()
       indirection) so they stay resolvable even if tokens.css fails to load
       in a particular environment — a CSS chain like
       `--ec-primary: var(--ec-blue)` silently produces no value if --ec-blue
       isn't defined yet, which would make `background: linear-gradient(...)`
       invalid and visually drop the button colour entirely. */
    --ec-primary:                #3b5fc0;   /* W.blue */
    --ec-primary-container:      rgba(59, 95, 192, 0.2);
    --ec-secondary:              #16a34a;   /* W.green */
    --ec-secondary-container:    rgba(22, 163, 74, 0.18);
    --ec-tertiary:               #d97706;   /* W.amber */
    --ec-tertiary-container:     rgba(217, 119, 6, 0.18);
    --ec-error:                  #dc2626;   /* W.red */
    --ec-error-container:        rgba(220, 38, 38, 0.15);
    --ec-surface:                #f7f8fc;   /* W.bg */
    --ec-surface-low:            #f4f6fc;   /* W.blueGh */
    --ec-surface-container:      #e9eefb;   /* W.blueLt */
    --ec-on-surface:             #1a2540;   /* W.text */
    --ec-on-surface-variant:     #5b6b8c;   /* W.sub */

  /* Parent portal design tokens */
  --ec-school-tint: #e8eef8;
  --ec-kg-tint:     #fdeaf2;

  --ec-card:        #ffffff;

  --ec-ok:          var(--ec-green);
  --ec-warn:        var(--ec-amber);
  --ec-alert:       var(--ec-red);

  /* Subject palette indices 0..9 */
  --ec-subj-0: #2e5dab;
  --ec-subj-1: #d63677;
  --ec-subj-2: #16a34a;
  --ec-subj-3: #d97706;
  --ec-subj-4: #7c3aed;
  --ec-subj-5: #0891b2;
  --ec-subj-6: #ea7025;
  --ec-subj-7: #dc2626;
  --ec-subj-8: #4f46e5;
  --ec-subj-9: #475569;
}

/* Parent page chrome — shared header used by Grades, Homework, MyChildren, PhotoGallery, Routine.
   Full-width (no max-width centering) so these pages align with every other page's
   left edge — the shell owns the gutter. Centering here made pd-page pages look
   inset vs full-width pages (e.g. Events/Polls). */
.pd-page {
    display: flex; flex-direction: column;
    gap: 1.5rem;
}
.pd-header {
    margin-bottom: 18px;
}
.pd-title {
    font-size: 24px; font-weight: 800;
    color: var(--ec-text);
    margin: 0;
    letter-spacing: -0.01em;
}
.pd-subtitle {
    font-size: 13px;
    color: var(--ec-sub);
    margin: 4px 0 0;
}

html, body {
    font-family: 'Manrope', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--ec-surface);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ── Institution Form Modal ── */
.if-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999 !important;
    background: rgba(30,50,86,0.25);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.if-overlay--visible { display: flex; }

.if-modal {
    background: white;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    border-radius: 2rem;
    box-shadow: 0 32px 64px -12px rgba(0,0,0,0.14);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.8);
}
.if-header { display: flex; justify-content: space-between; align-items: center; padding: 2rem 2.5rem; border-bottom: 1px solid #e9edff; flex-shrink: 0; background: white; }
.if-title { font-size: 1.6rem; font-weight: 800; color: var(--ec-on-surface); margin: 0 0 0.25rem; font-family: 'Plus Jakarta Sans', sans-serif; }
.if-subtitle { font-size: 0.875rem; color: var(--ec-on-surface-variant); margin: 0; }
.if-close-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; color: var(--ec-on-surface-variant); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.1rem; transition: background 0.15s; flex-shrink: 0; }
.if-close-btn:hover { background: #f1f5f9; color: var(--ec-on-surface); }
.if-content { flex: 1; overflow-y: auto; padding: 2.5rem; }
.if-content::-webkit-scrollbar { width: 6px; }
.if-content::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.if-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 3rem; align-items: start; }
.if-left  { display: flex; flex-direction: column; gap: 3rem; }
.if-right { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; }
.if-section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.if-section-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.if-icon-primary  { background: rgba(46,93,171,0.1);  color: var(--ec-primary); }
.if-icon-green    { background: rgba(0,110,45,0.1);   color: var(--ec-secondary); }
.if-icon-tertiary { background: rgba(122,90,0,0.1);   color: var(--ec-tertiary); }
.if-icon-blue     { background: rgba(59,130,246,0.1); color: #3b82f6; }
.if-section-title { font-size: 1.1rem; font-weight: 700; color: var(--ec-on-surface); margin: 0; }
.if-field-grid { display: grid; gap: 1.25rem; }
.if-col-2 { grid-template-columns: 1fr 1fr; }
.if-span-2 { grid-column: span 2; }
.if-label { display: block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ec-on-surface-variant); margin-bottom: 0.5rem; }
.if-label-sm { display: block; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ec-on-surface-variant); margin-bottom: 0.5rem; }
.if-label-hint { font-size: 0.7rem; font-weight: 400; font-style: italic; text-transform: none; letter-spacing: 0; opacity: 0.7; }
.if-required { color: var(--ec-error); font-weight: 700; }
.if-input { width: 100%; padding: 0.875rem 1.25rem; background: #f1f3ff; border: 1px solid rgba(159,178,221,0.3); border-radius: 14px; font-size: 0.875rem; color: var(--ec-on-surface); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; outline: none; box-sizing: border-box; font-family: inherit; }
.if-input:focus { background: white; border-color: var(--ec-primary); box-shadow: 0 0 0 3px rgba(46,93,171,0.12); }
.if-input-sm { padding: 0.625rem 1rem !important; font-size: 0.8rem !important; border-radius: 10px !important; }
.if-select { appearance: none; cursor: pointer; }
.if-mono { font-family: 'Courier New', monospace; letter-spacing: -0.02em; }
.if-time-input { text-align: center; min-width: 0; }
textarea.if-input { resize: vertical; }
.if-validation { font-size: 0.75rem; color: var(--ec-error); display: block; margin-top: 0.25rem; }
.if-status-field { display: flex; flex-direction: column; justify-content: flex-end; }
.if-active-toggle { display: flex; align-items: center; gap: 12px; padding: 0.75rem 0; }
.if-active-label { font-size: 0.875rem; font-weight: 700; color: var(--ec-on-surface); }
.if-icon-input { position: relative; }
.if-input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ec-on-surface-variant); pointer-events: none; }
.if-icon-input .if-input { padding-left: 2.75rem; }
.if-right-card { padding: 1.75rem; background: #f1f3ff; border: 1px solid #e9edff; border-radius: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.if-right-card-title { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ec-primary); display: flex; align-items: center; gap: 8px; margin: 0; }
.if-logo-row { display: flex; align-items: center; gap: 1.25rem; padding: 1rem; background: white; border-radius: 14px; border: 1px solid rgba(159,178,221,0.2); }
.if-logo-preview { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 2px solid #e9edff; flex-shrink: 0; }
.if-logo-placeholder { width: 72px; height: 72px; border-radius: 12px; background: #e9edff; border: 2px dashed #d8e2ff; display: flex; align-items: center; justify-content: center; color: var(--ec-on-surface-variant); font-size: 1.5rem; flex-shrink: 0; }
.if-logo-input-wrap { flex: 1; min-width: 0; }
.if-notif-hub { padding: 1.75rem; background: rgba(216,226,255,0.3); border: 1px solid rgba(159,178,221,0.1); border-radius: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.if-notif-hub-title { font-size: 1rem; font-weight: 700; color: var(--ec-on-surface); display: flex; align-items: center; gap: 8px; margin: 0; }
.if-notif-hub-title .bi { color: var(--ec-primary); }
.if-notif-section { display: flex; flex-direction: column; gap: 0.75rem; }
.if-notif-subsection-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ec-primary); margin: 0; }
.if-notif-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.if-check-item { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1rem; background: white; border-radius: 14px; border: 1px solid rgba(159,178,221,0.1); cursor: pointer; transition: border-color 0.15s; }
.if-check-item:hover { border-color: rgba(46,93,171,0.3); }
.if-check-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ec-primary); cursor: pointer; }
.if-check-text { font-size: 0.875rem; font-weight: 700; color: var(--ec-on-surface); }
.if-push-list { display: flex; flex-direction: column; gap: 0.5rem; }
.if-push-item { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1rem; background: rgba(255,255,255,0.5); border-radius: 14px; }
.if-push-label { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; font-weight: 700; color: var(--ec-on-surface); }
.if-push-label .bi { color: var(--ec-on-surface-variant); }
.if-push-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ec-secondary); cursor: pointer; }
.if-digest-pills { display: flex; gap: 0.375rem; padding: 0.375rem; background: #f1f3ff; border-radius: 14px; flex-wrap: wrap; }
.if-digest-pill { flex: 1; padding: 0.625rem 0.5rem; border-radius: 10px; border: none; background: transparent; font-size: 0.75rem; font-weight: 800; color: var(--ec-on-surface-variant); cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.if-digest-pill:hover { background: white; }
.if-digest-pill.if-pill-active { background: var(--ec-primary); color: white; box-shadow: 0 4px 12px -2px rgba(46,93,171,0.35); }
.if-quiet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.if-weekend-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: white; border: 1px solid rgba(159,178,221,0.1); border-radius: 14px; }
.if-weekend-info { display: flex; align-items: center; gap: 1rem; }
.if-weekend-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(249,115,22,0.1); color: #f97316; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.if-weekend-title { font-size: 0.875rem; font-weight: 700; color: var(--ec-on-surface); margin: 0; }
.if-weekend-sub   { font-size: 0.7rem; color: var(--ec-on-surface-variant); margin: 0; }
.if-error-banner { display: flex; align-items: center; gap: 8px; padding: 0.875rem 1.25rem; background: rgba(172,52,52,0.08); color: var(--ec-error); border-radius: 12px; font-size: 0.875rem; font-weight: 600; margin-top: 1.5rem; }
.if-footer { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; padding: 1.5rem 2.5rem; background: #f1f3ff; border-top: 1px solid #e9edff; flex-shrink: 0; }
.if-discard-btn { background: none; border: none; font-size: 0.875rem; font-weight: 700; color: var(--ec-on-surface-variant); cursor: pointer; padding: 0.75rem 1.5rem; border-radius: 99px; transition: background 0.15s, color 0.15s; }
.if-discard-btn:hover { background: #e2e8f0; color: var(--ec-on-surface); }
.if-discard-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.if-save-btn { display: flex; align-items: center; gap: 0.625rem; padding: 0.875rem 2.5rem; background: linear-gradient(135deg, var(--ec-primary), #1d4190); color: white; border: none; border-radius: 99px; font-size: 0.875rem; font-weight: 800; cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; box-shadow: 0 8px 20px -4px rgba(46,93,171,0.4); }
.if-save-btn:hover { transform: scale(1.02); }
.if-save-btn:active { transform: scale(0.98); }
.if-save-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.if-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%; animation: if-spin 0.6s linear infinite; display: inline-block; }
@keyframes if-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .if-grid { grid-template-columns: 1fr; }
    .if-right { position: static; }
}
@media (max-width: 600px) {
    .if-modal { border-radius: 1.5rem; }
    .if-header { padding: 1.5rem; }
    .if-content { padding: 1.5rem; }
    .if-footer { padding: 1rem 1.5rem; }
    .if-col-2 { grid-template-columns: 1fr; }
    .if-span-2 { grid-column: span 1; }
    .if-notif-check-grid { grid-template-columns: 1fr; }
    .if-quiet-grid { grid-template-columns: 1fr; }
}
/* Admin dashboard — mirrors prototype/EduConnect All Roles.html lines 14104-14286.
   Spacing / font sizes / weights all carried over from the prototype's inline styles. */

.aw-dash {
    /* No outer padding — the shell (.ec-app-content) owns the standard 24px
       gutter. Matches .up2-page / the rest of the admin pages; adding padding
       here compounded with the shell and made the dashboard inset further. */
    padding: 0;
    background: var(--ec-bg);
    min-height: 100%;
}

/* ── Today header ─────────────────────────────────────── */
.aw-today {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.aw-today-date {
    font-size: 11px;
    font-weight: 700;
    color: var(--ec-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

.aw-today-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--ec-text);
    letter-spacing: -0.01em;
    margin: 2px 0 0;
}

.aw-today-scope {
    font-size: 13px;
    font-weight: 600;
    color: var(--ec-muted);
    margin-left: 8px;
}

.aw-reports-btn {
    padding: 7px 13px;
    background: var(--ec-purple);
    border: none;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 0.15s;
}
.aw-reports-btn:hover { filter: brightness(0.92); color: #fff; }
.aw-reports-btn i     { font-size: 12px; }

/* ── Shared primary CTA button ─────────────────────────────
   The ONE primary-action button for every role and page (Add user, Add
   student, New poll, Save, …). Background is the INSTITUTION accent via
   --ec-primary, which MainLayout.BrandStyle() injects onto .ec-app-root, so
   the button re-themes per institution automatically. Fixed size everywhere
   so primary CTAs are identical across admin / teacher / parent / student.
   Do NOT hardcode a colour (var(--ec-purple)/--ec-green/etc.) on a primary
   CTA — use this class. Reserve fixed colours for SEMANTIC chrome (status
   dots, progress bars, success/danger states). */
.ec-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    background: var(--ec-primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ec-btn-primary:hover    { filter: brightness(0.93); color: #fff; }
.ec-btn-primary:active   { transform: translateY(0.5px); }
.ec-btn-primary:disabled { opacity: 0.55; cursor: default; filter: none; transform: none; }
.ec-btn-primary i        { font-size: 13px; }

/* Required-field asterisk — appended to a label so the user can see at a
   glance which fields are mandatory. Reusable across every dialog. */
.ec-req {
    color: var(--ec-red);
    font-weight: 700;
    margin-left: 1px;
}

/* ── KPI cards ────────────────────────────────────────── */
.aw-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.aw-kpi {
    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: 14px;
    padding: 18px 20px;
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.aw-kpi:hover {
    border-color: var(--ec-blue);
    box-shadow: 0 4px 14px rgba(59, 95, 192, 0.08);
}

.aw-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.aw-kpi-body { flex: 1; min-width: 0; }

.aw-kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.aw-kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--ec-text);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0;
}

.aw-kpi-trend {
    font-size: 11px;
    font-weight: 700;
    color: var(--ec-green);
}

.aw-kpi-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ec-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 5px 0 0;
}

.aw-kpi-sub {
    font-size: 11px;
    color: var(--ec-sub);
    margin: 3px 0 0;
}

/* ── Needs attention strip ────────────────────────────── */
.aw-attention {
    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
}

.aw-attention-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--ec-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

.aw-attention-chip {
    padding: 6px 11px;
    border-radius: 7px;
    border: 1px solid;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 0.15s;
}
.aw-attention-chip:hover { filter: brightness(0.95); }
.aw-attention-chip i { font-size: 13px; }

.aw-attention-chip--red   { background: var(--ec-red-lt);   border-color: rgba(220,38,38,0.3);  color: var(--ec-red); }
.aw-attention-chip--amber { background: var(--ec-amber-lt); border-color: rgba(217,119,6,0.3);  color: var(--ec-amber); }
.aw-attention-chip--blue  { background: var(--ec-blue-gh);  border-color: rgba(59,95,192,0.3);  color: var(--ec-blue); }

.aw-attention--ok {
    background: var(--ec-green-lt);
    border-color: #bbf7d0;
    color: var(--ec-green);
}
.aw-attention--ok i { font-size: 18px; }
.aw-attention--ok p { font-size: 12.5px; font-weight: 700; color: var(--ec-green); margin: 0; }

/* ── 2-column split ───────────────────────────────────── */
.aw-split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
}

.aw-panel {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--ec-border);
    overflow: hidden;
}

.aw-panel-hdr {
    padding: 14px 18px;
    border-bottom: 1px solid var(--ec-border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.aw-panel-hdr--single { display: block; }

.aw-panel-hdr h3 {
    font-size: 14px;
    font-weight: 800;
    color: var(--ec-text);
    margin: 0;
}
.aw-panel-hdr p {
    font-size: 12px;
    color: var(--ec-muted);
    margin: 2px 0 0;
}

.aw-panel-btn {
    background: none;
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ec-blue);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.aw-panel-btn:hover { background: var(--ec-blue-gh); color: var(--ec-blue); }

.aw-panel-empty {
    padding: 24px 18px;
    text-align: center;
    font-size: 12.5px;
    color: var(--ec-muted);
    margin: 0;
}

/* ── Capacity-at-risk row ─────────────────────────────── */
.aw-cap-row {
    display: grid;
    grid-template-columns: 1.6fr 1.4fr 1.6fr 90px;
    padding: 12px 18px;
    border-top: 1px solid var(--ec-border-soft);
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.1s;
}
.aw-cap-row:hover { background: var(--ec-bg); color: inherit; }

/* Col 1: icon + name+facility share a single cell so the grade pill
   stays anchored to col 4 instead of wrapping to row 2. */
.aw-cap-class {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.aw-cap-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.aw-cap-body { min-width: 0; }
.aw-cap-name { font-size: 13px; font-weight: 700; color: var(--ec-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-cap-fac  { font-size: 10.5px; color: var(--ec-muted); margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.aw-cap-teacher {
    font-size: 12px;
    color: var(--ec-sub);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aw-cap-teacher--empty { color: var(--ec-muted); font-style: italic; }

.aw-cap-bar-block { min-width: 0; }
.aw-cap-bar-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
}
.aw-cap-bar {
    flex: 1;
    height: 6px;
    background: var(--ec-bg);
    border-radius: 3px;
    overflow: hidden;
}
.aw-cap-bar-fill { height: 100%; transition: width 0.3s; }
.aw-cap-bar-count {
    font-size: 11px;
    font-weight: 800;
    min-width: 32px;
    text-align: right;
}
.aw-cap-bar-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
}

.aw-cap-pill {
    font-size: 9px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    justify-self: end;
}

/* ── Today's activity stream row ──────────────────────── */
.aw-stream-row {
    display: flex;
    gap: 10px;
    padding: 11px 18px;
    border-top: 1px solid var(--ec-border-soft);
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.1s;
}
.aw-stream-row:hover { background: var(--ec-bg); color: inherit; }

.aw-stream-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 15px;
}

.aw-stream-body { flex: 1; min-width: 0; }
.aw-stream-title { font-size: 12.5px; font-weight: 700; color: var(--ec-text); margin: 0; line-height: 1.3; }
.aw-stream-sub   { font-size: 11px; color: var(--ec-muted); margin: 2px 0 0; }

.aw-stream-chevron { color: var(--ec-muted); font-size: 14px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
    .aw-kpis { grid-template-columns: repeat(2, 1fr); }
    .aw-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .aw-kpis { grid-template-columns: 1fr; }
    .aw-cap-row { grid-template-columns: 1fr; }
    .aw-cap-pill { justify-self: start; }
}

/* ── Scroll lock for full-screen overlays (UserEditor, StudentEditor,
   detail drawers). Applied to <body> via JS interop while a modal is
   mounted so the wheel doesn't scroll the page behind the dialog. */
body.ec-modal-open {
    overflow: hidden;
}

/* ── Platform notification banner (SuperUser-configured) ──────────────────
   Shared chrome: rendered by Components/Common/PlatformBanner.razor on the
   login screen + every authenticated page, and reused for the live preview in
   the SuperUser editor. Kept global so the component and the preview match. */
.ec-pbanner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

/* Global: full-width strip below the top bar */
.ec-pbanner.variant-global {
    align-items: center;
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
    border-left: 4px solid currentColor;
}

/* Login: rounded notice under the sign-in card */
.ec-pbanner.variant-login {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 0.875rem;
    padding: 1rem;
    margin-top: 1.25rem;
    font-size: 0.72rem;
    line-height: 1.6;
}

.ec-pbanner-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ec-pbanner.variant-global .ec-pbanner-icon {
    font-size: 1rem;
}

.ec-pbanner.variant-login .ec-pbanner-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.ec-pbanner-text {
    flex: 1;
    margin: 0;
}

.ec-pbanner-text strong {
    font-weight: 700;
}

.ec-pbanner-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0.15rem 0.25rem;
    line-height: 1;
    font-size: 0.8rem;
    border-radius: 0.25rem;
}

.ec-pbanner-close:hover {
    opacity: 1;
}

.ec-pbanner.is-error {
    background: rgba(172, 52, 52, 0.10);
    color: #8f2b2b;
    border-color: rgba(172, 52, 52, 0.28);
}
.ec-pbanner.is-error .ec-pbanner-icon {
    background: rgba(172, 52, 52, 0.16);
    color: #ac3434;
}

.ec-pbanner.is-warning {
    background: rgba(251, 188, 5, 0.12);
    color: #6b5200;
    border-color: rgba(251, 188, 5, 0.32);
}
.ec-pbanner.is-warning .ec-pbanner-icon {
    background: rgba(251, 188, 5, 0.20);
    color: #b07d00;
}

.ec-pbanner.is-info {
    background: rgba(46, 93, 171, 0.10);
    color: #1e4585;
    border-color: rgba(46, 93, 171, 0.26);
}
.ec-pbanner.is-info .ec-pbanner-icon {
    background: rgba(46, 93, 171, 0.16);
    color: #2e5dab;
}

/* ── KG daily-log cell loading overlay (shared by the care cells) ──────────
   Each care cell wraps its variants in .kgcell-host; while a server-bound
   action ("Now" stamp / absent cycle) is in flight the cell shows a progress
   ring over its content so the tap feels instant. */
.kgcell-host {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 52px;
    box-sizing: border-box;
}
.kgcell-host > :not(.kgcell-loading) { flex: 1; min-width: 0; }
.kgcell-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.62);
    border-radius: 9px;
}
.kgcell-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(26, 37, 64, 0.16);
    border-top-color: var(--ec-primary, #d63677);
    animation: kgcell-spin 0.6s linear infinite;
}
@keyframes kgcell-spin { to { transform: rotate(360deg); } }
