/**
 * Task Scheduler - Main Stylesheet
 * Modern, responsive design with clean UI
 */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors - Professional Navy Blue */
    /* ── Aakar Foundation brand palette ── */
    --primary-color:   #0d8a8a;   /* Aakar teal */
    --primary-dark:    #076969;   /* darker teal for hover */
    --primary-light:   #e0f5f5;   /* light teal tint */
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    
    /* Secondary Colors - Elegant Slate */
    --secondary-color: #475569;
    --secondary-dark: #334155;
    
    /* Accent & Status Colors */
    --accent-color: #0891b2;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    
    /* Text Colors - High Contrast */
    --text-dark: #0f172a;
    --text-medium: #475569;
    --text-light: #64748b;
    --text-white: #ffffff;
    
    /* Background Colors */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --bg-dark: #1e293b;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Shadows */
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 15px;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.auth-container {
    max-width: 450px;
    margin: 50px auto;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.card-header h2 {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 700;
}
    font-weight: 600;
}

/* ===== Dashboard Statistics ===== */
.tasks-dashboard {
    margin-bottom: 30px;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 8px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card.stat-total      { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.stat-completed  { background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%); }
.stat-card.stat-pending    { background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%); }
.stat-card.stat-completion { background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%); }

.stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    font-size: 10px;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 2px;
}

/* Export controls — admin only, compact */
.export-controls {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.export-controls .btn {
    font-size: 12px;
    padding: 5px 10px;
}

/* Progress bar */
.progress-bar {
    width: 70px;
    height: 4px;
    background: rgba(0,0,0,0.10);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: var(--shadow);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-tertiary {
    background: var(--bg-gray);
    color: var(--text-dark);
    border: 1px solid var(--border-medium);
}

.btn-tertiary:hover {
    background: var(--border-color);
    border-color: var(--border-dark);
}

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

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--primary-color);
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: var(--secondary-color);
    color: #0c5460;
}

/* ===== Navigation ===== */
.navbar {
    background: linear-gradient(135deg, #0a5f5f 0%, #042f2f 100%);
    padding: 0;
    box-shadow: var(--shadow-md);
    margin-bottom: 10px;
    position: relative;
    z-index: 500;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 52px;
}

/* Logo image in navbar */
.navbar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
    background: #fff;
    border-radius: 6px;
    padding: 3px 6px;
}

/* App name next to logo */
.navbar-app-name {
    font-size: 15px;
    font-weight: 700;
    color: #e0f5f5;
    letter-spacing: 0.4px;
    margin-left: 8px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-brand:hover .navbar-logo { opacity: 0.9; }
.navbar-brand:hover .navbar-app-name { opacity: 0.95; }

.navbar-user {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   ACTION TAB MENU (Add Task / Suggest / Topics)
   ══════════════════════════════════════════════ */
.action-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.action-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 6px;
    border: none;
    background: transparent;
    color: var(--text-medium);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-right: 1px solid var(--border-color);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.action-tab:last-child { border-right: none; }

.action-tab:hover { background: var(--primary-light); color: var(--primary-color); }

.action-tab.active {
    background: var(--primary-color);
    color: #fff;
}

.action-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--bg-gray);
}

.action-tab-icon { font-size: 15px; line-height: 1; }
.action-tab-label { white-space: nowrap; }

/* ══════════════════════════════════════════════
   SITE FOOTER with Dnyanmandir logo
   ══════════════════════════════════════════════ */
.site-footer {
    background: linear-gradient(135deg, #0a5f5f 0%, #042f2f 100%);
    padding: 10px 16px;
    margin-top: 20px;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;  /* center content */
    gap: 12px;
}

.footer-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 3px 5px;
    flex-shrink: 0;
}

.footer-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.footer-brand {
    font-size: 13px;
    font-weight: 700;
    color: #e0f5f5;
    letter-spacing: 0.3px;
}

