/* ============================
   CSS Variables & Themes
   ============================ */
:root {
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --topnav-h: 60px;
    --sidebar-w: 240px;
    --bottom-nav-h: 64px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 4px rgba(0,0,0,.15);
    --shadow-md: 0 4px 16px rgba(0,0,0,.2);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.28);
    --accent: #4f8ef7;
    --accent-hover: #3a7de8;
    --accent-light: rgba(79, 142, 247, 0.12);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

[data-theme="dark"] {
    --bg: #141414;
    --bg-secondary: #1c1c1c;
    --bg-card: #212121;
    --bg-hover: #2a2a2a;
    --bg-input: #2a2a2a;
    --border: #2e2e2e;
    --border-strong: #3a3a3a;
    --text-primary: #f0f0f0;
    --text-secondary: #9a9a9a;
    --text-muted: #666;
    --sidebar-bg: #181818;
    --topnav-bg: #141414;
    --modal-bg: #1e1e1e;
    --task-card-bg: #262626;
    --task-card-hover: #2e2e2e;
    --scrollbar-thumb: #333;
}

[data-theme="light"] {
    --bg: #f4f5f7;
    --bg-secondary: #eaecef;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    --bg-input: #ffffff;
    --border: #e1e4e8;
    --border-strong: #d0d4da;
    --text-primary: #172b4d;
    --text-secondary: #5e6c84;
    --text-muted: #97a0af;
    --sidebar-bg: #ffffff;
    --topnav-bg: #ffffff;
    --modal-bg: #ffffff;
    --task-card-bg: #ffffff;
    --task-card-hover: #f7f8fa;
    --scrollbar-thumb: #ccc;
}

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

html { font-size: 15px; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 99px; }

/* ============================
   Auth Page
   ============================ */
.auth-page {
    background:
        radial-gradient(circle at top left, rgba(79, 142, 247, 0.25), transparent 34%),
        radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.14), transparent 30%),
        var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
}

.auth-card {
    background: color-mix(in srgb, var(--bg-card) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    padding: 28px;
    backdrop-filter: blur(10px);
}

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

.auth-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-secondary);
}

.auth-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1;
    margin-top: 4px;
}

.auth-copy {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.auth-tab {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 700;
}

.auth-tab.active {
    background: var(--accent);
    color: #fff;
}

.auth-panel {
    display: none;
    gap: 14px;
}

.auth-panel.active {
    display: grid;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--border);
}

.auth-google {
    width: 100%;
    background: #fff;
    color: #111;
    border: 1px solid #d9d9d9;
}

.auth-message {
    min-height: 20px;
    margin-top: 14px;
    color: var(--danger);
    font-size: 0.92rem;
}

@media (max-width: 520px) {
    .auth-card {
        padding: 20px;
        border-radius: 22px;
    }
}

/* ============================
   Top Navigation
   ============================ */
.topnav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topnav-h);
    background: var(--topnav-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
    transition: background var(--transition);
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border-radius: var(--radius-sm);
}
.hamburger:hover { background: var(--bg-hover); }
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topnav-center {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0 16px 0 38px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* User avatar + menu */
.user-avatar-wrapper { position: relative; display: inline-block; }
.user-avatar { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; display:flex; align-items:center; justify-content:center; font-weight:700; }
.user-menu { position: absolute; right: 0; top: calc(var(--topnav-h) + 8px); min-width: 180px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); padding: 6px 0; display: none; z-index: 200; }
.user-menu.open { display: block; }
.user-menu-item { display: block; width: 100%; padding: 8px 12px; background: transparent; border: none; text-align: left; color: var(--text-primary); cursor: pointer; }
.user-menu-item.user-email { font-size: 0.88rem; color: var(--text-secondary); cursor: default; }
.user-menu-item:hover { background: var(--bg-hover); }

.icon-btn {
    position: relative;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--topnav-bg);
    display: none;
}
.notif-dot.active { display: block; }

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

.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    user-select: none;
}

/* ============================
   Sidebar
   ============================ */
.sidebar {
    position: fixed;
    top: var(--topnav-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 90;
    display: flex;
    flex-direction: column;
    transition: background var(--transition), transform var(--transition);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav-item svg { flex-shrink: 0; }

.badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 6px;
}
.badge:empty, .badge[data-count="0"] { display: none; }

/* Boards section */
.nav-section { margin-top: 8px; }

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}
.nav-section-header:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}

.chevron {
    transition: transform var(--transition);
    flex-shrink: 0;
}
.chevron.open { transform: rotate(180deg); }

.nav-submenu {
    padding-left: 8px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.nav-submenu.open { max-height: 600px; }

.nav-item-add {
    color: var(--accent);
    font-size: 0.83rem;
}
.nav-item-add:hover { color: var(--accent-hover); }

.sidebar-footer {
    padding: 12px 8px 20px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.premium-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-weight: 600;
    color: #f59e0b;
    transition: background var(--transition);
}
.premium-btn:hover { background: rgba(245,158,11,.1); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 89;
}

/* ============================
   Main Content
   ============================ */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topnav-h);
    min-height: calc(100vh - var(--topnav-h));
    padding: 0;
    transition: margin var(--transition);
}

.view { min-height: calc(100vh - var(--topnav-h)); }

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

.view-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.view-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Board Container */
.board-container {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    overflow-x: auto;
    min-height: calc(100vh - 180px);
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
}

/* List Column */
.list-column {
    flex-shrink: 0;
    width: 280px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
    transition: background var(--transition), border-color var(--transition);
    animation: slideIn 0.25s ease;
}

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

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    flex-shrink: 0;
}

.list-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.list-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 2px 7px;
    border-radius: 99px;
    font-weight: 500;
}

