html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--app-header-height, 65px) + 24px);
}

/* ============================================
   PREMIUM SAAS ANALYTICS DASHBOARD
   LeetCode Performance Engine
   ============================================ */

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

:root {
    /* Premium Color System */
    --primary: #22c55e;
    --accent: #6366F1;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --warning: #F59E0B;
    --danger: #EF4444;
    --success: #22c55e;

    /* Dark Theme (default) */
    --bg-primary: #0b1220;
    --bg-secondary: #131c2e;
    --bg-card: #1a2540;
    --bg-tertiary: #1a2540;
    --text-primary: #e2e8f0;
    --text-secondary: #8b95a5;
    --text-muted: #556070;
    --border: rgba(255, 255, 255, 0.07);

    /* Shadows & Effects */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
    --glow-primary: 0 0 20px rgba(34, 197, 94, 0.3);
    --glow-accent: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Spacing tokens */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Sticky layout heights — must match rendered header heights */
    --app-header-height: 65px;
    --table-header-height: 57px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, #0f172a, #020617);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.light-mode {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.app {
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

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

/* ============================================
   HEADER
   ============================================ */

.header {
    background: rgba(11, 18, 32, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: relative;
    
    z-index: 100;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* On mobile: not sticky (saves screen space) */
@media (max-width: 768px) {
    .header {
        position: relative;
    }
    .table-header {
        position: relative;
        top: auto;
    }
    .problems-table th {
        position: static;
    }
}

.header.scrolled {
    box-shadow: var(--shadow-lg);
}

body.light-mode .header {
    background: rgba(255, 253, 245, 0.92);
    border-bottom-color: var(--border);
    color: var(--text-primary);
}

body.light-mode .subtitle,
body.light-mode .header p {
    color: var(--text-secondary);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 769px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 20px 24px;
        gap: 20px;
    }
}

.header-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

@media (min-width: 769px) {
    .header-main {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: auto;
    }
}

.header-title h1 {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2px;
}

@media (min-width: 769px) {
    .header-title h1 {
        font-size: 24px;
    }
}

.subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

@media (min-width: 769px) {
    .subtitle {
        font-size: 13px;
    }
}

.sync-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid;
    white-space: nowrap;
    align-self: flex-start;
}

.sync-status.ok {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}

.sync-status.expired {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.sync-status.checking {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-color: var(--border);
}

.header-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

@media (min-width: 769px) {
    .header-actions {
        display: flex;
        gap: 12px;
        width: auto;
    }
}

.btn-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary), var(--accent-blue, #3b82f6));
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 44px;
}

@media (min-width: 769px) {
    .btn-profile {
        padding: 10px 18px;
        font-size: 13px;
    }
}

/* Shine sweep on hover */
.btn-profile::after {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-profile:hover::after {
    left: 130%;
}

.btn-profile:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
    filter: brightness(1.08);
}

.btn-profile:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.btn-sync-lc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    white-space: nowrap;
    min-height: 44px;
}

@media (min-width: 769px) {
    .btn-sync-lc {
        padding: 9px 16px;
        font-size: 13px;
    }
}

