:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --primary-bg: #eef2ff;
    --success: #10b981;
    --success-light: #34d399;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-bg: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --gray-50: #1e293b;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --primary-bg: rgba(79,70,229,.2);
    --success-bg: rgba(16,185,129,.2);
    --warning-bg: rgba(245,158,11,.2);
    --danger-bg: rgba(239,68,68,.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background .3s, color .3s;
}

.hidden { display: none !important; }

/* ===== TITLEBAR ===== */
.titlebar {
    height: 40px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    -webkit-app-region: drag;
    user-select: none;
    flex-shrink: 0;
}

.titlebar-drag {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
}

.titlebar-icon { font-size: 18px; }
.titlebar-text { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.titlebar-btns {
    display: flex;
    -webkit-app-region: no-drag;
}

.tb-btn {
    width: 44px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}

.tb-btn:hover { background: var(--gray-100); color: var(--text); }
.tb-close:hover { background: var(--danger); color: #fff; }
.tb-theme { font-size: 16px; }

/* ===== TIME BAR ===== */
.time-bar {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 20px 24px;
    flex-shrink: 0;
}

.time-bar-inner { max-width: 900px; margin: 0 auto; }

.time-bar-content {
    display: flex;
    align-items: center;
    gap: 32px;
}

.time-bar-left { flex: 0 0 auto; }

.time-bar-label {
    font-size: 12px;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.time-bar-big {
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.time-bar-divider {
    width: 1px;
    height: 50px;
    background: rgba(255,255,255,.2);
}

.time-bar-right {
    display: flex;
    gap: 24px;
}

.time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-item-label {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    margin-bottom: 4px;
}

.time-item-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.time-item-value.warning { color: #fbbf24; }

/* ===== RESERVE BANNER ===== */
.reserve-banner {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    padding: 14px 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(239,68,68,.3);
    animation: bannerPulse 2s infinite;
}

.banner-pulse {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: dotPulse 1s infinite;
}

@keyframes bannerPulse {
    0%, 100% { box-shadow: 0 10px 25px rgba(239,68,68,.3); }
    50% { box-shadow: 0 10px 35px rgba(239,68,68,.5); }
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(1.2); }
}

/* ===== TIMER FLOAT ===== */
.timer-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    padding: 14px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(239,68,68,.3);
    transition: transform .2s;
}

.timer-float:hover { transform: scale(1.05); }

.float-pulse {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: dotPulse 1s infinite;
}

.float-time {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.float-hint { font-size: 12px; opacity: .8; }

/* ===== MAIN ===== */
.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 32px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* ===== NAV TABS ===== */
.nav-tabs {
    display: flex;
    gap: 4px;
    margin: 16px 0;
    padding: 4px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.nav-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all .2s;
}

.nav-tab:hover { color: var(--primary); background: var(--primary-bg); }
.nav-tab.active { background: var(--primary); color: #fff; box-shadow: var(--shadow); }

/* ===== PANELS ===== */
.panel { display: none; animation: fadeIn .3s ease; }
.panel.active { display: block; }

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

/* ===== CARD ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: background .3s, border-color .3s;
}

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

.card-h {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

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

/* ===== DUAL TIMER ===== */
.timer-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.timer-card {
    text-align: center;
    padding: 28px 20px;
    position: relative;
    overflow: hidden;
}

.timer-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.study-timer .timer-type-badge { background: var(--primary-bg); color: var(--primary); }
.game-timer .timer-type-badge { background: var(--warning-bg); color: var(--warning); }

.study-btn .timer-btn-ring { border-color: var(--primary); }
.study-btn .timer-btn-inner { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

.game-btn .timer-btn-ring { border-color: var(--warning); }
.game-btn .timer-btn-inner.game-inner { background: linear-gradient(135deg, var(--warning), var(--warning-light)); }

.timer-btn.running .timer-btn-inner.game-inner {
    background: linear-gradient(135deg, var(--danger), #ef4444);
}

.game-color { color: var(--warning); }
.game-color.running { color: var(--danger); }

/* ===== STATS CARD ===== */
.stats-card { padding: 20px 24px; }

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

.stat-item {
    text-align: center;
    padding: 16px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all .2s;
}

.stat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon { font-size: 24px; margin-bottom: 8px; }

.stat-value {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.study-stat .stat-value { color: var(--primary); }
.game-stat .stat-value { color: var(--warning); }
.score-stat .stat-value { color: var(--success); }
.reward-stat .stat-value { color: var(--primary); }

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== GAME FLOAT ===== */
.game-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    background: linear-gradient(135deg, var(--warning), var(--warning-light));
    color: #fff;
    padding: 14px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(245,158,11,.3);
    transition: transform .2s;
}

.game-float:hover { transform: scale(1.05); }

.float-game-icon { font-size: 20px; }

.game-stop-body { text-align: center; }

.game-stop-time {
    font-size: 48px;
    font-weight: 800;
    color: var(--warning);
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
}

.stop-detail {
    text-align: left;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.stop-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--border);
}

.stop-row:last-child { border-bottom: none; }

.stop-row.highlight {
    font-weight: 600;
    color: var(--text);
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid var(--border);
    border-bottom: none;
}

@media (max-width: 900px) {
    .timer-dual { grid-template-columns: 1fr; }
}

/* ===== SIMULATOR ===== */
.sim-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.sim-form {
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.sim-result {
    margin-top: 16px;
}

.sim-report {
    padding: 8px;
}

.sim-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.sim-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.sim-section h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.sim-params {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sim-param {
    text-align: center;
}

.param-label {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.param-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.sim-calc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-600);
}

.calc-formula {
    font-family: monospace;
    color: var(--text);
}

.sim-rewards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reward-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-600);
    padding: 8px 12px;
    background: var(--card);
    border-radius: var(--radius-xs);
}

.reward-row.penalty {
    background: var(--danger-bg);
    color: var(--danger);
}

.reward-total {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    padding: 12px;
    background: var(--primary-bg);
    border-radius: var(--radius-xs);
}

.total-value {
    color: var(--primary);
}

.sim-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-600);
}

.progress-row.highlight {
    font-weight: 600;
    color: var(--text);
}

.cap-hit {
    color: var(--success);
    font-size: 16px;
}

.progress-threshold {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-300);
    margin-top: 8px;
}

.threshold-met {
    color: var(--success);
    font-weight: 600;
    margin-left: 8px;
}

.threshold-not {
    color: var(--gray-400);
    margin-left: 8px;
}

.sim-reserve {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reserve-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-600);
}

.sim-summary {
    margin-top: 16px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
}

.summary-item.success {
    background: var(--success-bg);
    color: var(--success);
}

.summary-item.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.summary-icon {
    font-size: 24px;
}

.timer-main { margin-bottom: 24px; }

.timer-huge {
    font-size: 72px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: color .3s;
}

.timer-huge.running {
    color: var(--danger);
    animation: timerPulse 1.5s infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

.timer-msg {
    font-size: 14px;
    color: var(--gray-500);
    margin: 12px 0 24px;
}

.timer-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    margin: 0 auto;
    transition: transform .3s;
}

.timer-btn:hover { transform: scale(1.05); }

.timer-btn-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid var(--primary);
    opacity: .2;
    transition: opacity .3s;
}

