/* ─── Design system tokens ────────────────────────────────────── */
:root {
    /* Brand */
    --color-primary:        #0078d4;
    --color-primary-hover:  #106ebe;
    --color-primary-active: #005a9e;

    /* Surfaces */
    --color-bg:             #f3f2f1;
    --color-surface:        #ffffff;
    --color-surface-raised: #faf9f8;
    --color-surface-sunken: #edebe9;

    /* Text */
    --color-text:        #1e293b;
    --color-text-muted:  #475569;
    --color-text-light:  #64748b;

    /* Borders */
    --color-border:      transparent;
    --color-border-soft: #e2e8f0;

    /* Shadows */
    --shadow-card:       0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-modal:      0 10px 25px -5px rgb(0 0 0 / 0.15), 0 4px 10px -5px rgb(0 0 0 / 0.1);

    /* Layout */
    --border-width:      1px;
    --header-height:     72px;
    --sidebar-top:       var(--header-height);
    --z-sidebar:         40;
    --z-modal:           100;
    --z-drawer:          101;
    --z-toast:           9999999;
    --radius:            6px;
}

/* ─── Base typography ─────────────────────────────────────────── */
body {
    font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* ─── Keyframes ─────────────────────────────────────────────── */
@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

.animate-slide-in { animation: slide-in 0.2s ease-out; }
.animate-fade-up  { animation: fade-up  0.2s ease-out; }

/* ─── Toast ──────────────────────────────────────────────────── */
#toast-container {
    z-index: 9999999 !important;
    top: 4rem;
}

/* ─── App Shell ───────────────────────────────────────────────── */
.app-topbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: var(--z-drawer);
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 2px solid #0078d4;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(15,23,42,0.06);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
}
.topbar-left  { justify-self: start; display: flex; align-items: center; gap: 0.5rem; }
.topbar-center { justify-self: center; width: 450px; max-width: 100%; }
.topbar-right  { justify-self: end;   display: flex; align-items: center; gap: 0.625rem; }
.app-shell-main {
    position: fixed;
    top: var(--header-height);
    left: 15rem;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background-color: #f3f2f1;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 15rem;
    height: calc(100vh - var(--header-height));
    background: #faf9f8;
    border-right: none;
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    overflow-y: auto;
}
.sidebar-nav {
    padding: 0.625rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}
.sidebar-section-label ~ .sidebar-section-label {
    margin-top: 0.75rem;
}
.sidebar-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8886;
    padding: 0.75rem 0.875rem 0.25rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-weight: 400;
    color: #201f1e;
    text-decoration: none;
    transition: background-color 0.1s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background-color: #edebe9;
    color: #201f1e;
}
.sidebar-link-active {
    background-color: #deecf9;
    color: #005a9e;
    border-left-color: #0078d4;
    font-weight: 600;
}

