:root {
    --primary: #08a4d2;
    --primary-dark: #285795;
    --primary-soft: #e6f7fd;
    --gold: #d9b53f;
    --gold-soft: #fff6cf;
    --bg: #edf7fb;
    --card: #ffffff;
    --text: #172235;
    --muted: #65758d;
    --border: #cfe1ec;
    --green: #0fa66a;
    --yellow: #f0c337;
    --red: #ef4444;
    --navy: #0a3e5a;
    --ink: #102033;
    --surface: #f8fcff;
    --shadow: 0 14px 34px rgba(13, 63, 104, .13);
    --shadow-soft: 0 3px 12px rgba(16, 32, 51, .07);
    --ring: 0 0 0 3px rgba(8, 164, 210, .18);
}

* { box-sizing: border-box; }

[hidden] {
    display: none !important;
}

html {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Aptos, Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
}

a { text-decoration: none; color: inherit; }

input, select, textarea, button {
    font: inherit;
    max-width: 100%;
}

img, svg, canvas, video {
    max-width: 100%;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 22% 18%, rgba(248, 231, 28, .26), transparent 28%),
        linear-gradient(135deg, #dff6fd 0%, #f8fbff 45%, #fff8d8 100%);
    padding: 20px;
}

.login-wrapper { width: min(440px, 100%); }

