/* ============================================================
   HỆ THỐNG QUẢN LÝ TRUNG TÂM DẠY THÊM - STYLESHEET v2.1
   Design system: tokens, components, responsive
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette */
    --bg-soft: #F4F6F9;
    --bg-elevated: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #FAFBFC;
    --border: #E4E8EF;
    --border-strong: #D2D9E3;
    --ink: #1B2430;
    --ink-soft: #3A4657;
    --muted: #6B7686;
    --accent: #3C5A78;
    --accent-hover: #2E4760;
    --accent-soft: rgba(60, 90, 120, 0.1);
    --success: #2E7D32;
    --success-soft: rgba(46, 125, 50, 0.1);
    --warning: #E8791A;
    --warning-soft: rgba(232, 121, 26, 0.12);
    --error: #C62828;
    --error-soft: rgba(198, 40, 40, 0.1);
    --info: #0277BD;
    --info-soft: rgba(2, 119, 189, 0.1);

    /* Shape */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(20, 30, 45, 0.04);
    --shadow-sm: 0 1px 3px rgba(20, 30, 45, 0.06), 0 1px 2px rgba(20, 30, 45, 0.04);
    --shadow-md: 0 4px 16px rgba(20, 30, 45, 0.08);
    --shadow-lg: 0 12px 36px rgba(20, 30, 45, 0.14);
    --shadow-focus: 0 0 0 3px rgba(60, 90, 120, 0.18);

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.15s var(--ease);
    --t: 0.22s var(--ease);
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(60, 90, 120, 0.07), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(2, 119, 189, 0.05), transparent 55%),
        var(--bg-soft);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeInUp 0.35s var(--ease);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== LOGIN SCREEN ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 3rem;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.45s var(--ease);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--info));
}

.eyebrow {
    display: inline-block;
    background: var(--accent-soft);
    border: 1px solid rgba(60, 90, 120, 0.16);
    border-radius: var(--radius-pill);
    padding: 0.375rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 2.5rem;
    line-height: 1.18;
    margin-bottom: 1rem;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.0625rem;
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.login-form {
    margin-bottom: 2rem;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--ink-soft);
}

.form-group input,
.form-group textarea,
.select-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    color: var(--ink);
    background: var(--surface);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.form-group input:hover,
.form-group textarea:hover,
.select-field:hover {
    border-color: var(--accent);
}

.form-group input:focus,
.form-group textarea:focus,
.select-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
    background: var(--surface);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.select-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7686' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.25rem;
}

.help-text {
    display: block;
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), border-color var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(180deg, #44648A, var(--accent));
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--accent), var(--accent-hover));
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background: #B71C1C;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #1B5E20;
}

.btn-accent {
    background: var(--info);
    color: #fff;
}

.btn-accent:hover {
    background: #01579B;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #C96712;
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 1rem;
    display: none;
    padding: 0.65rem 0.9rem;
    background: var(--error-soft);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--error);
}

.error-message.show {
    display: block;
    animation: fadeIn 0.2s var(--ease);
}

.demo-credentials {
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-strong);
}

.muted-text {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

/* ==================== NAVIGATION ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.9375rem;
    color: var(--muted);
    font-weight: 500;
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.875rem 1.35rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
    white-space: nowrap;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
}

.tab-btn:hover {
    color: var(--ink);
    background: rgba(60, 90, 120, 0.05);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
    background: linear-gradient(180deg, rgba(60, 90, 120, 0.06), transparent);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.28s var(--ease);
}

/* ==================== SECTION HEADERS ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.7rem;
    color: var(--ink);
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 3.4rem;
    height: 0.22rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, #3C5A78, #55A9D8, transparent);
    box-shadow: 0 2px 8px rgba(60, 90, 120, 0.24);
}

.subsection-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--ink);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.subsection-title::before {
    content: '';
    width: 0.3rem;
    height: 1.25rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, #55A9D8, #3C5A78);
    box-shadow: 0 2px 8px rgba(60, 90, 120, 0.22);
}

.section-spacer {
    margin: 2rem 0;
}

/* ==================== DASHBOARD ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 0.22rem;
    background: linear-gradient(90deg, var(--accent), #75BDE0);
}

.dashboard-card:nth-child(2)::before {
    background: linear-gradient(90deg, #2E7D32, #78C98A);
}

.dashboard-card:nth-child(3)::before {
    background: linear-gradient(90deg, #7654D9, #B19BF2);
}

.dashboard-card:nth-child(4)::before {
    background: linear-gradient(90deg, #E49310, #FFD267);
}

.dashboard-card:nth-child(5)::before {
    background: linear-gradient(90deg, #D65365, #F2A0AA);
}

.dashboard-card:nth-child(6)::before {
    background: linear-gradient(90deg, #1F9EBB, #82DCE8);
}

.dashboard-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    border: 1px solid transparent;
    pointer-events: none;
    transition: border-color var(--t);
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dashboard-card-title {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.dashboard-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.dashboard-card-icon.blue {
    background: var(--accent-soft);
    color: var(--accent);
}

.dashboard-card-icon.green {
    background: var(--success-soft);
    color: var(--success);
}

.dashboard-card-icon.orange {
    background: var(--warning-soft);
    color: var(--warning);
}

.dashboard-card-icon.red {
    background: var(--error-soft);
    color: var(--error);
}

.dashboard-card-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.dashboard-card-subtitle {
    font-size: 0.875rem;
    color: var(--muted);
}

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.alert {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    border-radius: var(--radius-sm);
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.alert:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.alert.warning {
    border-left-color: var(--warning);
    background: linear-gradient(180deg, #FFFBF6, var(--surface));
}

.alert.error {
    border-left-color: var(--error);
    background: linear-gradient(180deg, #FFF7F7, var(--surface));
}

.alert.info {
    border-left-color: var(--info);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.alert-content h5 {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.2rem;
    color: var(--ink);
}

.alert-content p {
    font-size: 0.875rem;
    color: var(--muted);
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
    display: flex;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .select-field {
    min-width: 180px;
    width: auto;
}

/* ==================== TABLES ==================== */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    box-shadow: var(--shadow-sm);
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, rgba(60, 90, 120, 0.22), rgba(228, 232, 239, 0.7)) border-box;
    border: 1px solid transparent;
}

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

