:root {
    --bg: #0b0f19;
    --card-bg: #151d2f;
    --card-bg-elevated: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --secondary: #f43f5e;
    --secondary-hover: #e11d48;
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-bg: rgba(16, 185, 129, 0.12);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.14);
    --error-border: rgba(239, 68, 68, 0.35);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family:
        'Outfit',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    background-image:
        radial-gradient(
            circle at 10% 20%,
            rgba(56, 189, 248, 0.05) 0%,
            transparent 40%
        ),
        radial-gradient(
            circle at 90% 80%,
            rgba(16, 185, 129, 0.05) 0%,
            transparent 40%
        );
}

#app {
    max-width: 780px;
    margin: 0 auto;
    padding: 16px 20px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Navigation Bar */
.app-nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

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

.brand-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-tag {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-actions {
    display: flex;
    background: var(--card-bg);
    padding: 4px;
    border-radius: 9999px;
    border: 1px solid var(--border);
}

.nav-pill {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-pill.active {
    background: var(--primary);
    color: #000;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.4);
}

.nav-pill-logout {
    color: var(--text-muted);
}

.nav-pill-logout:hover {
    color: var(--secondary);
    background: rgba(244, 63, 94, 0.12);
}

/* Hamburger Toggle Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 10px;
    gap: 5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.hamburger-btn:hover,
.hamburger-btn:focus-visible {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.hamburger-bar {
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition:
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger-btn.is-open .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.is-open .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.is-open .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Menu Dropdown */
.mobile-nav-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(240px, calc(100vw - 28px));
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    z-index: 1000;
    animation: menuSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.mobile-nav-item.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.mobile-nav-item .mobile-nav-icon {
    flex-shrink: 0;
    stroke: currentColor;
}

.mobile-nav-item.active .mobile-nav-icon {
    stroke: var(--primary);
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

.mobile-nav-logout {
    color: var(--secondary);
}

.mobile-nav-logout:hover,
.mobile-nav-logout:focus-visible {
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
}

/* Views & Animation */
.view {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

.hidden {
    display: none !important;
}

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

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

/* Dropzone */
.dropzone-card {
    padding: 24px;
    background: linear-gradient(
        180deg,
        var(--card-bg) 0%,
        rgba(21, 29, 47, 0.7) 100%
    );
}

.dropzone {
    border: 2px dashed rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.02);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    outline: none;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.07);
    transform: scale(1.008);
}

.dropzone.drag-over {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.dropzone-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.dropzone-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.browse-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.dropzone-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
}

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

.sample-btn {
    font-size: 0.9rem;
    padding: 10px 20px;
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--primary);
}

.sample-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--primary);
}

.upload-status {
    text-align: center;
    padding: 20px 0 10px;
}

#upload-status-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 10px;
}

