/* Alpha Attendance - Editorial/Startup Aesthetic */

:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #22222e;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    --accent: #0066ff;
    --accent-hover: #0052cc;
    --accent-soft: rgba(0, 102, 255, 0.15);
    
    --present: #00d46a;
    --present-soft: rgba(0, 212, 106, 0.15);
    --tardy: #ffb800;
    --tardy-soft: rgba(255, 184, 0, 0.15);
    --absent: #ff4757;
    --absent-soft: rgba(255, 71, 87, 0.15);
    --unmarked: #606070;
    --unmarked-soft: rgba(96, 96, 112, 0.15);
    
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-display: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --nav-width: 240px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8f8fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f5;
    --bg-elevated: #ffffff;
    
    --text-primary: #0a0a0f;
    --text-secondary: #505060;
    --text-muted: #909098;
    
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* App Layout */
#app {
    display: flex;
    min-height: 100vh;
}

/* Navigation */
.nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--nav-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.brand-mark {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-link.active svg {
    stroke: var(--accent);
}

.nav-link svg {
    flex-shrink: 0;
    transition: stroke var(--transition-fast);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-top: auto;
    align-self: flex-start;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }

[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--nav-width);
    padding: 32px 40px;
    min-height: 100vh;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

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

.view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
}

.view-title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.view-date {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(0, 102, 255, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-danger {
    background: var(--absent-soft);
    color: var(--absent);
}

.btn-danger:hover {
    background: var(--absent);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Dashboard Stats */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-present .stat-icon {
    background: var(--present-soft);
    color: var(--present);
}

.stat-tardy .stat-icon {
    background: var(--tardy-soft);
    color: var(--tardy);
}

.stat-absent .stat-icon {
    background: var(--absent-soft);
    color: var(--absent);
}

.stat-unmarked .stat-icon {
    background: var(--unmarked-soft);
    color: var(--unmarked);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Dashboard Class Sections - Inline Attendance */
.class-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.class-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.class-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.class-section-header:hover {
    background: var(--bg-tertiary);
}

.class-section-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.class-section-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

.class-section-count {
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 100px;
}

.class-section-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.class-mini-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.class-mini-stat .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.class-mini-stat .dot.present { background: var(--present); }
.class-mini-stat .dot.tardy { background: var(--tardy); }
.class-mini-stat .dot.absent { background: var(--absent); }

.class-section-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.class-section.expanded .class-section-toggle {
    transform: rotate(180deg);
}

.class-section-body {
    display: none;
    border-top: 1px solid var(--border);
}

.class-section.expanded .class-section-body {
    display: block;
}

.class-section-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.inline-attendance-list {
    padding: 8px;
}

.inline-attendance-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.inline-attendance-row:hover {
    background: var(--bg-tertiary);
}

.inline-attendance-row.marked {
    position: relative;
}

.inline-attendance-row.marked::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 32px;
    border-radius: 2px;
}

.inline-attendance-row.present::before { background: var(--present); }
.inline-attendance-row.tardy::before { background: var(--tardy); }
.inline-attendance-row.absent::before { background: var(--absent); }

.inline-student-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.inline-student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.inline-student-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inline-attendance-buttons {
    display: flex;
    gap: 8px;
}

.inline-status-btn {
    width: 52px;
    height: 52px;
    border: 2px solid var(--border);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.inline-status-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: scale(1.05);
}

.inline-status-btn:active {
    transform: scale(0.95);
}

.inline-status-btn.present-btn:hover,
.inline-status-btn.present-btn.active {
    background: var(--present-soft);
    border-color: var(--present);
    color: var(--present);
}

.inline-status-btn.tardy-btn:hover,
.inline-status-btn.tardy-btn.active {
    background: var(--tardy-soft);
    border-color: var(--tardy);
    color: var(--tardy);
}

.inline-status-btn.absent-btn:hover,
.inline-status-btn.absent-btn.active {
    background: var(--absent-soft);
    border-color: var(--absent);
    color: var(--absent);
}

/* Success animation for attendance buttons */
@keyframes checkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.inline-status-btn.just-marked {
    animation: checkPulse 0.3s ease;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.inline-status-btn .ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    animation: ripple 0.4s ease-out;
    pointer-events: none;
}

.inline-status-btn.present-btn .ripple { background: var(--present); }
.inline-status-btn.tardy-btn .ripple { background: var(--tardy); }
.inline-status-btn.absent-btn .ripple { background: var(--absent); }

/* Class Cards for old layout */
.class-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.class-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.class-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.class-card:hover::before {
    transform: scaleX(1);
}

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.class-card-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

.class-card-schedule {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 100px;
}

.class-card-stats {
    display: flex;
    gap: 16px;
}

.class-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.class-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.class-stat-dot.present { background: var(--present); }
.class-stat-dot.tardy { background: var(--tardy); }
.class-stat-dot.absent { background: var(--absent); }
.class-stat-dot.students { background: var(--accent); }

/* Classes Grid */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.class-manage-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-base);
}

.class-manage-card:hover {
    border-color: var(--border-strong);
}

.class-manage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.class-manage-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
}