.data-table thead {
    background: var(--surface-2);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 0.9rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9375rem;
    color: var(--ink-soft);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--t-fast);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(244, 246, 249, 0.5);
}

.data-table tbody tr:hover {
    background: var(--accent-soft);
}

.table-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.table-actions .btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
}

/* ==================== STATUS BADGES ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-soft);
    color: var(--muted);
    white-space: nowrap;
}

.status-badge.active,
.status-badge.paid {
    background: var(--success-soft);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(107, 118, 134, 0.12);
    color: var(--muted);
}

.status-badge.unpaid {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-badge.pending {
    background: var(--info-soft);
    color: var(--info);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 25, 35, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s var(--ease);
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.28s var(--ease);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 2;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--ink);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.close-btn:hover {
    background: var(--error-soft);
    color: var(--error);
    transform: rotate(90deg);
}

.modal-form {
    padding: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
}

.modal-actions .btn {
    flex: 1;
}

.payment-info {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.payment-info p {
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.payment-info p:last-child {
    margin-bottom: 0;
}

.amount-highlight {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

/* ==================== REPORT FILTERS & CONTENT ==================== */
.report-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.report-filters .select-field {
    width: auto;
    min-width: 120px;
}

.report-filters .btn {
    width: auto;
}

.report-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s var(--ease);
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, rgba(60, 90, 120, 0.38), rgba(85, 169, 216, 0.15), rgba(228, 121, 26, 0.25)) border-box;
    border: 1px solid transparent;
}

.report-empty {
    text-align: center;
    color: var(--muted);
    padding: 3rem;
    font-size: 0.9375rem;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.4rem;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.summary-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.summary-value.accent {
    color: var(--accent);
}

.summary-value.success {
    color: var(--success);
}

.summary-value.warning {
    color: var(--warning);
}

.summary-value.error {
    color: var(--error);
}

td.success {
    color: var(--success);
    font-weight: 600;
}

td.error {
    color: var(--error);
    font-weight: 600;
}

.report-detail {
    margin-top: 2rem;
}

.report-detail h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--ink);
}

/* ==================== ATTENDANCE ==================== */
.date-display {
    font-size: 0.9375rem;
    color: var(--muted);
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.4rem 1rem;
    text-transform: capitalize;
}

.class-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.class-selector label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.class-selector .select-field {
    flex: 1;
    min-width: 200px;
}

.attendance-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.attendance-empty {
    text-align: center;
    color: var(--muted);
    padding: 3rem;
    font-size: 0.9375rem;
}

.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.attendance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    gap: 1rem;
    flex-wrap: wrap;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.attendance-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}

.student-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    flex: 1;
    min-width: 150px;
}

.attendance-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.attendance-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
}

