/* ========================================================
   Task Manager — Design System
   Inspired by Linear, Notion, and modern SaaS interfaces.
   Zero frameworks. Zero libraries. Pure CSS.
   ======================================================== */

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

:root {
    /* Surfaces */
    --bg-base: #f7f8fa;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #f1f3f5;
    --bg-active: #e9ecef;
    --bg-sunken: #f1f3f5;

    /* Borders */
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    --border-focus: #818cf8;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;

    /* Brand */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-subtle: #eef2ff;
    --accent-muted: rgba(99, 102, 241, .1);

    /* Semantic */
    --danger: #ef4444;
    --danger-subtle: #fef2f2;
    --success: #10b981;
    --success-subtle: #ecfdf5;
    --warning: #f59e0b;
    --warning-subtle: #fffbeb;

    /* Shape */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows — layered for depth */
    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 8px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 8px 24px -4px rgba(0,0,0,.1), 0 4px 8px -4px rgba(0,0,0,.06);
    --shadow-xl: 0 20px 48px -8px rgba(0,0,0,.15), 0 8px 16px -4px rgba(0,0,0,.06);
    --shadow-ring: 0 0 0 3px var(--accent-muted);

    /* Layout */
    --sidebar-w: 256px;
    --header-h: 56px;

    /* Type */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

    /* Motion */
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-in-out: cubic-bezier(.45, 0, .55, 1);
    --duration-fast: 120ms;
    --duration: 180ms;
    --duration-slow: 300ms;
}

/* ===== Base ===== */
html { font-size: 14px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent-muted); color: var(--accent-hover); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ===== Auth Pages ===== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
}
.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139,92,246,.06), transparent);
    pointer-events: none;
}
.auth-container { width: 100%; max-width: 400px; padding: 24px; position: relative; z-index: 1; }
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.auth-logo h1 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.auth-subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 13px; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-secondary); }

/* ===== Layout ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-w);
    background: #18181b;
    color: #a1a1aa;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--duration-slow) var(--ease-out);
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.logo-text { font-weight: 600; color: #fafafa; font-size: 14px; letter-spacing: -.01em; }

.sidebar-toggle {
    background: none; border: none;
    color: #71717a; cursor: pointer;
    padding: 6px; border-radius: var(--radius-sm);
    display: flex; transition: all var(--duration-fast);
}
.sidebar-toggle:hover { color: #e4e4e7; background: rgba(255,255,255,.06); }

.sidebar-nav { padding: 6px 8px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: #a1a1aa;
    font-size: 13px; font-weight: 500;
    transition: all var(--duration-fast);
    text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #e4e4e7; }
.nav-item.active {
    background: rgba(99,102,241,.15);
    color: #a5b4fc;
}
.nav-item svg { flex-shrink: 0; opacity: .7; }
.nav-item.active svg { opacity: 1; }

.sidebar-section { padding: 4px 8px; margin-top: 4px; }
.sidebar-section-title {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .8px;
    color: #52525b;
    padding: 10px 10px 4px;
}
.project-nav-item { padding: 6px 10px; font-size: 13px; }
.project-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.project-dot-lg { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.user-menu { display: flex; align-items: center; gap: 10px; padding: 4px; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 500; color: #e4e4e7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10px; color: #52525b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
    color: #52525b; display: flex; padding: 6px; border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* Sidebar expand button (visible only when collapsed) */
.sidebar-expand-btn {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 101;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px;
    cursor: pointer;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-fast);
}
.sidebar-expand-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Collapsed */
.sidebar-collapsed .sidebar { width: 0; overflow: hidden; }
.sidebar-collapsed .sidebar-expand-btn { display: flex; }
.sidebar-collapsed .main-content { margin-left: 0; }

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 24px 32px;
    min-height: 100vh;
    transition: margin-left var(--duration-slow) var(--ease-out);
}

/* ===== Page Header ===== */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.page-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 1px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13px; font-weight: 500; font-family: var(--font);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    text-decoration: none; white-space: nowrap; line-height: 1.4;
    user-select: none;
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--accent); color: var(--text-inverse);
    box-shadow: 0 1px 2px rgba(99,102,241,.3), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--text-inverse); box-shadow: 0 2px 8px rgba(99,102,241,.35); }

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

