:root {
    /* Color Palette - Premium Corporate/Educational Blue */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #4f46e5;
    --secondary-hover: #4338ca;
    --teams-blue: #4650b6;
    --teams-blue-hover: #3b449b;
    --sky-blue: #0ea5e9;
    --sky-blue-hover: #0284c7;
    --mint-green: #10b981;
    --mint-green-hover: #059669;
    --mint-bg: #ecfdf5;
    --web-gradient: linear-gradient(135deg, #4f46e5, #7c3aed);
    --app-gradient: linear-gradient(135deg, #4650b6, #6264a7);
    --fallback-gradient: linear-gradient(135deg, #0ea5e9, #38bdf8);

    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 25px -5px rgb(79 70 229 / 0.2), 0 8px 10px -6px rgb(79 70 229 / 0.2);
    
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Utilities */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-ghost {
    color: var(--text-muted);
}
.btn-ghost:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.btn-primary {
    background: var(--web-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--bg-body);
}

.btn-outline {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-xl {
    padding: 14px 24px;
    font-size: 1.0625rem;
    font-weight: 800;
    border-radius: var(--radius-lg);
    width: 100%;
}
.btn-lg {
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 700;
    width: 100%;
    border-radius: var(--radius-md);
}
.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 8px;
}

/* Specific button styles */
#btn-join-teams-web {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

#btn-join-teams-web:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

#btn-join-teams-app {
    background: var(--teams-blue);
    color: white;
    border: none;
}

#btn-join-teams-app:hover {
    background: var(--teams-blue-hover);
    filter: brightness(1.1);
}

#btn-join-teams-fallback {
    background: var(--sky-blue);
    color: white;
    border: none;
}

#btn-join-teams-fallback:hover {
    background: var(--sky-blue-hover);
    filter: brightness(1.1);
}

#btn-show-credentials {
    background: var(--mint-green);
    color: white;
    border: none;
}
#btn-show-credentials:hover {
    background: var(--mint-green-hover);
    filter: brightness(1.1);
}
#btn-show-credentials.active {
    background: #059669;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.btn-icon {
    padding: 8px;
    border-radius: 50%;
    background-color: white;
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
}
.btn-icon:hover {
    color: var(--primary);
}

/* Layout Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}
.logo-text span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* View 1: Selector */
.selector-container {
    padding: 40px 24px;
    flex: 1;
}

