/* ============================================================================
   1. CSS VARIABLES & THEME TOKENS (LIGHT & DARK MODE)
   ============================================================================ */
:root {
    --bg-main: #f7f6fb;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-main: #26223b;
    --text-muted: #777099;
    --border-color: #e5e1f5;
    --primary: #8170e9;
    --primary-hover: #6d5ce7;
    --accent-light: #ece8ff;
    --card-shadow: 0 10px 30px rgba(105, 89, 205, 0.06);
    --modal-bg: #ffffff;
    --input-bg: #ffffff;
}

body.dark-mode {
    --bg-main: #110f1a;
    --bg-sidebar: #171424;
    --bg-card: #1c182b;
    --text-main: #f2eefb;
    --text-muted: #a69ebd;
    --border-color: #2e2845;
    --primary: #9485f5;
    --primary-hover: #a69afa;
    --accent-light: #282142;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --modal-bg: #1c182b;
    --input-bg: #141121;
}

/* ============================================================================
   2. RESET & BASE STYLES
   ============================================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

.hidden {
    display: none !important;
}

/* ============================================================================
   3. AUTHENTICATION & APP SHELL LAYOUT
   ============================================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top right, var(--accent-light) 0%, var(--bg-main) 60%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, border 0.3s ease;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-main);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.auth-tab {
    border: none;
    background: transparent;
    padding: 9px 12px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 12px 0 6px;
    color: var(--text-main);
}

.auth-form input {
    width: 100%;
    padding: 11px 13px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(129, 112, 233, 0.2);
}

.auth-error {
    color: #d9534f;
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 18px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ============================================================================
   4. SIDEBAR & NAVIGATION
   ============================================================================ */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease, background 0.3s ease, border 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    padding: 0 8px 20px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    background: var(--accent-light);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.brand span strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.brand span small {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    padding: 12px 10px 6px;
}

.nav-label-gap {
    margin-top: 16px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--accent-light);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--primary);
    font-weight: 600;
}

.new-tag {
    margin-left: auto;
    font-size: 0.65rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 6px;
    font-style: normal;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-card {
    background: linear-gradient(135deg, var(--accent-light) 0%, rgba(129, 112, 233, 0.1) 100%);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 14px;
}

.upgrade-card .sparkle {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 4px;
}

.upgrade-card strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.upgrade-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 10px;
}

.upgrade-card button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.upgrade-card button:hover {
    background: var(--primary-hover);
}

.profile-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.2s ease;
}

.profile-mini:hover {
    background: var(--accent-light);
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.profile-mini span strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-main);
}

.profile-mini span small {
    font-size: 0.73rem;
    color: var(--text-muted);
}

.dots {
    margin-left: auto;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ============================================================================
   5. MAIN CONTENT AREA & TOPBAR
   ============================================================================ */
.main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 70px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 16px;
    transition: background 0.3s ease, border 0.3s ease;
}

.mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-main);
    cursor: pointer;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb span {
    margin: 0 6px;
}

.breadcrumb strong {
    color: var(--text-main);
    font-weight: 600;
}

.top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.global-search {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 10px;
    gap: 8px;
    width: 240px;
    transition: border 0.2s ease;
}

.global-search:focus-within {
    border-color: var(--primary);
}

.global-search span {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.global-search input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.88rem;
    color: var(--text-main);
    width: 100%;
}

.global-search kbd {
    font-size: 0.7rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 5px;
    border-radius: 5px;
    color: var(--text-muted);
}

.icon-button {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1rem;
    transition: background 0.2s ease;
}

.icon-button:hover {
    background: var(--accent-light);
    color: var(--primary);
}

.content {
    padding: 32px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================================
   6. DASHBOARD COMPONENTS & HERO CARD
   ============================================================================ */
.welcome-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #2e7d32;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wave {
    color: var(--primary);
    font-size: 1.2rem;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.primary-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(129, 112, 233, 0.25);
    transition: background 0.2s ease, transform 0.15s ease;
}

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

