/* =====================================================
   QNET Prospecting Dashboard - Design System
   Premium, Modern, Mobile-First CSS
   ===================================================== */

/* ===== CSS Custom Properties ===== */
:root {
    /* QNET Brand Colors */
    --color-orange: #F37021;
    --color-grey: #636466;
    --color-black: #231F20;
    --color-white: #FFFFFF;
    --color-blue: #004EA8;
    --color-green: #53AF3B;

    /* Semantic Mappings */
    --primary: var(--color-blue);
    --primary-light: #2468C0;
    /* Lighter Blue derived from #004EA8 */
    --primary-dark: #00367A;
    /* Darker Blue derived from #004EA8 */

    --secondary: var(--color-orange);
    --secondary-light: #F68D4D;
    /* Lighter Orange derived from #F37021 */
    --secondary-dark: #cc5200;

    --accent: var(--color-orange);
    --accent-light: #F68D4D;

    /* Gradient Palette */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, #2468C0 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, #F68D4D 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #F68D4D 100%);
    --gradient-dark: linear-gradient(135deg, var(--color-black) 0%, #2c2c2c 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Neutral Colors - Dark Mode Default */
    --bg-dark: var(--color-black);
    --bg-card: #2D292A;
    /* Slightly lighter than black for contrast */
    --bg-card-hover: #383435;
    --surface: #333333;
    /* Dark Grey */
    --border: rgba(255, 255, 255, 0.15);
    --border-light: rgba(255, 255, 255, 0.08);

    /* Text Colors - Dark Mode Default */
    --text-primary: var(--color-white);
    --text-secondary: #A0A0A0;
    /* Light Grey for readability on dark */
    --text-muted: var(--color-grey);

    /* Status Colors */
    --success: var(--color-green);
    --success-light: #72C45D;
    --warning: #f59e0b;
    /* Kept standard warning for now */
    --warning-light: #fbbf24;
    --danger: #ef4444;
    /* Kept standard danger for now */
    --danger-light: #f87171;
    --info: #3b82f6;
    --info-light: #60a5fa;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 78, 168, 0.3);
    /* Blue glow */

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', var(--font-sans);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #F5F7FA;
    /* Very light grey/white background */
    --bg-card: var(--color-white);
    --bg-card-hover: #F8FAFC;
    --surface: #E2E8F0;

    --border: rgba(35, 31, 32, 0.1);
    /* Black with opacity */
    --border-light: rgba(35, 31, 32, 0.05);

    --text-primary: var(--color-black);
    --text-secondary: var(--color-grey);
    --text-muted: #94A3B8;

    --gradient-glass: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.01) 100%);
    --shadow-glow: 0 0 30px rgba(0, 78, 168, 0.15);
}

/* ===== Base Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-light);
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    transition: margin-left var(--transition-base);
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
        padding-top: calc(var(--space-xl) + 60px);
    }
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-dark);
}

.sidebar-brand {
    flex: 1;
}

.sidebar-brand h1 {
    font-size: 1.25rem;
    margin-bottom: 0;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-lg) 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(0, 180, 216, 0.1);
    color: var(--secondary);
    border-left-color: var(--secondary);
}

.nav-link .icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mobile Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-card-hover);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
        opacity: 1;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== Header Bar ===== */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.header-title h2 {
    margin-bottom: var(--space-xs);
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

/* Float Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
}

.theme-toggle .btn {
    border-radius: var(--radius-full);
    width: 48px;
    height: 48px;
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.theme-toggle .btn:hover {
    transform: scale(1.1);
    border-color: var(--secondary);
}

.card-glass {
    background: var(--gradient-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(0, 180, 216, 0.15);
    color: var(--secondary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-change {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-height: 44px;
}

.btn-primary {
    background: var(--gradient-secondary);
    color: var(--primary-dark);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
    background: var(--gradient-accent);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    min-height: 48px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--secondary);
}

/* Search Input */
.search-box {
    position: relative;
}

.search-box .form-input {
    padding-left: 3rem;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ===== Tables ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--surface);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile Table Styles - Converts table to cards on small screens */
@media (max-width: 768px) {
    .table-wrapper {
        border: none;
        overflow: visible;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
    }

    .data-table tbody tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: var(--space-md);
        position: relative;
    }

    .data-table td {
        display: block;
        padding: var(--space-sm) 0;
        border-bottom: none;
        text-align: left;
    }

    .data-table td:first-child {
        padding-bottom: var(--space-md);
        border-bottom: 1px solid var(--border);
        margin-bottom: var(--space-sm);
    }

    .data-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        margin-bottom: var(--space-xs);
    }

    .data-table td:first-child::before {
        display: none;
    }
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.badge-primary {
    background: rgba(0, 180, 216, 0.15);
    color: var(--secondary);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    /* Add this */
    flex-direction: column;
    /* Add this */
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--surface);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
}

.tab {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--secondary);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-warning {
    border-left: 3px solid var(--warning);
}

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto var(--space-lg);
}

/* ===== Progress Bar ===== */
.progress-bar {
    height: 8px;
    background: var(--surface);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-secondary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ===== Checkbox Toggle ===== */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--surface);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--secondary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

/* ===== Grid Layouts ===== */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===== Masonry Layout (Dream Board) ===== */
.masonry-grid {
    columns: 4;
    column-gap: var(--space-lg);
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: var(--space-lg);
}

@media (max-width: 1200px) {
    .masonry-grid {
        columns: 3;
    }
}

@media (max-width: 900px) {
    .masonry-grid {
        columns: 2;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        columns: 1;
    }
}

/* ===== Utilities ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: fixed;
    bottom: var(--space-lg);
    left: var(--space-lg);
    z-index: 100;
}

@media (max-width: 1024px) {
    .theme-toggle {
        bottom: var(--space-md);
        left: auto;
        right: var(--space-md);
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Touch Improvements ===== */
@media (hover: none) {

    .btn:hover,
    .card:hover,
    .nav-link:hover {
        transform: none;
    }
}

/* Enhanced Mobile Touch Targets */
@media (hover: none) and (pointer: coarse) {

    /* Ensure minimum touch target size of 44px */
    .btn,
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-icon {
        width: 48px;
        height: 48px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        min-height: 48px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .form-checkbox input {
        width: 24px;
        height: 24px;
    }

    .nav-link {
        padding: var(--space-md) var(--space-lg);
        min-height: 48px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
    }
}

/* Small screen mobile enhancements */
@media (max-width: 480px) {
    .main-content {
        padding: var(--space-sm);
        padding-top: calc(var(--space-lg) + 60px);
    }

    .card {
        padding: var(--space-md);
    }

    .header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .header-actions {
        display: flex;
        gap: var(--space-sm);
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .header-title h2 {
        font-size: 1.25rem;
    }

    .stat-card {
        padding: var(--space-md);
    }

    .stat-icon {
        width: 44px;
        height: 44px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .modal {
        max-width: 100%;
        margin: var(--space-md);
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ===== Print Styles ===== */
@media print {

    .sidebar,
    .sidebar-toggle,
    .theme-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}