/* ==========================================================================
   Atmosphere Premium Glassmorphism Todo App Design System & Stylesheet
   ========================================================================== */

/* Define CSS Variables */
:root {
    /* Fonts */
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Dark Mode Tokens (Default) */
    --bg-app: #090d16;
    --bg-sidebar: rgba(13, 20, 35, 0.7);
    --bg-card: rgba(20, 30, 55, 0.45);
    --bg-card-hover: rgba(26, 38, 68, 0.6);
    --bg-card-border: rgba(255, 255, 255, 0.07);
    --bg-card-border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    --accent-primary: #8b5cf6; /* Indigo HSL: 260, 85%, 65% */
    --accent-primary-alpha: rgba(139, 92, 246, 0.15);
    --accent-secondary: #06b6d4; /* Cyan HSL: 195, 85%, 50% */
    
    --priority-low: #10b981;    /* Emerald */
    --priority-medium: #f59e0b; /* Amber */
    --priority-high: #ef4444;   /* Rose */
    
    --bg-input: rgba(15, 23, 42, 0.6);
    --border-input: rgba(255, 255, 255, 0.1);
    --border-input-focus: rgba(139, 92, 246, 0.5);
    
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 24px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 0 20px 0 rgba(139, 92, 246, 0.25);
    
    --glass-blur: blur(16px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    /* Light Mode Tokens */
    --bg-app: #f4f6fa;
    --bg-sidebar: rgba(255, 255, 255, 0.75);
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --bg-card-border: rgba(0, 0, 0, 0.06);
    --bg-card-border-hover: rgba(0, 0, 0, 0.12);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    --accent-primary: #6d28d9;
    --accent-primary-alpha: rgba(109, 40, 217, 0.1);
    --accent-secondary: #0891b2;
    
    --bg-input: rgba(255, 255, 255, 0.8);
    --border-input: rgba(0, 0, 0, 0.1);
    --border-input-focus: rgba(109, 40, 217, 0.4);
    
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 20px -4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 32px -8px rgba(0, 0, 0, 0.12);
    --shadow-accent: 0 0 20px 0 rgba(109, 40, 217, 0.15);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-card-border-hover);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Typography elements */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

/* ==========================================================================
   Reusable UI Components
   ========================================================================== */
.glassmorphic {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--bg-card-border);
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.glassmorphic:hover {
    border-color: var(--bg-card-border-hover);
}

/* Buttons */
.btn {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 0 25px 0 rgba(139, 92, 246, 0.35);
}
.btn-primary:active {
    transform: translateY(0);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--priority-high);
}
.btn-danger:hover {
    background: var(--priority-high);
    color: #ffffff;
}

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

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: var(--transition-fast);
}
.btn-icon:hover {
    background: var(--bg-card-border-hover);
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group textarea,
.glass-select {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.glass-select:focus {
    border-color: var(--border-input-focus);
    box-shadow: 0 0 0 3px var(--accent-primary-alpha);
}

.glass-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 2.25rem !important; /* Space for custom chevron */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' 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 0.75rem center;
    background-size: 14px;
}

.glass-select option {
    background-color: #0d1423;
    color: #f1f5f9;
    padding: 0.5rem;
}

[data-theme="light"] .glass-select option {
    background-color: #ffffff;
    color: #0f172a;
}

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

.form-error {
    color: var(--priority-high);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Hidden Class Utility */
.hidden {
    display: none !important;
}

/* ==========================================================================
   Authentication Screens (Setup & Login)
   ========================================================================== */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(6, 118, 212, 0.12) 0%, transparent 40%),
                var(--bg-app);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    margin-bottom: 2rem;
}

.brand-logo {
    display: inline-flex;
    padding: 0.75rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-accent);
}

.brand-logo svg {
    animation: pulse 3s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255,255,255,0.4)); }
    100% { transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(255,255,255,0.8)); }
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-form {
    text-align: left;
}

/* ==========================================================================
   Dashboard Main Workspace Layout
   ========================================================================== */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--bg-card-border);
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 2.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand .logo-icon {
    color: var(--accent-primary);
    width: 28px;
    height: 28px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.nav-item {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    width: 100%;
    text-align: left;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-card-border);
}

.nav-item.active {
    color: #ffffff;
    background: var(--accent-primary);
    box-shadow: 0 4px 12px -2px rgba(139, 92, 246, 0.4);
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.category-nav-btn:hover {
    background: var(--bg-card-border);
    color: var(--text-primary);
}

.category-nav-btn.active {
    background: var(--bg-card-border-hover);
    color: var(--text-primary);
    font-weight: 600;
}

.category-nav-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.category-nav-info > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 4px; /* Give it space from the edge so glow isn't cut off */
    box-shadow: 0 0 8px var(--dot-color);
}