.btn-danger { background: var(--danger); color: var(--text-inverse); box-shadow: 0 1px 2px rgba(239,68,68,.3); }
.btn-danger:hover { background: #dc2626; color: var(--text-inverse); }

.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; padding: 9px 16px; }
.btn-icon {
    background: none; border: none; color: var(--text-tertiary);
    cursor: pointer; padding: 5px; border-radius: var(--radius-sm);
    display: flex; transition: all var(--duration-fast);
}
.btn-icon:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-ghost.btn-danger { color: var(--danger); border-color: transparent; background: none; }
.btn-ghost.btn-danger:hover { background: var(--danger-subtle); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-primary); margin-bottom: 5px;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px; font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-ring);
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
textarea { resize: vertical; line-height: 1.5; }

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

/* Custom checkbox */
.task-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all var(--duration-fast);
    flex-shrink: 0;
    background: var(--bg-card);
}
.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.task-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.task-checkbox:focus-visible { box-shadow: var(--shadow-ring); }

.required { color: var(--danger); }
.color-input { width: 36px; height: 34px; padding: 2px; cursor: pointer; border-radius: var(--radius-sm); }

.inline-form { display: flex; gap: 8px; margin-bottom: 16px; align-items: end; }
.inline-form input, .inline-form select { max-width: 220px; }

/* Toggle checkbox label */
.toggle-label {
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 13px; font-weight: 400;
    color: var(--text-primary);
    line-height: 1;
}
.toggle-label input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
    margin: 0; flex-shrink: 0; vertical-align: middle;
}
.toggle-text { user-select: none; line-height: 1.4; }

/* ===== Alerts ===== */
.alert {
    padding: 10px 14px; border-radius: var(--radius);
    font-size: 13px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.alert-error { background: var(--danger-subtle); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-subtle); color: #065f46; border: 1px solid #a7f3d0; }

/* ===== Color Picker ===== */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-option { cursor: pointer; }
.color-option input { display: none; }
.color-swatch {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: block;
    border: 2px solid transparent;
    transition: all var(--duration-fast);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.color-swatch:hover { transform: scale(1.15); }
.color-option input:checked + .color-swatch {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text-primary);
    transform: scale(1.1);
}

/* ===== Avatar ===== */
.avatar {
    width: 30px; height: 30px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 11px; font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.avatar-sm { width: 24px; height: 24px; font-size: 9px; }
.avatar-xs { width: 20px; height: 20px; font-size: 8px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }

/* Avatar with image */
.avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
    display: block;
}

/* Avatar upload area */
.avatar-upload-area { display: flex; align-items: flex-start; gap: 20px; }
.avatar-upload-preview { flex-shrink: 0; }
.avatar-upload-img {
    width: 72px; height: 72px;
    border-radius: var(--radius-full);
    object-fit: cover;
    display: block;
    border: 2px solid var(--border);
}
.avatar-upload-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar-upload-btn { cursor: pointer; }
.avatar-upload-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Badges ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px; font-weight: 500;
    white-space: nowrap;
    letter-spacing: .01em;
}
.badge-project {
    background: color-mix(in srgb, var(--badge-color, var(--accent)) 10%, transparent);
    color: var(--badge-color, var(--accent));
}
.badge-column { background: var(--bg-sunken); color: var(--text-secondary); }
.badge-role { background: var(--accent-subtle); color: var(--accent); }

.label-badge {
    display: inline-flex; align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 11px; font-weight: 500;
    color: #fff;
    letter-spacing: .01em;
}
.label-badge-sm { padding: 0 6px; font-size: 10px; }

