/* ─── RESET & ROOT ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.15);
    --green: #10b981;
    --green-light: rgba(16, 185, 129, 0.15);
    --orange: #f59e0b;
    --orange-light: rgba(245, 158, 11, 0.15);
    --red: #ef4444;
    --red-light: rgba(239, 68, 68, 0.15);
    --purple: #8b5cf6;
    --purple-light: rgba(139, 92, 246, 0.15);
    --teal: #06b6d4;
    --teal-light: rgba(6, 182, 212, 0.15);
    --sidebar-width: 260px;
    --topbar-height: 65px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: all 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

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

/* ─── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
}

.logout-btn:hover {
    color: var(--red);
    background: var(--red-light);
}

/* ─── MAIN CONTENT ──────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ─── TOPBAR ────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: none;
}

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

.topbar-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.content-area {
    padding: 1.5rem;
    flex: 1;
}

/* ─── FLASH MESSAGES ────────────────────────────────────────── */
.flash-container {
    padding: 0 1.5rem;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-flash {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 350px;
    z-index: 999;
    padding: 0;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.flash-success {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-error {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    margin-left: auto;
    font-size: 1.1rem;
    opacity: 0.7;
    padding: 0 0.25rem;
}

.flash-close:hover { opacity: 1; }

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

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.3);
}

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

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.icon-btn.danger:hover {
    background: var(--red-light);
    color: var(--red);
}

.icon-btn.small {
    font-size: 0.7rem;
    padding: 0.25rem 0.35rem;
}

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--accent);
}

.view-all {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.view-all:hover { text-decoration: underline; }

/* ─── STATS GRID ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-blue .stat-icon { background: var(--accent-light); color: var(--accent); }
.stat-green .stat-icon { background: var(--green-light); color: var(--green); }
.stat-orange .stat-icon { background: var(--orange-light); color: var(--orange); }
.stat-purple .stat-icon { background: var(--purple-light); color: var(--purple); }
.stat-red .stat-icon { background: var(--red-light); color: var(--red); }
.stat-teal .stat-icon { background: var(--teal-light); color: var(--teal); }

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ─── CHARTS ────────────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card { }

.chart-wrapper {
    padding: 1.5rem;
    height: 220px;
    position: relative;
}

/* ─── ACTIVITY GRID ─────────────────────────────────────────── */
.activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ─── PROJECT LIST (Dashboard) ──────────────────────────────── */
.project-list {
    display: flex;
    flex-direction: column;
}

.project-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    gap: 1rem;
}

.project-list-item:last-child { border-bottom: none; }

.project-list-item:hover { background: var(--bg-hover); }

.project-list-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.project-list-meta {
    display: flex;
    gap: 0.4rem;
}

.project-list-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 30px;
    text-align: right;
}

/* ─── TASK LIST (Dashboard) ─────────────────────────────────── */
.task-list {
    display: flex;
    flex-direction: column;
}

.task-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.task-list-item:last-child { border-bottom: none; }
.task-list-item:hover { background: var(--bg-hover); }

.task-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-to-do { background: var(--text-muted); }
.status-dot-in-progress { background: var(--orange); }
.status-dot-done { background: var(--green); }

.task-list-info { flex: 1; }

.task-list-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.task-list-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ─── BADGES ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-active { background: var(--accent-light); color: var(--accent); }
.badge-completed { background: var(--green-light); color: var(--green); }
.badge-on-hold { background: var(--orange-light); color: var(--orange); }
.badge-overdue { background: var(--red-light); color: var(--red); }

.badge-priority-low { background: var(--green-light); color: var(--green); }
.badge-priority-medium { background: var(--orange-light); color: var(--orange); }
.badge-priority-high { background: var(--red-light); color: var(--red); }

