/* ════════════════════════════════════════════════════════
   StudyPal v3 — Design System
   Aesthetic: Dark Editorial / Soft Neon Accents
   ════════════════════════════════════════════════════════ */

/* ─── Custom Properties ─── */
:root {
    /* Core palette - Dark */
    --bg-base: #0a0a0f;
    --bg-raised: #12121a;
    --bg-surface: #1a1a26;
    --bg-overlay: #222233;
    --bg-hover: #2a2a3d;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-tertiary: #55556a;
    
    /* Accent colors */
    --accent: #818cf8;
    --accent-soft: rgba(129, 140, 248, 0.15);
    --accent-glow: rgba(129, 140, 248, 0.3);
    --emerald: #34d399;
    --emerald-soft: rgba(52, 211, 153, 0.15);
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, 0.15);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.15);
    --rose: #f87171;
    --rose-soft: rgba(248, 113, 113, 0.15);
    --cyan: #22d3ee;
    
    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --bg-base: #f5f5f7;
    --bg-raised: #ffffff;
    --bg-surface: #f0f0f3;
    --bg-overlay: #e8e8ef;
    --bg-hover: #e0e0ea;
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);
    --text-primary: #1a1a2e;
    --text-secondary: #6b6b80;
    --text-tertiary: #9999aa;
    --accent: #6366f1;
    --accent-soft: rgba(99, 102, 241, 0.1);
    --accent-glow: rgba(99, 102, 241, 0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ════════════════════════════════════════════════════════
   Loading Screen
   ════════════════════════════════════════════════════════ */
.loading-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg-base);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-content { text-align: center; }
.loader-icon {
    width: 56px; height: 56px; margin: 0 auto 16px;
    color: var(--accent);
    animation: pulse-glow 2s infinite;
}
.loader-icon svg { width: 100%; height: 100%; }
.loader-text { font-size: 1.5rem; font-weight: 700; letter-spacing: 2px; color: var(--text-primary); margin-bottom: 24px; }
.loader-bar { width: 200px; height: 3px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 0 auto 12px; }
.loader-bar-fill { height: 100%; width: 30%; background: var(--accent); border-radius: 4px; animation: loader-fill 1.5s var(--ease) infinite; }
.loader-status { font-size: 0.8rem; color: var(--text-tertiary); }

@keyframes loader-fill { 0% { width: 10%; } 50% { width: 70%; } 100% { width: 100%; } }
@keyframes pulse-glow { 0%, 100% { filter: drop-shadow(0 0 8px var(--accent-glow)); } 50% { filter: drop-shadow(0 0 20px var(--accent-glow)); } }

/* ════════════════════════════════════════════════════════
   Firebase Setup
   ════════════════════════════════════════════════════════ */
/* Login Screen */
.login-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg-base);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 40px; width: 380px; max-width: 90vw;
    text-align: center; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.login-icon { color: var(--accent); margin-bottom: 16px; }
.login-card h2 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card > p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.88rem; }
.login-form { text-align: right; }
.login-form .input-group { margin-bottom: 14px; }
.login-form input {
    width: 100%; padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}
.login-form input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.login-form .btn-setup { width: 100%; margin-top: 8px; }
.btn-setup {
    width: 100%; padding: 12px; margin-top: 16px;
    background: var(--accent); color: #fff; border: none; border-radius: var(--radius);
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}
.btn-setup:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }

/* ════════════════════════════════════════════════════════
   App Shell
   ════════════════════════════════════════════════════════ */
.app {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-raised);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform 0.3s var(--ease);
}

.sidebar-brand {
    padding: 20px 20px 16px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid var(--border);
}
.brand-icon {
    width: 36px; height: 36px; color: var(--accent);
    flex-shrink: 0;
}
.brand-icon svg { width: 100%; height: 100%; }
.brand-text { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.5px; }
.brand-version {
    font-size: 0.65rem; font-weight: 600;
    background: var(--accent-soft); color: var(--accent);
    padding: 2px 6px; border-radius: 4px;
    margin-right: auto;
}

.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 12px 10px;
}
.nav-group-label {
    font-size: 0.7rem; font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 12px 6px;
}

.nav-btn {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 10px 14px;
    background: none; border: none; color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.9rem;
    transition: all 0.2s var(--ease);
    position: relative;
}
.nav-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.nav-btn.active::before {
    content: '';
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}
.nav-badge {
    margin-right: auto;
    font-size: 0.7rem; font-weight: 700;
    background: var(--accent-soft); color: var(--accent);
    padding: 2px 7px; border-radius: 10px;
    min-width: 20px; text-align: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}
.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}
.user-card:hover { background: var(--bg-hover); }
.user-avatar {
    width: 36px; height: 36px;
    background: var(--accent-soft);
    color: var(--accent); font-weight: 700;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-status { font-size: 0.7rem; color: var(--text-tertiary); display: flex; align-items: center; gap: 4px; }
.status-dot { width: 6px; height: 6px; background: var(--emerald); border-radius: 50%; }

/* Sidebar mobile */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 99;
    opacity: 0; transition: opacity 0.3s;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.visible { display: block; opacity: 1; }
}

/* ─── Main Area ─── */
.main-area {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex; flex-direction: column;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .main-area { margin-right: 0; }
}

/* ─── Top Bar ─── */
.topbar {
    height: var(--topbar-height);
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg-raised);
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(12px);
}
.topbar-right, .topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 { font-size: 1.15rem; font-weight: 700; }
.topbar-date { font-size: 0.75rem; color: var(--text-tertiary); }

.mobile-menu-btn { display: none; }
@media (max-width: 768px) { .mobile-menu-btn { display: flex; } }

.icon-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* Theme toggle icons */
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
.icon-moon { display: none; }
.icon-sun { display: block; }

/* ─── Content Area ─── */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

@media (max-width: 768px) { .content-area { padding: 16px; } }

