/* ==========================================================================
   ApexManage - Modern Project Management & Tracking Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Theme Palette - Deep Modern Slate */
    --bg-app: #090d16;
    --bg-sidebar: #0f172a;
    --bg-header: rgba(15, 23, 42, 0.85);
    --surface-card: #131c31;
    --surface-card-hover: #19243e;
    --surface-alt: #1a253f;
    --border-color: #1e293b;
    --border-subtle: rgba(255, 255, 255, 0.07);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #090d16;

    /* Brand & Accent Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --primary-subtle: rgba(99, 102, 241, 0.12);

    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-subtle: rgba(239, 68, 68, 0.15);
    --info: #06b6d4;
    --info-subtle: rgba(6, 182, 212, 0.15);
    --purple: #a855f7;
    --purple-subtle: rgba(168, 85, 247, 0.15);

    /* Layout metrics */
    --sidebar-width: 270px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px -3px var(--primary-glow);
}

:root, [data-theme="dark"] {
    --bg-app: #090d16;
    --bg-sidebar: #0f172a;
    --bg-header: rgba(15, 23, 42, 0.85);
    --surface-card: #131c31;
    --surface-card-hover: #19243e;
    --surface-alt: #1a253f;
    --border-color: #1e293b;
    --border-subtle: rgba(255, 255, 255, 0.07);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #090d16;

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --primary-subtle: rgba(99, 102, 241, 0.12);

    --success-subtle: rgba(16, 185, 129, 0.15);
    --warning-subtle: rgba(245, 158, 11, 0.15);
    --danger-subtle: rgba(239, 68, 68, 0.15);
    --info-subtle: rgba(6, 182, 212, 0.15);
    --purple-subtle: rgba(168, 85, 247, 0.15);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px -3px var(--primary-glow);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-app: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.92);
    --surface-card: #ffffff;
    --surface-card-hover: #f1f5f9;
    --surface-alt: #f8fafc;
    --border-color: #e2e8f0;
    --border-subtle: rgba(0, 0, 0, 0.06);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --primary-subtle: rgba(79, 70, 229, 0.1);

    --success-subtle: rgba(16, 185, 129, 0.12);
    --warning-subtle: rgba(245, 158, 11, 0.12);
    --danger-subtle: rgba(239, 68, 68, 0.12);
    --info-subtle: rgba(6, 182, 212, 0.12);
    --purple-subtle: rgba(168, 85, 247, 0.12);

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px 0 rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px -3px rgba(79, 70, 229, 0.2);
}

/* Light Theme Component Specific Refinements */
[data-theme="light"] .nav-item.active a {
    color: var(--primary);
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.12) 0%, rgba(79, 70, 229, 0.03) 100%);
}
[data-theme="light"] .sidebar-footer {
    background: #f8fafc;
}
[data-theme="light"] .custom-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
}
[data-theme="light"] .custom-table tr:hover td {
    background-color: #f1f5f9;
}
[data-theme="light"] .progress-bar-wrap {
    background: #e2e8f0;
}
[data-theme="light"] .project-hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-sm);
}
[data-theme="light"] .modal-footer {
    background: #f8fafc;
}
[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.55);
}
[data-theme="light"] .tab-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .activity-dot {
    background: #ffffff;
}

/* ==========================================================================
   Theme Toggle Interactive Components
   ========================================================================== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    outline: none;
    height: 38px;
    box-sizing: border-box;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: var(--surface-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--primary-subtle);
}

.theme-toggle i {
    font-size: 1.12rem;
    line-height: 1;
    transition: transform 0.25s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* Icon visibility per active theme */
:root .theme-icon-sun,
[data-theme="dark"] .theme-icon-sun {
    display: none;
}
:root .theme-icon-moon,
[data-theme="dark"] .theme-icon-moon {
    display: inline-block;
    color: #a5b4fc;
}

[data-theme="light"] .theme-icon-moon {
    display: none;
}
[data-theme="light"] .theme-icon-sun {
    display: inline-block;
    color: #f59e0b;
}

.theme-toggle-label {
    text-transform: capitalize;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Mini sidebar theme button */
.theme-toggle-mini {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.theme-toggle-mini:hover {
    color: var(--primary);
    background: var(--surface-card-hover);
    transform: rotate(15deg);
}

/* Smooth Theme Transitions */
body,
.app-sidebar,
.app-header,
.sidebar-footer,
.stat-card,
.card,
.card-header,
.kanban-column,
.kanban-card,
.modal-card,
.modal-footer,
.btn-outline,
.form-control,
.theme-toggle,
.persona-btn,
.persona-dropdown,
.project-hero-card {
    transition: background-color 0.22s ease, border-color 0.22s ease, color 0.2s ease, box-shadow 0.22s ease;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--primary-hover);
}

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

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #8b5cf6 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 0 14px var(--primary-glow);
}