.timer-btn.running .timer-btn-ring {
    border-color: var(--danger);
    opacity: .3;
    animation: ringPulse 2s infinite;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: .3; }
    50% { transform: scale(1.08); opacity: .1; }
}

.timer-btn-inner {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(79,70,229,.3);
    transition: all .3s;
}

.timer-btn.running .timer-btn-inner {
    background: linear-gradient(135deg, var(--danger), #ef4444);
    box-shadow: 0 4px 15px rgba(239,68,68,.3);
}

.timer-btn-icon { font-size: 28px; }
#timerBtnText { font-size: 12px; font-weight: 600; }

.timer-hint {
    margin-top: 16px;
    font-size: 12px;
    color: var(--gray-400);
}

kbd {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid var(--gray-200);
    font-family: inherit;
}

.timer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.stat-item { text-align: center; }

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== ACCOUNT GRID ===== */
.acct-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.acct-item {
    text-align: center;
    padding: 20px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all .2s;
}

.acct-item:hover { background: var(--primary-bg); transform: translateY(-2px); }

.acct-icon { font-size: 24px; margin-bottom: 8px; }

.acct-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.acct-lbl {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm { padding: 8px 14px; font-size: 12px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 4px 12px rgba(79,70,229,.3);
    transform: translateY(-1px);
}

.btn-sec {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--border);
}

.btn-sec:hover { background: var(--gray-200); }

.btn-full { width: 100%; }

/* ===== CYCLE BAR ===== */
.cycle-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.cycle-day {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.cycle-lbl { font-size: 14px; color: var(--gray-600); }

.cycle-tag {
    padding: 4px 12px;
    background: var(--warning);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.cycle-cnt {
    margin-left: auto;
    font-size: 13px;
    color: var(--gray-400);
}

/* ===== FORM ===== */
.form-section { margin-bottom: 20px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.section-icon { font-size: 16px; }

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.study-display {
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    text-align: center;
    border: 2px dashed var(--gray-200);
}

.study-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.study-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 8px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.exam-form { padding: 0 4px; }

.form-row {
    display: flex;
    gap: 16px;
}

.form-group { flex: 1; margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.form-select,
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--card);
    color: var(--text);
    transition: all .2s;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.input-with-unit {
    display: flex;
    align-items: center;
}

.input-with-unit .form-input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-unit {
    padding: 12px 14px;
    background: var(--gray-100);
    border: 2px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    color: var(--gray-500);
}

/* ===== PREVIEW ===== */
.preview-box {
    padding: 16px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.prow {
    font-size: 13px;
    color: var(--gray-600);
    padding: 4px 0;
    line-height: 1.8;
}

.prow b { color: var(--text); }

.phl {
    color: var(--success);
    font-weight: 700;
    font-size: 15px;
    padding: 8px 0;
}

/* ===== SUBMIT ===== */
.submit-section { margin-top: 24px; }

/* ===== SUBJECT BOARD ===== */
.subj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.subj-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all .2s;
    background: var(--card);
}

.subj-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.subj-card.cooldown { opacity: .5; }

.subj-nm {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.subj-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.subj-sts { margin: 10px 0; }

.sts-ok { color: var(--success); font-weight: 600; font-size: 13px; }
.sts-cool { color: var(--warning); font-size: 12px; }

.pbar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.pfill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width .5s;
}

.ptxt {
    font-size: 11px;
    color: var(--gray-400);
    text-align: right;
    margin-top: 4px;
}

/* ===== CHARTS ===== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.chart-card { padding: 20px; }

.chart-h {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.chart-box {
    position: relative;
    height: 260px;
}

/* ===== TABLE ===== */
.tbl-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover { background: var(--gray-50); }

.empty-msg {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
    font-size: 14px;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active { display: flex; }

.modal-box {
    background: var(--card);
    border-radius: var(--radius);
    max-width: 500px;
    width: 92%;
    box-shadow: var(--shadow-xl);
    animation: modalIn .25s ease;
    border: 1px solid var(--border);
}

.modal-wide { max-width: 620px; }

@keyframes modalIn {
    from { transform: scale(.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
}

.modal-close:hover { background: var(--gray-200); }

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

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

.modal-footer .btn-full { justify-content: center; }

.set-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--card);
    color: var(--text);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== REPORT ===== */
.tab-switcher {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.switch-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all .2s;
}

.switch-btn.active {
    background: var(--card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.report-content { padding: 8px 0; }

.report-card { padding: 8px; }

.report-period {
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.report-item {
    text-align: center;
    padding: 16px 8px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.report-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.report-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== ACHIEVEMENTS ===== */
.achieve-stats { margin-bottom: 20px; }

.achieve-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.achieve-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.achieve-pct {
    font-size: 14px;
    color: var(--gray-500);
}

.achieve-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.achieve-item {
    position: relative;
    padding: 20px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all .2s;
    border: 2px solid transparent;
}

.achieve-item.unlocked {
    border-color: var(--success);
    background: var(--success-bg);
}

.achieve-item.locked {
    opacity: .5;
    filter: grayscale(.5);
}

.achieve-icon { font-size: 32px; margin-bottom: 8px; }

.achieve-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.achieve-desc {
    font-size: 11px;
    color: var(--gray-500);
}

.achieve-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== GOALS ===== */
.goals-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.goals-col { }

.goals-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 14px;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.goal-item {
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

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

.goal-label {
    font-size: 13px;
    color: var(--gray-600);
}

.goal-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.goal-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.goal-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width .5s;
}

.goal-fill.complete { background: var(--success); }

.goal-pct {
    text-align: right;
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

.goals-form-section {
    margin-bottom: 24px;
}

.goals-form-section h4 {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

/* ===== VISUALIZE ===== */
.visual-content { min-height: 350px; }

/* ===== HEATMAP ===== */
.heatmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.heatmap-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--gray-500);
}

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-label { font-size: 10px; }

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

.heatmap-dayname {
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
    padding: 8px;
    font-weight: 600;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all .2s;
    cursor: default;
    border: 2px solid transparent;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 1;
    box-shadow: var(--shadow-md);
}

.heatmap-cell.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.2);
}

.heatmap-cell.empty { background: transparent; }

.cell-day { font-weight: 600; color: var(--text); }
.cell-hours { font-size: 10px; color: var(--gray-500); }

/* ===== GUIDE ===== */
.guide-body { padding: 8px; }

.guide-section {
    margin-bottom: 20px;
}

.guide-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.guide-section ul {
    margin-left: 20px;
}

.guide-section li {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
    line-height: 1.7;
}

/* ===== STOP MODAL ===== */
.stop-body { text-align: center; }

.stop-time {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
}

.stop-detail {
    text-align: left;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.stop-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--border);
}

.stop-row:last-child { border-bottom: none; }

.stop-row.highlight {
    font-weight: 600;
    color: var(--text);
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid var(--border);
    border-bottom: none;
}

/* ===== NOTIFS ===== */
.notifs {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notif {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: notifIn .3s;
    max-width: 360px;
    pointer-events: auto;
}

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

.notif.fade-out {
    animation: notifOut .3s forwards;
}

@keyframes notifOut {
    to { transform: translateX(120%); opacity: 0; }
}

.n-ok { background: linear-gradient(135deg, #10b981, #059669); }
.n-err { background: linear-gradient(135deg, #ef4444, #dc2626); }
.n-warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.n-info { background: linear-gradient(135deg, #4f46e5, #7c3aed); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .time-bar-content { flex-direction: column; gap: 16px; }
    .time-bar-divider { width: 100%; height: 1px; }
    .time-bar-right { width: 100%; justify-content: space-around; }
    .subj-grid { grid-template-columns: 1fr; }
    .charts-row { grid-template-columns: 1fr; }
    .set-grid { grid-template-columns: 1fr; }
    .achieve-grid { grid-template-columns: repeat(2, 1fr); }
    .goals-columns { grid-template-columns: 1fr; }
    .report-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .nav-tabs { flex-wrap: wrap; }
    .nav-tab { font-size: 11px; padding: 10px 6px; }
    .timer-huge { font-size: 48px; }
    .acct-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { flex-direction: column; }
}
