/* ========================================
   Warkla — Modern Dark UI Design System
   ======================================== */

/* --- CSS Variables --- */
:root {
    /* Background layers */
    --bg-primary: #0F0F12;
    --bg-secondary: #16161D;
    --bg-tertiary: #1C1C27;
    --bg-elevated: #22222E;
    --bg-hover: #282836;
    --bg-active: #2E2E3E;

    /* Surface / Cards */
    --surface: #1A1A25;
    --surface-hover: #20202D;
    --surface-border: rgba(255, 255, 255, 0.06);

    /* Text */
    --text-primary: #F0F0F5;
    --text-secondary: #9090A7;
    --text-muted: #5C5C72;
    --text-inverse: #0F0F12;

    /* Accent */
    --accent: #6C5CE7;
    --accent-hover: #7D6FF0;
    --accent-subtle: rgba(108, 92, 231, 0.12);
    --accent-text: #A29BFE;

    /* Status */
    --success: #00B894;
    --success-bg: rgba(0, 184, 148, 0.10);
    --warning: #FDCB6E;
    --warning-bg: rgba(253, 203, 110, 0.10);
    --error: #E17055;
    --error-bg: rgba(225, 112, 85, 0.10);
    --info: #0984E3;
    --info-bg: rgba(9, 132, 227, 0.10);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}


/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.35s ease-out;
    min-width: 320px;
    max-width: 480px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

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


/* --- Auth Pages --- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 184, 148, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-logo .logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #A29BFE);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.auth-logo .logo-icon svg {
    width: 22px;
    height: 22px;
}

.auth-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

.form-input.error {
    border-color: var(--error);
}

.form-input:disabled,
.form-input[readonly] {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-color: transparent;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-error {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 6px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    border-radius: 4px;
    cursor: pointer;
}

.form-checkbox span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), #8075E8);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #8B80F0);
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(108, 92, 231, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-text);
    font-weight: 500;
    transition: var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--accent-hover);
}


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


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

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    outline: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #A29BFE);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 18px;
    height: 18px;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

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

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-normal);
}


/* --- Sidebar Collapsed State --- */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0 12px;
}

.sidebar.collapsed .logo {
    cursor: pointer;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .badge {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .nav-item svg {
    margin: 0;
}

.sidebar.collapsed .user-info,
.sidebar.collapsed .user-logout {
    display: none;
}

.sidebar.collapsed .user-card {
    justify-content: center;
    padding: 6px;
}

.sidebar.collapsed .sidebar-footer {
    padding: 8px;
}

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

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}


/* --- Sidebar Navigation --- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

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

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

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: default;
}

.nav-item.disabled:hover {
    background: transparent;
    color: var(--text-secondary);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-soon {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.badge-new {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

.badge-count {
    background: var(--error-bg);
    color: var(--error);
    min-width: 20px;
    text-align: center;
}


/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--surface-border);
    flex-shrink: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

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

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

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

.user-logout {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.user-logout:hover {
    background: var(--error-bg);
    color: var(--error);
}

.user-logout svg {
    width: 16px;
    height: 16px;
}


/* --- Top Bar --- */
.top-bar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 32px;
    border-bottom: 1px solid var(--surface-border);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
    gap: 16px;
}

.top-bar-title h1 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.top-bar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}


/* --- Content Area --- */
.content-area {
    flex: 1;
    padding: 32px;
}

/* Full-bleed content (no padding, for mail etc.) */
.content-area.content-fullbleed {
    padding: 0;
    display: flex;
    flex-direction: column;
}


/* --- Dashboard --- */
.dashboard-greeting {
    margin-bottom: 32px;
}

.dashboard-greeting h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.dashboard-greeting p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--module-color);
    opacity: 0;
    transition: var(--transition-normal);
}

.module-card:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.module-card:hover::before {
    opacity: 1;
}

.module-card.soon {
    cursor: default;
}

.module-card.soon:hover {
    transform: none;
    box-shadow: none;
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

.module-icon svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
}

.module-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.module-status {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-hover);
    color: var(--text-muted);
}


/* --- Settings Page --- */
.settings-section {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--surface-border);
}


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

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

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-active);
}


/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }


/* --- Sidebar overlay for mobile --- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
    }

    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .badge {
        display: inline;
    }

    .sidebar.collapsed .nav-section-title {
        display: block;
    }

    .sidebar.collapsed .user-info {
        display: block;
    }

    .sidebar.collapsed .user-logout {
        display: flex;
    }

    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: space-between;
        padding: 0 20px;
    }

    .sidebar.collapsed .sidebar-toggle {
        display: flex;
    }

    .sidebar.collapsed .sidebar-footer {
        padding: 12px;
    }

    .sidebar.collapsed .user-card {
        padding: 10px;
    }

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

    .main-content,
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-toggle {
        display: none;
    }

    .top-bar {
        padding: 0 16px;
    }

    .content-area {
        padding: 20px 16px;
    }

    .content-area.content-fullbleed {
        padding: 0;
    }

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

    .auth-card {
        padding: 28px 24px;
    }

    .dashboard-greeting h2 {
        font-size: 1.4rem;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
    }
}


/* --- Buttons (extended) --- */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #8075E8);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-hover), #8B80F0);
    transform: translateY(-1px);
}

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

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

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