.brand-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 700;
    margin-left: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 10px 12px 6px;
    margin-top: 10px;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.18s ease;
    position: relative;
}

.nav-item a i {
    font-size: 1.18rem;
    color: var(--text-muted);
    transition: color 0.18s ease;
}

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

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

.nav-item.active a {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.06) 100%);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-weight: 600;
}

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

.nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 600;
}

.nav-badge-primary {
    background-color: var(--primary-subtle);
    color: var(--primary);
}

.nav-badge-danger {
    background-color: var(--danger-subtle);
    color: var(--danger);
}

/* Sidebar User Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 52px; height: 52px; }
.avatar-xl { width: 68px; height: 68px; }

.user-info {
    flex: 1;
    min-width: 0;
}

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

.user-role-badge {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: block;
    text-transform: capitalize;
}

/* ==========================================================================
   Main App Container & Header
   ========================================================================== */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-header {
    height: var(--header-height);
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
}

.header-search {
    position: relative;
    width: 320px;
}

.header-search input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: all 0.18s ease;
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Switch Persona Dropdown */
.persona-switcher {
    position: relative;
}

.persona-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.persona-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    z-index: 200;
}

.persona-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.15s ease;
}

.persona-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.persona-item:hover {
    background: var(--surface-card-hover);
}

.persona-item.active {
    background: var(--primary-subtle);
}

/* App Main Content Viewport */
.content-body {
    padding: 32px;
    flex: 1;
}

/* Breadcrumbs & Page Titles */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title-group h1 {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-outline {
    background: var(--surface-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Cards & Grid Layouts
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.35);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

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

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary { background: var(--primary-subtle); color: var(--primary); }
.stat-icon.success { background: var(--success-subtle); color: var(--success); }
.stat-icon.warning { background: var(--warning-subtle); color: var(--warning); }
.stat-icon.danger { background: var(--danger-subtle); color: var(--danger); }
.stat-icon.info { background: var(--info-subtle); color: var(--info); }
.stat-icon.purple { background: var(--purple-subtle); color: var(--purple); }

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.stat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.meta-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
}
.meta-trend.up { color: var(--success); }
.meta-trend.down { color: var(--danger); }

/* Standard Section Cards */
.card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

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

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

.card-body {
    padding: 24px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

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

.chart-container {
    position: relative;
    width: 100%;
    height: 290px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.86rem;
}

.custom-table th {
    padding: 12px 18px;
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background-color: var(--surface-card-hover);
    color: var(--text-primary);
}

/* Status Badges & Pills */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-primary .badge-dot { background: var(--primary); }

.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-success .badge-dot { background: var(--success); }

.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-warning .badge-dot { background: var(--warning); }

.badge-danger { background: var(--danger-subtle); color: var(--danger); }
.badge-danger .badge-dot { background: var(--danger); }

.badge-info { background: var(--info-subtle); color: var(--info); }
.badge-info .badge-dot { background: var(--info); }

.badge-secondary { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }
.badge-secondary .badge-dot { background: var(--text-secondary); }

/* Progress Bar */
.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
}

.progress-bar-fill.success { background: linear-gradient(90deg, #10b981 0%, #059669 100%); }
.progress-bar-fill.warning { background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%); }
.progress-bar-fill.danger { background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); }

/* Avatar Stacks */
.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack img, .avatar-stack .avatar-more {
    margin-left: -8px;
    border: 2px solid var(--surface-card);
    transition: transform 0.15s ease;
}

.avatar-stack img:first-child {
    margin-left: 0;
}

.avatar-stack img:hover {
    transform: translateY(-2px) scale(1.1);
    z-index: 5;
}

.avatar-more {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Project View & Tracking Tabs
   ========================================================================== */
.project-hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(19, 28, 49, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.project-hero-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

.project-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.project-code-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
}

.project-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.hero-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
}

/* Nav Tabs */
.tab-navigation {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* ==========================================================================
   Kanban Board
   ========================================================================== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: flex-start;
}

@media (max-width: 1200px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-column {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 550px;
}

.kanban-column-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-col-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-count-pill {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--surface-alt);
    color: var(--text-secondary);
    font-weight: 700;
}

.kanban-cards-wrapper {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 200px;
}

.kanban-card {
    background-color: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.4);
}

.kanban-card.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-subtle);
    border: 2px dashed var(--primary);
}

.kanban-card-key {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 10px;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Modals & Popups
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal-card {
    transform: scale(1);
}

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

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Alert Banners */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: var(--success-subtle);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background-color: var(--danger-subtle);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.25s ease;
    border-left: 4px solid var(--primary);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Timeline & Activity Stream */
.activity-stream {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.activity-stream::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 17px;
    width: 2px;
    background: var(--border-color);
}

.activity-item {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.activity-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.activity-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .header-search {
        display: none;
    }
    .content-body {
        padding: 20px 16px;
    }
}