/* Hero Card */
.hero-card {
    background: linear-gradient(135deg, #1c182b 0%, #292442 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(28, 24, 43, 0.2);
}

.hero-copy {
    z-index: 2;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    color: #dcd6f7;
}

.hero-copy h2 {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero-copy h2 em {
    font-style: normal;
    color: #a394f7;
}

.hero-copy p {
    color: #bfaee3;
    font-size: 0.95rem;
    margin-bottom: 20px;
    max-width: 420px;
    line-height: 1.5;
}

.hero-button {
    background: #ffffff;
    color: #1c182b;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.hero-button:hover {
    background: #ece7fb;
    transform: translateY(-1px);
}

.hero-art {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    color: #26223b;
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 3;
}

.card-note {
    top: 20px;
    left: 10px;
}

.card-score {
    bottom: 20px;
    right: 10px;
}

.floating-card b {
    display: block;
    font-size: 0.85rem;
}

.floating-card small {
    color: #6c668a;
    font-size: 0.7rem;
}

.float-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.float-icon.purple {
    background: #ece8ff;
    color: #8170e9;
}

.float-icon.yellow {
    background: #fff8e8;
    color: #f5a623;
}

/* ============================================================================
   7. STATS GRID & DASHBOARD PANELS
   ============================================================================ */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.section-heading p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.text-button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}

.text-button:hover {
    text-decoration: underline;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, background 0.3s ease, border 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.stat-icon.mint {
    background: #e6f4ea;
    color: #137333;
}

.stat-icon.lavender {
    background: #ece8ff;
    color: #8170e9;
}

.stat-icon.peach {
    background: #fef0ec;
    color: #c94a29;
}

.stat-icon.blue {
    background: #e8f0fe;
    color: #1a73e8;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value span {
    font-size: 1.1rem;
}

.stat-value .unit,
.stat-value .muted-value {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-foot {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.status-good {
    color: #137333;
    font-weight: 600;
}

.mini-progress {
    height: 6px;
    background: var(--bg-main);
    border-radius: 6px;
    overflow: hidden;
}

.mini-progress span {
    display: block;
    height: 100%;
    background: #137333;
    border-radius: 6px;
    transition: width 0.4s ease;
}

.lavender-bar span {
    background: var(--primary);
}

.peach-bar span {
    background: #e06d4e;
}

.blue-bar span {
    background: #1a73e8;
}

/* Dashboard Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

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

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: background 0.3s ease, border 0.3s ease;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.panel-heading h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.panel-heading p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.more-button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
}

/* Focus Panel & Tasks */
.focus-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.progress-ring {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0 60%, var(--border-color) 60% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.progress-ring::before {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: 50%;
}

.progress-ring div {
    position: relative;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.1;
    color: var(--text-main);
}

.progress-ring strong {
    display: block;
    font-size: 0.85rem;
}

.focus-progress strong {
    font-size: 0.92rem;
    color: var(--text-main);
}

.focus-progress p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 2px 0 6px;
}

.inline-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
}

.inline-link:hover {
    text-decoration: underline;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 230px;
    overflow-y: auto;
    margin-bottom: 14px;
}

.task {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.task input[type="checkbox"] {
    display: none;
}

.check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.task input:checked ~ .check {
    background: var(--primary);
    border-color: var(--primary);
}

.task input:checked ~ .check::after {
    content: '✓';
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.task-name {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-main);
}

.task-name b {
    display: block;
    font-weight: 600;
}

.task-name small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.task.done .task-name b {
    text-decoration: line-through;
    opacity: 0.6;
}

.task-time,
.task-tag {
    font-size: 0.74rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.add-task {
    width: 100%;
    background: var(--bg-main);
    border: 1px dashed var(--border-color);
    color: var(--text-main);
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-task:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* AI Panel */
.ai-badge {
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--accent-light);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 6px;
}

.ai-welcome {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 14px;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ai-welcome strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.ai-welcome p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.suggestion {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

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

.chat-input {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 6px 6px 14px;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.88rem;
    color: var(--text-main);
}

.chat-input button {
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chat-input button:hover {
    background: var(--primary-hover);
}

/* Resources & Deadlines */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
}

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

.resource-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.resource-icon.java {
    background: #fff0e8;
    color: #d9534f;
}

.resource-icon.db {
    background: #e8f0fe;
    color: #1a73e8;
}

.resource-icon.dsa {
    background: #e6f4ea;
    color: #137333;
}

.resource span {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-main);
}

.resource span b {
    display: block;
    font-weight: 600;
}

.resource span small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.resource-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.deadline {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 10px;
}

.date-box {
    width: 42px;
    height: 42px;
    background: #fef0ec;
    color: #d9534f;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.date-box small {
    font-size: 0.58rem;
    text-transform: uppercase;
    margin-top: 2px;
}

.date-blue {
    background: #e8f0fe;
    color: #1a73e8;
}

.date-green {
    background: #e6f4ea;
    color: #137333;
}

.deadline-info {
    flex: 1;
    font-size: 0.85rem;
}

.deadline-info b {
    display: block;
    color: var(--text-main);
    font-weight: 600;
}

.deadline-info small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.deadline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.deadline-dot.amber {
    background: #d9534f;
}

.deadline-dot.blue-dot {
    background: #1a73e8;
}

.deadline-dot.green-dot {
    background: #137333;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

footer b {
    color: var(--text-main);
}

/* ============================================================================
   8. MODALS & TOASTS
   ============================================================================ */
dialog {
    background: var(--modal-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    margin: auto;
    transition: background 0.3s ease, color 0.3s ease;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-head h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-head button {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
}

#modalBody label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 10px 0 4px;
    color: var(--text-main);
}

#modalBody input,
#modalBody textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    box-sizing: border-box;
}

#modalBody input:focus,
#modalBody textarea:focus {
    border-color: var(--primary);
}

.modal-submit {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 14px;
    transition: background 0.2s ease;
}

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

.answer-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-main);
    margin-top: 10px;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1c182b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ============================================================================
   9. RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .mobile-menu {
        display: block;
    }

    .hero-card {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .hero-art {
        display: none;
    }

    .dashboard-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 20px 16px;
    }

    .global-search {
        width: 160px;
    }
}