.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-app);
    padding: 2px 6px;
    border-radius: 20px;
    border: 1px solid var(--bg-card-border);
}

.category-nav-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.category-nav-btn:hover .category-nav-actions {
    opacity: 1;
}

.category-nav-actions .btn-icon {
    width: 20px;
    height: 20px;
    padding: 0;
}

/* Sidebar Footer Controls */
.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--bg-card-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.footer-row {
    display: flex;
    gap: 0.5rem;
}

.btn-settings, .btn-logout {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-card-border);
    border: 1px solid var(--bg-card-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-settings:hover, .btn-logout:hover {
    color: var(--text-primary);
    background: var(--bg-card-border-hover);
}

.btn-settings svg {
    transition: transform 0.4s ease;
}

.btn-settings:hover svg {
    transform: rotate(45deg);
}

/* Main Content Area */
.main-content {
    padding: 2.5rem;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: radial-gradient(circle at 80% 20%, var(--accent-primary-alpha) 0%, transparent 45%),
                var(--bg-app);
}

/* Top bar navigation */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.greeting-container h2 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.greeting-container p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 42px;
    border-radius: 10px;
    width: 280px;
}

.search-icon {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    width: 100%;
}

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

/* ==========================================================================
   Analytics Dashboard Cards
   ========================================================================== */
.analytics-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.stats-card {
    border-radius: 18px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-text h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stats-text .counter {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.stats-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-ring-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring-bar {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-mini-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
}

.stats-mini-card {
    border-radius: 14px;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mini-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-card-info {
    display: flex;
    flex-direction: column;
}

.mini-card-info .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mini-card-info .value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================================================
   Board panel - Todo Items Workspace
   ========================================================================== */
.board-panel {
    border-radius: 18px;
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 1.25rem;
}

.board-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.board-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.board-header h2 {
    font-size: 1.35rem;
}

.task-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--accent-primary-alpha);
    color: var(--accent-primary);
}

.board-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group {
    display: flex;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    padding: 2px;
}

.btn-filter {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    outline: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-filter:hover {
    color: var(--text-primary);
}

.btn-filter.active {
    background: var(--bg-card-border-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Interactive Task Cards
   ========================================================================== */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Card Outer Container */
.todo-card {
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-left: 4px solid transparent;
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.todo-card.priority-low { border-left-color: var(--priority-low); }
.todo-card.priority-medium { border-left-color: var(--priority-medium); }
.todo-card.priority-high { border-left-color: var(--priority-high); }

.todo-card.completed {
    opacity: 0.65;
}

/* Header line of the todo card */
.todo-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Custom Checkbox Design */
.checkbox-wrapper {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--text-muted);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 1;
}

.checkbox-wrapper:hover .custom-checkbox {
    border-color: var(--accent-primary);
}

.checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox {
    border-color: var(--priority-low);
    background: var(--priority-low);
}

.checkmark-icon {
    width: 12px;
    height: 12px;
    color: #ffffff;
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox .checkmark-icon {
    stroke-dashoffset: 0;
    opacity: 1;
}

.todo-content-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.todo-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    transition: var(--transition-fast);
}

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

.todo-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.todo-card-actions .btn-icon {
    width: 28px;
    height: 28px;
}

/* Metadata tags row */
.todo-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding-left: 2rem;
}

.meta-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-card-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-tag.priority {
    font-weight: 800;
}
.todo-card.priority-low .meta-tag.priority { background: rgba(16, 185, 129, 0.08); color: var(--priority-low); }
.todo-card.priority-medium .meta-tag.priority { background: rgba(245, 158, 11, 0.08); color: var(--priority-medium); }
.todo-card.priority-high .meta-tag.priority { background: rgba(239, 68, 68, 0.08); color: var(--priority-high); }

.meta-tag.due-date {
    background: rgba(255, 255, 255, 0.04);
}
.meta-tag.due-date.overdue {
    background: rgba(23ef, 68, 68, 0.12);
    color: var(--priority-high);
    animation: flash-red 2.5s infinite alternate;
}

@keyframes flash-red {
    0% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.3); }
}

.meta-tag.category-tag {
    color: var(--cat-color);
    background: var(--cat-bg);
    border: 1px solid var(--cat-border);
}

/* Collapsible detail box (Subtasks, description) */
.todo-card-details {
    padding-left: 2rem;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--bg-card-border);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-description-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-line;
}

/* Subtasks Checklist Section */
.subtasks-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--bg-card-border);
}

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

.subtasks-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.subtask-progress-bar {
    width: 60px;
    height: 4px;
    background: var(--bg-app);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

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

.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
}