/* Pages */
.page { display: none; animation: fadeIn 0.4s var(--ease); }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
    gap: 16px; margin-bottom: 24px;
}
.page-head h2 { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 2px; }

/* ════════════════════════════════════════════════════════
   Cards
   ════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border-strong); }

.card-head {
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 0.95rem; font-weight: 600; }

.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); text-align: center; }

/* ════════════════════════════════════════════════════════
   Buttons
   ════════════════════════════════════════════════════════ */
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    background: var(--accent); color: #fff;
    border: none; border-radius: var(--radius);
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    background: none; color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-weight: 500; font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }

.btn-danger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: var(--rose-soft); color: var(--rose);
    border: none; border-radius: var(--radius);
    font-weight: 500; font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s;
}
.btn-danger:hover { background: var(--rose); color: #fff; }

.link-btn {
    background: none; border: none;
    color: var(--accent); font-size: 0.85rem;
    cursor: pointer; font-weight: 500;
    transition: opacity 0.2s;
}
.link-btn:hover { opacity: 0.8; }

/* ════════════════════════════════════════════════════════
   Dashboard — Hero
   ════════════════════════════════════════════════════════ */
.hero-card {
    position: relative;
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 50%, #a855f7 100%);
    border-radius: var(--radius-xl);
    padding: 32px;
    overflow: hidden;
    margin-bottom: 24px;
}
.hero-content {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
.hero-text h2 { color: #fff; font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.hero-quote { color: rgba(255,255,255,0.85); font-size: 0.95rem; max-width: 500px; }
.hero-weather { text-align: left; color: #fff; }
.weather-temp { font-family: 'Space Mono', monospace; font-size: 2.5rem; font-weight: 700; line-height: 1; }
.weather-desc { font-size: 0.85rem; opacity: 0.85; }

.hero-glow {
    position: absolute; top: -50%; left: -30%; width: 60%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── Stats Row ─── */
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}
@media (max-width: 1024px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: border-color 0.2s, transform 0.2s var(--ease-spring);
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

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

.stat-card[data-accent="indigo"] .stat-icon-wrap { background: var(--accent-soft); color: var(--accent); }
.stat-card[data-accent="emerald"] .stat-icon-wrap { background: var(--emerald-soft); color: var(--emerald); }
.stat-card[data-accent="violet"] .stat-icon-wrap { background: var(--violet-soft); color: var(--violet); }
.stat-card[data-accent="amber"] .stat-icon-wrap { background: var(--amber-soft); color: var(--amber); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 2px; }
.stat-value { font-family: 'Space Mono', monospace; font-size: 1.25rem; font-weight: 700; }

/* ─── Dashboard Grid ─── */
.dash-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
.dash-main { display: flex; flex-direction: column; gap: 20px; }
.dash-aside { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 1024px) { .dash-grid { grid-template-columns: 1fr; } }

/* Quick actions */
.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-action-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 12px 16px;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    cursor: pointer; font-size: 0.9rem;
    transition: all 0.2s;
}
.quick-action-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.quick-action-btn svg { width: 18px; height: 18px; color: var(--accent); }

/* Empty states */
.empty-state {
    text-align: center; padding: 32px 20px;
    color: var(--text-tertiary);
}
.empty-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

/* ════════════════════════════════════════════════════════
   Subjects
   ════════════════════════════════════════════════════════ */
.subjects-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.subject-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.3s var(--ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.subject-card::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 4px; height: 100%;
    background: var(--subject-color);
    border-radius: 0 4px 4px 0;
}
.subject-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }

.subject-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.subject-icon {
    width: 48px; height: 48px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.subject-name { font-size: 1.1rem; font-weight: 700; }
.subject-code { font-size: 0.75rem; color: var(--text-tertiary); font-family: 'Space Mono', monospace; }

.subject-grade-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px;
}
.subject-grade-badge {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem; font-weight: 700;
    color: var(--subject-color);
}
.subject-grade-score { font-size: 0.85rem; color: var(--text-secondary); }

.subject-grade-bar {
    flex: 1; height: 6px;
    background: var(--bg-surface); border-radius: 3px;
    overflow: hidden;
}
.subject-grade-bar-fill {
    height: 100%; border-radius: 3px;
    background: var(--subject-color);
    transition: width 0.5s var(--ease);
}

.subject-card-actions {
    display: flex; gap: 8px; margin-top: 12px;
    padding-top: 12px; border-top: 1px solid var(--border);
}

/* Subject detail page */
.subject-detail-header {
    padding: 24px;
    border-radius: var(--radius-xl);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
.subject-detail-info { display: flex; align-items: center; gap: 16px; }
.subject-detail-icon { font-size: 2.5rem; }
.subject-detail-name { font-size: 1.5rem; font-weight: 700; }
.subject-detail-stats { display: flex; gap: 20px; }
.subject-detail-stat { text-align: center; }
.subject-detail-stat-value { font-family: 'Space Mono', monospace; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.subject-detail-stat-label { font-size: 0.75rem; color: var(--text-secondary); }

.grades-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.grade-input-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.grade-input-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; }
.grade-input-row { display: flex; align-items: center; gap: 8px; }
.grade-input-field {
    flex: 1; padding: 8px 10px;
    background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: 'Space Mono', monospace; font-size: 0.9rem;
    transition: border-color 0.2s;
}
.grade-input-field:focus { outline: none; border-color: var(--accent); }
.grade-max { font-size: 0.8rem; color: var(--text-tertiary); font-family: 'Space Mono', monospace; }

.grade-summary {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}
.grade-summary-total { font-family: 'Space Mono', monospace; font-size: 2rem; font-weight: 700; color: var(--accent); }
.grade-summary-letter { font-size: 1.1rem; font-weight: 600; margin-top: 4px; }
.grade-summary-needed { font-size: 0.85rem; color: var(--text-secondary); margin-top: 8px; }

/* ════════════════════════════════════════════════════════
   Tasks
   ════════════════════════════════════════════════════════ */
.task-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
    cursor: pointer;
}
.task-item:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.task-item:last-child { margin-bottom: 0; }
.task-item.completed { opacity: 0.5; }
.task-item.completed .task-title { text-decoration: line-through; }

.task-checkbox {
    width: 20px; height: 20px; flex-shrink: 0;
    appearance: none; -webkit-appearance: none;
    border: 2px solid var(--border-strong); border-radius: 6px;
    cursor: pointer; transition: all 0.25s var(--ease);
    position: relative; background: var(--bg-base);
}
.task-checkbox:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.task-checkbox:checked {
    background: var(--accent); border-color: var(--accent);
    animation: checkPop 0.3s var(--ease-spring);
}
@keyframes checkPop { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.task-checkbox:checked::after {
    content: '✓'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.65rem; font-weight: 700;
}

.task-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-title { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.72rem; color: var(--text-tertiary); align-items: center; }
.task-meta span { display: inline-flex; align-items: center; gap: 2px; }

.task-priority {
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
}
.task-priority[data-priority="high"] { background: var(--rose-soft); color: var(--rose); }
.task-priority[data-priority="medium"] { background: var(--amber-soft); color: var(--amber); }
.task-priority[data-priority="low"] { background: var(--emerald-soft); color: var(--emerald); }

.task-actions {
    display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity 0.15s;
}
.task-item:hover .task-actions { opacity: 1; }

.task-action-btn {
    background: none; border: none;
    color: var(--text-tertiary); cursor: pointer;
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; transition: all 0.15s;
}
.task-action-btn:hover { background: var(--bg-overlay); color: var(--text-primary); }
.task-action-btn.delete-btn:hover { background: var(--rose-soft); color: var(--rose); }

/* Legacy compat for delete btns used elsewhere */
.task-delete-btn {
    background: none; border: none;
    color: var(--text-tertiary); cursor: pointer;
    padding: 6px; border-radius: 6px;
    transition: all 0.2s; opacity: 0; font-size: 0.8rem;
}
.task-item:hover .task-delete-btn,
.resource-card:hover .task-delete-btn,
.sched-card:hover .task-delete-btn { opacity: 1; }
.task-delete-btn:hover { color: var(--rose); background: var(--rose-soft); }

/* Due urgency colors */
.due-urgent { color: var(--rose) !important; font-weight: 600; }
.due-soon { color: var(--amber) !important; }

/* ════════════════════════════════════════════════════════
   Schedule
   ════════════════════════════════════════════════════════ */
/* ════════════════════════════════════════════════════════
   Schedule — Timetable Grid View
   ════════════════════════════════════════════════════════ */

/* View toggle buttons */
.schedule-view-toggle {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.schedule-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

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

.schedule-view-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ── Grid View ── */
.schedule-timetable {
    background: var(--bg-raised);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.timetable-header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-bottom: 1px solid var(--border);
}

.timetable-header-cell {
    padding: 16px 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    transition: all 0.2s var(--ease);
}

.timetable-header-cell.is-today {
    color: var(--accent);
    background: var(--accent-soft);
}

.timetable-header-cell.is-today::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
}

.timetable-today-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 4px;
    vertical-align: middle;
    animation: todayPulse 2s ease-in-out infinite;
}

@keyframes todayPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.timetable-body {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 200px;
}

.timetable-column {
    padding: 12px 10px 16px;
    border-left: 1px solid var(--border);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timetable-column:last-child {
    border-left: none;
}

.timetable-column.is-today {
    background: var(--accent-soft);
    background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 100%);
}

/* Schedule Cards in Grid */
.sched-card {
    position: relative;
    border-radius: var(--radius);
    padding: 14px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-right: 4px solid var(--accent);
    cursor: default;
    transition: all 0.25s var(--ease);
    overflow: hidden;
}

.sched-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background: var(--sched-color, var(--accent));
    transition: opacity 0.25s var(--ease);
    pointer-events: none;
}

.sched-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}

.sched-card:hover::before {
    opacity: 0.12;
}

.sched-card-subject {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.sched-card-time {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    direction: ltr;
    text-align: right;
}

.sched-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sched-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sched-card-badge.onsite {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.sched-card-badge.online {
    background: var(--violet-soft);
    color: var(--violet);
}

.sched-card-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sched-card-delete {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--bg-overlay);
    color: var(--text-tertiary);
    font-size: 0.65rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sched-card:hover .sched-card-delete {
    opacity: 1;
}

.sched-card-delete:hover {
    background: var(--rose-soft);
    color: var(--rose);
}

/* Empty column state */
.timetable-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 80px;
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    color: var(--text-tertiary);
    font-size: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.timetable-empty:hover {
    opacity: 0.8;
}

/* Schedule stats bar */
.schedule-stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.schedule-stat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 140px;
}

.schedule-stat-chip .stat-chip-value {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.schedule-stat-chip .stat-chip-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── List View ── */
.schedule-list-view .schedule-day-block {
    margin-bottom: 20px;
}

.schedule-list-view .schedule-day-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-raised);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

.schedule-list-view .schedule-day-indicator {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.schedule-list-view .schedule-day-header.is-today .schedule-day-indicator {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.schedule-list-view .schedule-day-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    border: none;
    padding: 0;
    margin: 0;
}

.schedule-list-view .schedule-day-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.schedule-list-view .schedule-day-items {
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    background: var(--bg-raised);
}

.schedule-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s var(--ease);
    position: relative;
}

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

.schedule-list-item:hover {
    background: var(--bg-hover);
}

.schedule-list-item-color {
    width: 4px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
}

.schedule-list-item-time {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    direction: ltr;
    text-align: right;
}

.schedule-list-item-info {
    flex: 1;
}

.schedule-list-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-list-item-meta {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.schedule-list-item-delete {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.schedule-list-item:hover .schedule-list-item-delete {
    opacity: 1;
}

.schedule-list-item-delete:hover {
    background: var(--rose-soft);
    color: var(--rose);
}

@media (max-width: 768px) {
    .timetable-header { grid-template-columns: repeat(5, 1fr); font-size: 0.75rem; }
    .timetable-header-cell { padding: 10px 4px; font-size: 0.75rem; }
    .timetable-body { grid-template-columns: repeat(5, 1fr); }
    .timetable-column { padding: 8px 4px; }
    .sched-card { padding: 10px 8px; }
    .sched-card-subject { font-size: 0.75rem; }
    .sched-card-time { font-size: 0.65rem; }
    .sched-card-footer { flex-direction: column; align-items: flex-start; }
    .schedule-stats-bar { flex-direction: column; }
    .schedule-view-toggle { display: none; }
}

/* ════════════════════════════════════════════════════════
   Pomodoro
   ════════════════════════════════════════════════════════ */
.pomodoro-wrapper {
    max-width: 420px; margin: 0 auto;
    text-align: center;
}
.pomodoro-wrapper h2 { font-size: 1.5rem; margin-bottom: 4px; }
.pomodoro-wrapper .page-subtitle { margin-bottom: 32px; }

.pomo-ring-container {
    position: relative;
    width: 220px; height: 220px;
    margin: 0 auto 28px;
}
.pomo-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo-ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.pomo-ring-fill {
    fill: none; stroke: var(--accent); stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 565.48; stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}
.pomo-ring-text {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.pomo-time { font-family: 'Space Mono', monospace; font-size: 2.5rem; font-weight: 700; }
.pomo-label { font-size: 0.8rem; color: var(--text-tertiary); }

.pomo-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.pomo-btn { min-width: 120px; justify-content: center; }

.pomo-tabs { display: flex; gap: 8px; justify-content: center; }
.pomo-tab {
    padding: 8px 16px;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-secondary);
    font-size: 0.85rem; cursor: pointer;
    transition: all 0.2s;
}
.pomo-tab:hover { background: var(--bg-hover); }
.pomo-tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ════════════════════════════════════════════════════════
   Modals
   ════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.6);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: modalFade 0.3s var(--ease);
}
.modal-overlay.open { display: flex; }

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

.modal-card {
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    max-width: 500px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    animation: modalSlide 0.3s var(--ease-spring);
}
@keyframes modalSlide { from { transform: translateY(20px) scale(0.97); } to { transform: translateY(0) scale(1); } }

.modal-head {
    padding: 20px 24px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-tertiary);
    font-size: 1.4rem; cursor: pointer; border-radius: 8px;
    transition: all 0.2s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

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

/* ─── Form Elements ─── */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block; font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%; padding: 10px 14px;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Picker grid */
.picker-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 180px; overflow-y: auto; padding: 4px 0; }
.picker-item {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface); border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 1.2rem;
    cursor: pointer; transition: all 0.2s;
}
.picker-item:hover { border-color: var(--border-strong); }
.picker-item.selected { border-color: var(--accent); background: var(--accent-soft); }