/* Summary Card */
.summary-card {
    background: linear-gradient(135deg, #182338 0%, #111827 100%);
    border-color: rgba(56, 189, 248, 0.2);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.summary-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.summary-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.cost-badge {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.stat-card.stat-success .stat-value {
    color: var(--accent);
}

.stat-card.stat-alert .stat-value {
    color: var(--error);
}

.stat-card.stat-discount .stat-value {
    color: #a78bfa;
}

/* Cycles Toolbar */
.cycles-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 32px 0 16px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cycle-filter-pills {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 3px;
}

.filter-pill {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill.active {
    background: rgba(56, 189, 248, 0.2);
    color: var(--primary);
}

/* Cycle Report Cards */
.cycle-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px;
    margin-bottom: 18px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cycle-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.cycle-card.has-too-early {
    border-color: rgba(239, 68, 68, 0.3);
}

.cycle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.cycle-date-range {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.cycle-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.cycle-summary-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.counted-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
}

.counted-badge .num {
    font-size: 1.25rem;
    font-weight: 800;
}

/* User's Exact Requirement: In Red */
.too-early-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
    animation: pulseAlert 2s infinite ease-in-out;
}

@keyframes pulseAlert {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.25);
    }
}

.too-early-icon {
    font-size: 1.1rem;
}

/* Cycle Financials */
.cycle-financials {
    display: flex;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    gap: 16px 24px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.fin-item {
    display: flex;
    flex-direction: column;
}

.fin-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.fin-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.fin-val.discount {
    color: var(--accent);
}

.fin-val.payment {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.05rem;
}

/* Session Accordion */
.cycle-details-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.cycle-details-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.sessions-accordion {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.88rem;
    transition: background 0.15s;
}

.session-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.session-row.is-invalid {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--error);
}

.session-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.session-date-time {
    font-weight: 600;
    color: #fff;
}

.session-studio {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.session-status-tag {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
}

.session-row.is-orange {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
}

.session-status-tag.tag-counted {
    background: var(--accent-bg);
    color: var(--accent);
}

.session-status-tag.tag-orange {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.session-status-tag.tag-too-early {
    background: var(--error-bg);
    color: var(--error);
}

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

/* Forms & Inputs */
.input-group {
    margin-bottom: 16px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-wrapper input[type='text'] {
    padding-right: 48px;
}

.hidden-date-picker {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    overflow: hidden;
}

.date-picker-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    color: var(--text-muted);
}

.date-picker-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

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

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-big {
    padding: 24px;
    font-size: 1.15rem;
    margin-bottom: 14px;
    border-radius: var(--radius-lg);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.btn-text:hover {
    background: rgba(56, 189, 248, 0.1);
}

.error-msg {
    color: var(--error);
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    padding: 10px;
    background: var(--error-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--error-border);
}

.error-msg:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Auth Card */
.auth-card {
    max-width: 440px;
    margin: 40px auto;
}

.auth-header {
    text-align: center;
    margin: 16px 0 24px;
}

.auth-header h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

/* Live Tracker / Dashboard Styles */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.status-card {
    text-align: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    margin-top: 10px;
}

.status-time {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 12px 0;
    color: var(--primary);
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.status-time.timer-passed {
    color: var(--accent);
}

.success-card {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent);
    text-align: center;
}

.success-card .icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.nav-tabs {
    display: flex;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--card-bg-elevated);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* History Styles */
.month-group {
    margin-bottom: 24px;
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.month-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.payment-tag {
    background: var(--accent);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.record-item {
    background: var(--card-bg);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

.record-date {
    font-weight: 600;
}

.record-duration {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.record-checkout-time {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.8;
}

.loader {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 16px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.modal-warning {
    color: var(--secondary);
    font-weight: 600;
    margin-top: 12px;
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    #app {
        padding: 12px 14px 30px;
    }

    .desktop-nav {
        display: none !important;
    }

    .hamburger-btn {
        display: flex;
    }

    .app-nav {
        padding: 12px 0 16px;
        margin-bottom: 20px;
    }

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

    .dropzone {
        padding: 28px 16px;
    }

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

    .cycle-card {
        padding: 16px;
    }

    .cycle-date-range {
        font-size: 1.05rem;
    }
}

/* Config Page Styles */
.config-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(56, 189, 248, 0.2);
    padding: 28px;
    max-width: 540px;
    margin: 0 auto;
}

.input-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

input[type='date'] {
    color-scheme: dark;
}

.success-msg {
    color: var(--accent);
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    padding: 10px;
    background: rgba(16, 185, 129, 0.14);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.success-msg:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* ==========================================================================
   Step Cards & Upload Flow
   ========================================================================== */

.upload-flow-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.step-card {
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.step-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.step-badge {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(56, 189, 248, 0.08) 100%);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.step-header-text {
    flex: 1;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.step-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Attendance Calendar Widget
   ========================================================================== */

.cal {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    user-select: none;
    -webkit-user-select: none;
}

.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cal-navs {
    display: flex;
    gap: 6px;
}

.cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.cal-nav:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.cal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.cal-count {
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.cal-count.is-empty {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: var(--border);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    text-align: center;
}

.cal-weekday {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.cal-weekday:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.cal-weekday:disabled {
    cursor: default;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    touch-action: none;
    position: relative;
}

.cal-day {
    position: relative;
    aspect-ratio: 1;
    min-width: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    padding: 2px;
}

.cal-day:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.cal-day:disabled {
    opacity: 0.22;
    cursor: not-allowed;
    background: transparent;
}

.cal-day.is-placeholder {
    visibility: hidden;
    pointer-events: none;
    border: none;
    background: none;
}

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

.cal-day.is-selected {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #0b0f19;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

.cal-day.is-selected.joins-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.cal-day.is-selected.joins-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.cal-day.just-changed {
    animation: cellPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cellPop {
    0% { transform: scale(0.92); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.cal-day-num {
    font-size: 0.88rem;
    line-height: 1;
}

.cal-day-mark {
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 2px;
}

.cal-cycle-dot {
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 4px var(--primary);
}

.cal-day.is-selected .cal-cycle-dot {
    background: #0b0f19;
    box-shadow: none;
}

/* Comparison Statuses */
.cal-day.st-verified {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.35) 100%);
    border-color: var(--accent);
    color: #34d399;
}

.cal-day.st-not-counted {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.3) 100%);
    border-color: #f59e0b;
    color: #fbbf24;
}

.cal-day.st-missing {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25) 0%, rgba(225, 29, 72, 0.38) 100%);
    border-color: var(--secondary);
    color: #fda4af;
    animation: subtleShake 3s infinite ease-in-out;
}

.cal-day.st-unmarked {
    background: rgba(56, 189, 248, 0.08);
    border: 1px dashed var(--primary);
    color: var(--primary);
}

.cal-day.st-pending {
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed var(--text-muted);
    color: var(--text-muted);
}

.cal-day.is-dimmed {
    opacity: 0.18 !important;
}

.cal-day.is-inspected {
    box-shadow: 0 0 0 3px #ffffff, 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    z-index: 10;
}

@keyframes subtleShake {
    0%, 90%, 100% { transform: translateX(0); }
    92% { transform: translateX(-2px); }
    96% { transform: translateX(2px); }
}

.cal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

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

.cal-action {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cal-action:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--border-strong);
}

.cal-action:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cal-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.cal-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 1px 4px;
    font-family: inherit;
    font-size: 0.72rem;
}

/* Popover in Calendar */
.cal-popover {
    position: absolute;
    width: min(290px, calc(100% - 20px));
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 100;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cal-popover-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cal-popover-date {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.cal-popover-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.cal-popover-close:hover {
    color: var(--text);
}

.cal-popover-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.cal-popover-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

[data-status="verified"] .cal-popover-status { color: var(--accent); background: var(--accent-bg); }
[data-status="not-counted"] .cal-popover-status { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }
[data-status="missing"] .cal-popover-status { color: var(--secondary); background: var(--error-bg); }
[data-status="unmarked"] .cal-popover-status { color: var(--primary); background: rgba(56, 189, 248, 0.15); }
[data-status="pending"] .cal-popover-status { color: var(--text-muted); background: rgba(255, 255, 255, 0.08); }

.cal-popover-msg {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 10px;
}

.cal-popover-sessions {
    list-style: none;
    margin-bottom: 10px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}

.cal-popover-sessions li {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    color: var(--text);
}

.cal-popover-action {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cal-popover-action:hover {
    background: var(--primary);
    color: #0b0f19;
}

/* ==========================================================================
   Verification Summary Section & Bank Comparison
   ========================================================================== */

.verification-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-out;
}

.verification-card {
    background: linear-gradient(135deg, #162035 0%, #0d1527 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: 24px;
}

.verify-hero-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.verify-gauge {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.verify-gauge svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.verify-gauge-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.gauge-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.gauge-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 3px;
}

.verify-headline-wrap {
    flex: 1;
    min-width: 200px;
}

.verify-headline {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 6px;
}

.verify-headline.has-missing {
    color: #fb7185;
}

.verify-headline.all-good {
    color: #34d399;
}

.verify-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Bank Charge Callout Box */
.bank-compare-box {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.bank-compare-box.is-overcharged {
    border-color: rgba(244, 63, 94, 0.4);
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.bank-compare-box.is-matched {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.bank-compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bank-compare-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bank-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.bank-item {
    display: flex;
    flex-direction: column;
}

.bank-item-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.bank-item-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

.bank-item-value.overcharge {
    color: #fb7185;
}

.bank-item-value.matched {
    color: #34d399;
}

/* Filter Chips */
.verify-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.verify-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.verify-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.verify-chip.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.verify-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.verify-chip-dot.dot-verified { background: var(--accent); }
.verify-chip-dot.dot-not-counted { background: #f59e0b; }
.verify-chip-dot.dot-missing { background: var(--secondary); }
.verify-chip-dot.dot-unmarked { background: var(--primary); }
.verify-chip-dot.dot-pending { background: var(--text-muted); }

/* Verification Calendar Card */
.verification-calendar-card {
    padding: 20px 24px;
}

.verify-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.verify-cal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.verify-cal-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Cycle Card Verification Enhancements */
.cycle-verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
}

.cycle-verify-badge.badge-good {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cycle-verify-badge.badge-alert {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

.cycle-bank-reconcile {
    background: rgba(244, 63, 94, 0.08);
    border-left: 3px solid var(--secondary);
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 12px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.cycle-bank-reconcile .reconcile-text {
    color: #fda4af;
    font-weight: 600;
}

.cycle-bank-reconcile .reconcile-val {
    font-weight: 800;
    color: #fff;
}

.session-row.is-missing {
    background: rgba(244, 63, 94, 0.1);
    border-left: 3px solid var(--secondary);
}

.session-row.is-missing .session-date-time {
    color: #fda4af;
}

.session-status-tag.tag-missing {
    background: var(--error-bg);
    color: #fda4af;
    border: 1px solid var(--error-border);
}

