/* Layout Utilities */
.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--section-gap);
}

.grid-main-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--section-gap);
}

.grid-main-side.with-sidebar {
    grid-template-columns: 1fr 340px;
}

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

.flex-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

:root {
    /* Core Colors */
    --bg-dark: #020617; /* Deep Slate 950 */
    --bg-sidebar: #0f172a; /* Slate 900 */
    --primary: #6366f1; /* Indigo 500 */
    --primary-hover: #4f46e5; /* Indigo 600 */
    --primary-glow: rgba(99, 102, 241, 0.2);
    
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --text-dim: #64748b; /* Slate 500 */
    
    /* Accents */
    --accent-indigo: #818cf8;
    --accent-violet: #a78bfa;
    --accent-cyan: #22d3ee;
    
    /* Glassmorphism Refined */
    --card-bg: rgba(30, 41, 59, 0.4); /* Slate 800 with opacity */
    --border: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(15, 23, 42, 0.7); /* Slate 900 with opacity */
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;

    /* Shadows & Glows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

    /* Spacing */
    --page-padding: 2.5rem;
    --section-gap: 2rem;
    --card-padding: 1.5rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    line-height: 1.5;
}

h1,
h2,
h3,
.logo {
    font-family: 'Outfit', sans-serif;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.app-container.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex !important;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 180px;
    max-width: 400px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    position: relative;
}

/* Sidebar Resize Handle */
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    z-index: 101;
    background: transparent;
    transition: background 0.2s;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--primary);
}