.color-pick {
    background: var(--pick-color) !important;
    border: 2px solid transparent !important;
}
.color-pick.selected { border-color: var(--text-primary) !important; box-shadow: 0 0 0 2px var(--pick-color); }

/* ════════════════════════════════════════════════════════
   Toast
   ════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed; bottom: 24px; left: 24px;
    z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px;
}
.toast {
    padding: 12px 20px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    animation: toastIn 0.4s var(--ease-spring);
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 8px;
}
.toast.success::before { content: '✓'; color: var(--emerald); font-weight: 700; }
.toast.error::before { content: '✕'; color: var(--rose); font-weight: 700; }
.toast.info::before { content: 'ℹ'; color: var(--accent); font-weight: 700; }
.toast.removing { animation: toastOut 0.3s var(--ease) forwards; }

@keyframes toastIn { from { transform: translateX(-30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(-30px); opacity: 0; } }

/* ════════════════════════════════════════════════════════
   Settings
   ════════════════════════════════════════════════════════ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.theme-switcher { display: flex; gap: 10px; }
.theme-btn {
    flex: 1; padding: 12px;
    background: var(--bg-surface); border: 2px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    font-size: 0.9rem; transition: all 0.2s;
    color: var(--text-primary);
}
.theme-btn:hover { border-color: var(--border-strong); }
.theme-btn.active { border-color: var(--accent); background: var(--accent-soft); }

/* ════════════════════════════════════════════════════════
   Schedule Widget (Dashboard)
   ════════════════════════════════════════════════════════ */