.footer-copy {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* ── Avatar dropdown menu ──────────────────────────────── */
.nav-menu {
    position: relative;
}

/* Trigger button */
.nav-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 40px;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.18s, border-color 0.18s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-menu-trigger:hover,
.nav-menu.open .nav-menu-trigger {
    background: rgba(255,255,255,0.13);
    border-color: rgba(255,255,255,0.22);
}

/* Avatar circle */
.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-trigger-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f1f5f9;
}

/* Admin pip */
.nav-admin-pip {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    border: 1.5px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(34,197,94,0.6);
}

/* Chevron */
.nav-chevron {
    width: 14px; height: 14px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.nav-menu.open .nav-chevron { transform: rotate(180deg); }

/* ── Dropdown panel ────────────────────────────────────── */
.nav-dropdown {
    position: absolute;        /* relative to .nav-menu */
    top: calc(100% + 8px);
    right: 0;
    width: 268px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    overflow: hidden;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    pointer-events: none;
}

.nav-menu.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
    pointer-events: auto;
}

/* Tap-outside overlay (mobile) */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: transparent;
}
.nav-menu.open ~ .nav-overlay,
body.nav-open .nav-overlay { display: block; }

/* Dropdown internals */
.nav-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 14px;
}

.nav-dropdown-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-dropdown-info { flex: 1; min-width: 0; }

.nav-dropdown-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-dropdown-email {
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.nav-dropdown-role {
    display: inline-block;
    margin-top: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.25);
}

.nav-dropdown-role-member {
    background: rgba(100,116,139,0.15);
    color: #94a3b8;
    border-color: rgba(100,116,139,0.25);
}

.nav-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0;
}