.sidebar-header {
    padding: 2rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background-image: url('logo.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.folder-nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-collapse-trigger {
    transition: transform 0.2s ease;
}

.folder-children {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    margin-left: 10px;
    padding-left: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    margin-bottom: 2px;
}

.nav-item i {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.nav-item:hover i {
    opacity: 1;
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.nav-item.active i {
    opacity: 1;
    color: var(--primary);
}

.sidebar-sub-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0.5rem;
}

.folder-nav-item .nav-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
    height: auto;
    gap: 0.75rem;
    border-radius: 8px;
}

.folder-nav-item .nav-item i {
    width: 14px;
    height: 14px;
}

.folder-nav-item:hover .delete-folder-btn {
    opacity: 1 !important;
}

.delete-folder-btn:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.nav-item-secondary:hover {
    color: var(--text-main) !important;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

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

.avatar {
    width: 40px;
    height: 40px;
    background: #1e1e24;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-dark);
    position: relative;
    z-index: 1;
}

.main-content::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.main-content::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.top-bar {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
}

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

.view-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.view-content {
    padding: var(--page-padding);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    height: 44px;
    /* Standard height for all buttons */
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Icon-only Square Buttons */
.btn-square {
    width: 48px;
    height: 48px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}

.btn-square i {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Small Buttons (Maintaining proportions) */
.btn-small {
    padding: 0.5rem 0.875rem !important;
    font-size: 0.8rem !important;
    height: 34px !important;
    gap: 0.4rem !important;
}

.btn-small.btn-square {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
}

.btn-small i {
    width: 16px !important;
    height: 16px !important;
}

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

.project-actions-group {
    display: flex;
    gap: 0.5rem;
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--section-gap);
    margin-bottom: var(--section-gap);
}

.stat-card {
    padding: var(--card-padding);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.2), var(--shadow-glow);
}

.stat-card.clickable:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Outfit';
}

.stat-footer {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.stat-down {
    color: var(--danger);
}

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

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s;
}

.modal-content {
    width: 100%;
    max-width: 540px;
    padding: 3rem;
    border-radius: var(--radius-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-content.large {
    max-width: 750px;
}

.hidden {
    display: none !important;
}

/* Status Badges */
.status-badge {
    padding: 0 0.85rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    /* Fixed height for pill shape */
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Select elements need flexible height to avoid text clipping */
select.status-badge {
    height: auto;
    min-height: 28px;
    padding: 0.35rem 0.75rem;
    -webkit-appearance: auto;
    appearance: auto;
}

.status-badge select {
    background: transparent;
    border: none;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.status-badge.planning {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.status-badge.doing,
.status-badge.performing {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-badge.review {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.status-badge.complete,
.status-badge.completed,
.status-badge.done {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.on-hold {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-badge.todo {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-badge.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.zigzag-line {
    text-decoration: line-through wavy #ef4444 !important;
    text-decoration-thickness: 1.5px !important;
    color: var(--text-dim) !important;
}

/* Task Card Refinements */
.task-card {
    transition: background 0.2s;
    cursor: pointer;
}

.task-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

.task-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-dim);
    font-size: 1.125rem;
}

/* Form Styles */
.form-group label {
    font-weight: 500;
}

select option {
    background: var(--bg-sidebar);
    color: white;
}

/* Ensure all status-badge selects have visible text */
select.status-badge,
.status-badge select {
    color: inherit;
}

select.status-badge option,
.status-badge select option {
    background: var(--bg-sidebar);
    color: white;
}

/* Folder Select Specific Styles - Dark background for readability */
.project-folder-col select.status-badge,
select.status-badge:not(.planning):not(.doing):not(.review):not(.complete):not(.completed):not(.done):not(.on-hold):not(.todo):not(.cancelled):not(.performing) {
    background: rgba(30, 30, 40, 0.9);
    color: var(--text-main);
    border: 1px solid var(--border);
}

/* Kanban View */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 500px;
}

.kanban-column {
    flex: 1;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.015);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border: 1px solid var(--border);
}

.kanban-column h4 {
    font-family: 'Outfit';
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.kanban-task {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.kanban-task:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Table View */
.table-container {
    overflow-x: auto;
}

.task-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.task-table th {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-table td {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.task-table tr:last-child td {
    border-bottom: none;
}

.task-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Priority Badges */
.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

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

.priority-low {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* Auth Section */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    background: var(--bg-dark);
    transition: opacity 0.4s ease;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    border-radius: 24px;
    background: rgba(17, 17, 20, 0.8);
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* View Switcher */
.view-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
}

.view-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn.active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

/* Subtasks & Hierarchy */
.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.task-indent {
    margin-left: 24px;
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Phase 2 Enhancements */
.dropdown-item {
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.kanban-column.drag-over,
.task-card.drag-over,
#tasks-list.drag-over {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px dashed var(--primary) !important;
}

.drag-nest {
    box-shadow: inset 0 0 0 2px var(--primary) !important;
    background: rgba(59, 130, 246, 0.08) !important;
}

.drag-reorder-top {
    box-shadow: 0 -2px 0 var(--primary) !important;
}

.drag-reorder-bottom {
    box-shadow: 0 2px 0 var(--primary) !important;
}

.clickable-row {
    transition: all 0.2s ease;
}

.clickable-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-2px);
}

.all-tasks-view .task-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Project Card Rows */
.project-card-row {
    display: grid !important;
    grid-template-columns: 2.5fr 1.2fr 1.2fr 1fr 1.2fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 0.875rem 1.5rem !important;
    transition: all 0.2s ease;
}

.project-card-row:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px);
}

.project-title-main {
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.project-client-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.project-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.meta-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
}

.meta-value input[type="date"] {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.progress-txt {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.project-row-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.completion-banner {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    color: var(--success);
    font-style: italic;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

/* Responsive Design & Mobile Excellence */
.mobile-only {
    display: none !important;
}

@media (max-width: 1024px) {
    :root {
        --page-padding: 1rem;
        --section-gap: 1.25rem;
    }

    * {
        box-sizing: border-box !important;
    }

    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        position: relative !important;
    }

    body {
        overflow-y: auto;
    }

    .app-container {
        flex-direction: column;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Sidebar Drawer */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 2000;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        background: #0d0d12;
        border-right: 1px solid var(--border);
        box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0);
        visibility: hidden;
    }

    .sidebar.mobile-active {
        left: 0;
        visibility: visible;
        box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.7);
    }

    .sidebar-header {
        padding: calc(1.5rem + env(safe-area-inset-top)) 1.25rem 1.5rem 1.25rem;
    }

    /* Main Layout */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-height: 100vh;
    }

    .top-bar {
        padding: calc(1rem + env(safe-area-inset-top)) 1.25rem 1rem 1.25rem !important;
        background: rgba(10, 10, 12, 0.9);
        border-bottom: 1px solid var(--border);
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas:
            "title title"
            "menu actions" !important;
        gap: 0.75rem !important;
        height: auto !important;
    }

    .top-bar-left {
        display: contents !important;
        /* Allow children to participate in the top-bar grid */
    }

    .view-title {
        grid-area: title;
        width: 100%;
    }

    .view-title h1 {
        font-size: 1.35rem !important;
        max-width: none !important;
        white-space: normal !important;
        text-align: center;
        width: 100%;
    }

    /* Move buttons below title */
    .top-bar-actions {
        grid-area: actions;
        display: flex !important;
        justify-self: end;
        width: auto !important;
    }

    /* Pull the hamburger menu next to the + button on the bottom row */
    #mobile-menu-toggle {
        grid-area: menu;
        display: flex !important;
        width: 44px !important;
        height: 44px !important;
        justify-self: start;
    }

    .folder-actions {
        display: flex !important;
    }

    .top-bar-left button {
        display: none !important;
        /* Hide original hamburger location */
    }

    /* We need to restructure top-bar via CSS to move hamburger next to add button */
    /* Alternative: Just stack everything */

    .view-content {
        padding: var(--page-padding);
    }

    .mobile-only {
        display: flex !important;
    }

    /* Typography Adjustments */
    .view-title h1 {
        font-size: 1.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
        /* Prevent pushing the right button */
    }

    .top-bar-actions {
        flex-shrink: 0;
    }

    /* Dashboard Optimizations */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
        border-radius: var(--radius-md);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .grid-2-1,
    .grid-main-side,
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Component Refinements */
    .project-card-row {
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "info actions"
            "status status" !important;
        padding: 1rem !important;
        gap: 0.75rem !important;
        position: relative;
    }

    /* Hide less important columns on mobile list */
    .project-date-col,
    .project-folder-col,
    .project-progress-col {
        display: none !important;
    }

    .project-info {
        grid-area: info;
    }

    .project-row-actions {
        grid-area: actions;
        align-self: flex-start;
    }

    .project-status-col {
        grid-area: status;
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.25rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .project-status-col .meta-label {
        margin-bottom: 0;
    }

    /* Fix select padding on mobile that causes distortion */
    .status-badge {
        height: 32px !important;
        padding: 0 1.25rem !important;
    }

    .project-status-col .status-badge select {
        padding: 0 10px 0 0 !important;
        font-size: 0.85rem !important;
        height: 100% !important;
        width: 100% !important;
        text-align: center !important;
    }

    .meta-label {
        font-size: 0.75rem !important;
    }

    .clickable-row {
        grid-template-columns: 1fr !important;
        padding: 0.85rem 1rem !important;
        gap: 0.75rem !important;
    }

    /* Task Cards - Fixed Grid & Selectors */
    .task-card {
        grid-template-columns: auto 1fr !important;
        grid-template-areas:
            "check title"
            ". actions" !important;
        padding: 1rem 1.25rem !important;
        gap: 0.25rem 0.75rem !important;
        align-items: center !important;
    }

    /* Selector fix based on App.renderTasks structure */
    .task-card > input[type="checkbox"] {
        grid-area: check;
        margin: 0 !important;
        width: 20px !important;
        height: 20px !important;
    }

    /* nth-child(1) is the spacer/collapse btn, nth-child(2) is checkbox, nth-child(3) is title */
    .task-card > div:nth-child(3) { 
        grid-area: title !important;
        display: block !important;
        text-align: left !important;
        min-width: 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: anywhere !important;
    }

    /* Hide badges and extra metadata on very small screens to save space */
    .task-card > div:nth-child(4) {
        display: none !important;
    }

    /* Timer info - can stay below the title or be hidden if too cluttered */
    .task-card > div:nth-child(5) {
        display: none !important; /* Hide timer column on mobile for now as actions has timer button */
    }

    .task-card > div:last-child {
        grid-area: actions;
        justify-self: flex-start;
        display: flex;
        gap: 0.5rem;
        margin-top: 0.25rem;
    }

    .task-card > div:last-child .btn {
        padding: 4px !important;
        height: 32px !important;
        width: 32px !important;
    }

    /* Project Header Refinements */
    .project-header-container {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .project-header-top {
        display: grid !important;
        grid-template-columns: auto 1fr !important;
        grid-template-areas: 
            "back title"
            "actions actions" !important;
        gap: 1rem !important;
        align-items: center !important;
    }

    .back-btn {
        grid-area: back;
        margin: 0 !important;
    }

    .project-title-wrapper {
        grid-area: title;
        min-width: 0 !important; /* Force override of inline min-width: 250px */
        width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: anywhere !important;
    }

    .project-title-wrapper h1, 
    .project-title-wrapper textarea {
        font-size: 1.25rem !important;
        margin: 0 !important;
    }

    .project-title-wrapper p {
        font-size: 0.75rem !important;
        margin-top: 2px !important;
    }

    .project-actions {
        grid-area: actions;
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
        margin-top: -0.5rem !important; /* Pull up to title */
    }

    .project-actions .btn, 
    .project-actions select {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
    }

    .project-header-bottom {
        gap: 0.75rem !important;
        margin-top: 1rem !important;
    }

    .project-header-bottom > div {
        max-width: 100% !important;
    }

    .top-bar {
        padding: 1rem !important;
    }

    .view-title h1 {
        font-size: 1.25rem !important;
    }

    .task-card-wrapper {
        margin-left: 0.75rem !important;
    }

    /* Kanban & Tables */
    .kanban-board {
        padding: 0.5rem;
        gap: 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .kanban-column {
        min-width: 280px;
    }

    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    /* Restore 'New Project' button to top bar (no longer a FAB) */
    #mobile-menu-toggle,
    #add-project-btn {
        position: static !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 10;
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid var(--border) !important;
    }

    #add-project-btn {
        background: var(--primary) !important;
        border-color: transparent !important;
    }

    #add-project-btn span {
        display: none !important;
    }

    #add-project-btn {
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    #mobile-menu-toggle i,
    #add-project-btn i {
        width: 20px !important;
        height: 20px !important;
    }

    /* Modals */
    .modal-content {
        width: 95% !important;
        padding: 1.5rem !important;
        border-radius: 20px !important;
        max-height: 90vh;
        overflow-y: auto;
        box-sizing: border-box !important;
    }

    .project-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    #project-modal-desc {
        min-height: 150px !important;
    }

    .modal-content.large {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }

    .grid-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Forms */
    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevent iOS zoom */
        padding: 0.75rem !important;
    }

    /* Project Detail Header Mobile */
    .project-header-top {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .project-title-wrapper {
        width: 100% !important;
        order: 1;
    }

    .project-header-top .back-btn {
        display: flex !important;
        order: 2;
    }

    .project-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        order: 3;
        margin-top: 0.5rem;
    }

    .project-detail h1,
    .project-detail textarea#p-edit-name {
        font-size: 1.5rem !important;
        width: 100% !important;
        white-space: normal !important;
    }


    .view-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
        background: rgba(255, 255, 255, 0.02);
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }

    .view-switcher {
        justify-content: space-between;
    }

    .view-switcher .view-btn {
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.25rem !important;
        font-size: 0.75rem !important;
    }

    /* Top bar actions alignment */
    .top-bar-actions {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
    }

    /* Fixed double hiding of the add project button */
    .top-bar-actions #add-project-btn {
        display: flex !important;
        /* Force visibility as FAB */
    }

    /* Modal Bottom Sheet on Mobile */
    .modal-overlay {
        align-items: flex-end !important;
    }

    .modal-content {
        width: 100% !important;
        max-height: 92vh !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 1.5rem !important;
        margin-top: auto;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .task-card-wrapper {
        margin-left: 0.75rem !important;
        /* Tighten nesting on mobile */
    }

    /* Mobile Auth Optimizations */
    .auth-overlay {
        background: var(--bg-dark) !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 9999 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .auth-card {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        padding: calc(3rem + env(safe-area-inset-top)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom)) !important;
        border-radius: 0 !important;
        background: var(--bg-dark) !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        color: white !important;
    }

    .auth-card h2 {
        font-size: 1.75rem !important;
        color: white !important;
        margin-bottom: 0.5rem !important;
    }

    .auth-card p {
        color: var(--text-muted) !important;
    }

    .auth-card input {
        height: 52px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid var(--border) !important;
        color: white !important;
        margin-bottom: 1rem !important;
    }

    #auth-page-overlay {
        background: var(--bg-dark) !important;
        backdrop-filter: none !important;
    }

    .project-header-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.25rem !important;
    }

    .project-actions-group {
        width: 100% !important;
    }

    .project-actions-group .btn {
        flex: 1 !important;
        justify-content: center !important;
    }

    .project-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    #project-modal-desc {
        min-height: 200px !important;
    }
}