.btn-sync-lc:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.btn-sync-lc:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.sync-spinner {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.sync-status {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.sync-status.ok {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}
.sync-status.expired {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}
.sync-status.checking {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-color: var(--border);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:active {
    animation: themeRotate 0.4s ease;
}

@keyframes themeRotate {
    0%   { transform: scale(0.97) rotate(0deg); }
    50%  { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    min-width: 260px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    animation: slideIn 0.25s ease;
    line-height: 1.5;
}

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

.notification-title {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 3px;
}

.notification-message {
    font-weight: 500;
    font-size: 0.82rem;
    opacity: 0.92;
    white-space: pre-line;
    word-break: break-word;
}

.notification-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
    transition: color 0.15s;
}
.notification-dismiss:hover { color: #fff; }

.notification-success  { background: linear-gradient(135deg, var(--success), #00A87A); color: white; }
.notification-error    { background: linear-gradient(135deg, var(--danger), #DC2626);  color: white; }
.notification-warning  { background: linear-gradient(135deg, #f59e0b, #d97706);        color: white; }
.notification-info     { background: linear-gradient(135deg, #3b82f6, #2563eb);        color: white; }

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================
   MICRO ANIMATIONS
   ============================================ */

.fade-in {
    animation: fadeInUp 0.4s ease;
}

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

.fade-out {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.fade-in-new {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes highlightRow {
    0%   { background-color: rgba(99, 102, 241, 0.4); }
    50%  { background-color: rgba(99, 102, 241, 0.2); }
    100% { background-color: transparent; }
}

.highlight-row {
    animation: highlightRow 2.5s ease;
}

/* ============================================
/* ============================================
   RECENT ACTIVITY — Today's Progress + Recently Solved
   ============================================ */

/* Stable 3-col grid — always 3 columns regardless of item count */
/* ── Today's Progress list ─────────────────────────────────────────────────── */
.tp-list {
    display: flex;
    flex-direction: column;
}

.tp-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.tp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    transition: background 0.15s ease;
}

.tp-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.tp-item-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.tp-problem-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.tp-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.tp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tp-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tp-item-right .pc-btn-open {
    min-width: 80px;
    text-align: center;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tp-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.tp-badge-new {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.tp-badge-revisited {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ── Recently Solved status badges ─────────────────────────────────────────── */
.rs-status {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.rs-status-fresh {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.rs-status-stale {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ── Striver / Target toggle buttons ───────────────────────────────────────── */
.pc-btn-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 22px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 1.1rem;
}

.pc-btn-toggle:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.pc-btn-toggle.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.pc-btn-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-icon {
    display: block;
    line-height: 1;
}

.recent-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Trend indicator */
.trend {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.trend.up {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.trend.down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

button:active {
    transform: scale(0.97);
}

/* Status / difficulty colors */
.easy  { color: #22c55e; }
.medium { color: #f59e0b; }
.hard  { color: #ef4444; }

.priority-high { color: #ef4444; }
.priority-mid  { color: #f59e0b; }
.priority-low  { color: #22c55e; }

/* ============================================
   NAVBAR STATS BAR — Extraordinary dark mode
   ============================================ */

.navbar-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(17,24,39,0.97) 0%, rgba(11,18,32,0.99) 100%);
    border: 1px solid rgba(0, 200, 150, 0.25);
    border-top: 1px solid rgba(0, 200, 150, 0.45);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0,200,150,0.1),
        0 0 30px rgba(0,200,150,0.08),
        0 8px 32px rgba(0,0,0,0.5),
        0 1px 0 rgba(255,255,255,0.05) inset;
    position: relative;
    isolation: isolate;
    animation: navbarBorderPulse 4s ease-in-out infinite;
}

@keyframes navbarBorderPulse {
    0%, 100% { border-top-color: rgba(0, 200, 150, 0.3); box-shadow: 0 0 0 1px rgba(0,200,150,0.08), 0 0 20px rgba(0,200,150,0.06), 0 8px 32px rgba(0,0,0,0.5); }
    50%       { border-top-color: rgba(0, 200, 150, 0.7); box-shadow: 0 0 0 1px rgba(0,200,150,0.15), 0 0 40px rgba(0,200,150,0.12), 0 8px 32px rgba(0,0,0,0.5); }
}

/* Animated shimmer sweep — bright moving light */
.navbar-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(0, 200, 150, 0.04) 20%,
        rgba(0, 200, 150, 0.18) 40%,
        rgba(99, 102, 241, 0.14) 55%,
        rgba(0, 200, 150, 0.04) 75%,
        transparent 100%
    );
    animation: navbarShimmer 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    border-radius: 20px;
}

/* Glowing bottom border pulse */
.navbar-stats::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 200, 150, 0.0) 10%,
        rgba(0, 200, 150, 0.9) 35%,
        rgba(99, 102, 241, 0.8) 65%,
        rgba(0, 200, 150, 0.0) 90%,
        transparent 100%
    );
    animation: navbarGlow 4s ease-in-out infinite;
    pointer-events: none;
    filter: blur(1px);
}

@keyframes navbarShimmer {
    0%   { left: -100%; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { left: 160%; opacity: 0; }
}

@keyframes navbarGlow {
    0%, 100% { opacity: 0.2; transform: scaleX(0.4); }
    30%       { opacity: 0.7; transform: scaleX(0.8); }
    50%       { opacity: 1;   transform: scaleX(1); }
    70%       { opacity: 0.7; transform: scaleX(0.8); }
}

.navbar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    flex: 1;
    transition: background 0.3s ease, transform 0.2s ease;
    cursor: default;
    position: relative;
    z-index: 1;
}

.navbar-stat-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

/* Hover: radial glow spotlight from bottom */
.navbar-stat::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 130%, rgba(0,200,150,0.18) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    border-radius: 12px;
}

.navbar-stat:hover::before {
    opacity: 1;
}

.navbar-stat:hover {
    transform: translateY(-3px);
}

/* Number count-up feel on load */
.navbar-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
    animation: statPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    text-shadow: 0 0 16px rgba(0,200,150,0.1);
}

.navbar-stat:nth-child(1) .navbar-stat-value { animation-delay: 0.05s; }
.navbar-stat:nth-child(3) .navbar-stat-value { animation-delay: 0.10s; }
.navbar-stat:nth-child(5) .navbar-stat-value { animation-delay: 0.15s; }
.navbar-stat:nth-child(7) .navbar-stat-value { animation-delay: 0.20s; }

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

.navbar-stat-label {
    font-size: 0.62rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    opacity: 0.85;
}

.navbar-stat-icon {
    font-size: 1.1rem;
    opacity: 0.8;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.navbar-stat:hover .navbar-stat-icon {
    transform: scale(1.15) rotate(-4deg);
    opacity: 1;
}

/* Targeted stat — gradient text */
.navbar-stat-targeted .navbar-stat-value {
    background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(0,200,150,0.5));
}

.navbar-stat-divider {
    width: 1px;
    height: 44px;
    background: linear-gradient(180deg, transparent, rgba(0,200,150,0.3) 50%, transparent);
    flex-shrink: 0;
}

/* ── Light mode overrides ── */
body.light-mode .navbar-stats {
    background: #ffffff;
    border: 1.5px solid rgba(0, 200, 150, 0.5);
    border-top: 3px solid #00C896;
    box-shadow:
        0 4px 24px rgba(0,200,150,0.15),
        0 1px 4px rgba(0,0,0,0.08);
    animation: navbarBorderPulseLight 4s ease-in-out infinite;
}

@keyframes navbarBorderPulseLight {
    0%, 100% { border-top-color: rgba(0, 200, 150, 0.35); box-shadow: 0 0 0 1px rgba(0,200,150,0.1), 0 0 16px rgba(0,200,150,0.08), 0 8px 32px rgba(0,0,0,0.07); }
    50%       { border-top-color: rgba(0, 200, 150, 0.7);  box-shadow: 0 0 0 1px rgba(0,200,150,0.18), 0 0 32px rgba(0,200,150,0.14), 0 8px 32px rgba(0,0,0,0.07); }
}

body.light-mode .navbar-stats::before {
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(0, 200, 150, 0.06) 20%,
        rgba(0, 200, 150, 0.18) 40%,
        rgba(99, 102, 241, 0.12) 55%,
        rgba(0, 200, 150, 0.06) 75%,
        transparent 100%
    );
}

body.light-mode .navbar-stats::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 200, 150, 0.0) 10%,
        rgba(0, 200, 150, 0.7) 35%,
        rgba(99, 102, 241, 0.6) 65%,
        rgba(0, 200, 150, 0.0) 90%,
        transparent 100%
    );
}

body.light-mode .navbar-stat:hover {
    background: rgba(0, 200, 150, 0.06);
}

body.light-mode .navbar-stat::before {
    background: radial-gradient(ellipse at 50% 120%, rgba(0,200,150,0.12) 0%, transparent 70%);
}

body.light-mode .navbar-stat-value {
    color: #0f172a;
    text-shadow: 0 0 20px rgba(0,200,150,0.12);
}

body.light-mode .navbar-stat-label {
    color: #475569;
}

body.light-mode .navbar-stat-divider {
    background: linear-gradient(180deg, transparent, rgba(0,200,150,0.25) 50%, transparent);
}

body.light-mode .navbar-stat-targeted .navbar-stat-value {
    background: linear-gradient(135deg, #059669 0%, #6366F1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(0,200,150,0.3));
}

@media (max-width: 768px) {
    .navbar-stats {
        flex-wrap: wrap;
        border-radius: 14px;
        margin-bottom: 20px;
    }
    .navbar-stat {
        padding: 14px 16px;
        min-width: 50%;
    }
    .navbar-stat-value {
        font-size: 1.45rem;
    }
    .navbar-stat-divider {
        display: none;
    }
}

/* ============================================
   STATS GRID
   ============================================ */

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

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 200, 150, 0.3);
}

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

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 200, 150, 0.1);
    border-radius: 12px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   PROGRESS CARD
   ============================================ */

.progress-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.progress-card:hover {
    box-shadow: var(--shadow-md);
}

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

.progress-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.btn-add-problem {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-blue, #3b82f6));
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-problem:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-accent);
}

.btn-add-problem span {
    font-size: 20px;
    line-height: 1;
}

.btn-restore-deleted {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--warning), #F59E0B);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-restore-deleted:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.btn-restore-deleted span {
    font-size: 18px;
    line-height: 1;
}

.btn-permanent-delete {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-permanent-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-permanent-delete span {
    font-size: 16px;
    line-height: 1;
}
.btn-restore-deleted:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.btn-restore-deleted span {
    font-size: 18px;
    line-height: 1;
}

.progress-bar-wrapper {
    margin-bottom: 16px;
}

.progress-bar-track {
    background: var(--bg-tertiary);
    border-radius: 12px;
    height: 40px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary), #00E5A8);
    height: 100%;
    border-radius: 12px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    position: relative;
    z-index: 1;
}

.rolling-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.rolling-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rolling-stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.rolling-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.rolling-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.rolling-stat-value.solved {
    color: var(--primary);
}

.rolling-stat-value.target {
    color: var(--accent);
}

/* ============================================
   ANALYTICS GRID
   ============================================ */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

.analytics-card {
    background: var(--bg-card, var(--bg-secondary));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.analytics-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 16px 16px 0 0;
}

.analytics-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    border-color: rgba(34, 197, 94, 0.3);
}

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

.analytics-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

/* Difficulty Stats */
.difficulty-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.difficulty-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.difficulty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-easy {
    background: rgba(0, 200, 150, 0.15);
    color: var(--success);
}

.difficulty-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.difficulty-hard {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.difficulty-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.difficulty-bar {
    background: var(--bg-tertiary);
    border-radius: 8px;
    height: 16px;
    overflow: hidden;
    position: relative;
}

.difficulty-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.difficulty-bar-fill.difficulty-easy {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.difficulty-bar-fill.difficulty-medium {
    background: linear-gradient(90deg, var(--warning), #FBBF24);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.difficulty-bar-fill.difficulty-hard {
    background: linear-gradient(90deg, var(--danger), #F87171);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.difficulty-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

/* Pattern Intelligence - Premium Ranked Cards */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.pattern-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pattern-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.pattern-card.pattern-success {
    border-color: rgba(0, 200, 150, 0.4);
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.05), rgba(0, 200, 150, 0.02));
}

.pattern-card.pattern-success:hover {
    box-shadow: var(--glow-primary);
}

.pattern-card.pattern-warning {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
}

.pattern-card.pattern-danger {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
}

.pattern-rank {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 6px;
}

.pattern-info {
    margin-bottom: 12px;
}

.pattern-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pattern-stats-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.pattern-percentage {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pattern-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--success);
    background: rgba(0, 200, 150, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
}

/* Alerts */
.alert {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent);
}

/* ============================================
   FILTERS CARD — entry + hover animations
   ============================================ */

.table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: visible;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    margin-top: 32px;
    animation: filterCardEntry 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

/* ============================================
   PREMIUM TABLE TOOLBAR
   ============================================ */
.table-toolbar {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(19, 28, 46, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
    transition: box-shadow 0.3s ease, background 0.3s ease, padding 0.3s ease;
    gap: 16px;
    flex-wrap: nowrap;
}

.table-toolbar.scrolled-header {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(255,255,255,0.05) inset;
    background: rgba(13, 20, 36, 0.92);
    border-bottom-color: rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 14px 24px;
}

.table-toolbar-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
    gap: 3px;
    flex: 0 0 auto;
    width: fit-content;
}

.table-toolbar-left h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.table-toolbar-subtitle {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.table-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    align-self: center;
}

/* Toolbar Search */
.toolbar-search {
    position: relative;
    display: flex;
    align-items: center;
    height: 36px;
}

.toolbar-search .search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.toolbar-search input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0 14px 0 32px;
    color: var(--text-primary);
    font-size: 13px;
    width: 200px;
    height: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) inset;
}

.toolbar-search input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1), 0 1px 2px rgba(0,0,0,0.1) inset;
    width: 240px;
}

/* Toolbar Filters */
.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 36px;
}

.toolbar-select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 0 22px 0 8px;
    height: 100%;
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 8px auto;
    display: flex;
    align-items: center;
}

.toolbar-select:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.toolbar-select.active {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236366f1%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

.toolbar-select:focus {
    outline: none;
}

.toolbar-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.toolbar-clear-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.toolbar-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.table-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0 8px;
    height: 100%;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

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

.table-count.count-update {
    animation: countPulse 0.5s ease;
}

@keyframes countPulse {
    0%   { transform: scale(1);    color: var(--text-secondary); }
    50%  { transform: scale(1.15); color: var(--primary); }
    100% { transform: scale(1);    color: var(--text-secondary); }
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 769px) {
    .table-wrapper {
        overflow-x: clip;
    }
}

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

/* sticky must be on th, NOT thead — thead sticky is ignored by browsers with border-collapse */
.problems-table thead {
    background: var(--bg-tertiary);
}

.problems-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: var(--table-header-height);
    z-index: 12;
    background: var(--bg-tertiary);
}

/* Fix 1: Remove stacking context from tbody — was causing rows to render above sticky th */
.problems-table tbody {
    position: static;
    z-index: auto;
}

.problems-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease, opacity 0.2s ease;
}

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

.problems-table tbody tr:hover {
    background: rgba(34, 197, 94, 0.04);
}

.problems-table tbody tr:last-child {
    border-bottom: none;
}

.problems-table tbody tr.highlight-row {
    animation: highlightRowPulse 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes highlightPulse {
    0%, 100% { background: transparent; }
    50% { background: rgba(0, 200, 150, 0.12); }
}

@keyframes highlightRow {
    0% { background: rgba(0, 200, 150, 0.25); transform: scale(1.01); }
    100% { background: transparent; transform: scale(1); }
}

.problems-table td {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 500;
    vertical-align: middle;
    color: var(--text-primary);
}

.problem-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
    white-space: nowrap;
}

.problem-title {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 280px;
}

/* Desktop: table scrollable horizontally — use clip (not auto) so sticky th isn't broken */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 16px 16px;
}
@media (min-width: 769px) {
    .table-wrapper {
        overflow-x: clip;
    }
}
.problems-table {
    min-width: 640px;
}

body.light-mode .problems-table thead {
    background: #F1F5F9;
}

body.light-mode .problems-table th {
    background: #F1F5F9;
}

body.light-mode .problems-table tbody tr:hover {
    background: rgba(0, 200, 150, 0.04);
}

body.light-mode .table-count {
    background: #F1F5F9;
}

.problem-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.problem-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.problem-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--primary), #00A87A);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.problem-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(0, 200, 150, 0.4);
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-easy {
    background: rgba(0, 200, 150, 0.15);
    color: var(--success);
}

.badge-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-hard {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-pattern {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
}

.status-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

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

.status-select.status-done {
    color: var(--success);
    border-color: rgba(0, 200, 150, 0.3);
}

.status-select.status-in-progress {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.difficulty-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

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

.difficulty-select.difficulty-easy {
    color: var(--success);
    border-color: rgba(0, 200, 150, 0.3);
}

.difficulty-select.difficulty-medium {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.difficulty-select.difficulty-hard {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 7px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

/* Target toggle button in table */
.btn-target {
    background: rgba(100, 116, 139, 0.12);
    border: 1.5px solid rgba(100, 116, 139, 0.35);
    color: var(--text-secondary);
    padding: 5px 9px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.18s ease;
    line-height: 1;
    min-width: 32px;
    opacity: 0.6;
}

.btn-target:hover {
    opacity: 1;
    background: rgba(0, 200, 150, 0.12);
    border-color: rgba(0, 200, 150, 0.5);
    transform: scale(1.08);
}

.btn-target.active {
    opacity: 1;
    background: rgba(0, 200, 150, 0.18);
    border-color: rgba(0, 200, 150, 0.7);
    box-shadow: 0 0 10px rgba(0, 200, 150, 0.3);
    animation: targetPulse 2s ease-in-out infinite;
}

@keyframes targetPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
    50%       { box-shadow: 0 0 0 4px rgba(0, 200, 150, 0.18); }
}

.btn-target:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

body.light-mode .btn-target {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.3);
    color: #64748b;
    opacity: 0.65;
}

body.light-mode .btn-target:hover {
    opacity: 1;
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(22, 163, 74, 0.45);
}

body.light-mode .btn-target.active {
    opacity: 1;
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.55);
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.25);
}