/* ─── Sidebar footer ──────────────────────────────────────────── */
.sidebar-footer {
    padding: 0.625rem 0.75rem;
    border-top: 1px solid #e2e0de;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.sidebar-footer-link {
    font-size: 0.75rem;
    color: #8a8886;
    text-decoration: none;
    padding: 0.25rem 0.375rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.1s, background-color 0.1s;
}
.sidebar-footer-link:hover { color: #201f1e; background: #edebe9; }
.sidebar-footer-link-active { color: #0078d4; font-weight: 600; }
.sidebar-footer-dot { font-size: 0.75rem; color: #c8c6c4; }

/* ─── Mobile sidebar + stack layout ──────────────────────────── */
@media (max-width: 767px) {
    .sidebar {
        display: none;
        z-index: var(--z-drawer);
        box-shadow: 4px 0 16px rgba(0,0,0,0.15);
    }
    .sidebar.sidebar-mobile-open {
        display: flex;
    }
    .app-shell-main {
        left: 0;
    }

    /* Stack layout: horizontal rows become vertical blocks */
    .flex-row-responsive {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    .grid-cols-responsive {
        grid-template-columns: 1fr !important;
    }
    /* Table rows become stacked blocks */
    .data-table.table-stack thead { display: none; }
    .data-table.table-stack .table-row {
        display: block;
        box-shadow: 0 1px 3px rgba(0,0,0,0.07);
        border-radius: var(--radius);
        margin-bottom: .75rem;
        padding: .5rem;
        background: #fff;
    }
    .data-table.table-stack .table-td {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #e2e8f0;
        padding: .4rem .5rem;
    }
    .data-table.table-stack .table-td:last-child { border-bottom: none; }
    .data-table.table-stack .table-td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: .7rem;
        text-transform: uppercase;
        color: var(--color-text-light);
        margin-right: .5rem;
        flex-shrink: 0;
    }
    /* Page content full width */
    .page-content .max-w-5xl,
    .page-content .max-w-3xl,
    .page-content .max-w-7xl {
        max-width: 100% !important;
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    line-height: 1.25rem;
    text-decoration: none;
}
.btn:focus-visible {
    outline: 2px solid #0078d4;
    outline-offset: 2px;
}
.btn-primary { background: #0078d4; color: #fff; border-color: #0078d4; }
.btn-primary:hover { background: #106ebe; border-color: #106ebe; }
.btn-primary:active { background: #005a9e; border-color: #005a9e; }

.btn-secondary { background: #fff; color: #201f1e; border-color: #8a8886; }
.btn-secondary:hover { background: #f3f2f1; border-color: #605e5c; }

.btn-ghost { background: transparent; color: #201f1e; border-color: transparent; }
.btn-ghost:hover { background: #edebe9; color: #201f1e; }

.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-danger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(220,38,38,0.4); }
.btn-primary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(0,120,212,0.35); }

.btn-danger-outline { background: #fff; color: #dc2626; border-color: #fca5a5; }
.btn-danger-outline:hover { background: #fef2f2; border-color: #f87171; }

.btn-ghost-danger { background: transparent; color: #dc2626; border-color: transparent; }
.btn-ghost-danger:hover { background: #fef2f2; color: #b91c1c; }

.btn-sm { padding: 0.3125rem 0.625rem; font-size: 0.75rem; min-height: 2.25rem; }

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 2px 12px rgba(0,0,0,0.07);
}
.card-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #faf9f8;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 1.25rem; }

/* ─── Stat Card ───────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 2px 12px rgba(0,0,0,0.07);
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    transition: transform 0.15s ease;
    cursor: default;
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08); }
.stat-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #deecf9;
    border-radius: 0.25rem;
    color: #0078d4;
}
.stat-icon-green  { background: #e8f7ee; color: #107c41; }
.stat-icon-teal   { background: #d6f4f7; color: #038387; }
.stat-icon-amber  { background: #fef3cd; color: #8a5d00; }
.stat-icon-purple { background: #f0e6f6; color: #8764b8; }
.stat-icon-red    { background: #fce8e8; color: #b91c1c; }
.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #201f1e;
    line-height: 1.2;
    margin-top: 0.125rem;
    font-feature-settings: "tnum";
}

/* ─── Typography helpers ──────────────────────────────────────── */
.page-title    { font-size: 1.375rem; font-weight: 800; color: var(--color-text); line-height: 1.2; }
.section-title { font-size: 1.125rem; font-weight: 700; color: var(--color-text); }
.muted         { color: var(--color-text-muted); font-size: 0.875rem; }

/* ─── Forms ───────────────────────────────────────────────────── */
.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 0.3rem;
}
.input, .select, .textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: #201f1e;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
}
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23605e5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0,120,212,0.2);
}
.input::placeholder { color: #9ca3af; }
.help-text  { font-size: 0.875rem; color: #4b5563; margin-top: 0.25rem; }
.field-error { font-size: 0.875rem; color: #dc2626; margin-top: 0.25rem; }
.input-error { border-color: #f87171 !important; }

/* ─── Table ───────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table thead { position: sticky; top: 0; z-index: 1; }
.table-head-row { background: #faf9f8; }
.table-th {
    padding: 0.5625rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--color-border-soft);
    white-space: nowrap;
    background: #faf9f8;
}
.table-td {
    padding: 0.75rem 1rem;
    color: var(--color-text);
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    font-feature-settings: "tnum";
}
.table-row:last-child .table-td { border-bottom: none; }
.table-row:hover .table-td { background: #f0f4f8; }

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1.5px solid currentColor;
}
.badge-blue   { background: #deecf9; color: #004e8c; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #713f12; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #374151; border-color: #94a3b8; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ─── Back navigation button ──────────────────────────────────── */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    text-decoration: none;
    margin-left: -0.5rem;
}
.btn-back:hover { background: #edebe9; color: #111; }

/* ─── Modal close button touch target ─────────────────────────── */
.modal-header .btn-ghost,
.drawer-header .btn-ghost {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.5rem;
    justify-content: center;
}

/* ─── Slide-over drawer ────────────────────────────────────────── */
.drawer-backdrop {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    background: rgba(0,0,0,0.55);
}
.drawer-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    height: calc(100vh - var(--header-height));
    width: 100%;
    max-width: 42rem;
    background: #fff;
    border-left: none;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    z-index: var(--z-drawer);
    animation: slide-in 0.2s ease-out;
    overflow: hidden;
}
.drawer-panel > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.drawer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-top: 1px solid #e1dfdd;
    background: #faf9f8;
    flex-shrink: 0;
}

/* ─── Confirmation modal size ─────────────────────────────────── */
.modal-sm { max-width: 28rem; }

/* ─── Typeahead results dropdown ──────────────────────────────── */
.typeahead-results {
    margin-top: 0.25rem;
    border: 1px solid #e1dfdd;
    border-radius: 0.25rem;
    background: #fff;
    max-height: 12rem;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(15,23,42,0.08);
}

/* ─── Attendance mark-all buttons ─────────────────────────────── */
.btn-attendance-present { background: #fff; color: #15803d; border-color: #86efac; }
.btn-attendance-present:hover { background: #f0fdf4; border-color: #4ade80; }
.btn-attendance-absent { background: #fff; color: #b91c1c; border-color: #fca5a5; }
.btn-attendance-absent:hover { background: #fef2f2; border-color: #f87171; }

/* ─── Table cell alignment ────────────────────────────────────── */
.table-td-right { text-align: right; }

/* ─── Divider ─────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid #e2e8f0; margin: 1rem 0; }

/* ─── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
}
.modal-panel {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fade-up 0.15s ease-out;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border-soft);
}
.modal-body    { padding: 1.5rem; }
.modal-footer  {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--color-border-soft);
    background: #faf9f8;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── Content wrapper: full-width ─────────────────────────────── */
.page-content .max-w-5xl,
.page-content .max-w-3xl,
.page-content .max-w-7xl {
    max-width: 100%;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* ─── Main content: font leggermente più grande ─────────────────── */
.app-shell-main .text-xs  { font-size: 0.8rem; }
.app-shell-main .text-sm  { font-size: 0.9rem; }

/* ─── Page header ─────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.page-header-title { font-size: 1.5rem; font-weight: 800; color: var(--color-text); line-height: 1.2; }
.page-header-sub   { font-size: 0.875rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* ─── Toolbar ─────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
    flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap .search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    width: 0.875rem;
    height: 0.875rem;
}
.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    font-size: 1rem;
    color: #201f1e;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0,120,212,0.2);
}

/* ─── Global search (topbar) ──────────────────────────────────── */
.topbar-search {
    position: relative;
    width: 100%;
}
.topbar-search .search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8a8886;
    pointer-events: none;
    width: 0.875rem;
    height: 0.875rem;
}
.topbar-search-input {
    width: 100%;
    padding: 0.375rem 0.75rem 0.375rem 2rem;
    font-size: 0.875rem;
    color: #201f1e;
    background: #f3f2f1;
    border: 1px solid #e2e0de;
    border-radius: 0.25rem;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.topbar-search-input:focus {
    outline: none;
    background: #fff;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}
.topbar-search-input::placeholder { color: #a19f9d; }
.global-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e0de;
    border-radius: 0.375rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 500;
    max-height: 24rem;
    overflow-y: auto;
}
.global-search-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8886;
    padding: 0.5rem 0.875rem 0.25rem;
}
.global-search-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    transition: background-color 0.1s;
    text-decoration: none;
    color: #201f1e;
}
.global-search-item:hover,
.global-search-item.active {
    background-color: #deecf9;
    color: #005a9e;
}
.global-search-item-icon {
    flex-shrink: 0;
    color: #8a8886;
}
.global-search-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.global-search-item-sub {
    font-size: 0.75rem;
    color: #8a8886;
    flex-shrink: 0;
}
.global-search-empty {
    padding: 1rem 0.875rem;
    font-size: 0.875rem;
    color: #8a8886;
    text-align: center;
}

/* ─── Empty & loading states ──────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #c8c6c4;
    gap: 0.5rem;
    text-align: center;
}
.empty-state-title { font-size: 1rem; font-weight: 600; color: #111; }
.empty-state-sub   { font-size: 0.875rem; color: #6b7280; }

/* ─── Attendance page ─────────────────────────────────────────── */
.attendance-row-btn {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.attendance-row-btn:hover { border-color: #93c5fd; color: #2563eb; background: #eff6ff; }
.attendance-btn-present   { border-color: #15803d; background: #16a34a; color: #fff; box-shadow: 0 1px 3px rgba(22,163,74,.35); }
.attendance-btn-absent    { border-color: #b91c1c; background: #dc2626; color: #fff; box-shadow: 0 1px 3px rgba(220,38,38,.35); }
.attendance-btn-justified { border-color: #b45309; background: #d97706; color: #fff; box-shadow: 0 1px 3px rgba(217,119,6,.35); }
.attendance-row:hover     { background: #e2e8f0 !important; }
.attendance-row a:hover   { color: #000; }

/* ─── page.content fade ───────────────────────────────────────── */
.page-content { animation: fade-up 0.2s ease-out; }

/* ─── Contrast overrides for inline Tailwind muted classes ───── */
.text-slate-400, .text-slate-500 { color: var(--color-text-muted) !important; }
.text-slate-600 { color: var(--color-text-muted) !important; }
.text-gray-400, .text-gray-500   { color: var(--color-text-muted) !important; }
.text-gray-600  { color: var(--color-text-muted) !important; }
.text-slate-900, .text-gray-900  { color: var(--color-text) !important; }
.stat-label                      { color: var(--color-text-muted); }
.stat-value                      { color: var(--color-text); }

/* ─── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Pagination ──────────────────────────────────────────────── */
.pagination-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2rem; height: 2rem; padding: 0 0.375rem;
    border: 1px solid #e2e8f0; border-radius: 0.375rem;
    font-size: 0.8125rem; font-weight: 500; color: #475569;
    background: #fff; cursor: pointer; transition: all 0.15s;
}
.pagination-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #94a3b8; }
.pagination-btn-active {
    background: #0078d4 !important; border-color: #0078d4 !important;
    color: #fff !important;
}


/* ─── Print report ────────────────────────────────────────────── */
@media print {
    .no-print,
    #sidebar,
    #header,
    .sidebar,
    header,
    nav,
    .page-header button,
    #rep-scope-type,
    #rep-scope-id-wrap,
    #rep-print-btn {
        display: none !important;
    }

    body, html {
        background: #fff !important;
        color: #000 !important;
    }

    .page-content {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    .card-header {
        background: #f5f5f5 !important;
    }

    a { color: #000 !important; text-decoration: none !important; }
}