.timeline-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px; flex-shrink: 0;
}
.timeline-time {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem; color: var(--text-secondary);
    min-width: 65px;
}
.timeline-info { flex: 1; }
.timeline-subject { font-weight: 600; }
.timeline-meta { font-size: 0.8rem; color: var(--text-tertiary); margin-top: 2px; }

/* Upcoming task widget */
.upcoming-task-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.upcoming-task-item:last-child { border-bottom: none; }
.upcoming-task-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; flex-shrink: 0;
}
.upcoming-task-title { font-size: 0.9rem; font-weight: 500; }
.upcoming-task-date { font-size: 0.75rem; color: var(--text-tertiary); }

/* Subject overview mini cards */
.mini-subject-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer; transition: opacity 0.2s;
}
.mini-subject-card:last-child { border-bottom: none; }
.mini-subject-card:hover { opacity: 0.8; }
.mini-subject-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.mini-subject-info { flex: 1; }
.mini-subject-name { font-weight: 600; font-size: 0.9rem; }
.mini-subject-grade { font-family: 'Space Mono', monospace; font-size: 0.8rem; color: var(--text-secondary); }

/* ════════════════════════════════════════════════════════
   Notes — Sticky Notes Design
   ════════════════════════════════════════════════════════ */

.notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.sticky-note {
    position: relative;
    border-radius: 2px 2px var(--radius-sm) var(--radius-sm);
    padding: 0;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
    overflow: visible;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.08);
}