.attendance-btn:hover {
    background: var(--bg-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.attendance-btn.active.present {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.attendance-btn.active.absent-excuse {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
    box-shadow: 0 2px 8px rgba(232, 121, 26, 0.3);
}

.attendance-btn.active.absent {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
}

.save-attendance-btn {
    margin-top: 2rem;
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

.success-message {
    background: var(--success);
    color: #fff;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
    display: none;
}

.success-message.show {
    display: block;
    animation: popIn 0.3s var(--ease);
}

/* ==================== CHARTS ==================== */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t);
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, rgba(60, 90, 120, 0.55), rgba(85, 169, 216, 0.18), rgba(228, 121, 26, 0.35)) border-box;
    border: 1px solid transparent;
}

.chart-container::before {
    content: '';
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 0;
    height: 0.22rem;
    border-radius: 0 0 var(--radius-pill) var(--radius-pill);
    background: linear-gradient(90deg, #3C5A78, #55A9D8, #E49310);
    opacity: 0.9;
}

.chart-container::after {
    content: '';
    position: absolute;
    width: 12rem;
    height: 12rem;
    right: -6rem;
    top: -7rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(85, 169, 216, 0.11), transparent 68%);
    pointer-events: none;
}

.chart-container:hover {
    box-shadow: var(--shadow-md);
}

.chart-container canvas {
    max-height: 300px;
}

/* ==================== SETTINGS ==================== */
.settings-section {
    margin-bottom: 2.5rem;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

/* ==================== PRINT ==================== */
.print-receipt {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.print-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 1rem;
}

.print-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.print-info {
    margin: 1.5rem 0;
}

.print-info-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border-strong);
}

.print-info-label {
    font-weight: 600;
    color: var(--ink);
}

.print-total {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    text-align: center;
}

.print-total-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0.5rem 0;
}

.print-footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
}

.print-signature {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
}

.print-signature-box {
    text-align: center;
}

.print-signature-box p {
    margin-bottom: 3rem;
    font-weight: 600;
}

/* ==================== MOBILE APP HOME ==================== */
.mobile-home-head,
.mobile-bottom-nav {
    display: none;
}

/* Mobile markup must never leak into desktop if the responsive block is unavailable. */
.mobile-home-head,
.mobile-bottom-nav {
    visibility: hidden;
}

@media print {
    body * {
        visibility: hidden;
    }
    #printContent, #printContent *,
    #reportContent, #reportContent * {
        visibility: visible;
    }
    #printContent, #reportContent {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .print-receipt {
        padding: 0;
    }
    .modal-actions {
        display: none !important;
    }
    .data-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

/* Giao diện mobile dùng chung trên PC và điện thoại */
body {
    background: #F7F8FC;
}

.screen:not(#loginScreen) .navbar {
    display: none;
}

.screen:not(#loginScreen) .container > .tabs {
    display: none;
}

.remember-login {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: -0.15rem 0 1rem;
    color: var(--muted, #70798A);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.remember-login input {
    width: 1rem;
    height: 1rem;
    accent-color: #367EE5;
    cursor: pointer;
}

#adminScreen,
#teacherScreen {
    padding-bottom: 5.5rem;
}

.brand-logo {
    display: block;
    object-fit: contain;
}

.login-brand-logo {
    width: clamp(7.5rem, 24vw, 10.5rem);
    height: clamp(7.5rem, 24vw, 10.5rem);
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    filter: drop-shadow(0 10px 18px rgba(17, 49, 99, 0.14));
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.nav-brand-logo {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 50%;
    filter: drop-shadow(0 4px 8px rgba(17, 49, 99, 0.18));
}

.brand-name {
    color: #0B346B;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.brand-avatar {
    padding: 0.12rem;
    background: #fff;
    border: 2px solid rgba(49, 87, 213, 0.16);
    box-shadow: 0 6px 16px rgba(32, 56, 101, 0.18);
}

.teacher-avatar.brand-avatar {
    border-color: rgba(14, 165, 183, 0.2);
}

#adminScreen .container,
#teacherScreen .container {
    padding-top: 1rem;
}

.back-dashboard-btn {
    display: none;
    align-items: center;
    min-height: 2.75rem;
    margin: 0 0 1rem;
    padding: 0.7rem 1rem;
    border: 1px solid #D9E1EF;
    border-radius: 0.7rem;
    background: #FFFFFF;
    color: #2F6FBE;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(40, 54, 82, 0.06);
}

.back-dashboard-btn.visible {
    display: inline-flex;
}