/* Revision count chip in table */
.rev-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.18);
    white-space: nowrap;
}

.rev-chip.zero {
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    border-color: var(--border);
}

/* Inline +/- revision controls */
.rev-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rev-btn {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.rev-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(34, 197, 94, 0.08);
}

.rev-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* Password confirm modal */
.pw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.15s ease;
}

.pw-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 340px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.2s ease;
}

.pw-modal h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.pw-modal p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.pw-modal input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.pw-modal input:focus {
    border-color: var(--primary);
}

.pw-modal-error {
    font-size: 12px;
    color: var(--danger);
    margin-bottom: 10px;
    min-height: 16px;
}

.pw-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.pw-modal-actions .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
}

.pw-modal-actions .btn-danger {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pw-modal-actions .btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.pw-modal-actions .btn-confirm {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pw-modal-actions .btn-confirm:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state small {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    margin-top: 8px;
}

/* Table row fade-out animation */
.problems-table tbody tr {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.problems-table tbody tr.deleting {
    opacity: 0;
    transform: translateX(-20px);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    margin: auto;
}

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

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

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

.modal-body {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.1);
}

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

.form-hint {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-blue, #3b82f6));
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: var(--glow-primary);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* ============================================
   RESPONSIVE DESIGN (consolidated)
   ============================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .pattern-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-width: 95vw;
        max-height: 85vh;
        margin: 10px;
    }

    .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header { padding: 16px; }
    .modal-footer { padding: 16px; }

    body { -webkit-overflow-scrolling: touch; }

    input, select, textarea { font-size: 16px !important; }
}

/* ============================================
   LIGHT MODE (Optional Enhancement)
   ============================================ */

body.light-mode {
    --bg-primary: #FFFDF5;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-tertiary: #F9F7EF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --primary: #16a34a;
    --accent: #6366F1;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    --glow-primary: 0 0 20px rgba(22, 163, 74, 0.18);
}

/* ============================================
   LIGHT MODE — PREMIUM CARD SYSTEM
   ============================================ */

body.light-mode .analytics-card,
body.light-mode .streak-card,
body.light-mode .monthly-card,
body.light-mode .recently-solved-card,
body.light-mode .revision-card,
body.light-mode .progress-card,
body.light-mode .filters-card,
body.light-mode .table-card {
    background: #FFFFFF;
    border-color: #E5E7EB;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

body.light-mode .analytics-card:hover,
body.light-mode .streak-card:hover,
body.light-mode .monthly-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.10);
    border-color: #FACC15;
}

body.light-mode .analytics-card:active,
body.light-mode .streak-card:active,
body.light-mode .monthly-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Yellow accent top bar on hover */
body.light-mode .analytics-card::before,
body.light-mode .streak-card::before,
body.light-mode .monthly-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FACC15, #FDE68A);
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

body.light-mode .analytics-card,
body.light-mode .streak-card,
body.light-mode .monthly-card {
    position: relative;
    overflow: hidden;
}

body.light-mode .analytics-card:hover::before,
body.light-mode .streak-card:hover::before,
body.light-mode .monthly-card:hover::before {
    opacity: 1;
}

/* Card title in light mode */
body.light-mode .card-title {
    color: #111827;
}