.sticky-note:hover {
    transform: translateY(-3px) rotate(-0.4deg);
    box-shadow: 4px 8px 24px rgba(0,0,0,0.13);
}

.sticky-note-color-0 { background: #fff9c4; }
.sticky-note-color-1 { background: #c8e6c9; }
.sticky-note-color-2 { background: #bbdefb; }
.sticky-note-color-3 { background: #f8bbd0; }
.sticky-note-color-4 { background: #e1bee7; }
.sticky-note-color-5 { background: #ffe0b2; }
.sticky-note-color-6 { background: #b2dfdb; }
.sticky-note-color-7 { background: #d1c4e9; }

[data-theme="dark"] .sticky-note-color-0 { background: #33301a; }
[data-theme="dark"] .sticky-note-color-1 { background: #1a2e1e; }
[data-theme="dark"] .sticky-note-color-2 { background: #182636; }
[data-theme="dark"] .sticky-note-color-3 { background: #361a28; }
[data-theme="dark"] .sticky-note-color-4 { background: #2a1a34; }
[data-theme="dark"] .sticky-note-color-5 { background: #342616; }
[data-theme="dark"] .sticky-note-color-6 { background: #182e2c; }
[data-theme="dark"] .sticky-note-color-7 { background: #241c36; }

.sticky-note-tape {
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(1.5deg);
    width: 48px;
    height: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    z-index: 2;
    pointer-events: none;
}

[data-theme="dark"] .sticky-note-tape {
    background: rgba(255, 255, 255, 0.07);
}

.sticky-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 2px;
    z-index: 1;
}

.sticky-note-date {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(0,0,0,0.3);
    font-family: 'Space Mono', monospace;
}

[data-theme="dark"] .sticky-note-date {
    color: rgba(255,255,255,0.25);
}

.sticky-note-delete {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.05);
    color: rgba(0,0,0,0.25);
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s var(--ease);
}

[data-theme="dark"] .sticky-note-delete {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.25);
}

.sticky-note:hover .sticky-note-delete {
    opacity: 1;
}

.sticky-note-delete:hover {
    background: rgba(220, 50, 50, 0.15);
    color: #dc3232;
}

.sticky-note textarea {
    flex: 1;
    width: 100%;
    min-height: 110px;
    padding: 6px 14px 14px;
    background: transparent;
    border: none;
    color: rgba(0,0,0,0.7);
    resize: none;
    font-size: 0.85rem;
    line-height: 1.75;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

[data-theme="dark"] .sticky-note textarea {
    color: rgba(255,255,255,0.78);
}

.sticky-note textarea:focus { outline: none; }

.sticky-note textarea::placeholder {
    color: rgba(0,0,0,0.18);
}

[data-theme="dark"] .sticky-note textarea::placeholder {
    color: rgba(255,255,255,0.12);
}

.notes-empty-state {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .notes-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .sticky-note { min-height: 150px; }
}

/* ════════════════════════════════════════════════════════
   Pomodoro Enhanced
   ════════════════════════════════════════════════════════ */
.pomo-layout {
    display: grid; grid-template-columns: 420px 1fr;
    gap: 24px; align-items: start;
}
@media (max-width: 900px) { .pomo-layout { grid-template-columns: 1fr; } }

.pomo-subject-select { margin-bottom: 20px; }
.pomo-subject-select select {
    width: 100%; max-width: 280px; margin: 0 auto; display: block;
    padding: 8px 14px; background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem;
    text-align: center;
}

.pomo-stats-panel { display: flex; flex-direction: column; gap: 16px; }
.pomo-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.pomo-stat-item {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; text-align: center;
}
.pomo-stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem; font-weight: 700; color: var(--accent);
    display: block;
}
.pomo-stat-label { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 4px; }

/* Subject time bars */
.subject-time-bar { margin-bottom: 12px; }
.subject-time-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px; font-size: 0.85rem;
}
.subject-time-header span:last-child { font-family: 'Space Mono', monospace; color: var(--text-secondary); font-size: 0.8rem; }
.subject-time-track {
    height: 8px; background: var(--bg-surface); border-radius: 4px; overflow: hidden;
}
.subject-time-fill {
    height: 100%; border-radius: 4px; transition: width 0.5s var(--ease);
}

/* Week chart */
.week-chart {
    display: flex; align-items: flex-end; gap: 8px;
    height: 120px; padding-top: 8px;
}
.week-chart-bar {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 4px; height: 100%;
    justify-content: flex-end;
}
.week-chart-fill {
    width: 100%; background: var(--accent); border-radius: 4px 4px 0 0;
    min-height: 2px; transition: height 0.5s var(--ease);
}
.week-chart-label { font-size: 0.65rem; color: var(--text-tertiary); }
.week-chart-value { font-family: 'Space Mono', monospace; font-size: 0.65rem; color: var(--text-secondary); }

/* ════════════════════════════════════════════════════════
   Attendance Tracker (in Subject Detail)
   ════════════════════════════════════════════════════════ */
.attendance-card {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
.attendance-counter {
    display: flex; align-items: center; gap: 12px;
}
.attendance-btn {
    width: 36px; height: 36px;
    border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-surface); color: var(--text-primary);
    font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.attendance-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.attendance-count {
    font-family: 'Space Mono', monospace;
    font-size: 2rem; font-weight: 700; min-width: 40px; text-align: center;
}
.attendance-max { font-size: 0.85rem; color: var(--text-secondary); }

.attendance-bar-track {
    flex: 1; min-width: 150px; height: 10px;
    background: var(--bg-surface); border-radius: 5px; overflow: hidden;
}
.attendance-bar-fill {
    height: 100%; border-radius: 5px; transition: width 0.3s var(--ease);
}
.attendance-bar-fill.safe { background: var(--emerald); }
.attendance-bar-fill.warn { background: var(--amber); }
.attendance-bar-fill.danger { background: var(--rose); }

.attendance-warning {
    width: 100%; padding: 8px 12px; margin-top: 4px;
    background: var(--rose-soft); color: var(--rose);
    border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
    text-align: center;
}

/* ════════════════════════════════════════════════════════
   Study Planner
   ════════════════════════════════════════════════════════ */
.planner-settings {
    display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end;
}
.planner-settings .input-group { min-width: 200px; }

.day-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.day-toggle {
    padding: 6px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-surface);
    color: var(--text-secondary); font-size: 0.8rem; cursor: pointer;
    transition: all 0.2s;
}
.day-toggle:hover { border-color: var(--border-strong); }
.day-toggle.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.study-plan-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.plan-day-card {
    background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.plan-day-header {
    padding: 12px 16px; font-weight: 700; font-size: 0.95rem;
    background: var(--bg-surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.plan-day-total { font-family: 'Space Mono', monospace; font-size: 0.8rem; color: var(--text-secondary); font-weight: 400; }

.plan-slot {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.plan-slot:last-child { border-bottom: none; }
.plan-slot-color { width: 6px; height: 32px; border-radius: 3px; flex-shrink: 0; }
.plan-slot-info { flex: 1; }
.plan-slot-subject { font-weight: 600; font-size: 0.9rem; }
.plan-slot-time { font-size: 0.8rem; color: var(--text-tertiary); }
.plan-slot-reason { font-size: 0.75rem; color: var(--accent); margin-top: 2px; }

/* ════════════════════════════════════════════════════════
   Final Calculator
   ════════════════════════════════════════════════════════ */
.final-calc-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.final-calc-card {
    background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.final-calc-header {
    padding: 16px 20px;
    display: flex; align-items: center; gap: 14px;
    border-bottom: 1px solid var(--border);
}
.final-calc-icon {
    width: 44px; height: 44px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.final-calc-body { padding: 20px; }

.final-calc-current {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.final-calc-current-label { font-size: 0.85rem; color: var(--text-secondary); }
.final-calc-current-value { font-family: 'Space Mono', monospace; font-size: 1.1rem; font-weight: 700; }

.final-target-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.final-target-label {
    min-width: 32px; font-weight: 700; font-size: 0.9rem;
    text-align: center;
}
.final-target-bar {
    flex: 1; height: 6px; background: var(--bg-surface); border-radius: 3px; overflow: hidden;
}
.final-target-fill { height: 100%; border-radius: 3px; transition: width 0.3s var(--ease); }
.final-target-needed {
    font-family: 'Space Mono', monospace; font-size: 0.8rem;
    min-width: 55px; text-align: left;
}
.final-needed-ok { color: var(--emerald); }
.final-needed-hard { color: var(--amber); }
.final-needed-impossible { color: var(--rose); }
.final-needed-done { color: var(--accent); }

/* ════════════════════════════════════════════════════════
   Schedule Export (visual schedule grid)
   ════════════════════════════════════════════════════════ */
.schedule-export-container {
    background: var(--bg-raised); border-radius: var(--radius-lg);
    padding: 24px; border: 1px solid var(--border);
}
.schedule-export-title {
    text-align: center; font-size: 1.2rem; font-weight: 700;
    margin-bottom: 16px; color: var(--text-primary);
}
.schedule-visual-grid {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.schedule-visual-day { text-align: center; }
.schedule-visual-day-name {
    font-weight: 700; font-size: 0.85rem; padding: 8px;
    background: var(--accent-soft); color: var(--accent);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.schedule-visual-slots { min-height: 60px; }
.schedule-visual-slot {
    padding: 8px; margin: 4px 0; border-radius: var(--radius-sm);
    font-size: 0.75rem; text-align: center;
}
.schedule-visual-slot-name { font-weight: 600; }
.schedule-visual-slot-time { opacity: 0.8; margin-top: 2px; }

/* ════════════════════════════════════════════════════════
   Calendar
   ════════════════════════════════════════════════════════ */
.calendar-month-title {
    text-align: center; font-size: 1.3rem; font-weight: 700;
    margin-bottom: 16px; color: var(--text-primary);
}
.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
    background: var(--bg-raised); border-radius: var(--radius-lg);
    border: 1px solid var(--border); padding: 12px; overflow: hidden;
}
.calendar-header-cell {
    text-align: center; font-size: 0.75rem; font-weight: 700;
    color: var(--text-tertiary); padding: 8px 4px;
}
.calendar-cell {
    min-height: 70px; padding: 6px; border-radius: var(--radius-sm);
    position: relative; cursor: default; transition: background 0.2s;
}
.calendar-cell:hover { background: var(--bg-surface); }
.calendar-cell.today { background: var(--accent-soft); }
.calendar-cell.other-month { opacity: 0.3; }
.calendar-day-num {
    font-size: 0.8rem; font-weight: 600; margin-bottom: 4px;
    font-family: 'Space Mono', monospace;
}
.calendar-cell.today .calendar-day-num { color: var(--accent); font-weight: 700; }
.calendar-event-dot {
    display: inline-block; padding: 2px 5px; border-radius: 4px;
    font-size: 0.6rem; margin: 1px 0; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.calendar-upcoming-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.calendar-upcoming-item:last-child { border-bottom: none; }
.calendar-upcoming-date {
    min-width: 50px; text-align: center; font-family: 'Space Mono', monospace;
}
.calendar-upcoming-date-day { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.calendar-upcoming-date-month { font-size: 0.7rem; color: var(--text-tertiary); }

/* ════════════════════════════════════════════════════════
   Achievements
   ════════════════════════════════════════════════════════ */
.achievements-summary {
    display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.achievement-summary-card {
    flex: 1; min-width: 120px; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px; text-align: center;
}
.achievement-summary-value {
    font-family: 'Space Mono', monospace;
    font-size: 2rem; font-weight: 700; color: var(--accent);
}
.achievement-summary-label { font-size: 0.8rem; color: var(--text-tertiary); margin-top: 4px; }

.achievements-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
}
.achievement-card {
    background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; text-align: center;
    transition: all 0.3s var(--ease); position: relative; overflow: hidden;
}
.achievement-card.unlocked {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.15);
}
.achievement-card.locked { opacity: 0.5; filter: grayscale(0.8); }
.achievement-icon { font-size: 2.5rem; margin-bottom: 8px; }
.achievement-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.achievement-desc { font-size: 0.75rem; color: var(--text-tertiary); }
.achievement-badge {
    position: absolute; top: 8px; left: 8px;
    background: var(--accent); color: white;
    font-size: 0.6rem; padding: 2px 8px; border-radius: 10px;
    font-weight: 700;
}
.achievement-progress {
    margin-top: 8px; height: 4px; background: var(--bg-surface);
    border-radius: 2px; overflow: hidden;
}
.achievement-progress-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.5s; }

/* ════════════════════════════════════════════════════════
   Exam Mode Banner
   ════════════════════════════════════════════════════════ */
.exam-mode-banner {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 900; padding: 0 20px;
}
.exam-mode-inner {
    max-width: 700px; margin: 12px auto; padding: 16px 24px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 1px solid var(--accent); border-radius: var(--radius-lg);
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 8px 32px rgba(129, 140, 248, 0.3);
    position: relative; color: #e0e7ff;
}
[data-theme="light"] .exam-mode-inner {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #1e1b4b;
}
.exam-mode-close {
    position: absolute; top: 8px; left: 8px;
    background: none; border: none; color: inherit;
    font-size: 1.1rem; cursor: pointer; opacity: 0.7;
}
.exam-mode-close:hover { opacity: 1; }
.exam-mode-icon { font-size: 2rem; flex-shrink: 0; }
.exam-mode-title { font-weight: 700; font-size: 0.85rem; opacity: 0.8; }
.exam-mode-subject { font-weight: 700; font-size: 1.1rem; }
.exam-mode-countdown {
    font-family: 'Space Mono', monospace; font-size: 1rem;
    margin-right: auto; white-space: nowrap;
}
.exam-mode-tips { font-size: 0.8rem; opacity: 0.8; }

/* ════════════════════════════════════════════════════════
   Resources Section — Professional Cards
   ════════════════════════════════════════════════════════ */

.add-resource-form {
    display: flex; gap: 8px; flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}
.add-resource-form input,
.add-resource-form select {
    flex: 1; min-width: 100px;
}

/* Upload inline */
.resource-upload-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1.5px dashed var(--border-strong);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    color: var(--text-tertiary);
    font-size: 0.8rem;
    position: relative;
    margin-bottom: 14px;
}
.resource-upload-inline:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}
.resource-upload-inline.dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}
.resource-upload-inline input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.resource-upload-inline .upload-icon { font-size: 1.1rem; }
.resource-upload-inline .upload-limit {
    margin-right: auto;
    font-size: 0.68rem;
    opacity: 0.6;
    font-family: 'Space Mono', monospace;
}

.resource-upload-progress {
    height: 3px; border-radius: 3px;
    background: var(--border); overflow: hidden;
    display: none; margin-top: -8px; margin-bottom: 14px;
}
.resource-upload-progress.active { display: block; }
.resource-upload-progress-fill {
    height: 100%; border-radius: 3px;
    background: var(--accent);
    transition: width 0.3s; width: 0%;
}

/* Resource cards grid */
.resources-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.res-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
    position: relative;
    overflow: hidden;
}

.res-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 4px; height: 100%;
    background: var(--res-accent, var(--accent));
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.res-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.res-card:hover::before { opacity: 1; }

.res-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; flex-shrink: 0;
    position: relative;
}

.res-card-icon.t-link { background: var(--accent-soft); --res-accent: var(--accent); }
.res-card-icon.t-youtube { background: var(--rose-soft); --res-accent: var(--rose); }
.res-card-icon.t-pdf { background: var(--amber-soft); --res-accent: var(--amber); }
.res-card-icon.t-summary { background: var(--emerald-soft); --res-accent: var(--emerald); }
.res-card-icon.t-book { background: var(--violet-soft); --res-accent: var(--violet); }
.res-card-icon.t-file { background: rgba(34,211,238,0.12); --res-accent: #22d3ee; }

.res-card-body { flex: 1; min-width: 0; }

.res-card-title {
    font-weight: 600; font-size: 0.85rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 3px;
    color: var(--text-primary);
}

.res-card-sub {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.7rem; color: var(--text-tertiary);
}

.res-card-tag {
    display: inline-flex; align-items: center;
    padding: 1px 6px; border-radius: 8px;
    font-size: 0.6rem; font-weight: 700;
    background: var(--bg-overlay);
    color: var(--text-tertiary);
}

.res-card-domain {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
}

.res-card-actions {
    display: flex; flex-direction: column; gap: 3px;
    flex-shrink: 0; opacity: 0;
    transition: opacity 0.15s;
}

.res-card:hover .res-card-actions { opacity: 1; }

.res-card-actions a,
.res-card-actions button {
    width: 28px; height: 28px;
    border-radius: 6px; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; cursor: pointer;
    transition: all 0.15s; text-decoration: none;
    background: transparent; color: var(--text-tertiary);
}

.res-card-actions .res-open:hover { background: var(--accent-soft); color: var(--accent); }
.res-card-actions .res-del:hover { background: var(--rose-soft); color: var(--rose); }

/* Section labels */
.res-section-label {
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
    padding: 10px 0 6px;
    display: flex; align-items: center; gap: 8px;
}

.res-section-label::after {
    content: '';
    flex: 1; height: 1px;
    background: var(--border);
}

@media (max-width: 768px) {
    .resources-cards-grid { grid-template-columns: 1fr; }
    .res-card-domain { display: none; }
}

/* ════════════════════════════════════════════════════════
   Study Tracker
   ════════════════════════════════════════════════════════ */
.study-log-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.study-log-form select, .study-log-form input { flex: 1; min-width: 110px; }

.study-week-chart {
    display: flex; align-items: flex-end; gap: 8px;
    height: 180px; padding: 10px 0;
    border-bottom: 2px solid var(--border); margin-bottom: 12px;
}
.study-bar-col {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 6px; height: 100%; justify-content: flex-end;
}
.study-bar {
    width: 100%; max-width: 50px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-muted, var(--accent)));
    transition: height 0.5s var(--ease); min-height: 2px;
}
.study-bar-value { font-size: 0.68rem; font-weight: 700; color: var(--text-secondary); font-family: 'Space Mono', monospace; }
.study-bar-day { font-size: 0.72rem; font-weight: 600; color: var(--text-tertiary); }
.study-bar-col.is-today .study-bar { background: linear-gradient(180deg, var(--accent), var(--violet)); box-shadow: 0 0 12px var(--accent-soft); }
.study-bar-col.is-today .study-bar-day { color: var(--accent); font-weight: 700; }

.study-week-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.8rem; }
.study-week-stat { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--bg-surface); border: 1px solid var(--border); }
.study-week-stat strong { font-family: 'Space Mono', monospace; color: var(--accent); }

.study-subject-bar { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.study-subject-bar:last-child { border-bottom: none; }
.study-subject-name { font-size: 0.85rem; font-weight: 600; width: 100px; flex-shrink: 0; }
.study-subject-progress { flex: 1; height: 10px; border-radius: 6px; background: var(--bg-overlay); overflow: hidden; }
.study-subject-fill { height: 100%; border-radius: 6px; transition: width 0.5s var(--ease); }
.study-subject-hours { font-size: 0.75rem; font-weight: 700; font-family: 'Space Mono', monospace; width: 65px; text-align: left; color: var(--text-secondary); }

/* ════════════════════════════════════════════════════════
   Exam Plan
   ════════════════════════════════════════════════════════ */
.exam-date-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; border-radius: var(--radius-sm); background: var(--bg-surface); border: 1px solid var(--border); flex-wrap: wrap; }
.exam-date-subject { font-weight: 600; font-size: 0.88rem; flex: 1; min-width: 120px; }
.exam-date-row input[type="date"] { max-width: 160px; }

.exam-diff-btns { display: flex; gap: 4px; }
.exam-diff-btn { padding: 4px 10px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg-base); font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: inherit; color: var(--text-secondary); }
.exam-diff-btn.d-easy { background: var(--emerald-soft); border-color: var(--emerald); color: var(--emerald); }
.exam-diff-btn.d-medium { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.exam-diff-btn.d-hard { background: var(--rose-soft); border-color: var(--rose); color: var(--rose); }

.exam-plan-day { margin-bottom: 10px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.exam-plan-day-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-surface); font-weight: 700; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.exam-plan-day-date { font-size: 0.72rem; color: var(--text-tertiary); font-family: 'Space Mono', monospace; }
.exam-plan-slot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.exam-plan-slot:last-child { border-bottom: none; }
.exam-plan-slot-color { width: 4px; height: 32px; border-radius: 3px; flex-shrink: 0; }
.exam-plan-slot-info { flex: 1; }
.exam-plan-slot-subject { font-weight: 600; font-size: 0.85rem; }
.exam-plan-slot-meta { font-size: 0.72rem; color: var(--text-tertiary); }
.exam-plan-slot-hours { font-size: 0.78rem; font-weight: 700; font-family: 'Space Mono', monospace; padding: 3px 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.exam-plan-today .exam-plan-day-head { background: var(--accent-soft); color: var(--accent); }

.exam-plan-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.exam-plan-summary-chip { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--bg-surface); border: 1px solid var(--border); font-size: 0.8rem; }
.exam-plan-summary-chip strong { font-family: 'Space Mono', monospace; color: var(--accent); }

/* ════════════════════════════════════════════════════════
   Schedule: Multi-day Selector & Attendance Types
   ════════════════════════════════════════════════════════ */

.schedule-days-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-day-toggle {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    user-select: none;
}

.schedule-day-toggle:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.schedule-day-toggle.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.schedule-day-config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.schedule-day-config-item .day-config-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.schedule-day-config-item .day-config-options {
    display: flex;
    gap: 6px;
}

.attendance-type-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    background: var(--bg-overlay);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.attendance-type-btn:hover {
    border-color: var(--accent);
}

.attendance-type-btn.active[data-type="onsite"] {
    background: var(--emerald-soft);
    border-color: var(--emerald);
    color: var(--emerald);
}

.attendance-type-btn.active[data-type="online"] {
    background: var(--violet-soft);
    border-color: var(--violet);
    color: var(--violet);
}

/* Schedule item attendance badge — now handled by sched-card-badge */

/* Timeline attendance badge (dashboard) */
.timeline-attendance-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-right: 6px;
}

.timeline-attendance-badge.onsite {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.timeline-attendance-badge.online {
    background: var(--violet-soft);
    color: var(--violet);
}

/* ════════════════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero-card { padding: 24px; }
    .hero-text h2 { font-size: 1.2rem; }
    .weather-temp { font-size: 1.8rem; }
    .subjects-grid { grid-template-columns: 1fr; }
    .input-row { grid-template-columns: 1fr; }
}