#view-container {
    font-variant-numeric: tabular-nums;
}

[id*="timer-"],
[id*="total-timer-"] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.active-collaborators-section:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.05);
}

/* Calendar Section */
.calendar-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

.calendar-title-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.calendar-current-month {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: 'Outfit';
    min-width: 180px;
}

.calendar-main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

.calendar-grid-container {
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .view-content {
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .calendar-grid-container {
        padding: 0.75rem;
    }
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    flex: 1;
}

.calendar-day {
    padding: 0.5rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-height: 120px;
    height: 120px;
    /* Fixed height to enable scrolling */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow-y: auto;
    /* Enable scroll for many events */
    scrollbar-width: none;
    /* Hide scrollbar for cleaner look */
}

.calendar-day::-webkit-scrollbar {
    display: none;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.02);
}

.calendar-day.today {
    background: rgba(59, 130, 246, 0.03);
}

.calendar-day.today .day-number {
    background: var(--primary);
    color: white;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.calendar-day.other-month {
    opacity: 0.2;
}

.day-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.calendar-event {
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.event-project {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-left: 2px solid #3b82f6;
}

.event-task {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-left: 2px solid #10b981;
}

.event-custom {
    background: rgba(168, 85, 247, 0.1);
    color: #d8b4fe;
    border-left: 2px solid #a855f7;
}

.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 100%;
    overflow-y: auto;
}

.calendar-panel {
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
}

.team-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.team-member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.team-member-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.team-member-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.integration-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.integration-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.integration-toggle {
    width: 32px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.integration-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
}

.integration-toggle.active {
    background: var(--success);
}

.integration-toggle.active::after {
    left: 18px;
}

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

    .calendar-sidebar {
        order: -1;
    }
}