.class-manage-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.icon-btn.danger:hover {
    background: var(--absent-soft);
    color: var(--absent);
    border-color: var(--absent);
}

.class-manage-schedule {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.class-manage-students {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.student-chip {
    font-size: 13px;
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 100px;
    color: var(--text-secondary);
}

/* Students List */
.students-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: all var(--transition-fast);
}

.student-row:hover {
    border-color: var(--border-strong);
}

.student-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.student-info {
    flex: 1;
    min-width: 0;
}

.student-name {
    font-weight: 600;
    font-size: 16px;
}

.student-classes {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.student-actions {
    display: flex;
    gap: 8px;
}

/* Attendance List (legacy) */
.attendance-container {
    max-width: 800px;
}

.class-selector {
    margin-bottom: 32px;
}

.select-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.select-input {
    width: 100%;
    max-width: 400px;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a0a0b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.select-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.attendance-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    transition: all var(--transition-fast);
}

.attendance-row.present { border-left: 4px solid var(--present); }
.attendance-row.tardy { border-left: 4px solid var(--tardy); }
.attendance-row.absent { border-left: 4px solid var(--absent); }

.attendance-student {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.attendance-name {
    font-weight: 500;
}

.attendance-buttons {
    display: flex;
    gap: 8px;
}

.status-btn {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.status-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.status-btn.present-btn:hover,
.status-btn.present-btn.active {
    background: var(--present-soft);
    border-color: var(--present);
    color: var(--present);
}

.status-btn.tardy-btn:hover,
.status-btn.tardy-btn.active {
    background: var(--tardy-soft);
    border-color: var(--tardy);
    color: var(--tardy);
}

.status-btn.absent-btn:hover,
.status-btn.absent-btn.active {
    background: var(--absent-soft);
    border-color: var(--absent);
    color: var(--absent);
}

.status-btn:active {
    transform: scale(0.9);
}

.attendance-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Reports */
.reports-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-inputs span {
    color: var(--text-muted);
}

.date-input {
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.date-input:focus {
    outline: none;
    border-color: var(--accent);
}

.report-summary {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.summary-chart {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.summary-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.summary-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.summary-stat-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
}

.summary-stat-value.present { color: var(--present); }
.summary-stat-value.tardy { color: var(--tardy); }
.summary-stat-value.absent { color: var(--absent); }

.report-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.report-table th,
.report-table td {
    padding: 16px 20px;
    text-align: left;
}

.report-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.report-table td {
    border-bottom: 1px solid var(--border);
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.rate-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.rate-badge.excellent {
    background: var(--present-soft);
    color: var(--present);
}

.rate-badge.good {
    background: var(--tardy-soft);
    color: var(--tardy);
}

.rate-badge.poor {
    background: var(--absent-soft);
    color: var(--absent);
}

/* Empty State - Improved */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 24px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.empty-state-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Onboarding Overlay */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.onboarding-overlay.active {
    opacity: 1;
    visibility: visible;
}

.onboarding-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-slow);
}

.onboarding-overlay.active .onboarding-modal {
    transform: scale(1) translateY(0);
}

.onboarding-header {
    text-align: center;
    padding: 40px 32px 32px;
    border-bottom: 1px solid var(--border);
}

.onboarding-brand {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 800;
    color: var(--accent);
    display: block;
    margin-bottom: 16px;
}

.onboarding-header h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.onboarding-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.onboarding-step {
    display: none;
    padding: 32px;
}

.onboarding-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
}

.step-num.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.step-num.done {
    background: var(--present);
    border-color: var(--present);
    color: white;
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
}

.step-line.active {
    background: var(--present);
}

.onboarding-step h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.step-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.onboarding-textarea {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    resize: vertical;
    line-height: 1.6;
}

.onboarding-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.onboarding-textarea::placeholder {
    color: var(--text-muted);
}

.onboarding-form {
    margin-bottom: 24px;
}

.onboarding-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-hint {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    resize: vertical;
    line-height: 1.5;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

/* Tabs for add student modal */
.form-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.form-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-tab:hover {
    color: var(--text-primary);
}

.form-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.form-tab-content {
    display: none;
}

.form-tab-content.active {
    display: block;
}

.bulk-preview {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
}

.bulk-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.bulk-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-preview-item {
    font-size: 13px;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 100px;
    color: var(--text-primary);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checkbox-item:hover {
    border-color: var(--border-strong);
}

.checkbox-item.selected {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.checkbox-item input {
    display: none;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

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

/* Toast - Enhanced with Undo */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--present);
}

.toast.error {
    border-left: 4px solid var(--absent);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-weight: 500;
}

.toast-undo {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.toast-undo:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-summary {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --nav-width: 0px;
    }
    
    .nav {
        width: 100%;
        height: auto;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        flex-direction: row;
        padding: 8px 12px;
        border-right: none;
        border-top: 1px solid var(--border);
        background: var(--bg-secondary);
    }
    
    .nav-brand {
        display: none;
    }
    
    .nav-links {
        flex-direction: row;
        flex: 1;
        justify-content: space-around;
        gap: 0;
    }
    
    .nav-link {
        flex-direction: column;
        gap: 4px;
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .nav-link span {
        display: block;
    }
    
    .theme-toggle {
        display: none;
    }
    
    .main {
        margin-left: 0;
        padding: 20px 16px 100px;
    }
    
    .view-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .view-title {
        font-size: 32px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .classes-grid,
    .class-list {
        grid-template-columns: 1fr;
    }
    
    /* Mobile inline attendance */
    .class-section-header {
        padding: 16px;
    }
    
    .class-section-stats {
        display: none;
    }
    
    .inline-attendance-row {
        flex-wrap: wrap;
        padding: 12px;
    }
    
    .inline-student-info {
        width: 100%;
        margin-bottom: 12px;
    }
    
    .inline-attendance-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .inline-status-btn {
        flex: 1;
        height: 56px;
        max-width: none;
    }
    
    .class-section-actions {
        flex-wrap: wrap;
    }
    
    .class-section-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .attendance-row {
        flex-wrap: wrap;
    }
    
    .attendance-buttons {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .status-btn {
        width: 56px;
        height: 56px;
    }
    
    .reports-filters {
        flex-direction: column;
        gap: 16px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .report-table {
        font-size: 14px;
    }
    
    .report-table th,
    .report-table td {
        padding: 12px;
    }
    
    .modal {
        max-width: 100%;
        margin: 16px;
        border-radius: var(--radius-lg);
    }
    
    .onboarding-modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .onboarding-header {
        padding: 32px 24px 24px;
    }
    
    .onboarding-brand {
        font-size: 40px;
    }
    
    .onboarding-header h1 {
        font-size: 24px;
    }
    
    .onboarding-step {
        padding: 24px;
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 90px;
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .date-inputs {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-inputs span {
        display: none;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--accent);
    color: white;
}

/* Help Button */
/* Top Bar */
.top-bar {
    position: fixed;
    top: 16px;
    right: 24px;
    z-index: 90;
}

.help-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 16px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
}

.help-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Help Modal Overlay */
.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.help-overlay.active {
    opacity: 1;
    visibility: visible;
}

.help-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition-base);
}

.help-overlay.active .help-modal {
    transform: scale(1);
}

.help-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.help-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.help-header {
    text-align: center;
    padding: 32px 24px 24px;
    border-bottom: 1px solid var(--border);
}

.help-brand {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 12px;
}

.help-header h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.help-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-section {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.help-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}

.help-icon.attendance-icons {
    gap: 4px;
    padding: 8px;
}

.help-icon .mini-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.help-icon .mini-btn.present {
    background: var(--present-soft);
    color: var(--present);
}

.help-icon .mini-btn.tardy {
    background: var(--tardy-soft);
    color: var(--tardy);
}

.help-icon .mini-btn.absent {
    background: var(--absent-soft);
    color: var(--absent);
}

.help-text h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.help-text p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.help-footer {
    padding: 16px 24px 24px;
    text-align: center;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-shadow: var(--shadow-md);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    pointer-events: none;
    max-width: 200px;
}

.tooltip.active {
    opacity: 1;
    visibility: visible;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-elevated);
}

/* First Visit Pulse Animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 102, 255, 0);
    }
}

.first-visit-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

.class-section.first-visit-highlight .class-section-header {
    animation: pulse-glow 2s ease-in-out 3;
}

/* Nav button pulse on first visit */
.nav-link.first-visit-pulse {
    animation: pulse-glow 2s ease-in-out 3;
}

/* Help button pulse for first visit */
.help-btn.first-visit-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}