.list-menu-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}
.list-menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.tasks-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px;
}

/* Task Card */
.task-card {
    background: var(--task-card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    animation: fadeUp 0.2s ease;
    position: relative;
}

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

.task-card:hover {
    background: var(--task-card-hover);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.task-card.completed { opacity: 0.6; }
.task-card.completed .task-title { text-decoration: line-through; }

.task-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.task-checkbox {
    width: 18px; height: 18px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}
.task-checkbox.checked::after {
    content: '';
    width: 9px; height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translateY(-1px);
}

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

.task-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
}

.task-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.task-due {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 3px 8px;
    border-radius: 99px;
}
.task-due.overdue { color: var(--danger); background: rgba(239,68,68,.1); }
.task-due.today { color: var(--warning); background: rgba(245,158,11,.1); }

.priority-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.priority-badge.high { background: rgba(239,68,68,.12); color: #ef4444; }
.priority-badge.medium { background: rgba(245,158,11,.12); color: #f59e0b; }
.priority-badge.low { background: rgba(34,197,94,.12); color: #22c55e; }

.task-actions {
    position: absolute;
    top: 10px; right: 10px;
    display: none;
    gap: 4px;
}
.task-card:hover .task-actions { display: flex; }

.task-action-btn {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
    font-size: 13px;
}
.task-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.task-action-btn.delete:hover { background: rgba(239,68,68,.12); color: var(--danger); }

/* Add task button inside list */
.add-task-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 0 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    flex-shrink: 0;
}
.add-task-btn:hover { background: var(--bg-hover); color: var(--accent); }

/* Add new list button */
.add-list-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    margin: 20px 24px;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-strong);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
    width: 280px;
}
.add-list-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* No tasks empty state */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}
.empty-state svg { margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 0.85rem; }
.empty-state small { font-size: 0.76rem; opacity: .7; margin-top: 4px; display: block; }

/* Due Today List */
.due-today-list {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 700px;
}

.due-today-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.due-today-empty svg { margin-bottom: 16px; opacity: .4; }
.due-today-empty h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 8px; color: var(--text-secondary); }
.due-today-empty p { font-size: 0.85rem; }

.due-task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}
.due-task-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.due-task-info { flex: 1; min-width: 0; }
.due-task-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.due-task-board { font-size: 0.76rem; color: var(--text-muted); }
.due-task-time { font-size: 0.8rem; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ============================
   Bottom Navigation
   ============================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--topnav-bg);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
    position: relative;
}
.bottom-nav-item:hover,
.bottom-nav-item.active { color: var(--accent); }

.bnav-add-btn {
    width: 44px; height: 44px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(79,142,247,.4);
    margin-bottom: 2px;
    transition: background var(--transition), transform var(--transition);
}
.bnav-add-btn:hover { background: var(--accent-hover); transform: scale(1.05); }

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(79,142,247,.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-danger:hover { color: var(--danger) !important; border-color: var(--danger) !important; }

/* ============================
   Modals
   ============================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease;
}
.modal-overlay.open { display: flex; }

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

.modal {
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-sm { max-width: 360px; }
.modal-search { max-width: 520px; }

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

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

.modal-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder { color: var(--text-muted); }

.form-textarea { resize: vertical; min-height: 80px; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

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

/* Priority Picker */
.priority-picker {
    display: flex;
    gap: 8px;
}

.priority-opt {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}
.priority-opt:hover { border-color: var(--border-strong); color: var(--text-primary); }
.priority-opt.active[data-priority="high"] { background: rgba(239,68,68,.12); border-color: #ef4444; color: #ef4444; }
.priority-opt.active[data-priority="medium"] { background: rgba(245,158,11,.12); border-color: #f59e0b; color: #f59e0b; }
.priority-opt.active[data-priority="low"] { background: rgba(34,197,94,.12); border-color: #22c55e; color: #22c55e; }

/* Search Results */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}
.search-result-item:hover { border-color: var(--accent); background: var(--accent-light); }

.search-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================
   Context Menu
   ============================ */
.context-menu {
    position: fixed;
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    min-width: 160px;
    overflow: hidden;
    animation: fadeIn 0.12s ease;
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.ctx-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(239,68,68,.1); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================
   Toast Notifications
   ============================ */
#toastContainer {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 500;
    pointer-events: none;
}

.toast {
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 320px;
    animation: toastIn 0.25s ease;
    pointer-events: all;
}

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

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent); }
.toast.fadeOut { animation: toastOut 0.25s ease forwards; }

@keyframes toastOut {
    to { opacity: 0; transform: translateX(20px); }
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-overlay.active { display: block; }
    .hamburger { display: flex; }

    .main-content {
        margin-left: 0;
        margin-bottom: var(--bottom-nav-h);
        padding-bottom: 12px;
    }

    .bottom-nav {
        display: flex;
        align-items: stretch;
    }

    .topnav-center {
        display: none;
    }

    .board-container {
        padding: 12px 16px;
        gap: 12px;
    }

    .view-header {
        padding: 14px 16px 12px;
    }

    .list-column { width: 260px; }

    .add-list-btn {
        width: 260px;
        margin: 16px;
    }

    #toastContainer {
        bottom: calc(var(--bottom-nav-h) + 12px);
        right: 12px;
        left: 12px;
    }

    .toast { max-width: 100%; }

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

@media (max-width: 420px) {
    .logo-text { font-size: 1rem; }
    .topnav-right .icon-btn:first-child { display: none; }
}

/* ============================
   Notification badge style
   ============================ */
.notif-scheduled {
    position: relative;
}
.notif-scheduled::after {
    content: '';
    position: absolute;
    bottom: 2px; right: 2px;
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
}
