@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-latin-variable.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-latin-ext-variable.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
    font-family: 'Material Symbols Rounded';
    src: url('../fonts/material-symbols-rounded-latin-variable.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
}

:root {
    font-family: 'Inter', sans-serif;
    font-synthesis: none;
    font-optical-sizing: auto;
    font-variant-numeric: lining-nums tabular-nums;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    color-scheme: light;

    --font-ui: 'Inter', sans-serif;
    --font-numeric: 'Inter', sans-serif;
    --type-display: 2rem;
    --type-page-title: 1.5rem;
    --type-section-title: 1.25rem;
    --type-card-title: 1rem;
    --type-body: 0.9375rem;
    --type-support: 0.8125rem;
    --type-caption: 0.75rem;
    --line-body: 1.5;
    --line-heading: 1.25;
    --space-card: 1rem;
    --radius-card: 0.75rem;
    --color-ink: #1f2937;
    --color-muted: #526174;
    --color-border: #d9e0e8;
    --color-primary: #176b63;
    --color-primary-hover: #12574f;
    --color-surface: #ffffff;
    --color-page: #f5f7fa;
}

html {
    font-family: var(--font-ui);
    font-size: 100%;
    scroll-padding-top: 5rem;
}

body {
    min-width: 0;
    background-color: var(--color-page);
    color: var(--color-ink);
    font-family: var(--font-ui);
    font-size: var(--type-body);
    font-weight: 400;
    line-height: var(--line-body);
    font-variant-numeric: lining-nums tabular-nums;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
    color: var(--color-ink);
    font-family: var(--font-ui);
    font-weight: 700;
    letter-spacing: 0;
    line-height: var(--line-heading);
    overflow-wrap: anywhere;
}

h1[class~="text-2xl"], h1[class~="text-3xl"], .page-title {
    font-size: var(--type-page-title);
    font-weight: 700;
}

h2[class~="text-xl"], .section-title {
    font-size: var(--type-section-title);
    font-weight: 600;
}

h3[class~="text-lg"], .card-title {
    font-size: var(--type-card-title);
    font-weight: 600;
}

p {
    line-height: var(--line-body);
}

.text-xs {
    font-size: var(--type-support);
    line-height: 1.45;
}

[class~="text-[10px]"], [class~="text-[11px]"] {
    font-size: var(--type-caption);
    line-height: 1.4;
}