/* ─── PROGRESS BAR ──────────────────────────────────────────── */
.progress-bar-wrap {
    width: 100px;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-wrap.large {
    width: 100%;
    height: 10px;
    border-radius: 5px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    border-radius: inherit;
    transition: width 0.5s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ─── FILTER BAR ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-btn {
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    transition: var(--transition);
}

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

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ─── PROJECTS GRID ─────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.project-card.overdue {
    border-left: 3px solid var(--red);
}

.project-card-header {}

.project-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.project-card-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.project-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.project-progress {}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.project-meta-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.project-meta-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ─── PROJECT DETAIL ────────────────────────────────────────── */
.project-overview {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
}

.project-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.project-overview-badges {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.project-overview-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.project-overview-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.project-overview-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.project-stats-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.project-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.project-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.project-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-progress-section {}

.text-danger { color: var(--red) !important; }

/* ─── KANBAN BOARD ──────────────────────────────────────────── */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.kanban-col {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.kanban-todo { color: var(--text-muted); background: rgba(100,116,139,0.1); }
.kanban-inprogress { color: var(--orange); background: var(--orange-light); }
.kanban-done { color: var(--green); background: var(--green-light); }

.kanban-count {
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.kanban-cards {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    min-height: 200px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kanban-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.kanban-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.kanban-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.kanban-card-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.kanban-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.task-deadline {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.status-change-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.status-btn {
    background: var(--bg-hover);
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.status-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.kanban-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    gap: 0.5rem;
}

.kanban-empty i { font-size: 1.5rem; opacity: 0.4; }
.kanban-empty p { font-size: 0.8rem; }

/* ─── TASKS PAGE ────────────────────────────────────────────── */
.tasks-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
}

.tasks-table th {
    padding: 0.9rem 1.25rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.tasks-table td {
    padding: 0.9rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.tasks-table tr:hover td {
    background: var(--bg-hover);
}

.task-title-cell {
    font-weight: 500;
    color: var(--text-primary);
}

.task-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

/* ─── MODALS ────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
    box-shadow: var(--shadow);
}

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

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.modal-header h3 i { color: var(--accent); }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    padding: 0 0.25rem;
    transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

/* ─── FORMS ─────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.65rem 0.9rem;
    font-size: 0.875rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select option {
    background: var(--bg-secondary);
}

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

.form-row {
    display: flex;
    gap: 1rem;
}

/* ─── AUTH PAGES ────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
    bottom: -50px;
    left: -50px;
    border-radius: 50%;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.auth-brand i { font-size: 2rem; }

.auth-brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
}

.auth-tagline {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.6;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-feature i { color: var(--green); }

.auth-right {
    width: 480px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-left: 1px solid var(--border);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-form .form-group label {
    font-size: 0.85rem;
}

.auth-form .form-group input {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.auth-switch {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1.5rem;
}

.auth-switch a {
    color: var(--accent);
    font-weight: 600;
}

.auth-switch a:hover { text-decoration: underline; }

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 2.5rem !important;
}

.toggle-pw {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
}

.toggle-pw:hover { color: var(--text-primary); }

/* ─── EMPTY STATES ──────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    color: var(--text-muted);
    gap: 0.5rem;
    text-align: center;
}

.empty-state i { font-size: 2rem; opacity: 0.3; }
.empty-state p { font-size: 0.875rem; }
.empty-state a { color: var(--accent); }

.empty-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-muted);
    gap: 1rem;
    text-align: center;
}

.empty-page i { font-size: 3.5rem; opacity: 0.2; }
.empty-page h3 { color: var(--text-secondary); font-size: 1.1rem; }
.empty-page p { font-size: 0.875rem; }

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .activity-grid { grid-template-columns: 1fr; }
    .kanban-board { grid-template-columns: 1fr; }
    .auth-left { display: none; }
    .auth-right { width: 100%; border: none; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .project-overview-header {
        flex-direction: column;
    }

    .project-stats-row {
        gap: 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .tasks-table th:nth-child(3),
    .tasks-table td:nth-child(3),
    .tasks-table th:nth-child(4),
    .tasks-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .auth-right { padding: 1.5rem; }
}