.login-card {
    background: var(--card);
    border: 1px solid rgba(215, 173, 45, .45);
    border-radius: 22px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.brand-login {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.brand-login h1 {
    margin: 0;
    font-size: 24px;
}

.brand-login p {
    margin: 4px 0 0;
    color: var(--muted);
}

.brand-icon, .logo-box {
    width: 46px;
    height: 54px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: white;
    border: 2px solid var(--gold);
    box-shadow: 0 4px 12px rgba(43, 86, 145, .18);
    overflow: hidden;
}

.brand-icon {
    width: 64px;
    height: 78px;
    flex: 0 0 auto;
}

.brand-icon img, .logo-box img, .portal-logo img, .scanner-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.form {
    display: grid;
    gap: 10px;
}

.form input {
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
}

.form select,
.form-grid input,
.form-grid select {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
    color: var(--text);
}

.btn-primary, .btn-outline, .btn-light, .btn-small {
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    min-height: 42px;
    padding: 0 18px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(11, 159, 205, .22);
}

.btn-primary.full { width: 100%; margin-top: 10px; }

.btn-outline {
    background: transparent;
    border: 1px solid #3a4258;
    color: white;
    padding: 10px 16px;
}

.btn-light, .btn-small {
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
}

.alert {
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.alert.error {
    background: #fff1f1;
    color: #b42318;
    border: 1px solid #ffd5d5;
}

.alert.success {
    background: #edfdf5;
    color: #067647;
    border: 1px solid #b7efcf;
}

.alert.warning {
    background: #fff8db;
    color: #854d0e;
    border: 1px solid #f7df8a;
}

.login-help {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin-top: 18px;
}

.login-title {
    margin: 0 0 16px;
    font-size: 20px;
    color: var(--ink);
}

.login-alt {
    margin-top: 18px;
    text-align: center;
    font-weight: 700;
}

.login-alt a {
    color: var(--primary-dark);
}

.login-alt a:hover {
    color: var(--primary);
}

.login-home-action {
    margin-top: 12px;
}

.login-home-action .btn-light.full {
    width: 100%;
    min-height: 40px;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .login-home-action {
        display: none;
    }
}

/* App layout */
.app-body {
    min-height: 100vh;
    padding-left: 230px;
    padding-top: 56px;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 230px;
    height: 100vh;
    max-height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
    border-right: 1px solid var(--border);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .2s ease;
}

.sidebar-brand {
    height: 78px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand strong {
    color: var(--primary-dark);
}

.sidebar-brand span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 10px;
    display: grid;
    align-content: start;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.sidebar-section-title {
    margin: 10px 8px 2px;
    color: #8aa0b8;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sidebar-nav a {
    color: #607087;
    padding: 11px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-group {
    border: 1px solid transparent;
    border-radius: 12px;
}

.sidebar-group summary {
    list-style: none;
    color: #607087;
    padding: 11px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.sidebar-group summary::-webkit-details-marker {
    display: none;
}

.sidebar-group summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .16s ease;
    opacity: .7;
}

.sidebar-group[open] summary::after {
    transform: rotate(225deg);
}

.sidebar-subnav {
    display: grid;
    gap: 4px;
    padding: 2px 0 6px 28px;
}

.sidebar-subnav a {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 9px;
}

.sidebar-subnav a svg {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

.sidebar-nav a svg,
.sidebar-bottom a svg,
.mobile-menu-btn svg,
.sidebar-group summary svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.sidebar-nav a span,
.sidebar-bottom a span {
    min-width: 0;
}

.sidebar-nav a.active, .sidebar-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.sidebar-group.active > summary,
.sidebar-group summary:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.sidebar-nav a.active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-group.active {
    background: rgba(8, 164, 210, .04);
}

.sidebar-bottom {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 12px;
    display: grid;
    gap: 10px;
    background: linear-gradient(180deg, rgba(248, 252, 255, .94), #ffffff 42%);
    border-top: 1px solid rgba(207, 225, 236, .95);
    box-shadow: 0 -10px 24px rgba(16, 32, 51, .06);
}

.scanner-link, .logout-link {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    text-align: center;
    background: linear-gradient(90deg, #ffffff, #f5fbff);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-link {
    color: var(--red);
    border: 0;
}

.topbar {
    position: fixed;
    left: 230px;
    top: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(90deg, #ffffff, #f5fbff);
    border-bottom: 1px solid var(--border);
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
}

.topbar > div:first-child {
    min-width: 0;
}

.topbar strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    flex: 0 0 auto;
}

.user-box small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.mobile-menu-btn {
    position: fixed;
    top: 11px;
    left: 12px;
    z-index: 80;
    border: 0;
    background: var(--primary-dark);
    color: white;
    border-radius: 9px;
    height: 36px;
    width: 40px;
    display: none;
}

.main-content {
    padding: 22px;
    width: 100%;
    min-width: 0;
}

.page-header {
    margin-bottom: 18px;
}

.page-header.with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.page-header h1 {
    margin: 0;
    font-size: 26px;
}

.page-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card, .panel-card, .student-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .04);
}

.stat-card {
    min-height: 104px;
    padding: 18px;
    position: relative;
    border-top: 4px solid var(--gold);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    margin-top: 8px;
}

.positive { color: var(--green); font-weight: 700; }

.stat-icon {
    position: absolute;
    right: 16px;
    top: 18px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.stat-icon.blue { background: #e7f8fd; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.yellow { background: #fff7cc; }
.stat-icon.red { background: #ffe0e0; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-date-filter,
.dashboard-close-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-date-filter label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-weight: 800;
}

.dashboard-date-filter input {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
}

.dashboard-range-filter {
    align-items: end;
}

.dashboard-range-filter label {
    min-width: 160px;
}

.stat-chip {
    min-height: 54px;
    min-width: 150px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    display: grid;
    place-items: center;
    padding: 8px 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .04);
}

.stat-chip strong {
    font-size: 22px;
    color: var(--primary-dark);
    line-height: 1;
}

.stat-chip span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.panel-card {
    padding: 18px;
    min-width: 0;
}

.form-panel {
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px 18px;
    min-width: 0;
}

.form-grid label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 700;
}

.form-grid small {
    color: var(--muted);
    font-weight: 500;
}

.span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: end;
    gap: 10px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.student-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.student-header-actions .btn-light,
.student-header-actions .btn-primary,
.student-header-actions button {
    min-height: 42px;
    white-space: nowrap;
}

.table-toolbar h3 {
    margin: 0;
}

.search-inline {
    display: flex;
    gap: 8px;
    min-width: min(420px, 100%);
}

.search-inline input {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    flex: 1;
}

.import-help {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    padding: 14px;
    color: var(--text);
    display: grid;
    gap: 8px;
}

.import-help code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.data-table th,
.data-table td {
    border-top: 1px solid var(--border);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.data-table th:last-child,
.data-table td:last-child {
    min-width: 126px;
}

.data-table .select-col {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.data-table .select-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.data-table .select-col input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.data-table td small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.empty-cell {
    color: var(--muted);
    text-align: center !important;
    padding: 26px !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
}

.badge.ok {
    background: #dcfce7;
    color: #067647;
}

.badge.off {
    background: #f1f5f9;
    color: #64748b;
}

.badge.warn {
    background: #fff7cc;
    color: #b7791f;
}

.badge.bad {
    background: #ffe0e0;
    color: #b42318;
}

.badge.role {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.row-actions form {
    margin: 0;
}

.bulk-delete-form {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.header-action-cluster {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.more-actions {
    position: relative;
}

.more-actions > summary {
    list-style: none;
    cursor: pointer;
}

.more-actions > summary::-webkit-details-marker {
    display: none;
}

.more-actions[open] > summary {
    border-color: rgba(11, 159, 205, .38);
    background: var(--primary-soft);
}

.more-actions-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    min-width: 245px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    box-shadow: var(--shadow);
    display: grid;
    gap: 8px;
}

.more-actions-menu .btn-light,
.more-actions-menu .btn-primary,
.more-actions-menu button,
.more-actions-menu a {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.more-actions-menu form {
    margin: 0;
}

.selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 0 0 12px;
    border: 1px solid rgba(11, 159, 205, .16);
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fcff 0%, #ffffff 100%);
}

.selection-bar small {
    color: var(--muted);
    font-weight: 700;
}

.btn-light.danger-soft {
    color: var(--red);
    border-color: #ffd1d1;
    background: #fff8f8;
}

.btn-light.danger-soft:hover {
    background: #fff1f1;
    border-color: #ffb4b4;
}

.action-link,
.danger-link,
.icon-action {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
}

.action-link {
    color: var(--primary-dark);
}

.danger-link {
    color: var(--red);
}

.icon-action {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
    color: var(--primary-dark);
    display: inline-grid;
    place-items: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .05);
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.icon-action:hover {
    transform: translateY(-1px);
    border-color: rgba(11, 159, 205, .42);
    background: var(--primary-soft);
}

.icon-action.danger {
    color: var(--red);
    border-color: #ffd5d5;
    background: linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.icon-action.danger:hover {
    background: #fff1f1;
    border-color: #ffb4b4;
}

.icon-action.warn {
    color: #b7791f;
    border-color: #f7df8a;
    background: linear-gradient(180deg, #ffffff 0%, #fffdf0 100%);
}

.icon-action.ok {
    color: var(--green);
    border-color: #b7f0d4;
    background: linear-gradient(180deg, #ffffff 0%, #f0fff7 100%);
}

.icon-action.ok:hover {
    background: #e7fff2;
    border-color: #7cddb0;
}

.icon-action svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    min-width: 0;
    align-items: start;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(360px, .95fr) minmax(560px, 1.45fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.settings-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.form-grid.one-col {
    grid-template-columns: 1fr;
}

.helper-text {
    color: var(--muted);
    margin: 8px 0 0;
    font-size: 13px;
}

.schedule-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.schedule-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}

.schedule-card.morning {
    border-color: #bdebd8;
    background: linear-gradient(180deg, #f4fff9 0%, #ffffff 100%);
}

.schedule-card.afternoon {
    border-color: #f3d28c;
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
}

.schedule-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.schedule-card-head strong {
    font-size: 16px;
}

.schedule-card-head span {
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--border);
    font-weight: 800;
    font-size: 12px;
}

.schedule-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.schedule-steps .step {
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
}

.schedule-steps .present {
    background: #dcfce7;
    color: #047857;
}

.schedule-steps .late {
    background: #fff4c7;
    color: #b7791f;
}

.schedule-steps .absent {
    background: #ffe0e0;
    color: #d92d20;
}

.schedule-fields {
    grid-template-columns: 1fr;
    gap: 12px;
}

.schedule-fields .span-2 {
    grid-column: span 1;
}

.schedule-subtitle {
    margin-top: 4px;
    padding: 9px 10px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(8, 164, 210, .12), rgba(217, 181, 63, .14));
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.day-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.day-toggle {
    position: relative;
}

.day-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.day-toggle span {
    min-width: 54px;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #3b4758;
    cursor: pointer;
}

.day-toggle input:checked + span {
    background: #4358f3;
    color: white;
    border-color: #4358f3;
}

.section-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.section-chip {
    min-width: 42px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(8, 164, 210, .35);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(8, 164, 210, .14), rgba(217, 181, 63, .18));
    color: var(--primary-dark);
    display: inline-grid;
    place-items: center;
    font-weight: 900;
}

.holiday-card {
    border-top: 3px solid var(--primary);
}

.holiday-form {
    display: grid;
    grid-template-columns: minmax(150px, .35fr) minmax(220px, 1fr) auto;
    gap: 10px;
    margin-top: 14px;
    align-items: end;
}

.holiday-form input,
.history-filter-grid input,
.history-filter-grid select {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
}

.import-row {
    margin-top: 10px;
}

.btn-light.full {
    width: 100%;
}

.history-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 14px;
    min-width: 0;
}

.history-filter-grid label,
.report-filter-grid label {
    display: grid;
    gap: 6px;
    font-weight: 800;
    color: var(--text);
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr)) minmax(160px, .7fr);
    gap: 14px;
    align-items: end;
    min-width: 0;
}

.report-filter-grid input,
.report-filter-grid select {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
}

.report-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.report-tabs a {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
    color: #607087;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.report-tabs a.active,
.report-tabs a:hover {
    background: var(--primary-soft);
    border-color: rgba(11, 159, 205, .35);
    color: var(--primary-dark);
}

.export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.export-actions form {
    margin: 0;
}

.danger-button {
    color: var(--red);
    border-color: #ffd5d5;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    gap: 14px;
}

.color-grid label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.color-grid input[type="color"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    background: white;
    cursor: pointer;
}

.color-grid small {
    color: var(--muted);
    font-weight: 500;
}

.appearance-preview {
    min-height: 230px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--preview-bg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 190px 1fr;
}

.appearance-preview-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.appearance-preview-sidebar strong,
.appearance-preview-sidebar small {
    display: block;
}

.appearance-preview-sidebar strong {
    color: var(--preview-secondary);
}

.appearance-preview-sidebar small {
    color: var(--muted);
    margin-top: 4px;
}

.appearance-preview-content {
    padding: 18px;
    display: grid;
    align-content: start;
    gap: 18px;
}

.appearance-preview-content span {
    color: var(--preview-secondary);
    font-weight: 900;
}

.appearance-preview-content button {
    width: min(220px, 100%);
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, var(--preview-primary), var(--preview-secondary));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--preview-primary), transparent 78%);
}

.appearance-preview .logo-box {
    border-color: var(--preview-accent);
    flex: 0 0 auto;
}

.permission-user-panel {
    margin-bottom: 18px;
}

.permission-search-form,
.permission-user-form {
    max-width: 560px;
    margin-bottom: 14px;
}

.permission-search-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: end;
}

.permission-user-form label,
.permission-search-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.permission-search-form input,
.permission-user-form select {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
}

.permission-user-summary {
    min-height: 70px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid #e7eef5;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.permission-user-summary strong,
.permission-user-summary span {
    display: block;
}

.permission-user-summary span {
    color: var(--muted);
    margin-top: 4px;
}

.permission-panel {
    margin-bottom: 18px;
}

.permission-list {
    display: grid;
    gap: 14px;
}

.permission-module {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.permission-module-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.permission-master,
.permission-actions label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.permission-master small {
    display: block;
    color: var(--muted);
    font-weight: 600;
    margin-top: 3px;
}

.permission-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 12px 18px;
    min-width: 0;
}

.permission-actions label {
    font-size: 13px;
}

.permission-module input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4358f3;
}

.permission-state {
    font-weight: 800;
    font-size: 13px;
}

.permission-state.ok { color: #08a64b; }
.permission-state.partial { color: #c47a00; }
.permission-state.empty { color: var(--red); }

.report-table .num {
    text-align: center;
    font-weight: 800;
}

.green-text { color: #08a64b; }
.yellow-text { color: #c47a00; }
.red-text { color: var(--red); }

.filter-actions {
    display: grid;
    align-content: end;
    gap: 8px;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.metric-card {
    text-align: center;
    padding: 18px;
}

.metric-card strong {
    display: block;
    color: #4358f3;
    font-size: 32px;
}

.metric-card.green strong { color: #08a64b; }
.metric-card.yellow strong { color: #c47a00; }
.metric-card.red strong { color: var(--red); }

.metric-card span {
    color: var(--muted);
    font-weight: 700;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(17, 24, 39, .78);
    display: grid;
    place-items: center;
    padding: 18px;
}

.student-modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    position: relative;
    background: #f8fbff;
    border: 1px solid #dce7f0;
    border-radius: 8px;
    padding: 32px 34px 34px;
    box-shadow: 0 24px 70px rgba(2, 8, 23, .35);
    overscroll-behavior: contain;
}

.student-modal h2 {
    margin: 0 0 22px;
    color: #111827;
    font-size: 26px;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #6b7280;
    font-size: 32px;
    line-height: 1;
}

.modal-close:hover {
    background: #eef3f8;
    color: #111827;
}

.student-modal-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
}

.student-modal-form label {
    display: grid;
    gap: 8px;
    color: #1f2937;
    font-size: 19px;
    font-weight: 800;
}

.student-modal-form input,
.student-modal-form select,
.student-modal-form textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid #dfe8f1;
    border-radius: 10px;
    background: white;
    color: #1f2937;
    padding: 0 16px;
    font-size: 18px;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .04);
}

.student-modal-form textarea {
    min-height: 112px;
    padding: 12px 16px;
    resize: vertical;
}

.student-modal-form input:focus,
.student-modal-form select:focus,
.student-modal-form textarea:focus {
    border-color: #4358f3;
    box-shadow: 0 0 0 3px rgba(67, 88, 243, .18);
    outline: 0;
}

.modal-submit {
    grid-column: span 2;
    min-height: 52px;
    margin-top: 6px;
    font-size: 18px;
}

.panel-card h3 {
    margin: 0 0 14px;
}

.table-toolbar h3 {
    margin: 0;
}

.chart-box {
    min-height: 260px;
    height: 280px;
    width: 100%;
}

.legend-row {
    display: flex;
    justify-content: center;
    gap: 18px;
    color: var(--muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 5px;
}
.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); }
.dot.purple { background: #a855f7; }
.dot.blue { background: #3b82f6; }

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.calendar-toolbar h3 {
    margin: 0;
}

.calendar-filter {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-filter label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.calendar-filter select,
.calendar-filter input {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
}

.calendar-month-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 8px 0 18px;
}

.attendance-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-weekday {
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
    text-align: center;
    padding: 8px 0;
}

.calendar-day {
    min-height: 86px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #263348;
}

.calendar-day strong {
    font-size: 16px;
}

.calendar-day span {
    font-size: 12px;
    color: #607087;
    font-weight: 700;
}

.calendar-day.empty {
    background: transparent;
    border: 0;
}

.calendar-day.today {
    outline: 2px solid #4358f3;
    outline-offset: -2px;
}

.calendar-day.presente {
    background: #16c784;
    border-color: #16c784;
    color: white;
}

.calendar-day.tardanza {
    background: #f5c542;
    border-color: #f5c542;
    color: white;
}

.calendar-day.ausente {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: white;
}

.calendar-day.justificado {
    background: #a855f7;
    border-color: #a855f7;
    color: white;
}

.calendar-day.feriado {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.calendar-day.presente span,
.calendar-day.tardanza span,
.calendar-day.ausente span,
.calendar-day.justificado span,
.calendar-day.feriado span {
    color: rgba(255,255,255,.9);
}

.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
    margin: 18px 0;
}

.calendar-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.summary-card {
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    background: #f8fbff;
}

.summary-card strong {
    display: block;
    font-size: 26px;
}

.summary-card span {
    color: var(--muted);
    font-weight: 800;
}

.summary-card.present { background: #ecfdf5; color: #08a64b; }
.summary-card.late { background: #fff8db; color: #c47a00; }
.summary-card.absent { background: #fff1f1; color: #d92d20; }
.summary-card.justified { background: #f3e8ff; color: #9333ea; }
.summary-card.holiday { background: #eff6ff; color: #2563eb; }

.grade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.grade-card {
    background: #f4f7fb;
    border-radius: 10px;
    min-height: 70px;
    display: grid;
    place-items: center;
    text-align: center;
}

.grade-card strong { font-size: 24px; }
.grade-card span { color: var(--muted); }

.empty-state {
    min-height: 140px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.quick-access-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
    padding: 14px;
    display: grid;
    gap: 6px;
    min-height: 96px;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.quick-access-card:hover {
    transform: translateY(-1px);
    border-color: rgba(11, 159, 205, .42);
    box-shadow: 0 8px 18px rgba(11, 159, 205, .12);
}

.quick-access-card strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.quick-access-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

/* Scanner */
.scanner-body {
    background: linear-gradient(140deg, #04263c 0%, #0b587c 48%, #1f4f8d 100%);
    color: white;
    min-height: 100vh;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px;
}

.scanner-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.scanner-logo {
    width: 54px;
    height: 64px;
    border-radius: 12px;
    background: white;
    border: 2px solid var(--gold);
    overflow: hidden;
}

.scanner-header h1 {
    margin: 0;
    font-size: 20px;
}

.scanner-header p {
    color: #94a3b8;
    margin: 4px 0;
}

.scanner-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.online {
    color: #16c784;
    background: rgba(22, 199, 132, .12);
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.scanner-main {
    min-height: 55vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 16px;
    padding: 18px;
}

.scanner-alert {
    width: min(720px, calc(100% - 36px));
    margin: 10px auto 0;
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 800;
}

.scanner-alert.success {
    background: rgba(22, 199, 132, .14);
    color: #dcfce7;
    border: 1px solid rgba(22, 199, 132, .35);
}

.scanner-alert.error {
    background: rgba(255, 77, 79, .14);
    color: #fee2e2;
    border: 1px solid rgba(255, 77, 79, .35);
}

.scanner-form {
    display: grid;
    place-items: center;
    gap: 16px;
    width: min(720px, 100%);
}

.camera-frame {
    width: min(430px, 78vw);
    height: min(300px, 42vw);
    border: 4px solid var(--gold);
    border-radius: 18px;
    position: relative;
    display: grid;
    place-items: center;
    cursor: text;
    overflow: hidden;
    background: rgba(255, 255, 255, .03);
}

.scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .9;
    z-index: 0;
}

.scanner-dni-input {
    width: min(260px, 72%);
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: white;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    outline: 0;
    position: relative;
    z-index: 2;
}

.scanner-dni-input::placeholder {
    color: rgba(255, 255, 255, .62);
}

.scanner-dni-input.with-camera {
    opacity: 0;
    pointer-events: none;
}

.camera-message {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 2;
    border-radius: 999px;
    background: rgba(2, 8, 23, .55);
    color: white;
    padding: 8px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}

.scanner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.corner {
    position: absolute;
    width: 34px;
    height: 34px;
    border-color: var(--yellow);
    z-index: 3;
}

.c1 { left: 14px; top: 14px; border-left: 4px solid; border-top: 4px solid; }
.c2 { right: 14px; top: 14px; border-right: 4px solid; border-top: 4px solid; }
.c3 { left: 14px; bottom: 14px; border-left: 4px solid; border-bottom: 4px solid; }
.c4 { right: 14px; bottom: 14px; border-right: 4px solid; border-bottom: 4px solid; }

.last-entries {
    background: #101626;
    border-top: 1px solid #1e293b;
    padding: 14px;
}

.entry-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #202a3d;
    padding: 10px 0;
    color: #dbeafe;
}

.entry-row.empty {
    color: #94a3b8;
}

.scanner-manual-modal[hidden] {
    display: none !important;
}

/* Portal / auxiliar */
.portal-body {
    background: var(--bg);
    min-height: 100vh;
}

.portal-topbar {
    min-height: 58px;
    background: linear-gradient(90deg, #ffffff, #f5fbff);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 24px;
    flex-wrap: wrap;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
}

.portal-logo {
    width: 42px;
    height: 48px;
    border-radius: 10px;
    background: white;
    border: 2px solid var(--gold);
    overflow: hidden;
}

.portal-topbar nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.portal-nav-divider {
    width: 1px;
    min-height: 24px;
    background: var(--border);
    align-self: center;
}

.portal-topbar nav a {
    padding: 9px 12px;
    border-radius: 9px;
    color: #607087;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.portal-topbar nav a svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.portal-topbar nav a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-count {
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.portal-content {
    width: min(980px, calc(100% - 28px));
    margin: 24px auto;
    min-width: 0;
}

.student-card {
    padding: 24px;
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.student-avatar {
    width: 76px;
    height: 76px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 34px;
}

.portal-profile-card {
    justify-content: space-between;
}

.portal-profile-card h2 {
    margin: 0 0 4px;
}

.portal-profile-card p {
    margin: 3px 0;
    color: var(--muted);
    font-weight: 700;
}

.portal-student-picker select {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
}

.portal-home-panel {
    margin-bottom: 18px;
}

.today-status-box {
    min-height: 120px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
}

.today-status-box p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.status-pill {
    border-radius: 8px;
    color: white;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 0 20px;
    font-weight: 900;
}

.status-pill.present { background: var(--green); }
.status-pill.late { background: #f5c542; }
.status-pill.absent { background: var(--red); }

.portal-alert-row {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-top: 10px;
}

.portal-alert-row p {
    margin: 7px 0 0;
}

.portal-alert-row time {
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.portal-alert-row.incident {
    background: #fff1f1;
    border-color: #ffd5d5;
}

.portal-attended-note {
    margin-top: 10px;
    border-left: 3px solid var(--green);
    background: #ecfdf5;
    border-radius: 8px;
    padding: 8px 10px;
    color: #14532d;
}

.portal-attended-note p {
    margin: 6px 0 0;
}

.portal-attended-note small {
    display: block;
    margin-top: 4px;
    color: #166534;
}

.portal-alert-row.justification {
    background: #fffde8;
    border-color: #f7df8a;
}

.justification-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.justification-attachment img {
    width: 86px;
    height: 64px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: #164a84;
    padding: 0 10px;
    font-weight: 900;
    text-decoration: none;
}

.attachment-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.portal-alert-row.arrival-pending {
    background: #fff8db;
    border-color: #f7df8a;
    align-items: center;
}

.portal-alert-row.notification {
    background: #eef7ff;
    border-color: #cfe6ff;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.notification-actions form {
    margin: 0;
}

.empty-state.compact {
    min-height: 74px;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.search-row input {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.messages-layout {
    align-items: start;
}

.message-form {
    display: grid;
    gap: 14px;
}

.message-form label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 800;
}

.message-form input,
.message-form textarea {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    padding: 0 12px;
}

.message-form input {
    min-height: 42px;
}

.message-form textarea {
    min-height: 160px;
    padding: 12px;
    resize: vertical;
}

.message-list {
    display: grid;
    gap: 10px;
}

.message-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.message-item p {
    margin: 6px 0;
    color: #263348;
}

.message-item small {
    color: var(--muted);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 900px) {
    .app-body {
        padding-left: 0;
        padding-top: 56px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
        padding-left: 64px;
    }

    .topbar strong {
        max-width: 46vw;
    }

    .dashboard-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-topbar {
        padding: 12px 16px;
        align-items: flex-start;
    }

    .portal-topbar nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .portal-topbar nav a {
        flex: 0 0 auto;
    }

    .portal-profile-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header.with-actions,
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-date-filter,
    .dashboard-close-form {
        align-items: stretch;
    }

    .search-inline {
        min-width: 100%;
    }

    .form-actions {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .form-actions .btn-primary,
    .form-actions .btn-light,
    .form-actions .btn-small {
        flex: 1 1 180px;
    }

    .settings-grid,
    .settings-layout,
    .history-stats {
        grid-template-columns: 1fr;
    }

    .schedule-config-grid {
        grid-template-columns: 1fr;
    }

    .history-filter-grid,
    .report-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .permission-actions {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .permission-search-form {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-filter {
        align-items: stretch;
    }

    .calendar-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-tabs {
        grid-template-columns: 1fr;
    }

    .holiday-form {
        grid-template-columns: 1fr;
    }

    .appearance-preview {
        grid-template-columns: 1fr;
    }

    .appearance-preview-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 600px) {
    .app-body {
        padding-top: 54px;
    }

    .topbar {
        height: 54px;
        padding-right: 10px;
    }

    .topbar strong {
        max-width: 52vw;
        font-size: 13px;
    }

    .user-box {
        gap: 6px;
    }

    .user-box span,
    .user-box small {
        display: none;
    }

    .avatar {
        width: 30px;
        height: 30px;
    }

    .main-content {
        padding: 14px;
    }

    .panel-card {
        padding: 14px;
        border-radius: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card strong {
        font-size: 26px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .page-header p {
        font-size: 13px;
    }

    .page-header.with-actions > div,
    .table-toolbar > div {
        min-width: 0;
    }

    .chart-box {
        height: 230px;
        min-height: 230px;
    }

    .scanner-header,
    .scanner-status,
    .entry-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .scanner-header {
        padding: 12px;
        gap: 12px;
    }

    .scanner-brand {
        align-items: flex-start;
    }

    .scanner-logo {
        width: 44px;
        height: 52px;
        flex: 0 0 auto;
    }

    .scanner-header h1 {
        font-size: 16px;
    }

    .scanner-header p {
        font-size: 13px;
    }

    .scanner-status {
        width: 100%;
        gap: 8px;
    }

    .camera-frame {
        width: min(92vw, 430px);
        height: min(62vw, 300px);
        min-height: 220px;
    }

    .scanner-main {
        min-height: auto;
        padding: 22px 12px;
    }

    .scanner-actions {
        width: 100%;
    }

    .scanner-actions .btn-outline {
        flex: 1 1 150px;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .student-card {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .portal-topbar {
        padding: 10px 12px;
    }

    .portal-content {
        width: calc(100% - 20px);
        margin: 14px auto;
    }

    .portal-brand {
        width: 100%;
    }

    .portal-topbar nav a {
        padding: 8px 10px;
        font-size: 13px;
    }

    .portal-alert-row {
        flex-direction: column;
    }

    .notification-actions {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .form-actions,
    .search-inline,
    .dashboard-date-filter,
    .dashboard-close-form {
        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-light,
    .form-actions .btn-small,
    .search-inline .btn-light,
    .search-inline .btn-primary {
        width: 100%;
    }

    .dashboard-date-filter .btn-primary,
    .dashboard-date-filter .btn-light,
    .dashboard-close-form .btn-outline {
        width: 100%;
    }

    .permission-user-summary,
    .permission-module-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .permission-search-form .btn-primary,
    .permission-search-form .btn-light {
        width: 100%;
    }

    .calendar-filter {
        flex-direction: column;
    }

    .calendar-filter .btn-primary {
        width: 100%;
    }

    .calendar-day {
        min-height: 64px;
        padding: 8px;
    }

    .calendar-day span {
        display: none;
    }

    .calendar-summary {
        grid-template-columns: 1fr;
    }

    .history-filter-grid,
    .report-filter-grid {
        grid-template-columns: 1fr;
    }

    .report-tabs a,
    .export-actions a,
    .export-actions button,
    .student-header-actions,
    .student-header-actions .btn-light,
    .student-header-actions .btn-primary,
    .student-header-actions button,
    .filter-actions .btn-primary,
    .filter-actions .btn-light {
        width: 100%;
    }

    .permission-actions {
        grid-template-columns: 1fr;
    }

    .color-grid {
        grid-template-columns: 1fr;
    }

    .export-actions {
        width: 100%;
    }

    .export-actions a,
    .report-filter-grid .btn-primary {
        width: 100%;
    }

    .student-modal {
        width: min(100%, 540px);
        max-height: calc(100dvh - 20px);
        padding: 24px 20px;
    }

    .student-modal-form {
        grid-template-columns: 1fr;
    }

    .student-modal-form .span-2,
    .modal-submit {
        grid-column: span 1;
    }

    .student-modal h2 {
        padding-right: 42px;
        font-size: 22px;
    }

    .student-modal-form label {
        font-size: 15px;
    }

    .student-modal-form input,
    .student-modal-form select,
    .student-modal-form textarea {
        min-height: 46px;
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    .mobile-menu-btn {
        left: 8px;
        width: 36px;
    }

    .topbar {
        padding-left: 54px;
    }

    .topbar strong {
        max-width: 56vw;
    }

    .data-table {
        min-width: 720px;
    }

    .calendar-day {
        min-height: 52px;
        padding: 6px;
    }

    .calendar-weekday {
        font-size: 11px;
    }

    .camera-message {
        left: 8px;
        right: 8px;
        border-radius: 10px;
        font-size: 12px;
    }
}

/* Institutional polish: Colegio Bicentenario 19 de Abril */
body {
    background:
        linear-gradient(180deg, rgba(237, 247, 251, .92), rgba(246, 251, 253, .98)),
        radial-gradient(circle at 12% 0%, rgba(217, 181, 63, .14), transparent 30%),
        radial-gradient(circle at 92% 12%, rgba(8, 164, 210, .13), transparent 34%);
}

h1, h2, h3, h4,
.topbar strong,
.sidebar-brand strong,
.portal-brand,
.brand-login h1 {
    color: var(--ink);
    font-weight: 900;
    letter-spacing: 0;
}

.page-header h1 {
    font-size: clamp(24px, 2.2vw, 32px);
    line-height: 1.1;
}

.page-header p,
.helper-text,
.brand-login p,
.portal-profile-card p {
    color: var(--muted);
}

.login-body {
    background:
        linear-gradient(135deg, rgba(4, 38, 60, .94), rgba(8, 164, 210, .82)),
        radial-gradient(circle at 26% 18%, rgba(217, 181, 63, .38), transparent 28%);
}

.login-card,
.panel-card,
.student-card,
.stat-card,
.metric-card,
.quick-access-card,
.message-item,
.permission-module,
.schedule-card,
.grade-card,
.student-modal {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid rgba(207, 225, 236, .95);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.login-card,
.student-modal {
    box-shadow: 0 26px 70px rgba(8, 33, 58, .28);
}

.panel-card,
.student-card,
.stat-card {
    position: relative;
}

.panel-card::before,
.student-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, var(--gold), var(--primary), var(--primary-dark));
    opacity: .85;
    pointer-events: none;
}

.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 72%, #eef8fc 100%);
    border-right-color: rgba(207, 225, 236, .95);
    box-shadow: 4px 0 18px rgba(16, 32, 51, .04);
}

.sidebar-brand {
    min-height: 82px;
    border-bottom-color: rgba(207, 225, 236, .95);
    background: linear-gradient(90deg, rgba(8, 164, 210, .06), transparent);
}

.sidebar-brand strong {
    color: var(--primary-dark);
    line-height: 1.15;
}

.logo-box,
.brand-icon,
.portal-logo,
.scanner-logo {
    border-color: var(--gold);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(43, 86, 145, .18);
}

.sidebar-nav a,
.sidebar-group summary {
    color: #40546d;
    border: 1px solid transparent;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.sidebar-nav a:hover,
.sidebar-group summary:hover {
    transform: translateX(2px);
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.sidebar-group.active > summary,
.sidebar-group summary:hover,
.portal-topbar nav a.active,
.portal-topbar nav a:hover {
    background: linear-gradient(90deg, rgba(8, 164, 210, .13), rgba(217, 181, 63, .08));
    border-color: rgba(8, 164, 210, .18);
    color: var(--primary-dark);
}

.sidebar-nav a.active {
    box-shadow: inset 4px 0 0 var(--gold);
}

.sidebar-group.active > summary {
    box-shadow: inset 4px 0 0 var(--gold);
}

.sidebar-section-title {
    color: #7c8da1;
    letter-spacing: .08em;
}

.topbar,
.portal-topbar {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(207, 225, 236, .95);
    box-shadow: 0 2px 14px rgba(16, 32, 51, .05);
    backdrop-filter: blur(10px);
}

.avatar,
.student-avatar,
.aux-avatar,
.stat-icon.blue {
    background: linear-gradient(135deg, rgba(8, 164, 210, .14), rgba(43, 86, 145, .12));
    color: var(--primary-dark);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 9px;
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(8, 94, 151, .2);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.btn-primary:hover,
.btn-light:hover,
.btn-small:hover,
.quick-access-card:hover,
.icon-action:hover {
    transform: translateY(-1px);
}

.btn-primary:hover {
    filter: saturate(1.08);
    box-shadow: 0 14px 28px rgba(8, 94, 151, .25);
}

.btn-light,
.btn-small,
.scanner-link {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 100%);
    border: 1px solid var(--border);
    color: var(--ink);
    border-radius: 9px;
    font-weight: 800;
    box-shadow: 0 2px 7px rgba(16, 32, 51, .04);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, .34);
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
    font-weight: 800;
}

input,
select,
textarea,
.form input,
.form select,
.form-grid input,
.form-grid select,
.history-filter-grid input,
.history-filter-grid select,
.report-filter-grid input,
.report-filter-grid select,
.student-modal-form input,
.student-modal-form select,
.student-modal-form textarea,
.search-inline input,
.search-row input,
.message-form input,
.message-form textarea {
    border-color: var(--border);
    border-radius: 9px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 700;
}

input:focus,
select:focus,
textarea:focus,
.student-modal-form input:focus,
.student-modal-form select:focus,
.student-modal-form textarea:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
    outline: 0;
}

.stat-card {
    border-top: 4px solid var(--gold);
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -28px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(8, 164, 210, .08);
}

.stat-card span,
.data-table th,
.table-toolbar p,
.student-modal-form label,
.form-grid label,
.message-form label {
    color: #53677f;
}

.stat-card strong,
.metric-card strong,
.stat-chip strong {
    color: var(--ink);
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: #f4f9fc;
    border-top: 1px solid var(--border);
    color: #566a83;
    font-weight: 900;
}

.data-table td {
    background: rgba(255, 255, 255, .72);
    border-top-color: rgba(207, 225, 236, .9);
}

.data-table tbody tr:hover td {
    background: #f7fcff;
}

.badge {
    border: 1px solid transparent;
    font-weight: 900;
}

.badge.ok {
    background: #dff8ec;
    color: #066844;
    border-color: #bcebd2;
}

.badge.warn {
    background: #fff2c2;
    color: #9a6300;
    border-color: #f2d579;
}

.badge.bad {
    background: #ffe3e3;
    color: #b42318;
    border-color: #ffc9c9;
}

.badge.role {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: rgba(8, 164, 210, .18);
}

.icon-action {
    background: #ffffff;
    border-color: var(--border);
    border-radius: 9px;
    color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(16, 32, 51, .07);
}

.modal-backdrop {
    background: rgba(7, 18, 32, .74);
    backdrop-filter: blur(5px);
}

.student-modal {
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%) !important;
    border-color: rgba(207, 225, 236, .95) !important;
    border-radius: 12px !important;
}

.student-modal h2 {
    color: var(--ink) !important;
    font-weight: 900 !important;
}

.modal-close {
    display: inline-grid !important;
    place-items: center !important;
    width: 36px !important;
    height: 36px !important;
    border: 1px solid rgba(207, 225, 236, .92) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #596a80 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 1.45rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-shadow: 0 7px 18px rgba(16, 32, 51, .10) !important;
}

.modal-close:hover {
    color: #b42318 !important;
    border-color: #ffc9c9 !important;
    background: #fff5f5 !important;
}

.scanner-body {
    background:
        linear-gradient(135deg, rgba(4, 38, 60, .98) 0%, rgba(8, 94, 130, .96) 48%, rgba(43, 86, 145, .98) 100%) !important;
}

.camera-frame {
    border-color: var(--gold);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .24), 0 0 0 1px rgba(255, 255, 255, .12);
}

.corner {
    border-color: #ffffff;
}

.camera-message,
.last-entries {
    background: rgba(6, 20, 37, .84);
}

.portal-alert-row,
.aux-result-card,
.message-item {
    border-radius: 10px;
    box-shadow: 0 2px 9px rgba(16, 32, 51, .04);
}

.portal-alert-row.incident {
    background: #fff6f4;
    border-color: #ffd6cc;
}

.portal-alert-row.justification,
.portal-alert-row.arrival-pending {
    background: #fff9e6;
    border-color: #f0d783;
}

.portal-alert-row.notification {
    background: #eef9ff;
    border-color: #cbe9f6;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.grade-card {
    background: linear-gradient(180deg, #f7fbfe 0%, #eef7fb 100%);
}

.day-toggle input:checked + span,
.report-tabs a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border-color: transparent;
}

.schedule-card.morning {
    border-color: rgba(8, 164, 210, .28);
    background: linear-gradient(180deg, #f2fbff 0%, #ffffff 100%);
}

.schedule-card.afternoon {
    border-color: rgba(217, 181, 63, .55);
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
}

.calendar-nav-btn {
    min-width: 44px;
    font-size: 1.45rem;
    line-height: 1;
}

.notification-alert-modal {
    max-width: 520px !important;
    text-align: center;
}

.notification-alert-modal h2 {
    margin-bottom: 10px;
}

.notification-alert-count {
    display: inline-grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin: 8px auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 950;
    box-shadow: 0 18px 38px rgba(31, 79, 141, .22);
}

.notification-alert-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.notification-alert-actions a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Public home */
.home-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 85% 8%, rgba(248, 231, 28, .20), transparent 28%),
        radial-gradient(circle at 7% 14%, rgba(8, 164, 210, .22), transparent 32%),
        linear-gradient(180deg, #f3fbff 0%, #e8f5fb 56%, #f8fcff 100%);
    color: var(--ink);
}

.home-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px clamp(18px, 4vw, 64px);
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(207, 225, 236, .88);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 28px rgba(21, 50, 80, .07);
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    min-width: 210px;
}

.home-brand img {
    width: 48px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(31, 79, 141, .18));
}

.home-brand strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 950;
}

.home-brand small {
    display: block;
    color: #5f728b;
    font-weight: 750;
}

.home-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border: 1px solid rgba(207, 225, 236, .78);
    border-radius: 999px;
    background: rgba(244, 250, 253, .78);
}

.home-nav a {
    padding: 9px 14px;
    border-radius: 999px;
    color: #334b66;
    text-decoration: none;
    font-weight: 850;
    white-space: nowrap;
}

.home-nav a:hover {
    background: rgba(8, 164, 210, .12);
    color: var(--primary-dark);
}

.home-actions,
.home-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-actions .btn-primary,
.home-actions .btn-light,
.home-hero-actions .btn-primary,
.home-hero-actions .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    text-decoration: none;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    align-items: center;
    gap: clamp(28px, 6vw, 72px);
    min-height: calc(100vh - 84px);
    padding: clamp(38px, 6vw, 86px) clamp(18px, 5vw, 78px) 42px;
    overflow: hidden;
}

.home-hero-content {
    max-width: 680px;
}

.home-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 13px;
    margin: 0 0 18px;
    border: 1px solid rgba(217, 181, 63, .55);
    border-radius: 999px;
    background: rgba(255, 248, 215, .75);
    color: #80620c;
    font-weight: 950;
    letter-spacing: .02em;
    text-transform: uppercase;
    font-size: .78rem;
}

.home-hero h1 {
    margin: 0;
    color: #08243b;
    font-size: clamp(2.4rem, 5vw, 5rem);
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: 0;
}

.home-copy {
    max-width: 620px;
    margin: 20px 0 28px;
    color: #4f657f;
    font-size: 1.08rem;
    line-height: 1.7;
    font-weight: 720;
}

.home-outline {
    border-color: rgba(31, 79, 141, .26);
    color: var(--primary-dark);
    background: rgba(255, 255, 255, .74);
}

.home-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.home-trust-row span {
    padding: 9px 12px;
    border: 1px solid rgba(207, 225, 236, .8);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: #36516e;
    font-size: .88rem;
    font-weight: 900;
}

.home-emblem {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 520px;
}

.home-emblem::before {
    content: "";
    position: absolute;
    width: min(78vw, 520px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        linear-gradient(135deg, rgba(8, 164, 210, .18), rgba(43, 86, 145, .16)),
        rgba(255, 255, 255, .44);
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: 0 32px 80px rgba(20, 71, 112, .15);
}

.home-logo-ring {
    position: relative;
    width: min(78vw, 360px);
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(244, 250, 253, .82)),
        linear-gradient(135deg, rgba(217, 181, 63, .45), rgba(8, 164, 210, .26));
    border: 1px solid rgba(207, 225, 236, .82);
    box-shadow: 0 30px 70px rgba(31, 79, 141, .22);
}

.home-logo-ring img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 14px 18px rgba(19, 47, 80, .18));
}

.home-floating-card {
    position: absolute;
    display: grid;
    gap: 3px;
    max-width: 230px;
    padding: 14px 16px;
    border: 1px solid rgba(207, 225, 236, .82);
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 18px 42px rgba(31, 79, 141, .15);
}

.home-floating-card strong {
    color: var(--primary-dark);
    font-size: 1.12rem;
    font-weight: 950;
}

.home-floating-card span {
    color: #5a708a;
    font-size: .86rem;
    font-weight: 800;
}

.home-floating-card.card-one {
    left: 2%;
    top: 18%;
}

.home-floating-card.card-two {
    right: 0;
    bottom: 18%;
}

.home-section {
    padding: 24px clamp(18px, 5vw, 78px) 58px;
}

.home-section-head {
    margin-bottom: 18px;
}

.home-section-head span {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-dark);
    font-size: .82rem;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.home-section-head h2 {
    margin: 0;
    color: #0b253d;
    font-size: clamp(1.45rem, 2.6vw, 2.35rem);
    font-weight: 950;
}

.home-access-grid,
.home-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.home-access-card,
.home-flow-step {
    min-height: 184px;
    padding: 20px;
    border: 1px solid rgba(207, 225, 236, .86);
    border-radius: 16px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 12px 34px rgba(31, 79, 141, .09);
}

.home-access-card {
    display: grid;
    align-content: start;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-access-card:hover {
    transform: translateY(-3px);
    border-color: rgba(8, 164, 210, .45);
    box-shadow: 0 18px 48px rgba(31, 79, 141, .14);
}

.home-access-card strong,
.home-flow-step strong {
    color: #10263d;
    font-size: 1.02rem;
    font-weight: 950;
}

.home-access-card small,
.home-flow-step p {
    color: #5b718a;
    line-height: 1.55;
    font-weight: 720;
}

.access-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 950;
    box-shadow: 0 10px 22px rgba(31, 79, 141, .16);
}

.access-icon.admin {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.access-icon.aux {
    background: linear-gradient(135deg, #f97316, var(--gold));
}

.access-icon.parent {
    background: linear-gradient(135deg, #11a66a, #00c48c);
}

.access-icon.scan {
    background: linear-gradient(135deg, #0b253d, #285795);
    font-size: .82rem;
}

.home-flow-section {
    padding-top: 0;
}

.home-flow-step {
    min-height: 156px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(247, 252, 255, .92));
}

.home-flow-step b {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 950;
}

.home-flow-step p {
    margin: 10px 0 0;
}

.home-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px clamp(18px, 5vw, 78px);
    border-top: 1px solid rgba(207, 225, 236, .86);
    background: #ffffff;
    color: #64758a;
    font-weight: 780;
}

.home-footer a {
    color: var(--primary-dark);
    font-weight: 950;
    text-decoration: none;
}

@media (max-width: 1100px) {
    .home-header {
        flex-wrap: wrap;
    }

    .home-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
    }

    .home-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .home-emblem {
        min-height: 430px;
    }

    .home-access-grid,
    .home-flow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .home-header {
        align-items: flex-start;
    }

    .home-brand {
        min-width: 0;
    }

    .home-actions,
    .home-hero-actions,
    .home-actions .btn-primary,
    .home-actions .btn-light,
    .home-hero-actions .btn-primary,
    .home-hero-actions .btn-outline {
        width: 100%;
    }

    .home-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .home-hero {
        padding-top: 30px;
    }

    .home-copy {
        font-size: 1rem;
    }

    .home-emblem {
        min-height: 360px;
    }

    .home-floating-card {
        position: relative;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        margin-top: -8px;
    }

    .home-access-grid,
    .home-flow-grid {
        grid-template-columns: 1fr;
    }

    .home-footer {
        flex-direction: column;
    }
}

/* Mobile system controls: keep actions visible on phones and tablets */
@media (max-width: 760px) {
    html,
    body {
        overflow-x: hidden;
    }

    .sidebar {
        width: min(86vw, 320px) !important;
        max-width: calc(100vw - 28px);
        height: 100dvh;
        max-height: 100dvh;
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) auto;
        overflow: hidden;
    }

    .sidebar-brand {
        min-height: 76px;
        height: auto;
        padding: 12px 14px;
    }

    .sidebar-nav {
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 12px 10px;
        padding-bottom: 18px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .sidebar-nav a,
    .sidebar-group summary {
        min-height: 44px;
        display: flex;
        align-items: center;
        font-size: 15px;
    }

    .sidebar-subnav {
        padding-left: 18px;
    }

    .sidebar-subnav a {
        min-height: 40px;
        font-size: 14px;
    }

    .sidebar-bottom {
        margin-top: 0 !important;
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding: 10px;
        background: linear-gradient(180deg, rgba(248, 252, 255, .94), #ffffff 42%);
        border-top: 1px solid rgba(207, 225, 236, .95);
        box-shadow: 0 -10px 26px rgba(16, 32, 51, .08);
        display: grid;
        gap: 8px;
    }

    .sidebar-bottom .scanner-link,
    .sidebar-bottom .logout-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 900;
    }

    .main-content {
        padding: 12px;
        padding-bottom: 22px;
    }

    .page-header.with-actions,
    .table-toolbar,
    .calendar-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: stretch;
    }

    .header-action-cluster {
        justify-content: stretch;
        width: 100%;
    }

    .header-action-cluster > .btn-primary,
    .header-action-cluster > .btn-light,
    .header-action-cluster > .more-actions {
        width: 100%;
    }

    .more-actions-menu {
        position: static;
        margin-top: 8px;
        min-width: 0;
        width: 100%;
    }

    .selection-bar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .selection-bar .bulk-delete-form,
    .selection-bar .btn-light {
        width: 100%;
    }

    .page-header.with-actions > div,
    .table-toolbar > div,
    .calendar-toolbar > div {
        min-width: 0;
    }

    .student-header-actions,
    .export-actions,
    .form-actions,
    .filter-actions,
    .notification-alert-actions,
    .scanner-actions,
    .dashboard-date-filter,
    .dashboard-close-form,
    .search-inline,
    .calendar-filter,
    .holiday-form,
    .permission-search-form {
        display: flex;
        width: 100%;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        padding: 2px 2px 8px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .filter-actions,
    .holiday-form,
    .permission-search-form,
    .calendar-filter,
    .dashboard-date-filter {
        flex-direction: row;
        align-items: stretch;
    }

    .student-header-actions .btn-light,
    .student-header-actions .btn-primary,
    .student-header-actions button,
    .export-actions a,
    .export-actions button,
    .export-actions form,
    .form-actions .btn-primary,
    .form-actions .btn-light,
    .form-actions .btn-small,
    .filter-actions .btn-primary,
    .filter-actions .btn-light,
    .notification-alert-actions a,
    .scanner-actions .btn-outline,
    .scanner-actions button,
    .dashboard-date-filter .btn-primary,
    .dashboard-date-filter .btn-light,
    .dashboard-close-form .btn-outline,
    .search-inline .btn-primary,
    .search-inline .btn-light,
    .calendar-filter .btn-primary,
    .holiday-form .btn-primary,
    .permission-search-form .btn-primary,
    .permission-search-form .btn-light {
        flex: 0 0 auto;
        min-width: 132px;
        min-height: 44px;
        width: auto !important;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .search-inline input,
    .dashboard-date-filter label,
    .dashboard-close-form label,
    .calendar-filter label,
    .holiday-form input,
    .permission-search-form label {
        flex: 1 0 210px;
        min-width: 210px;
    }

    .history-filter-grid,
    .report-filter-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .history-filter-grid .filter-actions,
    .report-filter-grid .filter-actions {
        grid-column: 1;
    }

    .table-wrap {
        border: 1px solid rgba(207, 225, 236, .9);
        border-radius: 12px;
        background: #ffffff;
        overflow-x: auto;
        position: relative;
    }

    .data-table {
        min-width: 760px;
    }

    .data-table th:last-child,
    .data-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #ffffff;
        box-shadow: -10px 0 18px rgba(16, 32, 51, .08);
    }

    .data-table th:last-child {
        background: #f4f9fc;
        z-index: 3;
    }

    .row-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .icon-action {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .portal-topbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .portal-topbar nav {
        display: flex;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .portal-topbar nav a {
        flex: 0 0 auto;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
    }

    .portal-topbar > div:last-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .topbar {
        min-width: 0;
    }

    .topbar strong {
        max-width: calc(100vw - 132px);
    }

    .student-modal {
        width: calc(100vw - 18px) !important;
        max-height: calc(100dvh - 18px) !important;
        padding: 22px 16px 18px !important;
        border-radius: 14px !important;
    }

.modal-close {
    top: 12px !important;
    right: 12px !important;
}
}

/* Institutional public homepage */
.site-home-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 5%, rgba(8, 164, 210, .18), transparent 30%),
        radial-gradient(circle at 84% 12%, rgba(217, 181, 63, .12), transparent 28%),
        #06131c;
    color: #fff;
    font-family: Aptos, Inter, "Segoe UI", system-ui, sans-serif;
}

.site-top-strip {
    height: 34px;
    background: linear-gradient(90deg, #06131c, #0a3e5a 45%, #d9b53f);
    color: #f5fbff;
    font-size: 13px;
    font-weight: 800;
}

.site-top-inner {
    width: min(1000px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-home-body {
    overflow-x: hidden;
}

.site-top-inner b {
    font-weight: 950;
    margin-right: 5px;
}

.site-main-header {
    min-height: 102px;
    background:
        linear-gradient(90deg, rgba(6,19,28,.98), rgba(10,62,90,.96) 46%, rgba(40,87,149,.96)),
        linear-gradient(180deg, rgba(255,255,255,.06), transparent);
    border-bottom: 2px solid rgba(217, 181, 63, .9);
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

.site-header-inner {
    width: min(1000px, 100%);
    min-height: 102px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 26px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 292px;
    flex: 0 0 292px;
}

.site-brand img {
    width: 54px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
}

.site-brand strong {
    display: block;
    font-size: 27px;
    line-height: .92;
    font-weight: 950;
    color: #fff;
    letter-spacing: -.3px;
}

.site-brand small {
    display: block;
    margin-top: 7px;
    color: #ffdf2d;
    font-weight: 900;
    font-size: 13px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 900;
    color: #e8e8e8;
    white-space: nowrap;
    flex: 0 0 auto;
}

.site-nav span {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    color: #f5fbff;
    cursor: default;
}

.site-nav span:hover {
    color: #ffdf2d;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    margin-left: auto;
}

.site-pill {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 950;
    font-size: 13px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .18);
    cursor: default;
}

.site-pill.tech span {
    font-size: 15px;
    margin-right: 7px;
    line-height: 1;
}

.site-pill.tech {
    display: none;
    color: #fff;
    background: linear-gradient(135deg, #08a4d2, #285795);
    border: 1px solid rgba(217,181,63,.5);
    box-shadow: 0 10px 22px rgba(8,164,210,.22);
}

.site-pill.gold {
    color: #102033;
    background: linear-gradient(180deg, #ffdf2d, #d9b53f);
    cursor: pointer;
}

.site-hero {
    min-height: 590px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
}

.site-hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -3;
}

.site-hero-placeholder {
    background:
        linear-gradient(rgba(0,0,0,.58), rgba(0,0,0,.58)),
        radial-gradient(circle at 22% 26%, rgba(8,164,210,.35), transparent 32%),
        radial-gradient(circle at 84% 18%, rgba(217,181,63,.22), transparent 28%),
        linear-gradient(135deg, #07131b, #0a3e5a 58%, #285795);
}

.site-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 34%, rgba(8,164,210,.22), transparent 26%),
        linear-gradient(90deg, rgba(6,19,28,.86), rgba(7,35,52,.62), rgba(40,87,149,.72)),
        linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.78));
    z-index: -2;
}

.site-hero-content {
    width: min(900px, calc(100% - 32px));
    text-align: center;
    padding: 60px 0;
}

.site-hero-content p {
    margin: 0 0 18px;
    color: #f5fbff;
    font-size: 18px;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.site-hero-content h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(54px, 7.2vw, 84px);
    line-height: .95;
    font-weight: 950;
    text-shadow: 0 6px 12px rgba(0,0,0,.55);
}

.site-hero-content strong {
    display: block;
    margin: 28px auto 34px;
    color: #ffdf2d;
    font-size: clamp(16px, 2vw, 22px);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.site-hero-content a,
.student-portal a {
    display: inline-flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    padding: 0 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, #08a4d2, #285795);
    color: #fff;
    font-weight: 950;
    font-size: 17px;
    box-shadow: 0 16px 32px rgba(8,164,210,.25);
}

.site-section {
    background:
        linear-gradient(180deg, rgba(255,255,255,.02), transparent),
        radial-gradient(circle at 20% 0%, rgba(8,164,210,.16), transparent 32%),
        radial-gradient(circle at 80% 20%, rgba(217,181,63,.08), transparent 30%),
        #06131c;
    padding: 72px 24px;
    text-align: center;
}

.site-section h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 950;
    text-transform: uppercase;
    text-shadow: 0 3px 0 rgba(8,164,210,.45);
}

.site-underline {
    display: block;
    width: 68px;
    height: 4px;
    margin: 24px auto 34px;
    border-radius: 999px;
    background: linear-gradient(90deg, #08a4d2, #d9b53f, #285795);
    box-shadow: 0 0 18px rgba(8,164,210,.45);
}

.site-section > p {
    width: min(760px, 100%);
    margin: 0 auto;
    color: #fff;
    font-size: 17px;
    line-height: 1.65;
}

.site-feature-grid {
    width: min(1040px, 100%);
    margin: 42px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.site-feature-grid article {
    min-height: 180px;
    text-align: left;
    background:
        linear-gradient(180deg, rgba(12,75,110,.82), rgba(6,19,28,.96)),
        radial-gradient(circle at 20% 0%, rgba(217,181,63,.14), transparent 30%);
    border: 1px solid rgba(8,164,210,.36);
    border-top: 3px solid #d9b53f;
    padding: 24px;
    box-shadow: 0 18px 34px rgba(0,0,0,.2);
}

.site-feature-grid b {
    color: #ffcc00;
    font-size: 13px;
    letter-spacing: 2px;
}

.site-feature-grid h3 {
    margin: 12px 0 10px;
    font-size: 22px;
    color: #fff;
}

.site-feature-grid p {
    margin: 0;
    color: #d7d7d7;
    line-height: 1.55;
}

.site-slider {
    width: min(1060px, 100%);
    margin: 0 auto;
    position: relative;
    padding: 28px 52px 44px;
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(8,164,210,.2), rgba(40,87,149,.16)),
        rgba(6,31,45,.88);
    border: 1px solid rgba(8,164,210,.28);
    box-shadow: 0 34px 80px rgba(0,0,0,.45), inset 0 0 40px rgba(8,164,210,.08);
}

.site-slider-frame {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    border-radius: 20px;
    background: #07131b;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.site-slider figure {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transform: scale(.98);
    transition: opacity .35s ease, transform .35s ease;
}

.site-slider figure.active {
    opacity: 1;
    transform: scale(1);
}

.site-slider img,
.site-gallery-placeholder {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
}

.site-gallery-placeholder {
    display: grid;
    place-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(8,164,210,.25), rgba(217,181,63,.25)), #252525;
    color: #fff;
    font-weight: 900;
}

.site-gallery-placeholder img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.site-slider-btn {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(217,181,63,.55);
    background: rgba(10,62,90,.78);
    color: #fff;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
}

.site-slider-btn.prev { left: 0; }
.site-slider-btn.next { right: 0; }

.site-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.site-dots i {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #777;
}

.site-dots i.active {
    width: 28px;
    background: #d9b53f;
}

.student-portal a {
    margin-top: 30px;
    text-transform: uppercase;
}

.student-portal {
    padding-top: 90px;
}

.site-footer {
    min-height: 64px;
    display: grid;
    place-items: center;
    background: linear-gradient(90deg, #06131c, #0a3e5a 52%, #285795);
    color: #fff;
    font-weight: 800;
    text-align: center;
    padding: 16px;
}

@media (max-width: 980px) {
    .site-header-inner {
        position: static;
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 12px 0;
    }

    .site-brand {
        min-width: 0;
        flex: 1 1 100%;
    }

    .site-nav,
    .site-header-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .site-header-actions {
        margin-left: 0;
    }

    .site-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .site-top-strip {
        height: auto;
        padding: 8px 14px;
        gap: 10px;
        font-size: 12px;
    }

    .site-top-inner {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px 12px;
        justify-content: center;
        text-align: center;
    }

    .site-main-header {
        padding: 0 12px;
    }

    .site-header-inner {
        gap: 12px;
    }

    .site-brand img {
        width: 54px;
        height: 64px;
    }

    .site-brand strong {
        font-size: 20px;
    }

    .site-brand {
        gap: 12px;
        flex-basis: 100%;
    }

    .site-nav {
        gap: 8px;
        font-size: 12px;
    }

    .site-nav span {
        min-height: 36px;
        padding: 0 4px;
    }

    .site-header-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        overflow: visible;
    }

    .site-pill {
        width: 100%;
        min-height: 42px;
        padding: 0 14px;
        font-size: 12px;
    }

    .site-hero {
        min-height: 540px;
        padding-top: 18px;
    }

    .site-hero-content p {
        font-size: 13px;
        letter-spacing: 3px;
    }

    .site-hero-content h1 {
        font-size: clamp(38px, 12vw, 54px);
    }

    .site-hero-content strong {
        font-size: 14px;
        line-height: 1.45;
        letter-spacing: 1.2px;
    }

    .site-hero-content a,
    .student-portal a {
        width: 100%;
        max-width: 280px;
        min-height: 52px;
        padding: 0 20px;
        font-size: 15px;
    }

    .site-section {
        padding: 54px 16px;
    }

    .site-section h2 {
        font-size: clamp(28px, 9vw, 36px);
    }

    .site-slider {
        padding: 18px 16px 38px;
        border-radius: 20px;
        width: 100%;
    }

    .site-slider-frame {
        min-height: 260px;
        border-radius: 16px;
    }

    .site-slider img,
    .site-gallery-placeholder {
        min-height: 260px;
    }

    .site-slider-btn {
        width: 38px;
        height: 38px;
        font-size: 38px;
        background: rgba(10,62,90,.9);
    }

    .site-slider-btn.prev { left: 6px; }
    .site-slider-btn.next { right: 6px; }
}

@media (max-width: 380px) {
    .site-brand strong {
        font-size: 18px;
    }

    .site-brand img {
        width: 48px;
        height: 58px;
    }

    .site-hero-content {
        width: calc(100% - 24px);
    }

    .site-hero-content h1 {
        font-size: 34px;
    }

    .site-slider-frame,
    .site-slider img,
    .site-gallery-placeholder {
        min-height: 220px;
    }
}

@media (max-width: 460px) {
    .main-content {
        padding: 10px;
    }

    .page-header h1 {
        font-size: 21px;
    }

    .page-header p {
        font-size: 12px;
    }

    .student-header-actions .btn-light,
    .student-header-actions .btn-primary,
    .student-header-actions button,
    .export-actions a,
    .export-actions button,
    .form-actions .btn-primary,
    .form-actions .btn-light,
    .filter-actions .btn-primary,
    .filter-actions .btn-light,
    .scanner-actions .btn-outline,
    .scanner-actions button {
        min-width: 118px;
        padding-inline: 12px;
        font-size: 13px;
    }

    .search-inline input,
    .dashboard-date-filter label,
    .calendar-filter label,
    .holiday-form input,
    .permission-search-form label {
        flex-basis: 180px;
        min-width: 180px;
    }

    .data-table {
        min-width: 680px;
    }

    .icon-action {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
}