/* Week View Styles */
.calendar-week-grid {
    display: flex;
    flex: 1;
    min-height: 0;
    max-height: 720px;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.calendar-week-day {
    display: flex;
    flex-direction: column;
    min-height: 500px;
    background: var(--glass-bg);
}

.week-day-header {
    padding: 1.25rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.week-day-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.week-day-num {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
    font-family: 'Outfit';
}

.week-day-events {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.week-day-events::-webkit-scrollbar {
    display: none;
}

.week-day-header.today {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.week-day-header.today .week-day-num {
    color: var(--primary);
}

.view-mode-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 2px;
    border: 1px solid var(--border);
}

.view-mode-btn {
    padding: 0.5rem 1rem;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dim);
}

.view-mode-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Mobile Calendar Optimization */
@media (max-width: 768px) {

    body,
    .app-container {
        overflow-x: hidden;
        width: 100vw;
    }

    .main-content {
        width: 100%;
        overflow-x: hidden;
    }

    /* Stack header elements */
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .calendar-title-nav {
        justify-content: space-between;
        width: 100%;
        gap: 0.5rem;
    }

    .calendar-current-month {
        font-size: 1.1rem;
        min-width: auto;
    }

    /* Stack the right side controls */
    .calendar-header>div:last-child {
        display: flex;
        justify-content: space-between;
        width: 100%;
        gap: 0.5rem;
    }

    .view-mode-selector {
        flex: 1;
        justify-content: center;
    }

    .view-mode-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Optimize grid cells for small screens */
    .calendar-weekdays {
        font-size: 0.65rem;
        padding-bottom: 0.5rem;
        letter-spacing: 0;
    }

    .calendar-day {
        min-height: 80px;
        /* Reduced from 120px */
        height: 80px;
        padding: 0.25rem;
    }

    .day-number {
        font-size: 0.8rem;
        margin-bottom: 0.1rem;
    }

    .calendar-day.today .day-number {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    /* Hide less important event details or make events smaller */
    .calendar-event {
        font-size: 0.55rem;
        padding: 2px 4px;
        margin-bottom: 1px !important;
    }

    .calendar-grid-container {
        padding: 0.5rem;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        box-sizing: border-box;
    }

    .calendar-days, .calendar-weekdays {
        min-width: 600px; /* Allow internal scroll without breaking page layout */
    }

    .calendar-view {
        gap: 1rem;
        height: auto;
        /* allow grow */
        min-height: 100%;
    }

    .calendar-main-grid {
        display: flex;
        flex-direction: column;
    }

    .calendar-sidebar {
        order: 1 !important;
        /* Move sidebar below grid on mobile */
        margin-top: 1rem;
    }
}

/* Fix select text visibility in modal */
#modal-container select.status-badge {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    height: auto !important;
    min-height: 40px !important;
    padding: 0.75rem !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
}

#modal-container select.status-badge option {
    background-color: #1e1e28;
    color: white;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-anim {
    animation: spin 1s linear infinite;
}

/* Responsive Folder Row */
/* Responsive Folder Row */
.stat-card.folder-row-card {
    display: grid !important;
    grid-template-columns: 2.5fr 1fr 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 0.875rem 1.5rem !important;
    border-left: 4px solid var(--primary);
    min-height: auto;
    flex-direction: row;
    /* override stat-card default */
}

@media (max-width: 768px) {
    .stat-card.folder-row-card {
        grid-template-columns: 1fr auto !important;
        padding: 1rem !important;
        gap: 0.75rem !important;
        min-height: auto !important;
        align-content: center;
    }

    /* Hide extra columns on mobile */
    .stat-card.folder-row-card>div:nth-child(2),
    .stat-card.folder-row-card>div:nth-child(3) {
        display: none !important;
    }

    /* Adjust main info column */
    .stat-card.folder-row-card>div:first-child {
        gap: 0.75rem !important;
        display: flex;
        align-items: center;
    }

    .stat-card.folder-row-card i {
        width: 18px !important;
        height: 18px !important;
    }

    .stat-card.folder-row-card div {
        font-size: 1rem !important;
    }

    .stat-card.folder-row-card>div:first-child>div:last-child>div:last-child {
        font-size: 0.8rem !important;
        color: var(--text-dim);
    }
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    padding: 0;
    overflow: hidden;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.notifications-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.notifications-header h3 {
    font-size: 14px;
    margin: 0;
    color: var(--text-main);
}

.notifications-list {
    overflow-y: auto;
    max-height: 300px;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary);
}

.notification-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}