.priority-badge { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; }
.priority-urgent { color: #ef4444; }
.priority-high { color: #f97316; }
.priority-medium { color: #eab308; }
.priority-low { color: #3b82f6; }

/* Priority tag — colored pill label on kanban cards */
.priority-tag {
    display: inline-flex; align-items: center;
    padding: 1px 7px; border-radius: var(--radius-full);
    font-size: 10px; font-weight: 600; letter-spacing: .02em;
    white-space: nowrap;
}
.priority-tag.priority-urgent { background: #fef2f2; color: #dc2626; }
.priority-tag.priority-high   { background: #fff7ed; color: #ea580c; }
.priority-tag.priority-medium { background: #fefce8; color: #ca8a04; }
.priority-tag.priority-low    { background: #eff6ff; color: #2563eb; }

.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.priority-dot-lg { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.due-date { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.due-date.overdue { color: var(--danger); font-weight: 600; }

/* ===== Progress Bar ===== */
.progress-bar { height: 3px; background: var(--bg-sunken); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; transition: width var(--duration-slow) var(--ease-out); }

/* ===== Modals ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 40px 24px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn var(--duration-fast) var(--ease-out);
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%; max-width: 520px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    animation: modalIn var(--duration) var(--ease-out);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-header h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.modal-close {
    background: none; border: none;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary); cursor: pointer;
    font-size: 20px; line-height: 1;
    transition: all var(--duration-fast);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 20px; }

.task-modal { max-width: 680px; max-height: calc(100vh - 80px); }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Project Cards ===== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--duration) var(--ease-out);
    text-decoration: none; color: inherit; display: block;
    position: relative;
}
.project-card::before {
    content: '';
    position: absolute; inset: -1px;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: border-color var(--duration) var(--ease-out);
    pointer-events: none;
}
.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: inherit;
}
.project-card:hover::before { border-color: var(--accent); }
.project-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.project-card-color { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; margin-top: 5px; }
.project-card h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.project-card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.project-card-stats { margin-top: 8px; }
.project-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); margin-top: 8px; }

/* Project card with actions */
.project-card-wrap { position: relative; }
.project-card-actions {
    position: absolute; top: 10px; right: 10px;
    display: flex; gap: 2px;
    opacity: 0; transition: opacity var(--duration-fast);
}
.project-card-wrap:hover .project-card-actions { opacity: 1; }
.project-card-fav { border-color: #fde68a; }

/* ===== Empty States ===== */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-secondary); }
.empty-state svg { margin-bottom: 16px; opacity: .5; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 6px; font-size: 15px; }
.empty-state p { font-size: 13px; margin-bottom: 20px; color: var(--text-tertiary); }
.empty-state-small { padding: 24px; text-align: center; color: var(--text-tertiary); font-size: 13px; }

/* ===== Dashboard ===== */
.dashboard-grid { display: flex; gap: 28px; }
.dashboard-main { flex: 1; min-width: 0; }
.dashboard-aside { width: 320px; flex-shrink: 0; }
.dashboard-section { margin-bottom: 28px; }

.section-title {
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.section-title svg { color: var(--text-tertiary); width: 15px; height: 15px; }
.section-title-danger { color: var(--danger); }
.section-title-danger svg { color: var(--danger); }

/* Task List Compact */
.task-list-compact { display: flex; flex-direction: column; }
.task-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
    gap: 12px;
}
.task-row:hover { background: var(--bg-hover); }
.task-row-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.task-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.task-row-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Project Stats */
.project-stat-list { display: flex; flex-direction: column; gap: 6px; }
.project-stat-card {
    display: block; padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none; color: inherit;
    transition: all var(--duration-fast);
}
.project-stat-card:hover { border-color: var(--accent); background: var(--accent-subtle); color: inherit; }
.project-stat-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.project-stat-name { font-size: 13px; font-weight: 500; }
.project-stat-numbers { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; gap: 4px; }
.activity-item { display: flex; gap: 8px; padding: 6px 0; }
.activity-content { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.activity-user { font-weight: 500; color: var(--text-primary); }
.activity-target { color: var(--accent); }
.activity-time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ===== Project Tabs ===== */
.project-tabs {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.project-tabs-left { display: flex; align-items: center; gap: 8px; }
.project-tabs-title {
    font-size: 16px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    letter-spacing: -.01em;
}
.tabs { display: flex; gap: 0; }
.tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 14px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--duration-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    border-radius: 0;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

/* ===== Kanban Board ===== */
.board-container {
    display: flex; gap: 14px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: calc(100vh - 200px);
    align-items: flex-start;
}
.board-column {
    background: var(--bg-sunken);
    border-radius: var(--radius-lg);
    min-width: 280px; max-width: 320px;
    flex-shrink: 0;
    display: flex; flex-direction: column;
}
.column-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 12px 8px;
}
.column-header-left { display: flex; align-items: center; gap: 8px; }
.column-dot { width: 8px; height: 8px; border-radius: 50%; }
.column-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--text-secondary); }
.column-count {
    font-size: 11px; color: var(--text-tertiary);
    background: var(--bg-card); padding: 0 6px;
    border-radius: var(--radius-full); font-weight: 500;
    border: 1px solid var(--border-light);
}

.column-tasks {
    padding: 0 6px 6px;
    display: flex; flex-direction: column; gap: 5px;
    min-height: 32px;
    transition: background var(--duration-fast);
}
.column-tasks.drag-over { background: var(--accent-muted); border-radius: var(--radius); }

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    user-select: none;
    box-shadow: var(--shadow-xs);
}
.task-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.task-card.dragging { opacity: .35; transform: rotate(3deg) scale(.98); }
.task-card.task-completed { opacity: .55; }
.task-card.task-completed .task-card-title { text-decoration: line-through; color: var(--text-tertiary); }

.task-card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.task-card-title { font-size: 13px; font-weight: 500; line-height: 1.45; margin-bottom: 4px; word-break: break-word; color: var(--text-primary); }
.task-card-desc {
    font-size: 12px; line-height: 1.4; color: var(--text-tertiary);
    margin-bottom: 8px; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card-meta-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-card-due { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-tertiary); }
.task-card-due.overdue { color: var(--danger); font-weight: 500; }
.task-card-subtasks { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-tertiary); }

.column-add-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px;
    margin: 0 6px 8px;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--text-tertiary);
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
    font-family: var(--font);
}
.column-add-btn:hover { color: var(--accent); background: var(--accent-muted); }

.quick-add { padding: 0 6px 8px; }
.quick-add-input {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-size: 13px; outline: none;
    box-shadow: var(--shadow-ring);
    font-family: var(--font);
    background: var(--bg-card);
}
.quick-add-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ===== List View ===== */
.list-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 12px;
}
.filter-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-form select { width: auto; min-width: 140px; font-size: 12px; padding: 6px 30px 6px 10px; }
.task-count { font-size: 12px; color: var(--text-tertiary); }

.list-table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.list-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-card);
    table-layout: auto;
}
.list-table thead th {
    padding: 8px 12px; text-align: left;
    font-size: 11px; font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: .4px;
    white-space: nowrap;
}
.list-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--duration-fast);
}
.list-table tbody tr:hover { background: var(--bg-hover); }
.list-table tbody tr:last-child { border-bottom: none; }
.list-table td { padding: 9px 12px; font-size: 13px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-table tr.completed .task-title-text { text-decoration: line-through; color: var(--text-tertiary); }
/* colgroup controls column widths — no col-* class needed */
.assignee-cell { display: flex; align-items: center; gap: 6px; }
.sort-link { color: var(--text-tertiary); text-decoration: none; font-size: 11px; }
.sort-link:hover { color: var(--text-primary); }

/* ===== Calendar ===== */
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.calendar-nav { display: flex; align-items: center; gap: 6px; }
.calendar-title { font-size: 17px; font-weight: 600; min-width: 140px; text-align: center; letter-spacing: -.01em; }

.calendar-grid {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.calendar-weekday {
    padding: 8px; text-align: center;
    font-size: 11px; font-weight: 600;
    color: var(--text-tertiary); background: var(--bg-sunken);
    text-transform: uppercase; letter-spacing: .5px;
}
.calendar-weekday.sunday { color: var(--danger); }
.calendar-weekday.saturday { color: #3b82f6; }

.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-day {
    min-height: 100px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 4px;
    cursor: pointer;
    transition: background var(--duration-fast);
}
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day:hover { background: var(--bg-hover); }
.calendar-day-empty { background: var(--bg-sunken); cursor: default; opacity: .5; }
.calendar-day-empty:hover { background: var(--bg-sunken); }
.calendar-day.today { background: rgba(99,102,241,.04); }
.calendar-day-header { padding: 2px 4px; }
.calendar-day-number { font-size: 12px; font-weight: 500; color: var(--text-tertiary); }
.today-number {
    background: var(--accent); color: #fff;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 11px; font-weight: 600;
}
.calendar-day.sunday .calendar-day-number { color: var(--danger); }
.calendar-day.saturday .calendar-day-number { color: #3b82f6; }

.calendar-day-tasks { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.calendar-task {
    padding: 2px 6px; border-radius: 4px;
    background: var(--bg-sunken); font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer; transition: background var(--duration-fast);
}
.calendar-task:hover { background: var(--bg-active); }
.calendar-task.completed { opacity: .4; text-decoration: line-through; }
.calendar-task-title { color: var(--text-primary); }
.calendar-task-more { font-size: 10px; color: var(--text-tertiary); padding: 2px 6px; }

/* ===== Settings ===== */
.settings-grid { display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.settings-section .section-title { margin-bottom: 16px; }
.settings-danger { border-color: #fecaca; }
.settings-danger p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }

.member-list { display: flex; flex-direction: column; }
.member-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.member-item:last-child { border-bottom: none; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 13px; font-weight: 500; }
.member-email { font-size: 12px; color: var(--text-tertiary); }

.label-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.label-item { display: flex; align-items: center; gap: 6px; }

/* Session Management */
.session-list { display: flex; flex-direction: column; gap: 2px; }
.session-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: background var(--duration-fast);
}
.session-item:hover { background: var(--bg-hover); }
.session-item.session-current { border-color: var(--accent); background: var(--accent-subtle); }
.session-icon { color: var(--text-tertiary); flex-shrink: 0; display: flex; }
.session-info { flex: 1; min-width: 0; }
.session-device { font-size: 13px; font-weight: 500; display: flex; align-items: center; }
.session-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* Column (Status) Manager */
.column-manager { display: flex; flex-direction: column; gap: 2px; }
.column-manager-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: all var(--duration-fast);
    cursor: default;
}
.column-manager-item:hover { border-color: var(--border); }
.column-manager-item.dragging { opacity: .4; border-style: dashed; }
.column-manager-item.drag-above { border-top: 2px solid var(--accent); }

.column-manager-drag {
    cursor: grab; color: var(--text-tertiary);
    display: flex; padding: 2px;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast);
}
.column-manager-drag:hover { color: var(--text-secondary); }
.column-manager-drag:active { cursor: grabbing; }

.column-manager-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.column-manager-form {
    display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
}
.column-manager-input {
    flex: 1; min-width: 0;
    padding: 4px 8px !important;
    font-size: 13px !important;
    border-color: transparent !important;
    background: transparent !important;
    font-weight: 500;
}
.column-manager-input:focus {
    border-color: var(--border-focus) !important;
    background: var(--bg-card) !important;
    box-shadow: var(--shadow-ring);
}
.column-manager-color {
    width: 28px !important; height: 28px !important;
    padding: 1px !important; border-radius: 50% !important;
    border: 1px solid var(--border) !important;
    cursor: pointer;
    flex-shrink: 0;
}

.column-manager-name { flex: 1; font-size: 13px; font-weight: 500; }
.column-manager-count { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; flex-shrink: 0; }

/* ===== Task Detail (Modal) ===== */
.task-detail-header {
    padding: 24px 24px 0;
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
}
.task-detail-title {
    font-size: 17px; font-weight: 600; line-height: 1.35;
    flex: 1; border: none; outline: none;
    padding: 2px 0; font-family: var(--font);
    color: var(--text-primary); background: transparent;
    width: 100%; resize: none;
    letter-spacing: -.01em;
}
.task-detail-title.title-completed { text-decoration: line-through; color: var(--text-tertiary); }

/* Complete toggle button in modal */
.btn-complete, .btn-complete-done {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 600; font-family: var(--font);
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    border: 1.5px solid var(--border);
    transition: all var(--duration-fast);
}
.btn-complete {
    background: var(--bg-card); color: var(--text-secondary);
}
.btn-complete:hover { border-color: var(--success); color: var(--success); background: var(--success-subtle); }
.btn-complete-done {
    background: var(--success); color: #fff;
    border-color: var(--success);
}
.btn-complete-done:hover { background: #059669; border-color: #059669; }

.task-detail-body { padding: 16px 24px; }
/* Lock banner */
.lock-banner {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 24px;
    background: var(--warning-subtle);
    border-bottom: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.lock-banner svg { flex-shrink: 0; color: #d97706; }

/* Attachments */
.attachment-section .subtask-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.attachment-list { display: flex; flex-direction: column; gap: 4px; }
.attachment-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: var(--radius);
    cursor: pointer; transition: background var(--duration-fast);
}
.attachment-item:hover { background: var(--bg-hover); }
.attachment-icon { color: var(--text-tertiary); flex-shrink: 0; display: flex; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-meta { font-size: 11px; color: var(--text-tertiary); }
.attachment-upload-btn { cursor: pointer; }
.attachment-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 6px;
    transition: border-color var(--duration-fast);
}
.attachment-card:hover { border-color: var(--border); }
.attachment-card .attachment-item {
    border: none; border-radius: 0;
    margin: 0;
}
.attachment-card .attachment-thumbnail { margin-bottom: 0; border-radius: 0; }
.attachment-dl-btn {
    color: var(--text-tertiary); display: flex; flex-shrink: 0;
    padding: 4px; border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.attachment-dl-btn:hover { color: var(--accent); background: var(--accent-subtle); }
.attachment-delete-btn {
    background: none; border: none;
    color: var(--text-tertiary); cursor: pointer;
    padding: 4px; display: flex; flex-shrink: 0;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.attachment-delete-btn:hover { color: var(--danger); background: var(--danger-subtle); }

/* Image thumbnails in attachment list */
.attachment-thumbnail {
    width: 100%; border-radius: var(--radius);
    overflow: hidden; cursor: pointer;
    margin-bottom: 4px;
    max-height: 120px;
    background: var(--bg-sunken);
}
.attachment-thumbnail img {
    width: 100%; height: auto; max-height: 120px;
    object-fit: cover; display: block;
    transition: transform var(--duration);
}
.attachment-thumbnail:hover img { transform: scale(1.02); }

/* Full-screen image preview overlay */
.image-preview-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,.85);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn var(--duration-fast) var(--ease-out);
    cursor: zoom-out;
}
.image-preview-content {
    max-width: 90vw; max-height: 90vh;
    display: flex; flex-direction: column;
    cursor: default;
}
.image-preview-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 4px 12px;
    color: #fff;
}
.image-preview-name { font-size: 13px; font-weight: 500; opacity: .8; }
.image-preview-content img {
    max-width: 90vw; max-height: calc(90vh - 50px);
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* Show more button */
.btn-show-more {
    display: block; width: 100%;
    padding: 6px; margin-top: 4px;
    border: none; border-radius: var(--radius-sm);
    background: none; color: var(--accent);
    font-size: 12px; font-weight: 500; font-family: var(--font);
    cursor: pointer; text-align: center;
    transition: background var(--duration-fast);
}
.btn-show-more:hover { background: var(--accent-subtle); }

/* ===== Comments ===== */
.comment-section { margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.comment-item {
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: background var(--duration-fast);
}
.comment-item:hover { background: var(--bg-hover); }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-user-info { flex: 1; min-width: 0; }
.comment-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.comment-time { font-size: 11px; color: var(--text-tertiary); margin-left: 6px; }
.comment-body { font-size: 13px; line-height: 1.55; color: var(--text-primary); padding-left: 32px; word-break: break-word; }
.comment-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--duration-fast); }
.comment-item:hover .comment-actions { opacity: 1; }
.comment-action-btn {
    background: none; border: none; color: var(--text-tertiary);
    cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
    display: flex; transition: all var(--duration-fast);
}
.comment-action-btn:hover { color: var(--text-primary); background: var(--bg-active); }

/* Comment reactions */
.comment-reactions { display: flex; align-items: center; gap: 4px; padding-left: 32px; margin-top: 4px; flex-wrap: wrap; }
.reaction-btn {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: var(--radius-full);
    border: 1px solid var(--border-light); background: var(--bg-card);
    font-size: 12px; cursor: pointer;
    transition: all var(--duration-fast);
    font-family: var(--font);
}
.reaction-btn:hover { border-color: var(--accent); background: var(--accent-subtle); }
.reaction-btn.reaction-active { border-color: var(--accent); background: var(--accent-subtle); }

.reaction-picker-wrap { position: relative; display: inline-flex; }
.reaction-add-btn {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px dashed var(--border); border-radius: var(--radius-full);
    background: none; color: var(--text-tertiary);
    font-size: 14px; cursor: pointer;
    transition: all var(--duration-fast);
    font-family: var(--font);
}
.reaction-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.reaction-picker {
    display: none; position: absolute; bottom: 100%; left: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 4px; z-index: 10;
    white-space: nowrap;
}
.reaction-picker.show { display: flex; gap: 2px; }
.reaction-picker-item {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; border-radius: var(--radius-sm);
    font-size: 16px; cursor: pointer;
    transition: background var(--duration-fast);
}
.reaction-picker-item:hover { background: var(--bg-hover); }

/* Comment form */
.comment-form { border-top: 1px solid var(--border-light); padding-top: 12px; }
.comment-input {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 13px; font-family: var(--font);
    resize: vertical; min-height: 60px;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    outline: none;
}
.comment-input:focus { border-color: var(--border-focus); box-shadow: var(--shadow-ring); }
.comment-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
/* Mention */
.mention-wrap { position: relative; }
.mention-dropdown {
    position: absolute; bottom: 100%; left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    max-height: 200px; overflow-y: auto;
    z-index: 20; margin-bottom: 4px;
}
.mention-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; cursor: pointer;
    font-size: 13px; transition: background var(--duration-fast);
}
.mention-item:hover, .mention-item-active { background: var(--bg-hover); }
.mention-highlight {
    background: var(--accent-muted); color: var(--accent);
    padding: 0 2px; border-radius: 3px; font-weight: 500;
}

.comment-edit-textarea {
    width: 100%; padding: 6px 8px;
    border: 1px solid var(--accent); border-radius: var(--radius);
    font-size: 13px; font-family: var(--font);
    resize: vertical; min-height: 50px;
    outline: none; box-shadow: var(--shadow-ring);
}

/* Notification bell & dropdown */
.notification-bell {
    position: relative;
    background: none; border: none;
    color: #71717a; cursor: pointer;
    padding: 6px; border-radius: var(--radius-sm);
    display: flex; transition: all var(--duration-fast);
}
.notification-bell:hover { color: #e4e4e7; background: rgba(255,255,255,.06); }
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px;
    background: var(--danger); color: #fff;
    font-size: 9px; font-weight: 700;
    border-radius: 8px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

.notif-dropdown {
    position: absolute; bottom: 52px; left: 8px; right: 8px;
    background: #27272a; border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    max-height: 360px; overflow-y: auto;
    z-index: 200;
}
.notif-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.notif-dropdown-title { font-size: 12px; font-weight: 600; color: #e4e4e7; text-transform: uppercase; letter-spacing: .5px; }
.notif-dropdown-header .btn-icon { color: #71717a; }
.notif-dropdown-header .btn-icon:hover { color: #e4e4e7; }

.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
    display: block; padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    text-decoration: none; color: #a1a1aa;
    transition: background var(--duration-fast);
}
.notif-item:hover { background: rgba(255,255,255,.04); color: #e4e4e7; }
.notif-item.notif-unread { background: rgba(99,102,241,.08); }
.notif-title { font-size: 12px; font-weight: 500; color: #e4e4e7; line-height: 1.4; }
.notif-detail { font-size: 11px; color: #a1a1aa; margin-top: 2px; }
.notif-time { font-size: 10px; color: #52525b; margin-top: 3px; }

.task-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.task-detail-field label {
    display: block; font-size: 10px; font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: .6px;
    margin-bottom: 4px;
}
.task-detail-field select, .task-detail-field input { width: 100%; padding: 6px 10px; font-size: 13px; }

.task-detail-description { margin-bottom: 20px; }
.task-detail-description label {
    display: block; font-size: 10px; font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: .6px;
    margin-bottom: 4px;
}
.task-detail-description textarea { width: 100%; min-height: 60px; font-size: 13px; padding: 8px 10px; }

/* Subtasks */
.subtask-section { margin-bottom: 20px; }
.subtask-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.subtask-section-header h3 {
    font-size: 10px; font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: .6px;
}
.subtask-progress { font-size: 11px; color: var(--text-tertiary); }
.subtask-list { display: flex; flex-direction: column; gap: 1px; }
.subtask-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast);
}
.subtask-item:hover { background: var(--bg-hover); }
.subtask-item.done .subtask-title-input { text-decoration: line-through; color: var(--text-tertiary); }
.subtask-title { flex: 1; font-size: 13px; }
.subtask-title-input {
    flex: 1; min-width: 0;
    font-size: 13px !important;
    padding: 2px 6px !important;
    border-color: transparent !important;
    background: transparent !important;
    font-weight: 400;
}
.subtask-title-input:focus {
    border-color: var(--border-focus) !important;
    background: var(--bg-card) !important;
    box-shadow: var(--shadow-ring);
}
.subtask-delete {
    opacity: 0; background: none; border: none;
    color: var(--text-tertiary); cursor: pointer;
    padding: 3px; display: flex;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.subtask-item:hover .subtask-delete { opacity: 1; }
.subtask-delete:hover { color: var(--danger); background: var(--danger-subtle); }
.subtask-add { display: flex; gap: 6px; margin-top: 8px; }
.subtask-add input { flex: 1; }

/* Labels in detail */
.task-detail-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.label-toggle {
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px; font-weight: 500;
    color: #fff; cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--duration-fast);
    opacity: .3;
}
.label-toggle:hover { opacity: .6; }
.label-toggle.active { opacity: 1; border-color: rgba(255,255,255,.3); box-shadow: 0 1px 4px rgba(0,0,0,.15); }

.task-detail-actions {
    display: flex; gap: 8px;
    padding: 12px 24px 20px;
    border-top: 1px solid var(--border-light);
}

/* ===== Toasts ===== */
.toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: #18181b; color: #fafafa;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    animation: toastIn var(--duration) var(--ease-out);
    display: flex; align-items: center; gap: 8px;
    max-width: 360px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Font Size Settings ===== */
/* zoom で全体をスケーリング — px指定の要素も含め全て影響する */
body.font-small  { zoom: 0.85; -moz-transform: scale(0.85); -moz-transform-origin: 0 0; }
body.font-medium { /* default — no scaling */ }
body.font-large  { zoom: 1.15; -moz-transform: scale(1.15); -moz-transform-origin: 0 0; }
/* Firefox は zoom 非対応のため transform で代替、高さ補正 */
@-moz-document url-prefix() {
    body.font-small  { min-height: calc(100vh / 0.85); }
    body.font-large  { min-height: calc(100vh / 1.15); }
}

/* Font size picker UI */
.font-size-options {
    display: flex; gap: 10px;
}
.font-size-option {
    flex: 1; cursor: pointer;
}
.font-size-option input { display: none; }
.font-size-preview {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--duration-fast);
    background: var(--bg-base);
}
.font-size-option:hover .font-size-preview { border-color: #a5b4fc; }
.font-size-option.active .font-size-preview,
.font-size-option input:checked ~ .font-size-preview {
    border-color: var(--accent);
    background: var(--accent-subtle);
    box-shadow: 0 0 0 3px var(--accent-muted);
}
.font-size-sample-sm { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.font-size-sample-md { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.font-size-sample-lg { font-size: 22px; font-weight: 600; color: var(--text-primary); }
.font-size-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .dashboard-grid { flex-direction: column; }
    .dashboard-aside { width: 100%; }
}
@media (max-width: 768px) {
    .sidebar { width: 0; overflow: hidden; }
    .sidebar-expand-btn { display: flex; }
    .main-content { margin-left: 0; padding: 16px; }
    .project-tabs { flex-direction: column; align-items: flex-start; }
    .board-container { gap: 10px; }
    .board-column { min-width: 260px; }
    .form-row { flex-direction: column; }
    .calendar-day { min-height: 70px; }
    .list-toolbar { flex-direction: column; }
    .filter-form { flex-wrap: wrap; }
}