.btn-ghost-danger:hover {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error);
}


/* --- Form row --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}


/* --- Admin Toolbar --- */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.search-form {
    flex: 1;
    max-width: 400px;
}

.search-input-wrap {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding-left: 42px !important;
}


/* --- Data Table --- */
.table-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

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

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

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 14px 20px;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 20px;
    font-size: 0.9rem;
    border-top: 1px solid var(--surface-border);
    vertical-align: middle;
}

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

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

.table-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    object-fit: cover;
}

.table-user-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.table-user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.table-user-username {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.role-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-admin {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

.role-user {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-active {
    background: var(--success);
    box-shadow: 0 0 6px rgba(0, 184, 148, 0.4);
}

.status-inactive {
    background: var(--text-muted);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-fast);
    background: none;
    border: none;
    cursor: pointer;
}

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

.table-action-danger:hover {
    background: var(--error-bg);
    color: var(--error);
}

.table-action-btn svg {
    width: 15px;
    height: 15px;
}

.inline-form {
    display: inline;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--surface-border);
}

.pagination-btn {
    color: var(--accent-text);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.pagination-btn:hover {
    color: var(--accent-hover);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}


/* --- Form Page (admin forms) --- */
.form-page {
    max-width: 640px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
    transition: var(--transition-fast);
}

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

.back-link svg {
    width: 16px;
    height: 16px;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 28px;
}


/* --- Profile Avatar Section --- */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 8px;
}

.profile-avatar-wrap {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}


/* --- Input Group (email with domain suffix) --- */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-input,
.input-group .input-group-field {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex: 1;
    min-width: 0;
}

.input-suffix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    user-select: none;
}

.input-group .form-input:focus + .input-suffix {
    border-color: var(--accent);
}


/* --- Status: Pending (invite not accepted) --- */
.status-pending {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(253, 203, 110, 0.4);
}


/* --- Invite Error Page --- */
.invite-error {
    text-align: center;
    padding: 16px 0;
}

.invite-error-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--error-bg);
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.invite-error-icon svg {
    width: 28px;
    height: 28px;
}

.invite-error h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.invite-error p {
    font-size: 0.9rem;
    max-width: 320px;
    margin: 0 auto;
}


/* ── Projects ─────────────────────────────────────────────── */

/* Status filter tabs */
.project-status-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
}

.project-status-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.project-status-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.project-status-tab.active {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

/* Status dots for projects */
.status-dot.status-not-sent {
    background: var(--text-muted);
    box-shadow: 0 0 6px rgba(92, 92, 114, 0.4);
}

.status-dot.status-sent {
    background: var(--info);
    box-shadow: 0 0 6px rgba(9, 132, 227, 0.4);
}

.status-dot.status-success {
    background: var(--success);
    box-shadow: 0 0 6px rgba(0, 184, 148, 0.4);
}

.status-dot.status-revision {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(253, 203, 110, 0.4);
}

.status-dot.status-rejected {
    background: var(--error);
    box-shadow: 0 0 6px rgba(225, 112, 85, 0.4);
}

/* Status badges */
.project-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.project-status-not_sent {
    background: rgba(92, 92, 114, 0.15);
    color: var(--text-secondary);
}

.project-status-sent {
    background: var(--info-bg);
    color: var(--info);
}

.project-status-success {
    background: var(--success-bg);
    color: var(--success);
}

.project-status-revision {
    background: var(--warning-bg);
    color: var(--warning);
}

.project-status-rejected {
    background: var(--error-bg);
    color: var(--error);
}

/* Project link in table */
.project-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.project-link:hover {
    color: var(--accent-text);
}

/* Dynamic contacts in form */
.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr auto;
    gap: 8px;
    align-items: start;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .contact-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .contact-row input:nth-child(3) {
        grid-column: 1 / -1;
    }
}

.contact-remove-btn {
    padding: 8px !important;
    min-width: 36px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Project detail page */
.project-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.project-detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.project-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-detail-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-detail-value {
    font-size: 0.92rem;
    color: var(--text-primary);
    font-weight: 500;
}

.project-detail-reason {
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.project-detail-reason p {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.project-detail-section {
    margin-top: 20px;
}

.project-detail-section h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.project-proposal {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    margin: 0;
}

/* Contact cards in detail view */
.contacts-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.contact-card {
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.contact-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.contact-card-email {
    font-size: 0.82rem;
    color: var(--accent-text);
    text-decoration: none;
}

.contact-card-email:hover {
    text-decoration: underline;
}
