/* Project Waterfall - Modern Professional Stylesheet */
/*
 * CSS Architecture:
 * - This file contains the main application styles
 * - Component library available at: /static/css/components/
 *   - _variables.css: Design tokens and CSS custom properties
 *   - _buttons.css: Button styles
 *   - _forms.css: Form input styles
 *   - _cards.css: Card components
 *   - _tables.css: Table styles
 *   - _navigation.css: Nav and menu styles
 *   - _modals.css: Modal dialogs
 *   - _alerts.css: Alerts and toasts
 *
 * To use component library in a template:
 *   <link rel="stylesheet" href="/static/css/components/index.css">
 */

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

:root {
    /* Modern color palette */
    --primary-color: #3b5998;
    --primary-light: #5a7bc0;
    --primary-dark: #2d4373;
    --primary-gradient: linear-gradient(135deg, #3b5998 0%, #5a7bc0 100%);
    
    --secondary-color: #6b7280;
    --secondary-light: #9ca3af;
    
    --success-color: #059669;
    --success-light: #d1fae5;
    --error-color: #dc2626;
    --error-light: #fee2e2;
    --warning-color: #d97706;
    --warning-light: #fef3c7;
    --info-color: #0284c7;
    --info-light: #e0f2fe;
    
    --bg-color: #f8fafc;
    --bg-subtle: #f1f5f9;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --card-bg: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 2rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.nav-brand a {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    transition: all var(--transition);
    background: var(--primary-gradient);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-brand a:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition);
}

.hamburger-menu:hover {
    background-color: var(--bg-subtle);
}

.hamburger-menu span {
    width: 22px;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all var(--transition-slow);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-menu {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
    background-color: var(--bg-subtle);
}

.user-menu {
    position: relative;
    margin-left: 0.5rem;
}

.user-info {
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-subtle);
}

.user-info::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-muted);
    transition: transform var(--transition);
}

.user-info:hover {
    background-color: var(--border-color);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    display: block;
    animation: slideDown 0.15s ease-out;
}

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

.user-dropdown .dropdown-item {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.user-dropdown .dropdown-item:hover {
    background-color: var(--bg-subtle);
    color: var(--primary-color);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--card-bg);
    transition: all var(--transition);
}

.form-control:hover {
    border-color: var(--secondary-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.15);
}

.form-control::placeholder {
    color: var(--secondary-light);
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

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

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--border-color);
    border-color: var(--secondary-light);
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #b91c1c;
}

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

.btn-success:hover:not(:disabled) {
    background-color: #047857;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.auth-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-light);
}

.auth-card h1 {
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

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

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

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* ============================================
   ALERTS
   ============================================ */
.flash-messages {
    margin-bottom: 1.25rem;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.alert-error {
    background-color: var(--error-light);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.alert-info {
    background-color: var(--info-light);
    color: #075985;
    border: 1px solid rgba(2, 132, 199, 0.2);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.9375rem;
}

.card-body {
    padding: 1.25rem;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

.data-table thead {
    background-color: var(--bg-subtle);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition);
}

.data-table th.sortable:hover {
    background-color: var(--border-light);
}

.sort-indicator {
    margin-left: 0.5rem;
    opacity: 0.5;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.data-table tbody tr {
    transition: background-color var(--transition);
}

.data-table tbody tr:hover {
    background-color: var(--bg-subtle);
}

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

.text-center {
    text-align: center;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.settings-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.info-box {
    background: var(--bg-subtle);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.info-box h3 {
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.info-box ul {
    margin-left: 1.25rem;
}

.info-box li {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.info-box a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
    margin-top: auto;
}

.footer .container {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button,
.pagination a {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.pagination button:hover,
.pagination a:hover {
    background: var(--bg-subtle);
    border-color: var(--secondary-light);
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-primary {
    background-color: rgba(59, 89, 152, 0.1);
    color: var(--primary-color);
}

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

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

.badge-danger {
    background-color: var(--error-light);
    color: var(--error-color);
}

.badge-secondary {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
}

/* ============================================
   STATS / METRICS
   ============================================ */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.stat-change {
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

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

.stat-change.negative {
    color: var(--error-color);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.empty-state p {
    font-size: 0.9375rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 5rem 1.5rem 2rem;
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-slow);
        z-index: 1000;
        gap: 0.25rem;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu a {
        width: 100%;
        padding: 0.875rem 1rem;
        border-radius: var(--radius);
    }
    
    .nav-menu .user-menu {
        margin-top: auto;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        width: 100%;
    }
    
    .nav-menu .user-dropdown {
        position: static;
        margin-top: 0.5rem;
        width: 100%;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    .navbar .container {
        padding: 0.875rem 1rem;
    }
    
    .container {
        padding: 1rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
    color: var(--text-muted);
}

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

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--error-color);
}

.text-warning {
    color: var(--warning-color);
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

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

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: rgba(59, 89, 152, 0.2);
    color: var(--text-color);
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-subtle: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-light: #1e293b;
    --card-bg: #1e293b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .navbar {
    background-color: rgba(30, 41, 59, 0.95);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .alert-success {
    background: rgba(5, 150, 105, 0.15);
    border-color: rgba(5, 150, 105, 0.3);
}

[data-theme="dark"] .alert-error {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .alert-warning {
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="dark"] .alert-info {
    background: rgba(2, 132, 199, 0.15);
    border-color: rgba(2, 132, 199, 0.3);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-subtle);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(90, 123, 192, 0.2);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-subtle);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--border-color);
}

/* ============================================
   NAV SEARCH
   ============================================ */
.nav-search {
    position: relative;
    flex: 0 1 300px;
    margin: 0 1rem;
}

.search-form-nav {
    display: flex;
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.search-form-nav:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}

.search-form-nav input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-color);
    outline: none;
    min-width: 0;
}

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

.search-form-nav button {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-form-nav button svg {
    width: 16px;
    height: 16px;
}

.search-form-nav button:hover {
    color: var(--primary-color);
}

.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    display: none;
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}

.search-autocomplete.active {
    display: block;
}

.autocomplete-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

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

.autocomplete-item:hover {
    background: var(--bg-subtle);
}

.autocomplete-type {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.autocomplete-title {
    font-weight: 500;
    color: var(--text-color);
}

.autocomplete-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.autocomplete-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   NAV ACTIONS (Notifications, Theme, User)
   ============================================ */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.nav-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    position: relative;
}

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

.nav-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Notification Bell */
.notification-bell {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--error-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    display: none;
    z-index: 200;
}

.notification-dropdown.active {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.notification-dropdown-header a {
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
}

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

.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

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

.notification-item:hover {
    background: var(--bg-subtle);
}

.notification-item.unread {
    background: rgba(59, 89, 152, 0.03);
}

.notification-item-title {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-color);
}

.notification-item-message {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.notification-empty,
.notification-loading,
.notification-error {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Theme Toggle */
.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* User Menu Updates */
.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

/* Responsive Search */
@media (max-width: 768px) {
    .nav-search {
        display: none;
    }
    
    .nav-actions {
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .notification-dropdown {
        right: -60px;
        width: calc(100vw - 2rem);
        max-width: 320px;
    }
}