.metric-value, .financial-value, .font-numeric, .font-mono, .mono {
    font-family: var(--font-numeric);
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.metric-value, .financial-value {
    display: block;
    max-width: 100%;
    font-size: var(--type-display);
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.material-symbols-rounded {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-family: 'Material Symbols Rounded';
    font-size: 1.375rem;
    font-style: normal;
    font-weight: 500;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'liga';
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.glass-card {
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background-color: var(--color-surface);
    background-image: none !important;
    box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
    backdrop-filter: none;
    transition: none;
}

.glass-card[class*="bg-amber-"] { background-color: #fffbeb; }
.glass-card[class*="bg-emerald-"] { background-color: #f0fdf4; }
.glass-card[class*="bg-rose-"] { background-color: #fff1f2; }
.glass-card[class*="bg-teal-"] { background-color: #f0fdfa; }
.glass-card[class*="bg-indigo-"] { background-color: #f8fafc; }

.btn-primary, .btn-secondary, .btn-success, .btn-danger {
    min-height: 3rem;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: none;
    transform: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-primary {
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover, .btn-primary:focus-visible {
    border-color: var(--color-primary-hover);
    background: var(--color-primary-hover);
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    border: 1px solid #b7c3d0;
    background: #ffffff;
    color: #26364a;
}

.btn-secondary:hover, .btn-secondary:focus-visible {
    border-color: #75869a;
    background: #f8fafc;
    transform: none;
}

.btn-success {
    border: 1px solid #167348;
    background: #167348;
    color: #ffffff;
}

.btn-success:hover, .btn-success:focus-visible {
    background: #115c39;
    transform: none;
}

.btn-danger {
    border: 1px solid #b42318;
    background: #b42318;
    color: #ffffff;
}

.btn-danger:hover, .btn-danger:focus-visible {
    background: #912018;
    transform: none;
}

.whatsapp-action {
    display: inline-flex;
    width: 3rem;
    min-width: 3rem;
    height: 3rem;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.whatsapp-action img {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
}

.whatsapp-action:hover, .whatsapp-action:focus-visible {
    border-color: #25d366;
    background: #f0fdf4;
}

button:disabled, [aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.58;
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%;
    min-height: 3rem;
    border: 1px solid #aebdcb;
    border-radius: 0.5rem;
    background-color: #ffffff;
    padding: 0.625rem 0.75rem;
    color: var(--color-ink);
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
}

textarea {
    min-height: 7rem;
    resize: vertical;
}

label {
    color: #334155;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--color-primary);
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #0f766e;
    outline-offset: 2px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #26364a;
    font-size: 0.875rem;
    line-height: 1.45;
}

table th {
    color: #46576b;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
}

table td {
    font-family: var(--font-numeric);
    font-variant-numeric: lining-nums tabular-nums;
}

.responsive-table-wrap {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    min-width: 48rem;
}

.data-table thead th {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    background: #f8fafc;
}

.data-table tbody td {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid #e6ebf0;
    vertical-align: middle;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
}

.table-action {
    display: inline-flex;
    width: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
}

.table-action:hover { background: #f1f5f9; }
.table-action--primary { color: #155e75; }
.table-action--success { color: #166534; }
.table-action--warning { color: #92400e; }
.table-action--danger { color: #b42318; }
.table-action--danger:hover { background: #fff1f2; }

.overflow-x-auto {
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

#mobileTabBar {
    justify-content: space-between;
}

#mobileTabBar > a {
    flex: 1 1 0;
    min-width: 0;
    padding-right: 0.125rem;
    padding-left: 0.125rem;
}

#mobileTabBar > a > span:not(.material-symbols-rounded) {
    max-width: 100%;
    font-size: 0.6875rem;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    :root {
        --space-card: 0.875rem;
    }

    .glass-card {
        border-radius: 0.625rem;
    }

    .responsive-table-wrap {
        overflow: visible;
    }

    .data-table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        clip-path: inset(50%);
    }

    .data-table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .data-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem 0.5rem;
        padding: 0.5rem;
        border: 1px solid var(--color-border);
        border-radius: 0.625rem;
        background: #ffffff;
        box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
    }

    .data-table tbody tr:not(:last-child) {
        border-bottom: 1px solid var(--color-border);
    }

    .data-table tbody td {
        min-width: 0;
        padding: 0.5rem !important;
        border: 0 !important;
        overflow-wrap: anywhere;
        text-align: left;
    }

    .data-table tbody td[data-label]::before {
        display: block;
        margin-bottom: 0.25rem;
        color: var(--color-muted);
        content: attr(data-label);
        font-family: var(--font-ui);
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.35;
    }

    .data-table tbody td:first-child,
    .data-table tbody td:last-child,
    .data-table tbody td.empty-state-cell {
        grid-column: 1 / -1;
    }

    .data-table tbody td[data-label="Contact"],
    .data-table tbody td[data-label="Contact info"],
    .data-table tbody td[data-label="Parent"] {
        grid-column: 1 / -1;
    }

    .data-table tbody td:first-child {
        border-bottom: 1px solid #e6ebf0 !important;
    }

    .data-table tbody td:first-child::before,
    .data-table tbody td:last-child::before,
    .data-table tbody td.empty-state-cell::before {
        display: none;
    }

    .data-table tbody td:last-child {
        border-top: 1px solid #e6ebf0 !important;
    }

    .table-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    body { background: #ffffff !important; }
    .glass-card { border-color: #cbd5e1 !important; box-shadow: none !important; }
}

@media (max-width: 360px) {
    .mobile-role-badge { display: none !important; }

    #mobileTabBar > a > span:not(.material-symbols-rounded) {
        font-size: 0.5625rem;
    }
}