.back-dashboard-btn:hover,
.back-dashboard-btn:focus-visible {
    background: #EAF2FF;
    border-color: #7EA9E8;
    outline: none;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.mobile-logout-btn {
    min-height: 2.5rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid #F0C7CD;
    border-radius: 0.65rem;
    background: #FFF5F6;
    color: #C83E51;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.mobile-logout-btn:hover,
.mobile-logout-btn:focus-visible {
    background: #FFE7EA;
    outline: none;
}

.mobile-home-head {
    display: block;
    visibility: visible;
    padding: 1.35rem 1rem 0.5rem;
}

.mobile-home-head:not(.mobile-home-visible) {
    display: none;
}

.mobile-home-head.mobile-home-visible {
    display: block;
}

.mobile-bottom-nav {
    display: grid;
}

.mobile-greeting {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .mobile-avatar {
        width: 3.1rem;
        height: 3.1rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        color: #fff;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        background: linear-gradient(145deg, #5A8EEA, #7257D6);
        box-shadow: 0 6px 16px rgba(76, 106, 205, 0.25);
    }

    .teacher-avatar {
        background: linear-gradient(145deg, #23B5C8, #2775D4);
    }

    .mobile-greeting > div:nth-child(2) {
        min-width: 0;
        flex: 1;
    }

    .mobile-kicker {
        display: block;
        color: #70798A;
        font-size: 0.75rem;
        line-height: 1.25;
        margin-bottom: 0.15rem;
    }

    .mobile-greeting h1 {
        color: #202533;
        font-family: 'Inter', sans-serif;
        font-size: 1.17rem;
        font-weight: 750;
        line-height: 1.25;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-icon-btn {
        border: 0;
        background: #fff;
        color: #596479;
        width: 2.65rem;
        height: 2.65rem;
        border-radius: 50%;
        font-size: 1.35rem;
        box-shadow: 0 4px 14px rgba(33, 48, 74, 0.08);
        cursor: pointer;
    }

    .mobile-status-card {
        min-height: 142px;
        border-radius: 1.45rem;
        padding: 1.25rem 1.15rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        color: #fff;
        overflow: hidden;
        position: relative;
        background:
            radial-gradient(circle at 88% 20%, rgba(70, 133, 216, 0.28), transparent 38%),
            linear-gradient(135deg, #10232D, #121416 65%, #050505);
        box-shadow: 0 12px 25px rgba(18, 29, 42, 0.16);
    }

    .mobile-status-card::after {
        content: '';
        position: absolute;
        width: 180px;
        height: 80px;
        right: 18%;
        bottom: -50px;
        border-top: 1px solid rgba(243, 184, 68, 0.55);
        transform: rotate(-12deg);
        pointer-events: none;
    }

    .mobile-status-card .mobile-kicker {
        color: rgba(255, 255, 255, 0.68);
    }

    .mobile-status-card strong {
        display: block;
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0.25rem 0;
    }

    .mobile-status-card small {
        display: block;
        max-width: 180px;
        color: rgba(255, 255, 255, 0.65);
        font-size: 0.72rem;
        line-height: 1.35;
    }

    .mobile-ring {
        width: 5.8rem;
        height: 5.8rem;
        border: 0.72rem solid rgba(255, 255, 255, 0.15);
        border-top-color: #FFBE11;
        border-right-color: #FFBE11;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        transform: rotate(22deg);
    }

    .mobile-ring span {
        transform: rotate(-22deg);
        font-size: 1rem;
        font-weight: 700;
    }

    .teacher-status-card {
        background:
            radial-gradient(circle at 88% 20%, rgba(36, 163, 202, 0.3), transparent 38%),
            linear-gradient(135deg, #112D38, #101A20 70%, #081014);
    }

    .teacher-ring {
        border-top-color: #39D39A;
        border-right-color: #39D39A;
    }

    .mobile-section-title {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        color: #202533;
        font-size: 1.28rem;
        font-weight: 750;
        margin: 1.45rem 0 0.85rem;
    }

    .mobile-section-title i {
        display: block;
        width: 0.3rem;
        height: 1.45rem;
        border-radius: 1rem;
        background: linear-gradient(#4F9AF4, #6C62D8);
    }

    .mobile-action-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.8rem;
    }

    .mobile-action {
        min-height: 130px;
        padding: 0.9rem 0.65rem 0.75rem;
        border: 1px solid rgba(225, 229, 238, 0.85);
        border-radius: 1.05rem;
        background: rgba(255, 255, 255, 0.88);
        box-shadow: 0 5px 16px rgba(40, 54, 82, 0.05);
        text-align: center;
        cursor: pointer;
        transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .mobile-action:active {
        transform: scale(0.97);
        box-shadow: 0 2px 8px rgba(40, 54, 82, 0.08);
    }

    .mobile-action-icon {
        width: 3.35rem;
        height: 3.35rem;
        margin: 0 auto 0.6rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 1.55rem;
        font-weight: 700;
    }

    .mobile-action-icon.blue { color: #2479E9; background: #E6F0FF; }
    .mobile-action-icon.purple { color: #7654D9; background: #EEE9FF; }
    .mobile-action-icon.orange { color: #E49310; background: #FFF3D6; }
    .mobile-action-icon.green { color: #1FA56E; background: #DDF8EA; }
    .mobile-action-icon.cyan { color: #1F9EBB; background: #DDF7FB; }
    .mobile-action-icon.red { color: #D65365; background: #FFE8EB; }

    .mobile-action b {
        display: block;
        color: #333A49;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .mobile-action small {
        display: block;
        color: #8A92A1;
        font-size: 0.68rem;
        margin-top: 0.18rem;
    }

    .mobile-bottom-nav {
        position: fixed;
        visibility: visible;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.7rem;
        min-height: 4.35rem;
        padding: 0.35rem;
        background: rgba(255, 255, 255, 0.91);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border: 1px solid rgba(225, 229, 237, 0.9);
        border-radius: 1.7rem;
        box-shadow: 0 9px 30px rgba(37, 49, 75, 0.16);
        z-index: 500;
    }

    .mobile-bottom-nav button {
        border: 0;
        border-radius: 1.35rem;
        background: transparent;
        color: #777F8E;
        font-family: 'Inter', sans-serif;
        font-size: 0.68rem;
        font-weight: 600;
        cursor: pointer;
    }

    .mobile-bottom-nav button span {
        display: block;
        font-size: 1.4rem;
        line-height: 1.2;
        margin-bottom: 0.15rem;
    }

    .mobile-bottom-nav button.active {
        color: #367EE5;
        background: #E7F0FF;
    }

    .login-card {
        padding: 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .nav-content {
        padding: 0 1rem;
    }

    .nav-title {
        font-size: 1.15rem;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .user-name {
        display: none;
    }

    .container {
        padding: 1rem;
    }

    .tabs {
        gap: 0.15rem;
        margin-bottom: 1.25rem;
    }

    .tab-btn {
        padding: 0.75rem 0.9rem;
        font-size: 0.85rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header .btn {
        width: 100%;
    }

    .section-title {
        font-size: 1.45rem;
    }

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

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

    .data-table th,
    .data-table td {
        padding: 0.7rem 0.75rem;
        font-size: 0.875rem;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: 94vh;
    }

    .modal-header,
    .modal-form {
        padding: 1.25rem;
    }

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

    .report-filters,
    .filter-bar {
        width: 100%;
    }

    .report-filters .select-field,
    .filter-bar .select-field {
        flex: 1 1 140px;
        min-width: 0;
    }

    .report-filters .btn,
    .filter-bar .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .report-content {
        padding: 1.25rem;
    }

    .class-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .class-selector .select-field {
        width: 100%;
    }

    .attendance-content {
        padding: 1.25rem;
    }

    .attendance-item {
        flex-direction: column;
        align-items: stretch;
    }

    .student-name {
        min-width: auto;
    }

    .attendance-buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .attendance-btn {
        width: 100%;
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }

    .settings-card {
        padding: 1.25rem;
    }

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.7rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .table-actions {
        flex-direction: column;
    }

    .table-actions .btn {
        width: 100%;
    }

    .attendance-buttons {
        grid-template-columns: 1fr;
    }

    .dashboard-card-value {
        font-size: 1.6rem;
    }

    .brand-name {
        display: none;
    }
}

/* Bản dựng admin/CTV: nâng trải nghiệm giao diện mà không đổi logic nghiệp vụ. */
#adminScreen,
#teacherScreen {
    --ui-primary: #3157D5;
    --ui-primary-dark: #2443AE;
    --ui-primary-soft: #EEF2FF;
    --ui-cyan: #0EA5B7;
    --ui-success: #16845B;
    --ui-danger: #C94357;
    --ui-ink: #172033;
    --ui-muted: #69758A;
    --ui-line: #E3E8F2;
    --ui-surface: rgba(255, 255, 255, 0.96);
    --ui-shadow-sm: 0 4px 14px rgba(30, 49, 83, 0.06);
    --ui-shadow-md: 0 14px 34px rgba(30, 49, 83, 0.09);
}

#adminScreen,
#teacherScreen {
    background:
        radial-gradient(circle at 8% 4%, rgba(49, 87, 213, 0.06), transparent 24rem),
        radial-gradient(circle at 94% 8%, rgba(14, 165, 183, 0.055), transparent 22rem),
        linear-gradient(180deg, #F8FAFF 0%, #F5F7FC 100%);
    min-height: 100vh;
    color: var(--ui-ink);
}

#adminScreen .container,
#teacherScreen .container {
    max-width: 1440px;
    margin-inline: auto;
}

#adminScreen .mobile-home-head,
#teacherScreen .mobile-home-head {
    max-width: 1440px;
    margin-inline: auto;
}

.mobile-home-head {
    padding-top: 1.6rem;
    padding-bottom: 0.75rem;
}

.mobile-greeting {
    margin-bottom: 1.35rem;
}

.mobile-greeting h1 {
    color: var(--ui-ink);
    text-shadow: none;
}

.mobile-kicker {
    color: var(--ui-muted);
}

.mobile-status-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 18px 40px rgba(20, 34, 58, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    background:
        radial-gradient(circle at 88% 18%, rgba(64, 145, 240, 0.3), transparent 36%),
        radial-gradient(circle at 10% 110%, rgba(56, 217, 174, 0.18), transparent 34%),
        linear-gradient(135deg, #0F2235 0%, #10192B 64%, #090E18 100%);
}

.mobile-status-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to right, transparent, black 50%, transparent);
    pointer-events: none;
}

.mobile-status-card strong {
    font-size: 1.32rem;
    letter-spacing: -0.02em;
}

.mobile-ring {
    box-shadow:
        0 0 0 10px rgba(255, 190, 17, 0.05),
        0 0 30px rgba(255, 190, 17, 0.14);
}

.teacher-status-card {
    background:
        radial-gradient(circle at 88% 18%, rgba(36, 163, 202, 0.34), transparent 36%),
        radial-gradient(circle at 12% 110%, rgba(67, 214, 160, 0.2), transparent 34%),
        linear-gradient(135deg, #0D2634 0%, #101A22 64%, #070C12 100%);
}

.mobile-section-title {
    color: var(--ui-ink);
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}

.mobile-action-grid {
    gap: 0.95rem;
}

.mobile-action {
    min-height: 132px;
    border: 1px solid rgba(227, 232, 242, 0.9);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
    box-shadow: var(--ui-shadow-sm);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.mobile-action:hover {
    transform: translateY(-3px);
    border-color: rgba(49, 87, 213, 0.18);
    box-shadow: var(--ui-shadow-md);
}

.mobile-action:active {
    transform: translateY(-1px) scale(0.99);
}

.mobile-action-icon {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 6px 14px rgba(45, 67, 112, 0.08);
}

.mobile-action-icon.blue {
    color: #1769D9;
    background: linear-gradient(145deg, #F1F6FF, #E3EDFF);
}

.mobile-action-icon.purple {
    color: #7049D8;
    background: linear-gradient(145deg, #F6F3FF, #E9E3FF);
}

.mobile-action-icon.orange {
    color: #D97706;
    background: linear-gradient(145deg, #FFF8E7, #FFF0C9);
}

.mobile-action-icon.green {
    color: #16845B;
    background: linear-gradient(145deg, #EEFBF5, #DCF6EB);
}

.mobile-action-icon.cyan {
    color: #087E91;
    background: linear-gradient(145deg, #EEFBFE, #DCF5FA);
}

.mobile-action-icon.red {
    color: #C94357;
    background: linear-gradient(145deg, #FFF2F4, #FFE4E9);
}

.mobile-action b {
    color: #202B40;
    font-size: 0.92rem;
    font-weight: 750;
}

.mobile-action small {
    color: #7A8598;
    font-size: 0.7rem;
}

.mobile-bottom-nav {
    border: 1px solid rgba(220, 226, 239, 0.94);
    box-shadow:
        0 16px 42px rgba(27, 42, 70, 0.16),
        0 2px 8px rgba(27, 42, 70, 0.06);
}

.mobile-bottom-nav button {
    min-height: 3.65rem;
    border-radius: 1.25rem;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.mobile-bottom-nav button:hover {
    color: var(--ui-primary);
    background: rgba(49, 87, 213, 0.055);
}

.mobile-bottom-nav button.active {
    color: var(--ui-primary);
    background:
        linear-gradient(145deg, rgba(49, 87, 213, 0.11), rgba(49, 87, 213, 0.07));
    box-shadow: inset 0 0 0 1px rgba(49, 87, 213, 0.1);
}

.back-dashboard-btn {
    border-color: rgba(49, 87, 213, 0.16);
    background:
        linear-gradient(145deg, #FFFFFF, #F5F8FF);
    color: var(--ui-primary);
    box-shadow: var(--ui-shadow-sm);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.back-dashboard-btn:hover,
.back-dashboard-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(49, 87, 213, 0.34);
    box-shadow: var(--ui-shadow-md);
}

.section-title {
    color: var(--ui-ink);
    font-size: clamp(1.45rem, 2vw, 1.75rem);
    letter-spacing: -0.03em;
}

.section-header {
    gap: 1rem;
}

.report-filters,
.filter-bar,
.class-selector {
    padding: 0.75rem;
    border: 1px solid var(--ui-line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--ui-shadow-sm);
}

.report-filters .select-field,
.filter-bar .select-field,
.class-selector .select-field,
.report-filters input[type='date'],
.section-header input[type='date'] {
    min-height: 2.75rem;
    border-color: #D8DFEC;
    background-color: #FFFFFF;
    font-weight: 600;
}

.report-filters .select-field:hover,
.filter-bar .select-field:hover,
.class-selector .select-field:hover,
.report-filters input[type='date']:hover,
.section-header input[type='date']:hover {
    border-color: rgba(49, 87, 213, 0.42);
}

.report-filters .btn,
.filter-bar .btn {
    min-height: 2.75rem;
    box-shadow: none;
}

.dashboard-grid {
    gap: 1rem;
}

.dashboard-card {
    border: 1px solid var(--ui-line);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 255, 0.96));
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    border-color: rgba(49, 87, 213, 0.18);
    box-shadow: var(--ui-shadow-md);
}

.dashboard-card-value {
    color: #172033;
    letter-spacing: -0.035em;
}

.dashboard-card-subtitle {
    color: #748096;
}

.summary-card,
.report-summary .summary-card {
    border: 1px solid var(--ui-line);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(249, 250, 255, 0.96));
    box-shadow: var(--ui-shadow-sm);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ui-shadow-md);
}

.summary-label {
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.055em;
    font-size: 0.72rem;
    font-weight: 750;
}

.summary-value {
    color: #172033;
    letter-spacing: -0.025em;
}

.table-container {
    border: 1px solid var(--ui-line);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
}

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

.data-table thead {
    background:
        linear-gradient(145deg, #F8FAFF, #F2F5FC);
}

.data-table th {
    color: #566176;
    font-size: 0.76rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    border-bottom-color: var(--ui-line);
}

.data-table td {
    color: #29354B;
    border-bottom-color: rgba(227, 232, 242, 0.76);
}

.data-table tbody tr {
    transition:
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.data-table tbody tr:hover {
    background:
        linear-gradient(90deg, rgba(49, 87, 213, 0.045), rgba(49, 87, 213, 0.018));
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.table-actions .btn {
    min-height: 2.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    box-shadow: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: 0.28rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: none;
}

.status-badge.paid,
.status-badge.active,
.status-badge.present,
.status-badge.success {
    border-color: rgba(22, 132, 91, 0.14);
    background: rgba(22, 132, 91, 0.09);
    color: #14734F;
}

.status-badge.unpaid,
.status-badge.inactive,
.status-badge.absent,
.status-badge.error,
.status-badge.closed {
    border-color: rgba(201, 67, 87, 0.14);
    background: rgba(201, 67, 87, 0.08);
    color: #B3354A;
}

.status-badge.absent-excuse,
.status-badge.open,
.status-badge.warning {
    border-color: rgba(217, 119, 6, 0.16);
    background: rgba(217, 119, 6, 0.09);
    color: #A85F05;
}

.status-badge.info {
    border-color: rgba(49, 87, 213, 0.14);
    background: rgba(49, 87, 213, 0.08);
    color: var(--ui-primary);
}

.btn {
    min-height: 2.7rem;
    padding: 0.65rem 1.05rem;
    border-radius: 0.72rem;
    font-size: 0.88rem;
    letter-spacing: -0.01em;
    text-shadow: none;
    box-shadow: none;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background:
        linear-gradient(145deg, #3C64E0, var(--ui-primary-dark));
    border-color: rgba(36, 67, 174, 0.25);
}

.btn-primary:hover {
    background:
        linear-gradient(145deg, #3157D5, #1E3998);
}

#changeAdminPasswordModal .admin-save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    background: #3157D5;
    border: 1px solid #2443AE;
    color: #FFFFFF;
    font-weight: 750;
    opacity: 1;
    visibility: visible;
}

#changeAdminPasswordModal .admin-save-button:hover,
#changeAdminPasswordModal .admin-save-button:focus-visible {
    background: #2443AE;
    color: #FFFFFF;
}

.btn-secondary {
    background: #FFFFFF;
    border-color: #D8DFEC;
    color: #4D5A70;
}

.btn-secondary:hover {
    background: #F6F8FD;
    border-color: rgba(49, 87, 213, 0.36);
    color: var(--ui-primary);
}

.btn-success {
    background:
        linear-gradient(145deg, #1F9A6C, #137553);
    border-color: rgba(19, 117, 83, 0.2);
}

.btn-success:hover {
    background:
        linear-gradient(145deg, #16845B, #0E6547);
}

.btn-danger {
    background:
        linear-gradient(145deg, #D64D61, #B8354A);
    border-color: rgba(184, 53, 74, 0.2);
}

.btn-danger:hover {
    background:
        linear-gradient(145deg, #C94357, #A62E41);
}

.btn-accent {
    background:
        linear-gradient(145deg, #1FA3B7, #0B7788);
    border-color: rgba(11, 119, 136, 0.2);
}

.btn-accent:hover {
    background:
        linear-gradient(145deg, #1592A5, #075F6E);
}

.btn-warning {
    background:
        linear-gradient(145deg, #E79412, #C87500);
    border-color: rgba(200, 117, 0, 0.2);
}

.btn-warning:hover {
    background:
        linear-gradient(145deg, #D9870A, #A85F00);
}

.modal-content {
    border: 1px solid rgba(225, 230, 241, 0.96);
    background: #FFFFFF;
    box-shadow:
        0 30px 80px rgba(20, 33, 56, 0.22),
        0 8px 22px rgba(20, 33, 56, 0.08);
    overflow: hidden;
}

.modal-header {
    background:
        linear-gradient(145deg, #FAFBFF, #F4F7FE);
    border-bottom: 1px solid var(--ui-line);
}

.modal-header h3 {
    color: var(--ui-ink);
    letter-spacing: -0.02em;
}

.modal-actions {
    gap: 0.65rem;
}

.form-group input,
.form-group textarea,
.form-group select,
.select-field {
    border-color: #D8DFEC;
    background-color: #FFFFFF;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover,
.select-field:hover {
    border-color: rgba(49, 87, 213, 0.42);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.select-field:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.11);
    background: #FFFFFF;
}

.form-group input:disabled,
.form-group select:disabled,
.select-field:disabled {
    cursor: not-allowed;
    color: #7A8598;
    background: #F3F5F9;
    border-color: #E3E8F2;
}

.attendance-content {
    border: 1px solid var(--ui-line);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
    border-radius: 1rem;
    overflow: hidden;
}

.attendance-item {
    border: 1px solid var(--ui-line);
    background: #FFFFFF;
    box-shadow: none;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.attendance-item:hover {
    transform: translateY(-1px);
    border-color: rgba(49, 87, 213, 0.2);
    box-shadow: var(--ui-shadow-sm);
}

.attendance-btn {
    min-height: 2.65rem;
    border: 1px solid #DCE3EF;
    background: #FAFBFE;
    color: #5C6880;
    box-shadow: none;
    transition:
        color 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        transform 0.16s ease;
}

.attendance-btn:hover {
    transform: translateY(-1px);
}

.attendance-btn.active.present,
.attendance-btn.present.active {
    border-color: rgba(22, 132, 91, 0.3);
    background: rgba(22, 132, 91, 0.11);
    color: #14734F;
}

.attendance-btn.active.absent,
.attendance-btn.absent.active {
    border-color: rgba(201, 67, 87, 0.3);
    background: rgba(201, 67, 87, 0.1);
    color: #B3354A;
}

.attendance-btn.active.absent-excuse,
.attendance-btn.absent-excuse.active {
    border-color: rgba(217, 119, 6, 0.3);
    background: rgba(217, 119, 6, 0.1);
    color: #A85F05;
}

.report-empty {
    padding: 2.4rem 1rem;
    border: 1px dashed #D5DCE9;
    border-radius: 1rem;
    background:
        linear-gradient(145deg, rgba(248, 250, 255, 0.96), rgba(255, 255, 255, 0.96));
    color: var(--ui-muted);
    text-align: center;
    font-weight: 600;
}

.success-message {
    border: 1px solid rgba(22, 132, 91, 0.16);
    background: rgba(22, 132, 91, 0.075);
    color: #14734F;
}

.error-message {
    border: 1px solid rgba(201, 67, 87, 0.16);
    background: rgba(201, 67, 87, 0.07);
    color: #B3354A;
}

.settings-card {
    border: 1px solid var(--ui-line);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}

.chart-container {
    border: 1px solid var(--ui-line);
    background: #FFFFFF;
    box-shadow: var(--ui-shadow-sm);
}

.chart-container::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--ui-primary), var(--ui-cyan));
}

.chart-container canvas {
    display: block;
    max-width: 100%;
}

.settings-card,
.report-content,
.report-detail,
.attendance-content,
.table-container,
.dashboard-card,
.summary-card,
.chart-container {
    border-radius: 1rem;
}

.mobile-bottom-nav button:focus-visible,
.mobile-action:focus-visible,
.back-dashboard-btn:focus-visible,
.btn:focus-visible,
.select-field:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
    outline: 3px solid rgba(49, 87, 213, 0.22);
    outline-offset: 2px;
}

@keyframes uiFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    animation: uiFadeIn 0.24s ease both;
}

.mobile-action,
.dashboard-card,
.summary-card {
    will-change: transform;
}

@media (min-width: 769px) {
    .mobile-home-head {
        max-width: 1440px;
        margin-inline: auto;
        padding-inline: 1.5rem;
    }

    .mobile-action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .report-filters,
    .filter-bar {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .report-filters .select-field,
    .filter-bar .select-field,
    .report-filters input[type='date'],
    .section-header input[type='date'] {
        flex: 1 1 150px;
        width: auto;
    }

    .report-filters .btn,
    .filter-bar .btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 120px;
    }

    .attendance-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .attendance-item {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .attendance-item .student-name {
        flex: 1 1 260px;
        min-width: 0;
    }

    .attendance-buttons {
        flex: 1 1 420px;
    }
}

@media (min-width: 1025px) {
    .mobile-action-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .mobile-action {
        min-height: 142px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .report-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .section-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .section-header .btn {
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-action,
    .dashboard-card,
    .summary-card,
    .attendance-item,
    .attendance-btn,
    .btn,
    .tab-content.active,
    .mobile-bottom-nav button {
        transition-duration: 0.01ms;
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
    }
}