.nav-dropdown-section {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #475569;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;         /* taller rows — easier to tap on mobile */
    text-decoration: none;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 400;
    transition: background 0.13s;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:active {
    background: rgba(255,255,255,0.07);
    color: #f1f5f9;
}

.nav-item-icon {
    font-size: 17px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item-label {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    line-height: 1.3;
}

.nav-item-hint {
    font-size: 12px;
    color: #475569;
    line-height: 1.2;
}

/* Admin item */
.nav-dropdown-item-admin .nav-item-label { color: #fbbf24; }
.nav-dropdown-item-admin .nav-item-hint  { color: #78716c; }
.nav-dropdown-item-admin:hover,
.nav-dropdown-item-admin:active          { background: rgba(251,191,36,0.08); }

/* Sign out */
.nav-dropdown-item-danger .nav-item-label { color: #f87171; }
.nav-dropdown-item-danger:hover,
.nav-dropdown-item-danger:active          { background: rgba(248,113,113,0.08); }

/* DB badge chip */
.nav-item-badge {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(251,191,36,0.12);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.25);
    flex-shrink: 0;
}

/* ── Mobile adjustments ────────────────────────────────── */
@media (max-width: 480px) {
    .navbar-brand { font-size: 15px; }
    .navbar-logo {
        height: 30px;  /* slightly smaller logo on mobile */
        padding: 2px 5px;
    }
    .navbar-app-name { 
        font-size: 13px;  /* smaller but still visible */
        margin-left: 6px;
    }

    .nav-trigger-name { display: none; }
    .nav-menu-trigger { padding: 4px 8px 4px 4px; gap: 5px; }

    /* On very small screens ensure dropdown doesn't go off left edge */
    .nav-dropdown {
        right: 0;
        width: min(268px, calc(100vw - 20px));
    }
}

/* Ensure .nav-menu doesn't clip its dropdown */
.nav-menu { overflow: visible; }
.navbar-user { overflow: visible; }
.navbar-content { overflow: visible; }
.navbar { overflow: visible; }

/* ── Tablet portrait: slightly smaller navbar text ── */
@media (max-width: 600px) {
    .navbar-app-name {
        font-size: 14px;
        margin-left: 7px;
    }
}

/* ===== Task Controls ===== */
/* ══════════════════════════════════════════════
   COMPACT CONTROL BAR (date nav + view toggle)
   ══════════════════════════════════════════════ */
.ctrl-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* View toggle pills */
.view-toggle {
    display: flex;
    background: var(--bg-light);
    border-radius: 7px;
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}

.vtoggle-btn {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}

.vtoggle-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* Day navigator */
.day-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

/* Shared arrow button */
.nav-arrow {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.nav-arrow:hover,
.nav-arrow:active { background: #dde4ec; border-color: #b0bec5; }

/* Date input — minimal styling */
.day-date-input {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-white);
    outline: none;
    cursor: pointer;
}

.day-date-input:focus { border-color: var(--primary-color); }

/* Today button */
.today-btn {
    padding: 5px 10px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.today-btn:hover,
.today-btn:active { background: var(--primary-color); color: #fff; }

/* Date label */
.date-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* ══════════════════════════════════════════════
   COMPACT MONTH NAV (calendar header)
   ══════════════════════════════════════════════ */
.month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.month-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-export {
    flex-shrink: 0;
    padding: 4px 8px !important;
    font-size: 13px !important;
}

/* ===== Badges ===== */
.badge-me {
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: middle;
}

.badge-private {
    background: #ede9fe;
    color: #6d28d9;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-public {
    background: #d1fae5;
    color: #065f46;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== User task sections ===== */
.my-tasks-section {
    border: 1.5px solid var(--primary-color);
}

.user-task-section {
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    overflow: hidden;
}

/* Clickable collapse header */
.user-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    transition: background 0.15s;
}

.user-header:hover  { background: #e8eef4; }
.user-header:active { background: #dde6ef; }

.user-header-left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.user-email {
    font-size: 11px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Inline progress pill */
.user-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.meta-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

.meta-count.all-done { color: var(--success-color); }
.meta-count.partial  { color: var(--warning-color); }
.meta-count.none-done{ color: var(--text-light); }

.progress-bar {
    width: 50px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Collapse chevron */
.collapse-chevron {
    font-size: 10px;
    color: var(--text-light);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

.user-task-section.collapsed .collapse-chevron {
    transform: rotate(-90deg);
}

/* Collapsible body */
.user-task-body {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}

.user-task-section.collapsed .user-task-body {
    max-height: 0;
    opacity: 0;
}

/* ===== Task List ===== */
.task-list {
    list-style: none;
    padding: 4px 0;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.12s;
}

.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--bg-light); }
.task-item.completed { opacity: 0.6; }

.task-checkbox {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.task-status-icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

.task-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex-wrap: wrap;
}

.task-title {
    font-size: 13px;
    color: var(--text-dark);
    line-height: 1.3;
}

.task-title.completed {
    text-decoration: line-through;
    color: var(--text-light);
}

.task-badge {
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-daily   { background: #dbeafe; color: #1e40af; }
.badge-onetime { background: #fed7aa; color: #9a3412; }

.task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-delete {
    padding: 3px 8px;
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-delete:hover,
.btn-delete:active {
    background: var(--danger-color);
    color: #fff;
}

.no-tasks {
    text-align: center;
    padding: 12px;
    color: var(--text-light);
    font-size: 12px;
    font-style: italic;
}

/* ===== Add Task Form (Collapsible) ===== */
.add-task-form.hidden,
.suggest-topic-form.hidden { display: none; }

.add-task-form,
.suggest-topic-form {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    animation: slideDown 0.2s ease;
}

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

.add-task-form h3 { font-size: 14px; margin-bottom: 10px; color: var(--text-dark); }

/* ===== Suggest form ===== */
.suggest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.suggest-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.suggest-close {
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.topic-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

/* Compact field */
.sf-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sf-field.sf-full { grid-column: 1 / -1; }

.sf-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sf-input {
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-white);
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

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

.sf-textarea {
    resize: vertical;
    min-height: 52px;
}

.sf-actions {
    display: flex;
    gap: 6px;
}

.form-actions {
    display: flex;
    gap: 6px;
}

.btn-tertiary { background: var(--border-color); color: var(--text-dark); }
.btn-tertiary:hover { background: #b0bec5; }

/* ===== View Topics Section ===== */
.view-topics-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
}

.view-topics-section.hidden {
    display: none;
}

.topics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.topics-header h3 {
    font-size: 22px;
    color: var(--text-dark);
    margin: 0;
}

.topics-actions {
    display: flex;
    gap: 10px;
}

.topic-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.topic-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.topic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.topic-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.topic-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.topic-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-light);
}

.topic-type-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.topic-type-badge.parenting {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #2E7D32;
}

.topic-type-badge.vision {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    color: #1565C0;
}

.topic-type-badge.vidya {
    background: linear-gradient(135deg, #F3E5F5, #E1BEE7);
    color: #6A1B9A;
}

.topic-type-badge.general {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #E65100;
}

.topic-status-badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.topic-status-badge.pending {
    background: #FFF3E0;
    color: #E65100;
}

.topic-status-badge.approved {
    background: #E8F5E9;
    color: #2E7D32;
}

.topic-status-badge.rejected {
    background: #FFEBEE;
    color: #C62828;
}

.topic-status-badge.implemented {
    background: #E3F2FD;
    color: #1565C0;
}

.topic-details {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.topic-detail-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.topic-detail-row:last-child {
    margin-bottom: 0;
}

.topic-detail-label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 120px;
}

.topic-detail-value {
    color: var(--text-light);
}

.topic-notes {
    background: #FFFBF0;
    padding: 12px;
    border-left: 4px solid #FFA000;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
}

.topic-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.topic-suggested-by {
    font-size: 13px;
    color: var(--text-light);
}

.topic-suggested-by strong {
    color: var(--text-dark);
}

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

.btn-delete-topic {
    background: linear-gradient(135deg, #EF5350, #E53935);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-topic:hover {
    background: linear-gradient(135deg, #E53935, #C62828);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ===== Calendar Day Details ===== */
.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.calendar-day-header h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin: 0;
}

#calendar-day-tasks-container {
    max-height: 500px;
    overflow-y: auto;
}

/* ===== Add Task Form ===== */
.add-task-form {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.add-task-form h3 {
    color: white;
    margin-bottom: 15px;
}

.task-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.task-input-group input {
    flex: 1;
    min-width: 250px;
}

.task-input-group select {
    min-width: 150px;
}

/* ===== Loading Spinner ===== */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .task-input-group {
        flex-direction: column;
    }
    
    .task-input-group input,
    .task-input-group select {
        min-width: 100%;
    }
    
    /* navbar-content stays row — brand left, menu right */

    .task-item {
        flex-wrap: wrap;
    }
    
    .task-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Calendar View Container */
.calendar-view {
    margin-bottom: 12px;
}

.calendar-view.hidden {
    display: none;
}

/* List View Stats Summary */
.list-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 0;
    padding: 24px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 12px;
}

.stat-card {
    background: var(--bg-white);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.stat-number {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-total .stat-number {
    color: #0891b2;
}

.stat-completed .stat-number {
    color: var(--success-color);
}

.stat-pending .stat-number {
    color: var(--warning-color);
}

/* Calendar Team Tasks List */
.calendar-task-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.calendar-task-header h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin: 0;
}

.calendar-team-tasks-container {
    max-height: 600px;
    overflow-y: auto;
}

.calendar-task-group {
    margin-bottom: 25px;
}

.calendar-task-date {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    display: inline-block;
}

.calendar-user-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 20px 0 15px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.calendar-user-email {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 400;
    margin-left: 8px;
}

.calendar-task-items {
    list-style: none;
    padding: 0;
}

.calendar-task-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.calendar-task-item:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.calendar-task-item.completed {
    opacity: 0.7;
}

.calendar-task-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calendar-task-status.completed {
    background: var(--primary-color);
    color: white;
}

.calendar-task-status.pending {
    background: var(--accent-color);
    color: white;
}

.calendar-task-title {
    flex: 1;
    font-size: 15px;
    color: var(--text-dark);
}

.calendar-task-title.completed {
    text-decoration: line-through;
    color: var(--text-light);
}

.calendar-task-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-dark);
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* ===== Calendar Styles ===== */
.calendar-section { margin: 20px 0; }

/* Calendar Grid (Alternative to Table) */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    padding: 1px;
    margin: 20px 0;
}

.calendar-grid .day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.calendar-grid .day-cell {
    background: white;
    padding: 15px;
    min-height: 100px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.calendar-grid .day-cell:hover {
    background: #f5f5f5;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
}

.calendar-grid .day-cell.other-month {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.3;
}

.calendar-grid .day-cell.other-month:hover {
    background: #f5f5f5;
    transform: none;
    box-shadow: none;
}

.calendar-grid .day-cell.today {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    font-weight: bold;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.calendar-grid .day-cell.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: bold;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.calendar-grid .day-cell .day-number {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

/* ── Day-cell task list (desktop) ───────────────────────────── */
.calendar-grid .day-cell .day-tasks {
    font-size: 10px;
    text-align: left;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.calendar-grid .day-cell .day-task {
    padding: 2px 4px;
    margin: 1px 0;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
    display: block;
}

.calendar-grid .day-cell .day-task.completed {
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
}

.calendar-grid .day-cell .day-task.pending {
    background: rgba(255, 152, 0, 0.1);
    color: var(--accent-color);
}

.calendar-grid .day-cell .day-task-more {
    padding: 2px 4px;
    margin-top: 2px;
    font-size: 9px;
    color: var(--text-light);
    font-style: italic;
}

/* Task count badge */
.calendar-grid .day-cell .task-count {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.calendar-grid .day-cell.selected .task-count {
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
}

/* ── Mobile task count badge (shown only on mobile) ─────────── */
.calendar-grid .day-cell .mobile-task-badge {
    display: none; /* hidden on desktop */
}

/* ── Task Popup ─────────────────────────────────────────────── */
.cal-task-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.cal-task-popup-overlay.active {
    display: flex;
}

.cal-task-popup {
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    width: 100%;
    max-width: 340px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popupIn 0.2s ease;
}

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

.cal-task-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cal-task-popup-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.cal-task-popup-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.cal-task-popup-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-gray);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 30px;
    text-align: center;
    color: var(--text-secondary);
    transition: background 0.15s;
    flex-shrink: 0;
}

.cal-task-popup-close:hover { background: var(--border-medium); }

.cal-task-popup-body {
    overflow-y: auto;
    padding: 12px 18px 18px;
    flex: 1;
}

.cal-task-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    transition: background 0.15s;
}

.cal-task-popup-item:last-child { margin-bottom: 0; }

.cal-task-popup-item.completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.cal-task-popup-item.pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.cal-task-popup-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.cal-task-popup-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
    line-height: 1.4;
}

.cal-task-popup-item.completed .cal-task-popup-title {
    text-decoration: line-through;
    color: var(--text-light);
}

.cal-task-popup-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cal-task-popup-badge.daily   { background: #dbeafe; color: #1e40af; }
.cal-task-popup-badge.onetime { background: #fed7aa; color: #9a3412; }

.cal-task-popup-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    padding: 24px 0;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.calendar-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calendar-table th {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.calendar-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    height: 80px;
    vertical-align: top;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
    background: white;
}

.calendar-table td:hover {
    background-color: #f5f5f5;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
}

.calendar-table td.today {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    font-weight: bold;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.calendar-table td.other-month {
    color: var(--text-light);
    background-color: #fafafa;
    cursor: default;
}

.calendar-table td.other-month:hover {
    background-color: #fafafa;
}

.calendar-table td.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: bold;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.calendar-table td.selected:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2E7D32 100%);
}

.calendar-table td.has-tasks .task-count {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 11px;
    font-weight: bold;
    position: absolute;
    bottom: 4px;
    right: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.calendar-table td.selected.has-tasks .task-count {
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
}

.calendar-table td.today.has-tasks .task-count {
    background: rgba(33, 150, 243, 0.9);
    color: white;
}

/* Calendar responsive */
@media (max-width: 768px) {
    .calendar-table td {
        height: 70px;
        padding: 8px;
        font-size: 13px;
    }
    
    .calendar-table th {
        padding: 8px;
        font-size: 12px;
    }
    
    /* List stats responsive */
    .list-stats {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 28px;
    }

    /* ── Mobile calendar: hide inline task list, show badge instead ── */
    .calendar-grid .day-cell {
        padding: 6px 4px;
        min-height: 56px;
        justify-content: center;
        gap: 4px;
    }

    .calendar-grid .day-cell .day-number {
        font-size: 13px;
        margin-bottom: 0;
    }

    /* Hide the inline task list completely on mobile */
    .calendar-grid .day-cell .day-tasks,
    .calendar-grid .day-cell .day-task,
    .calendar-grid .day-cell .day-task-more {
        display: none !important;
    }

    /* Show the mobile badge (hidden on desktop) */
    .calendar-grid .day-cell .mobile-task-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-color);
        color: #fff;
        border-radius: 10px;
        font-size: 10px;
        font-weight: 700;
        padding: 2px 6px;
        min-width: 20px;
        line-height: 1.4;
        letter-spacing: 0.2px;
    }

    /* Colour variants */
    .calendar-grid .day-cell .mobile-task-badge.all-done {
        background: var(--success-color);
    }
    .calendar-grid .day-cell .mobile-task-badge.partial {
        background: var(--warning-color);
    }
    .calendar-grid .day-cell .mobile-task-badge.none-done {
        background: var(--text-light);
    }

    /* Selected day badge contrast */
    .calendar-grid .day-cell.selected .mobile-task-badge {
        background: rgba(255,255,255,0.9);
        color: var(--primary-dark);
    }
}

@media (max-width: 480px) {
    .calendar-table td {
        height: 60px;
        padding: 4px;
        font-size: 11px;
    }
    
    .calendar-table th {
        padding: 4px;
        font-size: 10px;
    }
    
    .calendar-table td.has-tasks .task-count {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 9px;
    }
    
    .calendar-grid {
        gap: 0;
        padding: 0;
    }
    
    .calendar-grid .day-header {
        padding: 10px 5px;
        font-size: 12px;
    }
    
    .calendar-grid .day-cell {
        min-height: 70px;
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .calendar-grid .day-number {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .calendar-grid .day-cell .task-count {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 9px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .stat-card { padding: 8px 6px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 10px; }

    .calendar-legend { gap: 10px; }
    .legend-item { font-size: 12px; }
}
/* ===== Enhanced Mobile Responsiveness ===== */
@media (max-width: 768px) {
    .container { padding: 8px; }

    .task-input-group { flex-direction: column; }
    .task-input-group .form-control,
    .task-input-group .btn { width: 100%; }

    /* Suggest form: single column */
    .topic-form-grid { grid-template-columns: 1fr; }

    /* Hide date label — not enough room */
    .date-label { display: none; }

    .topics-header  { flex-direction: column; }
    .topics-actions { width: 100%; }
    .topic-footer   { flex-direction: column; }
}

@media (max-width: 480px) {
    .btn { padding: 6px 10px; font-size: 12px; }
    .task-badge, .badge-private, .badge-public { font-size: 9px; padding: 1px 5px; }
    .user-email { display: none; }
    .day-date-input { font-size: 12px; padding: 4px 5px; }
    .vtoggle-btn { font-size: 11px; padding: 4px 8px; }
}