.selector-header {
    text-align: center;
    margin-bottom: 40px;
}
.selector-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.selector-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.level-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.level-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.level-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.level-card .card-icon {
    width: 64px;
    height: 64px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.level-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.selector-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* View 2: Dashboard */
/* View 2: Dashboard Redesign - Centered 2-Line Header */
.dashboard-top {
    padding: 32px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: transparent;
}

.btn-back {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
    transition: all 0.2s;
    z-index: 5;
}
.btn-back:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.dashboard-breadcrumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.dashboard-breadcrumb .program-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-breadcrumb .ri-arrow-right-s-line {
    display: none !important;
}

.dashboard-breadcrumb .level-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

@media (max-width: 600px) {
    .dashboard-top {
        padding: 40px 16px 24px; /* More top padding for back button space on small screens if needed */
    }
    .dashboard-breadcrumb .level-title {
        font-size: 1.5rem;
    }
    .btn-back {
        top: 24px;
        transform: none;
    }
}

.dashboard-layout {
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

/* Hero Status Card */
.card-hero {
    padding: 32px;
    text-align: center;
    background: linear-gradient(to right bottom, #ffffff, #f8fafc);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.status-badge.has-class {
    background-color: var(--mint-bg);
    color: var(--mint-green);
    border: none;
}
.status-badge.no-class {
    background-color: var(--border-color);
    color: var(--text-muted);
}

.hero-time {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.hero-meta {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

#meeting-manual-info {
    margin-top: 24px;
    padding: 16px;
    background: #f0f7ff;
    border: 1px dashed var(--primary);
    border-radius: var(--radius-lg);
    width: 100%;
}

.meeting-id-pass {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.copy-field {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 12px;
    font-size: 0.9375rem;
}

.copy-field .field-label {
    color: #475569;
    font-weight: 500;
}

.copy-field code {
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-copy {
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 2px 4px;
    transition: all 0.2s;
}

.btn-copy:hover {
    color: var(--primary-hover);
    filter: brightness(0.8);
}

.mini-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8125rem;
    z-index: 9999;
    animation: toastFade 2s forwards;
}

@keyframes toastFade {
    0% { opacity: 0; transform: translate(-50%, 10px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    align-items: center;
    width: 100%;
}

.action-sub-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    width: 100%;
}

@media (max-width: 480px) {
    .action-sub-buttons {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    #btn-show-credentials {
        grid-column: span 1;
    }
}

/* TKB Join Actions */
.join-actions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.table-actions, .mobile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.btn-join-tkb {
    background: var(--primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
    transition: all 0.2s;
}

.btn-join-tkb:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-backup-link {
    background: #f1f5f9;
    color: #475569 !important;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.btn-backup-link:hover {
    background: white;
    border-color: var(--teams-blue);
    color: var(--teams-blue) !important;
    transform: translateY(-1px);
}

.btn-backup-link i {
    font-size: 1rem;
}

.btn-backup-link.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Info Cards */
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #fafbfc;
}
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}
.card-header i {
    color: var(--primary);
}
.card-body {
    padding: 20px;
}

.rules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.rules-list li i {
    color: var(--success);
    font-size: 1.1rem;
    margin-top: 2px;
}

.support-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.s-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}
.s-label { color: var(--text-muted); }
.s-value { font-weight: 500; color: var(--text-main); }
.support-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Desktop Schedule Table */
.desktop-schedule-section {
    padding: 24px 0 0 0;
    margin-top: 0;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section-header h3 {
    font-size: 1.25rem;
}
.schedule-filters {
    display: flex;
    background: var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
}
.filter-tab {
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}
.filter-tab.active {
    background-color: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}
.schedule-table {
    width: 100%;
    border-collapse: collapse;
}
.schedule-table th, .schedule-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.schedule-table th {
    background-color: #fafbfc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.schedule-table tr:last-child td {
    border-bottom: none;
}
.schedule-table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Status Badges in table */
.badge-sm {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-upcoming { background: var(--bg-body); color: var(--text-muted); border: 1px solid var(--border-color); }
.badge-ready { background: var(--success-bg); color: var(--success); }
.badge-ongoing { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; animation: pulse 2s infinite; }
.badge-finished { background: #f1f5f9; color: #64748b; }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Mobile Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    align-items: flex-end;
    overscroll-behavior: none;
    touch-action: none;
}
.modal-overlay.active {
    display: flex;
}
.modal-overlay.active:has(.modal-center) {
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-content {
    background: var(--bg-surface);
    width: 100%;
    height: 85vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}
.modal-content.modal-center {
    height: auto;
    max-width: 400px;
    border-radius: 24px;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.confirm-icon {
    width: 64px;
    height: 64px;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
}
.text-center { text-align: center; }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 1.125rem; font-weight: 600; }
.btn-close-modal { font-size: 24px; color: var(--text-muted); }
.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* Schedule Card Mobile */
/* Mobile Schedule Row Styles (Compact) */
.mobile-schedule-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}
.mobile-schedule-row:last-child { border-bottom: none; }
.msr-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.msr-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.msr-time-inline { font-size: 0.85rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 4px; }
.msr-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.3;
}

.msr-action { flex-shrink: 0; }

.badge-temp {
    background-color: #fff3bf;
    color: #e67700;
    border: 1px solid #ffe066;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}
@keyframes pulse-yellow {
    0% { box-shadow: 0 0 0 0 rgba(255, 224, 102, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 224, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 224, 102, 0); }
}
.badge-temp { animation: pulse-yellow 2s infinite; }

@media (max-width: 600px) {
    /* Global Space & Overflow Fixes - Further Compact */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .selector-container { padding: 12px 10px; }
    .selector-header { margin-bottom: 16px; }
    .selector-header h2 { font-size: 1.25rem; }
    .selector-header p { font-size: 0.875rem; }
    
    .dashboard-top { padding: 16px 10px; }
    .btn-back { top: 10px; left: 10px; width: 32px; height: 32px; font-size: 16px; }
    .dashboard-breadcrumb .program-title { font-size: 0.75rem; }
    .dashboard-breadcrumb .level-title { font-size: 1.1rem; }
    
    .dashboard-layout { 
        padding: 0 8px; 
        gap: 6px; /* Reduced gap */
        display: flex;
        flex-direction: column;
    }

    /* FLATTEN HIERARCHY FOR INTERLEAVED ORDERING */
    .layout-main-col, 
    .layout-side-col, 
    .action-buttons-group {
        display: contents; 
    }

    /* Robust Component Ordering - Reduced margins */
    .card-rules { order: 1; margin-bottom: 6px; }
    .card-hero { order: 2; padding: 16px 12px; margin-bottom: 6px; }
    .status-badge { margin-bottom: 8px; padding: 4px 12px; font-size: 0.75rem; }
    .hero-time { font-size: 1.4rem; }
    .hero-title { font-size: 1rem; }
    
    #btn-join-teams-web { 
        order: 3; 
        padding: 12px; 
        font-size: 1rem;
        margin-bottom: 6px;
        width: 100%;
        border-radius: var(--radius-lg);
    }
    
    .action-sub-buttons {
        order: 4;
        margin-bottom: 8px;
    }
    
    #meeting-manual-info { 
        order: 5; 
        margin-top: 0 !important; 
        margin-bottom: 12px;
        width: 100%;
        padding: 12px;
    }
    
    #btn-view-schedule { 
        display: flex !important; 
        order: 6; 
        margin-bottom: 12px;
        width: 100%;
        padding: 12px;
        font-size: 0.95rem;
        border-radius: var(--radius-lg);
    }
    
    .card-support { order: 7; margin-bottom: 12px; }

    /* Level Selector Fix: 2 columns without overflow */
    .level-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
    }
    .level-card {
        padding: 10px 6px;
        gap: 6px;
        min-width: 0;
        border-radius: var(--radius-lg);
    }
    .level-card .card-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .level-card h3 {
        font-size: 0.85rem;
    }
    .level-card p {
        display: none;
    }
    .level-card .btn {
        font-size: 0.7rem;
        padding: 4px 6px;
    }

    /* Compact UI elements */
    .card-header { padding: 8px 12px; }
    .card-header h3 { font-size: 0.85rem; }
    .card-body { padding: 10px; }
    .rules-list { gap: 6px; }
    .rules-list li { font-size: 0.8rem; }
    
    .desktop-schedule-section { display: none !important; }
    .app-footer { margin-top: 12px; padding: 16px 10px; }
    .footer-text { font-size: 0.7rem; }
}



/* Multi-Supporter Styles */
.support-info-list {
    display: flex;
    flex-direction: column;
}
.supporter-item {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}
.supporter-item:first-child {
    padding-top: 0;
}
.supporter-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.supporter-item .s-name {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}
.supporter-item .s-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 10px;
}
.supporter-item .support-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.supporter-item .btn {
    padding: 6px 4px;
    font-size: 0.75rem;
    height: 32px;
}
/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    padding: 32px 24px;
    margin-top: 40px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.footer-logo i {
    color: var(--primary);
    font-size: 1.25rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--text-light);
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.btn-backup-link.btn-app-color {
    background: #eef2ff !important;
    color: var(--teams-blue) !important;
    border: 1px solid #c7d2fe !important;
}
.btn-backup-link.btn-app-color:hover {
    background: var(--teams-blue) !important;
    color: white !important;
}

.btn-backup-link.btn-sky-color {
    background: #f0f9ff !important;
    color: var(--sky-blue) !important;
    border: 1px solid #bae6fd !important;
}
.btn-backup-link.btn-sky-color:hover {
    background: var(--sky-blue) !important;
    color: white !important;
}

/* --- Attendance Modal & Form Styles --- */
#modal-attendance .modal-content {
    max-width: 480px; /* Hơi rộng hơn chút cho thoải mái */
    height: auto;
    border-radius: 20px;
}