/* Stat values in light mode */
body.light-mode .streak-value,
body.light-mode .consistency-score,
body.light-mode .compact-hero-num,
body.light-mode .mp-today-big {
    background: linear-gradient(135deg, #16a34a, #6366F1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .compact-big {
    color: #16a34a;
}

/* Tertiary backgrounds in light mode */
body.light-mode .consistency-detail-item,
body.light-mode .compact-main-row,
body.light-mode .mp-stats-row {
    background: transparent;
}

body.light-mode .consistency-detail-item {
    background: #F9F7EF;
    border: 1px solid #E5E7EB;
}

body.light-mode .detail-label { color: #6B7280; }
body.light-mode .detail-value { color: #111827; }

/* Icon accent circles in light mode */
body.light-mode .stat-icon {
    background: linear-gradient(135deg, rgba(250,204,21,0.15), rgba(253,230,138,0.1));
    border: 1px solid rgba(250,204,21,0.25);
}

/* Progress bars in light mode */
body.light-mode .progress-bar-track,
body.light-mode .difficulty-bar,
body.light-mode .mp-progress-bar-track,
body.light-mode .milestone-progress-bar {
    background: #F3F4F6;
}

/* Table in light mode */
body.light-mode .table-header {
    background: #FFFFFF;
    border-color: #E5E7EB;
}

body.light-mode .problems-table thead {
    background: #F9F7EF;
}

body.light-mode .problems-table th {
    background: #F9F7EF;
    color: #6B7280;
}

body.light-mode .problems-table tbody tr:hover {
    background: #FFFDF5;
}

body.light-mode .table-count {
    background: #F3F4F6;
    color: #6B7280;
}

/* Filters in light mode */
body.light-mode .filter-input,
body.light-mode .filter-select {
    background: #FFFFFF;
    border-color: #D1D5DB;
    color: #111827;
}

body.light-mode .filter-input:focus,
body.light-mode .filter-select:focus {
    border-color: #FACC15;
    box-shadow: 0 0 0 3px rgba(250,204,21,0.15);
}

body.light-mode .form-input:focus {
    border-color: #FACC15;
    box-shadow: 0 0 0 3px rgba(250,204,21,0.15);
}

/* Badges in light mode */
body.light-mode .badge-easy   { background: rgba(34,197,94,0.1);  color: #16a34a; }
body.light-mode .badge-medium { background: rgba(245,158,11,0.1); color: #d97706; }
body.light-mode .badge-hard   { background: rgba(239,68,68,0.1);  color: #dc2626; }

/* Status select in light mode */
body.light-mode .status-select {
    background: #FFFFFF;
    border-color: #E5E7EB;
    color: #111827;
}

/* Difficulty select in light mode */
body.light-mode .difficulty-select {
    background: #FFFFFF;
    border-color: #E5E7EB;
    color: #111827;
}

body.light-mode .difficulty-select.difficulty-easy  { color: #16a34a; border-color: rgba(22,163,74,0.3); }
body.light-mode .difficulty-select.difficulty-medium { color: #d97706; border-color: rgba(217,119,6,0.3); }
body.light-mode .difficulty-select.difficulty-hard  { color: #dc2626; border-color: rgba(220,38,38,0.3); }

/* Delete button in light mode */
body.light-mode .btn-delete {
    color: #9CA3AF;
}

body.light-mode .btn-delete:hover {
    background: rgba(239,68,68,0.08);
    color: #dc2626;
}

/* Table text in light mode */
body.light-mode .problems-table td {
    color: #374151;
}

body.light-mode .problem-number {
    color: #16a34a;
}

body.light-mode .problem-title {
    color: #111827;
}

/* Recently solved cards in light mode */
body.light-mode .rs-card {
    background: #F9F7EF;
    border-color: #E5E7EB;
}

body.light-mode .rs-card:hover {
    border-color: #FACC15;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}

body.light-mode .rs-card-btn {
    background: rgba(22,163,74,0.08);
    border-color: rgba(22,163,74,0.2);
    color: #16a34a;
}

body.light-mode .rs-card-btn:hover {
    background: rgba(22,163,74,0.15);
}

/* Revision rows in light mode */
body.light-mode .rev-row {
    background: #F9F7EF;
    border-color: #E5E7EB;
}

body.light-mode .rev-row:hover {
    background: #FFFDF5;
    border-color: #FACC15;
}

/* Monthly planner today plan in light mode */
body.light-mode .mp-today-plan {
    background: linear-gradient(135deg, rgba(250,204,21,0.08), rgba(99,102,241,0.06));
    border-color: rgba(250,204,21,0.3);
}

body.light-mode .mp-today-title {
    color: #d97706;
}

/* Streak milestone in light mode */
body.light-mode .streak-milestone {
    background: #F9F7EF;
    border: 1px solid #E5E7EB;
}

body.light-mode .milestone-progress-bar {
    background: #E5E7EB;
}

/* Motivation message in light mode */
body.light-mode .motivation-message {
    background: linear-gradient(135deg, rgba(99,102,241,0.07), rgba(139,92,246,0.07));
    border-color: rgba(99,102,241,0.15);
    color: #6366F1;
}

/* Today status in light mode */
body.light-mode .today-status.solved {
    background: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.2);
    color: #16a34a;
}

body.light-mode .today-status.pending {
    background: rgba(99,102,241,0.06);
    border-color: rgba(99,102,241,0.15);
    color: #6B7280;
}

/* Activity grid in light mode */
body.light-mode .recent-activity-grid {
    background: #F9F7EF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
}

body.light-mode .activity-day-count.inactive {
    background: #E5E7EB;
    color: #9CA3AF;
    border: none;
}

body.light-mode .activity-day-bar {
    background: #E5E7EB;
    border: none;
}

/* Modal in light mode */
body.light-mode .modal-content,
body.light-mode .pw-modal {
    background: #FFFFFF;
    border-color: #E5E7EB;
}

body.light-mode .modal-header,
body.light-mode .modal-footer {
    border-color: #E5E7EB;
}

body.light-mode .form-input {
    background: #FFFFFF;
    border-color: #E5E7EB;
    color: #111827;
}

body.light-mode .btn-secondary {
    background: #F3F4F6;
    border-color: #E5E7EB;
    color: #374151;
}

body.light-mode .btn-secondary:hover {
    background: #E5E7EB;
}

/* Rev chip in light mode */
body.light-mode .rev-chip {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.15);
}

body.light-mode .rev-chip.zero {
    color: #9CA3AF;
    border-color: #E5E7EB;
    background: #F3F4F6;
}

body.light-mode .rev-btn {
    border-color: #E5E7EB;
    color: #6B7280;
}

body.light-mode .rev-btn:hover:not(:disabled) {
    border-color: #16a34a;
    color: #16a34a;
    background: rgba(22,163,74,0.08);
}

/* Admin lock button in light mode */
body.light-mode .btn-admin-lock {
    background: #F3F4F6;
    border-color: #E5E7EB;
    color: #6B7280;
}

body.light-mode .btn-admin-lock.unlocked {
    background: rgba(22,163,74,0.08);
    border-color: rgba(22,163,74,0.25);
    color: #16a34a;
}

/* Notification in light mode */
body.light-mode .notification-success {
    background: linear-gradient(135deg, #22C55E, #16a34a);
}

body.light-mode .notification-error {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

body.light-mode .notification-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

body.light-mode .notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Skeleton in light mode */
body.light-mode .sk-card {
    background: #FFFFFF;
    border-color: #E5E7EB;
}

body.light-mode .sk-stats-bar {
    background: #FFFFFF;
    border-color: #E5E7EB;
}

/* Header in light mode */
body.light-mode .header {
    background: rgba(255,253,245,0.9);
    border-color: #E5E7EB;
}

body.light-mode .header-title h1 {
    background: linear-gradient(135deg, #16a34a, #6366F1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .theme-toggle {
    background: #F3F4F6;
    border-color: #E5E7EB;
    color: #374151;
}

body.light-mode .theme-toggle:hover {
    background: #E5E7EB;
}

body.light-mode .problem-number {
    color: #16a34a;
}

body.light-mode .problem-title {
    color: #111827;
}

body.light-mode .problem-link-btn {
    background: linear-gradient(135deg, #16a34a, #22C55E);
}

body.light-mode .btn-add-problem {
    background: linear-gradient(135deg, #6366F1, #8b5cf6);
}

body.light-mode .btn-align-activity {
    background: linear-gradient(135deg, #6366F1, #8b5cf6);
}

body.light-mode .btn-delete:hover {
    background: rgba(239,68,68,0.08);
    color: #dc2626;
}

body.light-mode .btn-revised {
    background: rgba(22,163,74,0.08);
    border-color: rgba(22,163,74,0.2);
    color: #16a34a;
}

body.light-mode .btn-rev-solve {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.15);
    color: #6366F1;
}

body.light-mode .mp-insight-urgent  { color: #dc2626; background: rgba(239,68,68,0.06); }
body.light-mode .mp-insight-improve { color: #d97706; background: rgba(245,158,11,0.06); }
body.light-mode .mp-insight-positive { color: #16a34a; background: rgba(34,197,94,0.06); }

body.light-mode .alert-warning {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.25);
    color: #d97706;
}

body.light-mode .empty-state {
    background: #FFFFFF;
    border-color: #E5E7EB;
}

body.light-mode .empty-title,
body.light-mode .empty-state p {
    color: #111827;
}

body.light-mode .empty-state small {
    color: #6B7280;
}

/* Scrollbar in light mode */
body.light-mode ::-webkit-scrollbar-track { background: #F3F4F6; }
body.light-mode ::-webkit-scrollbar-thumb { background: #D1D5DB; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ============================================
   STREAK & MONTHLY ANALYTICS
   ============================================ */

.streak-monthly-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .streak-monthly-grid {
        grid-template-columns: 1fr;
    }
}

.streak-card,
.monthly-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.streak-card::before,
.monthly-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 16px 16px 0 0;
}

.streak-card:hover,
.monthly-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    border-color: rgba(34, 197, 94, 0.3);
}

.streak-card:hover::before,
.monthly-card:hover::before {
    opacity: 1;
}

.streak-card:active,
.monthly-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.streak-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 1.5rem;
}

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

.streak-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.streak-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.streak-divider {
    width: 1px;
    height: 50px;
    background: var(--border);
}

.monthly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.current-month {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.best-month-badge {
    background: linear-gradient(135deg, var(--warning), #F97316);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.monthly-progress {
    text-align: center;
    margin: 1.5rem 0;
}

.monthly-count {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.monthly-value {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.monthly-separator {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.monthly-target {
    color: var(--text-secondary);
}

.monthly-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.monthly-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.monthly-bar-track {
    flex: 1;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.monthly-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--glow-primary);
}

.monthly-percent {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 50px;
    text-align: right;
}

/* ============================================
   LAST 6 MONTHS CHART
   ============================================ */

.months-chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.months-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    margin-top: 1.5rem;
    padding: 1rem 0;
    gap: 1rem;
}

.month-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.month-bar-wrapper {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.month-bar {
    width: 100%;
    max-width: 60px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 8px 8px 0 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.5rem;
    min-height: 30px;
    box-shadow: var(--glow-primary);
}

.month-bar:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(0, 200, 150, 0.5);
}

.month-bar-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
}

.month-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================
   LIGHT MODE ADJUSTMENTS
   ============================================ */

.light-mode .streak-card,
.light-mode .monthly-card,
.light-mode .months-chart-card {
    background: white;
    border-color: #E2E8F0;
}

.light-mode .streak-divider {
    background: #E2E8F0;
}

.light-mode .monthly-bar-track {
    background: #F1F5F9;
}

.light-mode .month-bar {
    box-shadow: 0 4px 6px rgba(0, 200, 150, 0.2);
}

.light-mode .month-bar:hover {
    box-shadow: 0 8px 12px rgba(0, 200, 150, 0.3);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .streak-monthly-grid {
        grid-template-columns: 1fr;
    }
    
    .streak-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .streak-divider {
        width: 100%;
        height: 1px;
    }
    
    .months-chart {
        height: 150px;
        gap: 0.5rem;
    }
    
    .month-bar-wrapper {
        height: 100px;
    }
    
    .month-bar {
        max-width: 40px;
    }
    
    .monthly-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Staggered entry for analytics cards */
.advanced-analytics-grid .analytics-card:nth-child(1) { animation: fadeUp 0.35s ease 0.05s both; }
.advanced-analytics-grid .analytics-card:nth-child(2) { animation: fadeUp 0.35s ease 0.10s both; }
.advanced-analytics-grid .analytics-card:nth-child(3) { animation: fadeUp 0.35s ease 0.15s both; }
.advanced-analytics-grid .analytics-card:nth-child(4) { animation: fadeUp 0.35s ease 0.20s both; }

/* ============================================
   ADVANCED ANALYTICS
   ============================================ */

.advanced-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Consistency Score */
.consistency-card .consistency-content {
    margin-top: 8px;
}

.consistency-score-display {
    text-align: center;
    margin-bottom: 10px;
}

.consistency-score {
    font-size: 2.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.consistency-status {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 2px;
}

.consistency-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.consistency-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.consistency-tooltip {
    display: none;
}

/* Weekly Performance */
.weekly-content {
    margin-top: 1.5rem;
}

.weekly-comparison {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.weekly-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.weekly-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.weekly-divider {
    width: 1px;
    height: 50px;
    background: var(--border);
}

.weekly-change {
    text-align: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.change-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.change-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Daily Average */
.daily-avg-content {
    margin-top: 1.5rem;
}

.daily-avg-main {
    text-align: center;
    margin-bottom: 1.5rem;
}

.daily-avg-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.daily-avg-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.daily-avg-trend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.trend-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.trend-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.trend-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trend-arrow {
    font-size: 1.25rem;
}

.trend-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Strongest Day */
.strongest-day-content {
    text-align: center;
    margin-top: 1.5rem;
}

.strongest-day-count {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--warning), #F97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.strongest-day-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.strongest-day-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: inline-block;
}

/* Milestones */
.milestones-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.milestone-badge {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.milestone-badge.unlocked {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: 2px solid var(--primary);
    box-shadow: var(--glow-primary);
}

.milestone-badge.next {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
}

.milestone-badge:hover {
    transform: translateY(-3px);
}

.milestone-icon {
    font-size: 2rem;
}

.milestone-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.milestone-status {
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
}

.milestone-progress-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.milestone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.6s ease;
}

.milestone-progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Solve Time Analytics */
.solve-time-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.solve-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.solve-time-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.solve-time-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.solve-time-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.solve-time-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Revision Tracking */
.revision-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.revision-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    animation: fadeInUp 0.4s ease;
}

.revision-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.revision-item:hover {
    background: var(--bg-primary);
    border-color: rgba(0,200,150,0.15);
    transform: translateX(2px);
}

.revision-number {
    font-weight: 700;
    color: var(--primary);
    min-width: 50px;
}

.revision-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.btn-revised {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-revised:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
}

.action-buttons > button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-revision {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-revision:hover {
    background: rgba(0, 200, 150, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-revision.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--glow-primary);
}

/* Light Mode */
.light-mode .consistency-detail-item,
.light-mode .consistency-tooltip,
.light-mode .weekly-change,
.light-mode .daily-avg-trend,
.light-mode .strongest-day-date,
.light-mode .solve-time-item,
.light-mode .revision-item {
    background: #F1F5F9;
}

.light-mode .milestone-badge.next {
    background: #F8FAFC;
}

.light-mode .milestones-card,
.light-mode .solve-time-card,
.light-mode .revision-card {
    background: white;
    border-color: #E2E8F0;
}

/* Responsive */
@media (max-width: 768px) {
    .advanced-analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .milestones-grid {
        grid-template-columns: 1fr;
    }
    
    .solve-time-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .weekly-comparison {
        flex-direction: column;
        gap: 1rem;
    }
    
    .weekly-divider {
        width: 100%;
        height: 1px;
    }
}

/* ============================================
   SEARCH INPUT WITH ICON + CLEAR BUTTON
   ============================================ */

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

.search-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    transform: translateY(-50%) scale(1.1);
}

.search-clear-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* ============================================
   AI TARGET SUGGESTION
   ============================================ */

.ai-suggestion-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.1), rgba(99, 102, 241, 0.1));
    border: 2px solid var(--primary);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.ai-suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-icon {
    font-size: 1.5rem;
}

.ai-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.growth-mode-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.growth-mode-badge.conservative {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
}

.growth-mode-badge.balanced {
    background: linear-gradient(135deg, var(--primary), #10B981);
    color: white;
}

.growth-mode-badge.aggressive {
    background: linear-gradient(135deg, var(--warning), #F97316);
    color: white;
}

.ai-suggestion-value {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.ai-suggestion-reason {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.btn-adopt-target {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glow-primary);
}

.btn-adopt-target:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 200, 150, 0.5);
}

.ai-tooltip {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

/* Light Mode */
.light-mode .ai-suggestion-section {
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.05), rgba(99, 102, 241, 0.05));
    border-color: var(--primary);
}

.light-mode .ai-tooltip {
    background: #F1F5F9;
}

.light-mode .search-clear-btn {
    background: rgba(239, 68, 68, 0.08);
    color: #64748B;
}

.light-mode .search-clear-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    transform: translateY(-50%) scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .ai-suggestion-header {
        flex-wrap: wrap;
    }
    
    .ai-suggestion-value {
        font-size: 2rem;
    }
}

/* ============================================
   STREAK ALIGNMENT
   ============================================ */

.streak-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-align-activity {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent), #8B5CF6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.btn-align-activity:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.5);
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Light Mode */
.light-mode .btn-align-activity {
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.light-mode .btn-align-activity:hover {
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .streak-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .btn-align-activity {
        width: 100%;
    }
}

/* ============================================
   ENHANCED STREAK CARD
   ============================================ */

/* Today Status */
.today-status {
    margin-top: 1.5rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

.today-status.solved {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.today-status.pending {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.status-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* Streak Milestone */
.streak-milestone {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.milestone-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.milestone-target {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 700;
}

.milestone-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.milestone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(0, 200, 150, 0.5);
}

.milestone-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Motivation Message */
.motivation-message {
    margin-top: 1.5rem;
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: var(--accent);
    animation: fadeIn 0.5s ease;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Light Mode */
.light-mode .today-status.solved {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.18);
    color: #16a34a;
}

.light-mode .today-status.pending {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.12);
    color: var(--text-secondary);
}

.light-mode .streak-milestone {
    background: #F8FAFC;
}

.light-mode .milestone-progress-bar {
    background: #E2E8F0;
}

.light-mode .motivation-message {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .today-status {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .motivation-message {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}

/* ============================================
   RECENT ACTIVITY (LAST 7 DAYS)
   ============================================ */

.recent-activity-section {
    margin-top: 1.5rem;
}

.recent-activity-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-activity-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.activity-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.activity-day.today .activity-day-name {
    color: var(--primary);
    font-weight: 700;
}

.activity-day-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.activity-day-count {
    font-size: 1.25rem;
    font-weight: 800;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.activity-day-count.active {
    background: linear-gradient(135deg, var(--primary), #10B981);
    color: white;
    box-shadow: 0 0 15px rgba(0, 200, 150, 0.4);
}

.activity-day-count.inactive {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-day-bar {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-day-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 4px 4px 0 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -2px 10px rgba(0, 200, 150, 0.3);
}

/* Light Mode */
.light-mode .recent-activity-grid {
    background: #F8FAFC;
}

.light-mode .activity-day-count.inactive {
    background: #E2E8F0;
    border-color: #CBD5E1;
}

.light-mode .activity-day-count.active {
    box-shadow: 0 0 12px rgba(0, 200, 150, 0.3);
}

.light-mode .activity-day-bar {
    background: #E2E8F0;
    border-color: #CBD5E1;
}

.light-mode .activity-day-bar-fill {
    box-shadow: 0 -2px 8px rgba(0, 200, 150, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .recent-activity-grid {
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .activity-day-name {
        font-size: 0.65rem;
    }
    
    .activity-day-count {
        font-size: 1rem;
        min-width: 24px;
        height: 24px;
    }
    
    .activity-day-bar {
        height: 30px;
    }
}
/* ============================================
   LOADING & ERROR STATES
   ============================================ */

/* ── Skeleton shimmer — soft, not harsh ── */
.skeleton {
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.09) 37%,
        rgba(255, 255, 255, 0.04) 63%
    );
    background-size: 400% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

body.light-mode .skeleton {
    background: linear-gradient(
        110deg,
        rgba(0, 0, 0, 0.04) 25%,
        rgba(0, 0, 0, 0.08) 37%,
        rgba(0, 0, 0, 0.04) 63%
    );
    background-size: 400% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

/* Sync label under navbar */
.sk-sync-label {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

/* Skeleton card base */
.sk-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Skeleton stats bar */
.sk-stats-bar {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.sk-stat-pill {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Skeleton grids */
.sk-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 16px;
}

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

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

@media (max-width: 1024px) {
    .sk-grid-2 { grid-template-columns: 1fr; }
    .sk-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .sk-grid-4 { grid-template-columns: 1fr; }
    .sk-grid-3 { grid-template-columns: 1fr; }
}

/* ── Background ambient glow (very subtle) ── */
.app::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(34, 197, 94, 0.04), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ── Dashboard fade-in on load complete ── */
.app-ready {
    animation: appFadeIn 0.25s ease;
}

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

/* Cards fade up on mount */
.fade-up {
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp 0.3s ease forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.fade-up-1 { animation-delay: 0.04s; }
.fade-up-2 { animation-delay: 0.08s; }
.fade-up-3 { animation-delay: 0.12s; }
.fade-up-4 { animation-delay: 0.16s; }
.fade-up-5 { animation-delay: 0.20s; }

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    text-align: center;
}

.error-icon {
    font-size: 64px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--danger);
}

.error-message {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
}

.retry-button {
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.retry-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 200, 150, 0.3);
}

.retry-button:active {
    transform: translateY(0);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px dashed var(--border);
    margin: 40px 0;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
}

.empty-state-action {
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-state-action:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

/* ============================================
   RECENTLY SOLVED — CARD GRID
   ============================================ */

.recently-solved-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.recently-solved-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.rs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
    animation: fadeInUp 0.4s ease;
}

/* 1–2 items: stretch to fill */
.rs-grid.rs-grid-stretch {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* 3–4 items: 2-column */
.rs-grid.rs-grid-mid {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
    .rs-grid { grid-template-columns: repeat(2, 1fr); }
    .rs-grid.rs-grid-mid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .rs-grid,
    .rs-grid.rs-grid-stretch,
    .rs-grid.rs-grid-mid { grid-template-columns: 1fr; }
}

.rs-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.rs-empty-state small {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.rs-rev-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.18);
    padding: 2px 7px;
    border-radius: 20px;
}

.rs-card-btn-revise {
    background: rgba(34, 197, 94, 0.1) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
}

.rs-card-btn-revise:hover {
    background: rgba(34, 197, 94, 0.2) !important;
}

body.light-mode .rs-rev-count {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light-mode .rs-card-btn-revise {
    background: rgba(22, 163, 74, 0.08) !important;
    border-color: rgba(22, 163, 74, 0.2) !important;
    color: #16a34a !important;
}

body.light-mode .rs-empty-state {
    color: #6B7280;
}

body.light-mode .rs-empty-state small {
    color: #9CA3AF;
}

/* Light mode admin lock */
body.light-mode .btn-admin-lock.locked {
    background: rgba(239, 68, 68, 0.07);
    border-color: rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

body.light-mode .btn-admin-lock.unlocked {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.3);
    color: #16a34a;
}

.rs-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: default;
}

.rs-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(34, 197, 94, 0.3);
}

.rs-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.rs-card-id {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.03em;
}

.rs-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.rs-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rs-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rs-card-btn {
    display: block;
    text-align: center;
    background: rgba(0, 200, 150, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 200, 150, 0.25);
    border-radius: 7px;
    padding: 6px 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-top: 2px;
}

.rs-card-btn:hover {
    background: rgba(0, 200, 150, 0.2);
    transform: translateY(-1px);
}

body.light-mode .recently-solved-card {
    background: #fff;
    border-color: #E2E8F0;
}

body.light-mode .rs-card {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

body.light-mode .rs-card:hover {
    border-color: rgba(0, 200, 150, 0.3);
}

body.light-mode .rs-card-btn {
    background: rgba(0, 200, 150, 0.07);
    border-color: rgba(0, 200, 150, 0.2);
}

body.light-mode .rs-card-btn:hover {
    background: rgba(0, 200, 150, 0.14);
}

@media (max-width: 600px) {
    .rs-card-btn {
        width: 100%;
    }
}

/* ============================================
   PROBLEM CARD SYSTEM (pc-*) — unified reusable
   Used by: Recently Solved, Needs Revision, Targeted
   ============================================ */

.pc-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pc-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Grid system */
.pc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px;
    animation: fadeInUp 0.35s ease;
}

.pc-grid.pc-grid-stretch {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

@media (max-width: 1024px) {
    .pc-grid { grid-template-columns: repeat(2, 1fr); }
    .pc-grid.pc-grid-mid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .pc-grid,
    .pc-grid.pc-grid-stretch,
    .pc-grid.pc-grid-mid { grid-template-columns: 1fr; }
}

/* Individual card */
.pc-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.pc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pc-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(34, 197, 94, 0.3);
}

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

.pc-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Top row: ID + user difficulty */
.pc-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pc-id {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.04em;
}

/* User difficulty dropdown in cards */
.pc-user-diff-select {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.pc-user-diff-select.pc-user-diff-easy {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
}

.pc-user-diff-select.pc-user-diff-medium {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}

.pc-user-diff-select.pc-user-diff-hard {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.pc-user-diff-select:hover {
    filter: brightness(1.1);
}

.pc-user-diff-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.75rem;
}

/* Title */
.pc-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Meta row */
.pc-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.pc-rev-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.18);
    padding: 2px 7px;
    border-radius: 20px;
}

.pc-status-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 2px 7px;
    border-radius: 20px;
}

.pc-targeted-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 200, 150, 0.1);
    border: 1px solid rgba(0, 200, 150, 0.25);
    padding: 2px 7px;
    border-radius: 20px;
}

.pc-date {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Sub info */
.pc-sub-info {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Actions */
.pc-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    align-items: center;
}

.pc-actions .pc-btn-open {
    flex: 1;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 6px 10px;
}

.pc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 0.73rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    min-height: 36px;
    white-space: nowrap;
}

.pc-btn-open {
    background: rgba(0, 200, 150, 0.1);
    color: var(--primary);
    border-color: rgba(0, 200, 150, 0.25);
}

.pc-btn-open:hover {
    background: rgba(0, 200, 150, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 200, 150, 0.15);
}

.pc-btn-revise {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-color: rgba(99, 102, 241, 0.2);
}

.pc-btn-revise:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.15);
}

.pc-btn-revise:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pc-btn-untarget {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.pc-btn-untarget:hover {
    background: rgba(239, 68, 68, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.15);
}

.pc-btn-untarget:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

body.light-mode .pc-btn-untarget {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.15);
}

body.light-mode .pc-btn-untarget:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* Empty state */
.pc-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pc-empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.pc-empty small {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Light mode */
body.light-mode .pc-section {
    background: #fff;
    border-color: #E2E8F0;
}

body.light-mode .pc-card {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

body.light-mode .pc-card:hover {
    border-color: rgba(0, 200, 150, 0.3);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

body.light-mode .pc-btn-open {
    background: rgba(0, 200, 150, 0.07);
    border-color: rgba(0, 200, 150, 0.2);
}

body.light-mode .pc-btn-open:hover {
    background: rgba(0, 200, 150, 0.14);
}

body.light-mode .pc-btn-revise {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light-mode .pc-btn-revise:hover {
    background: rgba(99, 102, 241, 0.14);
}

body.light-mode .pc-rev-badge {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light-mode .pc-empty {
    color: #6B7280;
}

body.light-mode .pc-empty small {
    color: #9CA3AF;
}

/* ── Mobile compact card overrides ── */
@media (max-width: 768px) {
    .pc-card {
        padding: 10px 12px;
        gap: 6px;
        border-radius: 12px;
    }

    .pc-title {
        font-size: 0.82rem;
        -webkit-line-clamp: 1;
    }

    .pc-id {
        font-size: 0.65rem;
    }

    .pc-meta {
        gap: 5px;
    }

    .pc-rev-badge,
    .pc-status-label,
    .pc-date {
        font-size: 0.62rem;
        padding: 1px 5px;
    }

    .pc-sub-info {
        font-size: 0.65rem;
    }

    /* Buttons inline, compact */
    .pc-actions {
        flex-direction: row;
        gap: 5px;
        margin-top: 4px;
    }

    .pc-btn {
        padding: 5px 0;
        font-size: 0.68rem;
        border-radius: 6px;
    }

    .pc-user-diff-select {
        font-size: 0.6rem;
        padding: 1px 5px;
    }

    .pc-grid {
        gap: 8px;
    }
}



/* ============================================
   MOBILE PROBLEM CARDS — replaces table on ≤768px
   ============================================ */

/* Hide mobile cards on desktop — base rule MUST come before media query */
.problems-mobile {
    display: none;
}

/* Hide table on mobile, show cards */
@media (max-width: 768px) {
    .table-wrapper {
        display: none;
    }
    .problems-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
}

/* Individual mobile card */
.pm-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.pm-card:hover {
    border-color: rgba(0, 200, 150, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Top row: number + badges */
.pm-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pm-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.03em;
}

.pm-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

.pm-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
}

.pm-tag-target {
    background: rgba(0, 200, 150, 0.12);
    border: 1px solid rgba(0, 200, 150, 0.3);
}

.pm-tag-striver {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Title */
.pm-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

/* Meta row */
.pm-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Primary actions: Open + Status */
.pm-actions-primary {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    height: 40px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.pm-btn-open {
    background: rgba(0, 200, 150, 0.12);
    color: var(--primary);
    border-color: rgba(0, 200, 150, 0.3);
}

.pm-btn-open:hover {
    background: rgba(0, 200, 150, 0.22);
}

.pm-status-select {
    flex: 1;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
}

.pm-status-select.status-done {
    color: var(--success);
    border-color: rgba(0, 200, 150, 0.35);
}

.pm-status-select.status-in-progress {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.35);
}

/* Secondary actions: diff + rev + icon buttons */
.pm-actions-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pm-diff-select {
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
}

.pm-diff-select.difficulty-easy  { color: var(--success); border-color: rgba(34,197,94,0.3); }
.pm-diff-select.difficulty-medium { color: var(--warning); border-color: rgba(245,158,11,0.3); }
.pm-diff-select.difficulty-hard  { color: var(--danger);  border-color: rgba(239,68,68,0.3); }

.pm-rev-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0 6px;
    height: 36px;
}

.pm-rev-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Make target/striver/delete bigger on mobile */
@media (max-width: 768px) {
    .pm-actions-secondary .btn-target,
    .pm-actions-secondary .btn-striver {
        width: 40px;
        height: 36px;
        font-size: 1rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        opacity: 0.65;
    }

    .pm-actions-secondary .btn-target.active,
    .pm-actions-secondary .btn-striver.active {
        opacity: 1;
    }

    .pm-actions-secondary .btn-delete {
        width: 40px;
        height: 36px;
        font-size: 1rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
    }

    .pm-actions-secondary .rev-btn {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }
}

/* Empty state */
.pm-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
}

.pm-empty p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 8px 0 4px;
}

.pm-empty small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Light mode */
body.light-mode .pm-card {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

body.light-mode .pm-card:hover {
    border-color: rgba(0, 200, 150, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.light-mode .pm-title {
    color: #111827;
}

body.light-mode .pm-number {
    color: #16a34a;
}

body.light-mode .pm-status-select,
body.light-mode .pm-diff-select {
    background: #FFFFFF;
    border-color: #E2E8F0;
    color: #111827;
}

body.light-mode .pm-status-select.status-done { color: #16a34a; border-color: rgba(22,163,74,0.3); }
body.light-mode .pm-status-select.status-in-progress { color: #d97706; border-color: rgba(217,119,6,0.3); }
body.light-mode .pm-diff-select.difficulty-easy  { color: #16a34a; }
body.light-mode .pm-diff-select.difficulty-medium { color: #d97706; }
body.light-mode .pm-diff-select.difficulty-hard  { color: #dc2626; }

body.light-mode .pm-rev-controls {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

body.light-mode .pm-btn-open {
    background: rgba(0, 200, 150, 0.08);
    border-color: rgba(0, 200, 150, 0.2);
}

body.light-mode .pm-empty p { color: #111827; }
body.light-mode .pm-empty small { color: #9CA3AF; }

/* ============================================
   NEEDS REVISION — 3-COLUMN GRID ROW
   ============================================ */

.rev-row {
    display: grid;
    grid-template-columns: 2fr 1.6fr 1fr;
    align-items: center;
    gap: 16px;
    padding: 11px 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.rev-row:hover {
    background: var(--bg-primary);
    border-color: rgba(34, 197, 94, 0.12);
}

/* Left: #ID + title */
.rev-col-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.rev-col-left .revision-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.83rem;
}

/* Center: badge · date · priority — spaced out */
.rev-col-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.rev-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 2px 6px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
}

.rev-priority-score {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.04);
}

/* Right: action buttons — clear gap */
.rev-col-right {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.btn-rev-solve {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-rev-solve:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

/* Revise button in rev-row */
.btn-revised {
    padding: 5px 10px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.btn-revised:hover {
    background: rgba(34, 197, 94, 0.18);
    transform: translateY(-1px);
}

body.light-mode .rev-row {
    background: #F8FAFC;
}

body.light-mode .rev-row:hover {
    background: #F1F5F9;
    border-color: rgba(34, 197, 94, 0.15);
}

body.light-mode .rev-date,
body.light-mode .rev-priority-score {
    background: rgba(0,0,0,0.04);
}

body.light-mode .btn-rev-solve {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light-mode .btn-revised {
    background: rgba(34, 197, 94, 0.07);
    border-color: rgba(34, 197, 94, 0.15);
}

/* Mobile: stack */
@media (max-width: 768px) {
    .rev-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .rev-col-right {
        justify-content: flex-start;
    }
    .rev-col-left .revision-title {
        white-space: normal;
    }
    .rev-col-center {
        flex-wrap: wrap;
    }
}

/* ============================================
   MONTHLY PLANNER — REDESIGNED
   ============================================ */

.mp-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.mp-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mp-month-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

.mp-month-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mp-progress-bar-track {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.mp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 6px;
    transition: width 0.6s ease;
}

.mp-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.mp-stats-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.mp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.mp-stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.mp-stat-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.mp-stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

/* Today's Plan — primary focus block */
.mp-today-plan {
    background: rgba(99, 102, 241, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    text-align: center;
}

.mp-today-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.mp-today-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.mp-today-num {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mp-today-big {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.mp-today-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 3px;
}

.mp-today-sep {
    font-size: 1.8rem;
    color: var(--border);
    font-weight: 300;
    line-height: 1;
}

.mp-today-focus {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Insights section */
.mp-insights {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.mp-insights-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}

.mp-insight-row {
    font-size: 0.85rem;
    padding: 5px 8px;
    border-radius: 6px;
    line-height: 1.45;
    margin-bottom: 3px;
    display: block;
    width: 100%;
}

.mp-insight-urgent  { color: #f87171; background: rgba(239,68,68,0.07); }
.mp-insight-improve { color: #fbbf24; background: rgba(245,158,11,0.07); }
.mp-insight-positive { color: #4ade80; background: rgba(34,197,94,0.07); }

body.light-mode .mp-today-plan {
    background: linear-gradient(135deg, rgba(99,102,241,0.07), rgba(0,200,150,0.05));
    border-color: rgba(99,102,241,0.15);
}

@media (max-width: 768px) {
    .mp-today-big { font-size: 1.8rem; }
    .mp-stat-val  { font-size: 1.2rem; }
    .mp-insight-row { font-size: 0.8rem; }
}

/* ============================================
   COMPACT ANALYTICS CARDS
   ============================================ */

.compact-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.compact-main-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 2px;
}

.compact-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.compact-big {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.compact-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.compact-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
    flex-shrink: 0;
}

.compact-sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.compact-context {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

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

.compact-muted-val {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.compact-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2px;
}

.compact-hero-num {
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.compact-hero-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ============================================
   ADMIN LOCK BUTTON — red locked / green unlocked
   ============================================ */

.btn-admin-lock {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

/* LOCKED → red */
.btn-admin-lock.locked {
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.btn-admin-lock.locked:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.65);
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-admin-lock.locked:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* UNLOCKED → green with subtle pulse */
.btn-admin-lock.unlocked {
    color: #22C55E;
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.1);
    animation: lockGlow 2.5s ease-in-out infinite;
}

@keyframes lockGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
    50%       { box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.2); }
}

.btn-admin-lock.unlocked:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.45);
    color: #EF4444;
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.22);
    animation: none;
}

.btn-admin-lock.unlocked:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.admin-modal-icon {
    font-size: 28px;
    text-align: center;
    margin-bottom: 8px;
}

/* ============================================
   LIGHT MODE — MISC FIXES
   ============================================ */

body.light-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

body.light-mode .pw-modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

body.light-mode .mp-section {
    border-color: #E5E7EB;
}

body.light-mode .mp-stat-divider,
body.light-mode .compact-divider,
body.light-mode .navbar-stat-divider,
body.light-mode .streak-divider,
body.light-mode .rolling-stat-divider {
    background: #E5E7EB;
}

body.light-mode .mp-month-name {
    color: #111827;
}

body.light-mode .mp-stat-val {
    color: #111827;
}

body.light-mode .mp-stat-lbl,
body.light-mode .mp-today-sub,
body.light-mode .mp-today-focus,
body.light-mode .mp-insights-title {
    color: #6B7280;
}

body.light-mode .mp-progress-label {
    color: #6B7280;
}

body.light-mode .compact-muted { color: #9CA3AF; }
body.light-mode .compact-muted-val { color: #6B7280; }
body.light-mode .compact-context { color: #6B7280; }
body.light-mode .compact-lbl { color: #9CA3AF; }

body.light-mode .rolling-stat-label { color: #6B7280; }
body.light-mode .rolling-stat-value { color: #111827; }
body.light-mode .rolling-stat-value.solved { color: #16a34a; }

body.light-mode .progress-header h2 { color: #111827; }
body.light-mode .progress-subtitle { color: #6B7280; }

body.light-mode .table-header h3 { color: #111827; }

body.light-mode .filter-group label { color: #6B7280; }

body.light-mode .form-group label { color: #6B7280; }
body.light-mode .form-hint {
    background: rgba(99,102,241,0.05);
    border-color: rgba(99,102,241,0.15);
    color: #6B7280;
}

body.light-mode .modal-header h2 { color: #111827; }
body.light-mode .modal-close { color: #6B7280; }
body.light-mode .modal-close:hover { background: #F3F4F6; color: #111827; }

body.light-mode .pw-modal h3 { color: #111827; }
body.light-mode .pw-modal p { color: #6B7280; }
body.light-mode .pw-modal input {
    background: #FFFFFF;
    border-color: #E5E7EB;
    color: #111827;
}

body.light-mode .streak-label { color: #6B7280; }
body.light-mode .milestone-label { color: #6B7280; }
body.light-mode .milestone-text { color: #9CA3AF; }
body.light-mode .milestone-target { color: #16a34a; }

body.light-mode .recent-activity-title { color: #6B7280; }
body.light-mode .activity-day-name { color: #6B7280; }
body.light-mode .activity-day.today .activity-day-name { color: #16a34a; }

body.light-mode .revision-number { color: #16a34a; }
body.light-mode .revision-title { color: #111827; }

body.light-mode .rev-priority-score { background: rgba(0,0,0,0.04); }
body.light-mode .rev-date { background: rgba(0,0,0,0.04); color: #9CA3AF; }

body.light-mode .detail-label { color: #6B7280; }
body.light-mode .detail-value { color: #111827; }

body.light-mode .consistency-status { color: #6B7280; }

body.light-mode .compact-sub-row span[style] { }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   MOBILE TABLE CARDS
   ============================================ */

/* ── Scroll Buttons (up + down) ── */
.scroll-btns {
    position: fixed;
    bottom: 20px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
}

@media (max-width: 600px) {
    .scroll-btns {
        bottom: 16px;
        right: 12px;
        gap: 10px;
    }
}

.scroll-btn {
    width: 48px;
    height: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,200,150,0.4), 0 2px 6px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: scrollBtnIn 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}

@media (max-width: 600px) {
    .scroll-btn {
        width: 44px;
        height: 44px;
        min-height: 44px;
        font-size: 1.1rem;
    }
}

@keyframes scrollBtnIn {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

.scroll-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 22px rgba(0,200,150,0.5), 0 2px 6px rgba(0,0,0,0.25);
}

.scroll-btn:active {
    transform: scale(0.94);
}

body.light-mode .scroll-btn {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(22,163,74,0.3), 0 2px 6px rgba(0,0,0,0.1);
}

body.light-mode .scroll-btn:hover {
    background: #15803d;
    box-shadow: 0 6px 22px rgba(22,163,74,0.4), 0 2px 6px rgba(0,0,0,0.12);
}

/* ============================================
   STRIVER BUTTON — table action button
   ============================================ */

.btn-striver {
    background: rgba(100, 116, 139, 0.12);
    border: 1.5px solid rgba(100, 116, 139, 0.35);
    color: var(--text-secondary);
    padding: 5px 9px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.18s ease;
    line-height: 1;
    min-width: 32px;
    opacity: 0.6;
}

.btn-striver:hover {
    opacity: 1;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.5);
    transform: scale(1.08);
}

.btn-striver.active {
    opacity: 1;
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.7);
    color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    animation: striverPulse 2s ease-in-out infinite;
}

@keyframes striverPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
    50%       { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18); }
}

.btn-striver:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

body.light-mode .btn-striver {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.3);
    color: #64748b;
    opacity: 0.65;
}

body.light-mode .btn-striver:hover {
    opacity: 1;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.45);
}

body.light-mode .btn-striver.active {
    opacity: 1;
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.55);
    color: #2563eb;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.25);
}

/* TLE toggle button — mirrors btn-striver with amber/orange accent */
.btn-tle {
    padding: 5px 8px; border-radius: 6px; font-size: 0.8rem; cursor: pointer;
    background: rgba(100, 116, 139, 0.12);
    border: 1.5px solid rgba(100, 116, 139, 0.35);
    color: var(--text-secondary); transition: all 0.2s ease; opacity: 0.7;
}
.btn-tle:hover { opacity: 1; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.5); color: #f59e0b; }
.btn-tle.active { opacity: 1; background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.6); color: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
.btn-tle:disabled { opacity: 0.35; cursor: not-allowed; }
body.light-mode .btn-tle { background: rgba(100, 116, 139, 0.08); border-color: rgba(100, 116, 139, 0.3); }
body.light-mode .btn-tle:hover { background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.5); color: #d97706; }
body.light-mode .btn-tle.active { background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.55); color: #d97706; box-shadow: 0 0 8px rgba(217, 119, 6, 0.25); }

/* ============================================
   STRIVER CARD — dashboard section
   ============================================ */

.striver-card {
    margin-bottom: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.striver-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

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

.striver-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.2);
}

.striver-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .striver-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.striver-stat-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: background 0.2s ease, border-color 0.2s ease;
    text-align: center;
}

.striver-stat-row:hover {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.2);
}

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

.striver-dot.easy   { background: #22c55e; }
.striver-dot.medium { background: #f59e0b; }
.striver-dot.hard   { background: #ef4444; }
.striver-dot.total  { background: linear-gradient(135deg, #3b82f6, #6366f1); }

.striver-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
}

.striver-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.striver-total-row {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.06);
}

.striver-total {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.striver-empty {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

body.light-mode .striver-card {
    background: #fff;
    border-color: #E2E8F0;
}

body.light-mode .striver-stat-row {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-mode .striver-stat-row:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.2);
}

body.light-mode .striver-total-row {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.25);
}

body.light-mode .striver-label {
    color: #475569;
}

body.light-mode .striver-value {
    color: #0f172a;
}

/* ============================================
   COACHING INTELLIGENCE — NEW COMPONENTS
   ============================================ */

/* ── Rolling Insight Badges ── */
.rolling-insight-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}
.rib {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.rib-green  { background: rgba(0,200,150,0.12); color: var(--success); border-color: rgba(0,200,150,0.25); }
.rib-yellow { background: rgba(245,158,11,0.12); color: #f59e0b; border-color: rgba(245,158,11,0.25); }
.rib-red    { background: rgba(239,68,68,0.12);  color: #ef4444; border-color: rgba(239,68,68,0.25); }

body.light-mode .rib-green  { background: rgba(0,200,150,0.08); }
body.light-mode .rib-yellow { background: rgba(245,158,11,0.08); }
body.light-mode .rib-red    { background: rgba(239,68,68,0.08); }

/* ── Monthly Planner: track badge + expected marker + pace gap ── */
.mp-track-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.mp-track-badge.on-track { background: rgba(0,200,150,0.15); color: var(--success); }
.mp-track-badge.behind   { background: rgba(239,68,68,0.15);  color: #ef4444; }

.mp-progress-bar-track { position: relative; }
.mp-expected-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: calc(100% + 8px);
    background: rgba(245,158,11,0.7);
    border-radius: 2px;
    transform: translateX(-50%);
}
.mp-expected-marker::after {
    content: 'exp';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: #f59e0b;
    white-space: nowrap;
}
.mp-pace-gap {
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 600;
    margin-top: 4px;
    text-align: right;
}

/* insight action label */
.mp-insight-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.mp-insight-action {
    font-size: 0.7rem;
    opacity: 0.75;
    font-style: italic;
}

/* ── Smart Coach Card ── */
.smart-coach-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.smart-coach-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366F1, var(--primary));
}
.sc-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.sc-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.sc-insights {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sc-empty {
    font-size: 0.85rem;
    color: var(--success);
    padding: 8px 0;
}
.sc-insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border-left: 3px solid transparent;
}
.sc-critical { background: rgba(239,68,68,0.08);  border-left-color: #ef4444; }
.sc-warning  { background: rgba(245,158,11,0.08); border-left-color: #f59e0b; }
.sc-positive { background: rgba(0,200,150,0.08);  border-left-color: var(--success); }

.sc-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.sc-body { display: flex; flex-direction: column; gap: 2px; }
.sc-msg  { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.sc-action { font-size: 0.75rem; color: var(--text-secondary); }

body.light-mode .smart-coach-card { background: #fff; border-color: #E2E8F0; }
body.light-mode .sc-critical { background: rgba(239,68,68,0.06); }
body.light-mode .sc-warning  { background: rgba(245,158,11,0.06); }
body.light-mode .sc-positive { background: rgba(0,200,150,0.06); }
body.light-mode .sc-msg { color: #0f172a; }

/* ── What To Do Today Card ── */
.what-todo-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.what-todo-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #6366F1);
}
.wtd-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}
.wtd-empty {
    font-size: 0.85rem;
    color: var(--success);
    padding: 4px 0;
}
.wtd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}
.wtd-solve  { background: rgba(99,102,241,0.08); border-left: 3px solid #6366F1; }
.wtd-revise { background: rgba(0,200,150,0.08);  border-left: 3px solid var(--success); }
.wtd-icon { font-size: 1rem; flex-shrink: 0; }
.wtd-text { color: var(--text-primary); }

body.light-mode .what-todo-card { background: #fff; border-color: #E2E8F0; }
body.light-mode .wtd-solve  { background: rgba(99,102,241,0.06); }
body.light-mode .wtd-revise { background: rgba(0,200,150,0.06); }
body.light-mode .wtd-text { color: #0f172a; }

@media (max-width: 768px) {
    .rolling-insight-badges { gap: 6px; }
    .rib { font-size: 0.7rem; padding: 3px 8px; }
    .sc-insight { padding: 8px 10px; }
    .wtd-item { padding: 8px 10px; }
    .smart-coach-card, .what-todo-card { padding: 16px; }
}

/* ============================================
   DIFFICULTY NAVBAR
   ============================================ */

.diff-navbar {
    display: flex;
    gap: 8px;
    margin: 12px 0 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    flex-wrap: wrap;
}

.diff-nav-btn {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.diff-nav-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--diff-color, var(--border));
    color: var(--text-primary);
}

.diff-nav-btn.active {
    background: color-mix(in srgb, var(--diff-color, #6366f1) 15%, transparent);
    border-color: var(--diff-color, #6366f1);
    color: var(--diff-color, #6366f1);
    box-shadow: 0 0 12px color-mix(in srgb, var(--diff-color, #6366f1) 25%, transparent);
}

.diff-nav-count {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    color: inherit;
}

.diff-nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: inherit;
    opacity: 0.85;
}

/* Active filter badge in table header */
.diff-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.diff-active-easy   { background: rgba(34,197,94,0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.diff-active-medium { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.diff-active-hard   { background: rgba(239,68,68,0.15);  color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.diff-active-solved { background: rgba(99,102,241,0.15); color: #6366f1; border: 1px solid rgba(99,102,241,0.3); }

.diff-active-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    font-size: 0.75rem;
    padding: 0;
    line-height: 1;
}
.diff-active-clear:hover { opacity: 1; }

@media (max-width: 480px) {
    .diff-nav-btn { min-width: 60px; padding: 8px 6px; }
    .diff-nav-count { font-size: 1.1rem; }
}

/* ============================================
   SUGGESTIONS SECTION
   ============================================ */

.suggestions-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.sug-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

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

.sug-section {
    margin-bottom: 16px;
}

.sug-section:last-child { margin-bottom: 0; }

.sug-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.sug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.sug-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sug-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(34,197,94,0.15);
}

.sug-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sug-id {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.sug-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

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

.sug-topic {
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 600;
    background: rgba(99,102,241,0.1);
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.sug-reason {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 600px) {
    .sug-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
    .sug-grid { grid-template-columns: 1fr; }
}

/* ============================================
   HIGHLIGHT ROW ANIMATION (table)
   ============================================ */

@keyframes highlightRowPulse {
    0%   { background: rgba(34,197,94,0.18); box-shadow: inset 0 0 0 1px rgba(34,197,94,0.4); }
    40%  { background: rgba(34,197,94,0.10); box-shadow: inset 0 0 0 1px rgba(34,197,94,0.2); }
    70%  { background: rgba(34,197,94,0.15); box-shadow: inset 0 0 0 1px rgba(34,197,94,0.35); }
    100% { background: transparent;          box-shadow: none; }
}

tr.highlight-row {
    animation: highlightRowPulse 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pm-card.highlight-row {
    animation: highlightRowPulse 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    border-radius: 12px;
}

/* ── Today's Progress + Recently Solved — mobile ───────────────────────────── */
@media (max-width: 600px) {
    .tp-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }

    .tp-item-left {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    .tp-item-right {
        width: 100%;
    }

    .tp-item-right .pc-btn-open {
        width: 100%;
    }

    .tp-title {
        max-width: 100%;
        white-space: normal;
    }

    .pc-actions {
        flex-wrap: wrap;
    }
}

/* ── Clickable card behavior ───────────────────────────────────────────────── */
.pc-card-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pc-card-clickable:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.pc-card-clickable:active {
    transform: translateY(-1px) scale(1.01);
}

/* ── Global overflow fix ───────────────────────────────────────────────────── */
body {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* ── Minimum touch target size (mobile accessibility) ──────────────────────── */
.pc-btn,
.btn-sync-lc,
.btn-profile,
.btn-admin-lock,
.theme-toggle,
button {
    min-height: 44px;
}

/* ── Mobile button stacking ────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .pc-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .pc-actions .pc-btn-open {
        flex: 1 1 100%;
    }

    .pc-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Safe area support (iOS notch) ─────────────────────────────────────────── */
.container {
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* ── Highlight animation for navigation ────────────────────────────────────── */
tr.highlight-row,
.pc-card.highlight-row {
    animation: highlightRowPulse 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    border: 1px solid #00ffcc !important;
    background: rgba(0, 255, 204, 0.08) !important;
}

/* ── Empty state with CTA ──────────────────────────────────────────────────── */
.pc-empty-cta {
    padding: 40px 20px;
}

.btn-cta {
    margin-top: 16px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-cta:active {
    transform: translateY(0);
}

/* ── Mobile responsive for Today's Progress ────────────────────────────────── */
@media (max-width: 600px) {
    .tp-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    .tp-item-left {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }

    .tp-problem-info {
        width: 100%;
    }

    .tp-title {
        font-size: 0.85rem;
    }

    .tp-item-right {
        width: 100%;
    }

    .tp-item-right .pc-btn-open {
        width: 100%;
        flex: 1;
    }
}

/* ============================================
   HERO CARD (Unified Premium Header)
   ============================================ */

.hero-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(99, 102, 241, 0.06), 0 2px 20px rgba(99, 102, 241, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.hero-card:hover {
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(99, 102, 241, 0.15), 0 4px 32px rgba(139, 92, 246, 0.14);
}

/* Subtle gradient border effect for premium feel */
.hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
    opacity: 0.18;
    transition: opacity 0.4s ease;
}

.hero-card:hover::before {
    opacity: 0.75;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-profile {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-profile h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.1;
}

.hero-profile .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

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

.hero-stats-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.dashboard-primary-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 24px;
}

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

.dashboard-single-card {
    margin-bottom: 24px;
}

.analytics-chart-container {
    margin-bottom: 24px;
}

.activity-chart-card {
    padding: 24px 28px;
}

.activity-chart-card .chart-title {
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.trend-up {
    font-size: 0.7rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
    vertical-align: middle;
}

.striver-stat-row.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.striver-stat-row.clickable:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

.striver-stat-row.active-filter {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.02);
}

/* ============================================
   STREAK STATS HIERARCHY
   ============================================ */

.streak-item.streak-primary .streak-value {
    font-size: 3rem;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.streak-item.streak-secondary .streak-value {
    font-size: 2rem;
    color: var(--text-primary);
}

.streak-item.streak-tertiary .streak-value {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

/* Monthly Planner Premium Glow */
.monthly-planner {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15) inset, 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

body.light-mode .monthly-planner {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.08) inset, 0 8px 32px rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

/* ============================================
   MOBILE LAYOUT — compact, section-based
   DESKTOP: completely untouched
   ============================================ */
@media (max-width: 768px) {

    /* ── Global overflow containment ── */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }
    .app {
        overflow-x: hidden;
        max-width: 100%;
    }
    .container {
        max-width: 100%;
        box-sizing: border-box;
        padding: 12px;
    }

    /* ── Hero card ── */
    .hero-card {
        max-width: 100%;
        overflow: hidden;
        padding: 14px 14px 12px;
        gap: 12px;
        margin-bottom: 14px;
    }

    /* Profile + actions row: stack vertically */
    .hero-content {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .hero-profile h1 {
        font-size: 1.25rem;
    }

    /* Action buttons: wrap into a tight row */
    .hero-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    .hero-actions .btn-sync-lc,
    .hero-actions .btn-profile {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 12px;
        padding: 8px 10px;
    }
    .hero-actions .btn-admin-lock,
    .hero-actions .theme-toggle {
        flex: 0 0 auto;
    }

    /* ── Hero stats bar → 2×2 grid ── */
    .hero-stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    /* Hide the vertical dividers between stats */
    .hero-stats-bar .navbar-stat-divider {
        display: none;
    }

    /* Each stat card: compact, centered */
    .hero-stats-bar .navbar-stat {
        flex: unset;
        padding: 10px 8px;
        min-width: 0;
        box-sizing: border-box;
        border-radius: 8px;
    }

    .hero-stats-bar .navbar-stat-value {
        font-size: 1.3rem;
    }

    .hero-stats-bar .navbar-stat-label {
        font-size: 0.58rem;
    }

    /* ── Problem list toolbar on mobile ── */
    .table-toolbar {
        position: relative; /* remove sticky on mobile — stays in section */
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    /* Title row: full width */
    .table-toolbar-left {
        flex: 1 1 100%;
        min-width: 0;
    }
    .table-toolbar-left h3 {
        font-size: 14px;
    }
    .table-toolbar-subtitle {
        font-size: 11px;
    }

    /* Controls row: search + filters on one compact row */
    .table-toolbar-right {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
        gap: 6px;
    }

    /* Search: takes available space */
    .toolbar-search {
        flex: 1 1 auto;
        min-width: 0;
    }
    .toolbar-search input {
        width: 100%;
        font-size: 12px;
        padding: 0 10px 0 28px;
    }

    /* Filters: compact pill row */
    .toolbar-filters {
        flex-wrap: wrap;
        height: auto;
        padding: 4px 6px;
        gap: 4px;
        width: 100%;
    }
    .toolbar-select {
        padding: 4px 18px 4px 6px;
        font-size: 11px;
        flex: 1 1 auto;
    }
    .toolbar-divider {
        display: none;
    }

    /* ── Table card ── */
    .table-card {
        max-width: 100%;
        overflow: hidden;
        margin-top: 14px;
        margin-bottom: 14px;
    }

    /* Table scrolls horizontally inside its wrapper */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* ── Notification ── */
    .notification {
        min-width: 0;
        max-width: calc(100vw - 32px);
        width: auto;
        left: 16px;
        right: 16px;
    }

    /* ── Dashboard grids: single column ── */
    .dashboard-primary-grid,
    .analytics-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 12px;
    }

    /* ── Generic cards ── */
    .card, .stat-card, .progress-card, .filters-card {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ── Tighter section spacing ── */
    .dashboard-single-card,
    .analytics-chart-container {
        margin-bottom: 14px;
    }
}