.subtask-item.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.subtask-checkbox {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1.5px solid var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.subtask-item.completed .subtask-checkbox {
    background: var(--priority-low);
    border-color: var(--priority-low);
}

.subtask-checkbox-inner {
    width: 7px;
    height: 5px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
    opacity: 0;
}

.subtask-item.completed .subtask-checkbox-inner {
    opacity: 1;
}

.subtask-input-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.subtask-quick-input {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: var(--text-primary);
    background: var(--bg-app);
    border: 1px solid var(--bg-card-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    flex: 1;
    outline: none;
}
.subtask-quick-input:focus {
    border-color: var(--accent-primary);
}

.subtask-delete-btn {
    opacity: 0;
    margin-left: auto;
    transition: opacity 0.2s ease;
    border: none;
    background: transparent;
    color: var(--priority-high);
    cursor: pointer;
    padding: 2px 4px;
}

.subtask-item:hover .subtask-delete-btn {
    opacity: 0.8;
}

/* Expand details toggle button */
.btn-toggle-details {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-toggle-details svg {
    transition: transform 0.2s ease;
}

.btn-toggle-details.expanded svg {
    transform: rotate(180deg);
}

/* Empty State illustration space */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
}

.empty-state svg {
    color: var(--bg-card-border-hover);
    margin-bottom: 0.5rem;
    stroke-width: 1.5px;
}

.empty-state h3 {
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 280px;
    line-height: 1.5;
}

/* ==========================================================================
   Modals & Popups Overlays
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 10, 19, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: opacity 0.25s ease;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow-lg);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.modal-card.animate-in {
    animation: modal-slide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-slide {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.modal-divider {
    border: 0;
    height: 1px;
    background: var(--bg-card-border);
    margin: 1.5rem 0;
}

.backup-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.backup-section h3 {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.backup-section p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.file-upload-btn {
    border-style: dashed !important;
}

.import-status {
    font-size: 0.8rem;
    padding: 0.5rem;
    border-radius: 6px;
    display: none;
}
.import-status.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--priority-low);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.import-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--priority-high);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* HSL Color Selection Grid in Category Modal */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.color-radio {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.color-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: hsl(var(--color-hsl));
    box-shadow: 0 0 10px hsl(var(--color-hsl));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.color-radio input[type="radio"]:checked + .color-dot {
    transform: scale(1.25);
}

.color-radio:has(input[type="radio"]:checked) {
    border-color: var(--text-primary);
    background: var(--bg-card-border);
}

/* Hamburger toggle button (hidden by default on desktop) */
.hamburger-menu {
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-card-border);
    border: 1px solid var(--bg-card-border);
    color: var(--text-secondary);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    transition: var(--transition-fast);
}

.hamburger-menu:hover {
    color: var(--text-primary);
    background: var(--bg-card-border-hover);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Sidebar Backdrop for mobile drawer mode */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 10, 19, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Auth link footer styles */
.auth-footer a {
    transition: var(--transition-fast);
}
.auth-footer a:hover {
    color: var(--accent-secondary) !important;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .hamburger-menu {
        display: inline-flex;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100dvh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--bg-card-border);
        border-bottom: none;
        padding: 1.75rem;
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    /* Keep sidebar layout vertical in drawer mode */
    .sidebar-nav {
        flex-direction: column;
        overflow-y: auto;
        gap: 2rem;
        height: auto;
        padding-bottom: 0;
    }

    .nav-section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .categories-list {
        flex-direction: column;
        gap: 0.25rem;
    }

    .category-nav-btn {
        width: 100%;
        padding: 0.65rem 0.85rem;
    }

    .category-nav-actions {
        display: flex;
    }

    .sidebar-footer {
        flex-direction: column;
        margin-top: auto;
        padding-top: 1.5rem;
        align-items: stretch;
    }
    
    .sidebar-footer .btn {
        width: 100%;
    }

    .sidebar-footer .footer-row {
        flex: 1;
        width: 100%;
    }

    .main-content {
        padding: 1.25rem;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .topbar-actions {
        width: 100%;
    }

    .search-bar {
        width: 100%;
        flex: 1;
    }

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

    .board-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .board-controls {
        display: flex;
        justify-content: space-between;
        width: 100%;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .sort-select-wrapper {
        flex: 1;
        min-width: 130px;
    }

    .sort-select-wrapper .glass-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .modal-card {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   Workspace Settings Slider Switch & Simplified View Modifications
   ========================================================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 24px;
    transition: var(--transition-smooth);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.switch input:checked + .slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Simplified Fullscreen Mode adjustments */
.simplified-fullscreen .analytics-section,
.simplified-fullscreen .greeting-container {
    display: none !important;
}

.simplified-fullscreen .topbar {
    justify-content: flex-end; /* Align topbar elements cleanly when greeting is hidden */
}