#form-attendance .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Custom Autocomplete Suggestions */
.autocomplete-results {
    position: absolute;
    top: calc(100% + 5px);
    left: -10px;    /* Cho tràn qua trái chút cho rộng */
    right: -10px;   /* Cho tràn qua phải chút cho rộng */
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    max-height: 250px;
    overflow-y: auto;
    display: none; /* Ẩn mặc định */
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.autocomplete-results.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.btn-role-select:hover {
    border-color: var(--primary) !important;
    background-color: #f8fafc !important;
    transform: translateY(-2px);
}
.btn-back-role:hover {
    background: #e2e8f0 !important;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: row;
    justify-content: flex-start; /* Sát vào nhau */
    align-items: center;
    gap: 8px; /* Gap nhỏ */
    transition: all 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f0f7ff;
    padding-left: 16px;
}

.autocomplete-item .student-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
    white-space: nowrap;
}

.autocomplete-item .student-dob {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.autocomplete-item .student-dob::before {
    content: "(";
}
.autocomplete-item .student-dob::after {
    content: ")";
}

.autocomplete-item.is-blocked .student-name {
    text-decoration: line-through;
    opacity: 0.5;
}

.autocomplete-item.is-blocked .student-dob {
    opacity: 0.5;
}

.autocomplete-item .student-class {
    font-size: 0.75rem;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 500;
}
/* --- Success Feedback Overlay --- */
.attendance-success-overlay {
    text-align: center;
    padding: 24px 16px;
    animation: fadeIn 0.3s ease-out;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.success-msg {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.countdown-timer {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    padding: 8px 16px;
    background: var(--primary-light);
    border-radius: 20px;
    display: inline-block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Chrome/Safari/Edge Date Picker consistency */
input[type="date"]::-webkit-calendar-picker-indicator {
 cursor: pointer;
 filter: invert(0.4);
}

@media (max-width: 600px) {
    #modal-attendance.modal-overlay.active {
        align-items: flex-end !important;
        padding: 0 !important;
    }
    #modal-attendance .modal-content {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        animation: slideUp 0.3s ease !important;
        padding-bottom: 24px;
    }
}

/* --- Attendance Modal Expanded Styles --- */
.attendance-modal-expanded {
    max-width: 550px !important;
}

#form-attendance .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

#form-attendance .form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
}

#form-attendance .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

#form-attendance .required {
    color: #ef4444;
    margin-left: 2px;
}

@media (max-width: 480px) {
    #form-attendance .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
