/* ============================================
   NovusPraxis - Main Stylesheet
   Custom styles that complement Bootstrap 5
   ============================================ */

/* ============================================
   CSS Variables - Global Color Palette
   Reusable color variables for the entire project
   ============================================ */
:root {
    /* Bootstrap color overrides */
    --bs-primary: #2563eb;
    --bs-secondary: #64748b;
    --bs-success: #10b981;
    --bs-danger: #ef4444;
    --bs-warning: #f59e0b;
    --bs-info: #3b82f6;

    /* NovusPraxis Brand Colors - Blue */
    --nexus-blue: #2563eb;
    --nexus-blue-light: #3b82f6;
    --nexus-blue-dark: #1e40af;

    /* NovusPraxis Brand Colors - Green */
    --nexus-green: #10b981;
    --nexus-green-light: #34d399;

    /* NovusPraxis Brand Colors - Orange */
    --nexus-orange: #f59e0b;
    --nexus-orange-light: #fbbf24;

    /* NovusPraxis Brand Colors - Purple */
    --nexus-purple: #8b5cf6;
    --nexus-purple-light: #a78bfa;

    /* NovusPraxis Brand Colors - Red */
    --nexus-red: #ef4444;

    /* NovusPraxis Brand Colors - Yellow */
    --nexus-yellow: #fbbf24;

    /* NovusPraxis Legacy Variables (for backward compatibility) */
    --nexus-primary: var(--nexus-blue);
    --nexus-secondary: #64748b;
    --nexus-bg-secondary: #f8fafc;
    --nexus-bg-tertiary: #f1f5f9;
    --nexus-text-muted: #94a3b8;

    /* Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: #f1f5f9;
    background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.045) 1px, transparent 0);
    background-size: 22px 22px;
    background-attachment: fixed;
    overflow-x: hidden;
}

body.auth-body {
    background-color: #ffffff;
    background-image: none;
}

/* ============================================
   Modern Navbar - Minimalist Design
   ============================================ */
.navbar-modern {
    background-color: var(--gray-900);
    border-bottom: 1px solid transparent;
    box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.55);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-modern-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Left: Logo and Brand */
.navbar-brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.navbar-brand-section:hover {
    opacity: 0.85;
}

.navbar-brand-section:active {
    opacity: 0.7;
}

.navbar-logo {
    height: 62px;
    width: auto;
    object-fit: contain;
}

/* Product brand lockup (icon + NovusPraxis wordmark) in the navbar. */
.navbar-wordmark {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}

.navbar-brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-white);
    letter-spacing: -0.02em;
}

/* Center: Global Search */
.navbar-search-section {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}

.global-search-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.global-search-container:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.2);
}

.global-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    color: var(--bs-white);
    padding: 0;
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.global-search-shortcut {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
}

.global-search-shortcut svg {
    width: 14px;
    height: 14px;
}

.global-search-shortcut span {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bs-white);
}

/* Right: Actions Section */
.navbar-actions-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Icon Button (Notifications) */
.navbar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.navbar-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--bs-white);
}

/* User Profile Dropdown */
/* ============================================
   User Profile Dropdown — slice D.12
   Polished menu surface (Linear/Vercel/Notion language):
   - Identity header (avatar + name + email) at the top
   - Sectioned items grouped by dividers (no border-per-item)
   - Avatar placeholder switched from blue→purple gradient to solid
     gray-700 (kills the last --nexus-purple reference on the app shell)
   - Logout sits in its own section, accent only on hover
   ============================================ */
.navbar-user-profile {
    position: relative;
}

.navbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.5rem 0.3rem 0.3rem;
    border: none;
    background: transparent;
    border-radius: 0.55rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.navbar-user-btn:hover,
.navbar-user-profile.active .navbar-user-btn {
    background-color: rgba(255, 255, 255, 0.06);
}

.navbar-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.navbar-user-avatar-placeholder {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gray-700);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.navbar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.005em;
}

.navbar-user-chevron {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    transition: transform 0.2s ease, color 0.15s ease;
}

.navbar-user-btn:hover .navbar-user-chevron,
.navbar-user-profile.active .navbar-user-chevron {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-user-profile.active .navbar-user-chevron {
    transform: rotate(180deg);
}

/* ---------- Dropdown shell ---------- */
.navbar-user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow:
        0 20px 40px -8px rgba(15, 23, 42, 0.18),
        0 4px 8px -2px rgba(15, 23, 42, 0.06);
    min-width: 16rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.15s;
    z-index: 1000;
    padding: 0;
    overflow: hidden;
}

.navbar-user-profile.active .navbar-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

/* ---------- Identity header ---------- */
.navbar-user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 0.85rem 0.75rem;
}

.navbar-user-dropdown-avatar,
.navbar-user-dropdown-avatar-placeholder {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.navbar-user-dropdown-avatar {
    object-fit: cover;
    border: 1px solid var(--gray-200);
}

.navbar-user-dropdown-avatar-placeholder {
    background: var(--gray-700);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.navbar-user-dropdown-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.navbar-user-dropdown-name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-user-dropdown-email {
    margin: 0;
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Dividers + sections ---------- */
.navbar-user-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0;
}

.navbar-user-dropdown-section {
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

/* ---------- Items ---------- */
.navbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.45rem;
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.navbar-dropdown-item:hover,
.navbar-dropdown-item:focus-visible {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.navbar-dropdown-item > i {
    font-size: 1rem;
    color: var(--gray-500);
    transition: color 0.12s ease;
    flex-shrink: 0;
}

.navbar-dropdown-item:hover > i,
.navbar-dropdown-item:focus-visible > i {
    color: var(--gray-800);
}

.navbar-dropdown-item > span {
    flex: 1;
}

/* Trailing icon used for external links (e.g. Admin opens in a new tab) */
.navbar-dropdown-item-external {
    font-size: 0.75rem !important;
    color: var(--gray-400) !important;
    margin-left: auto;
}

/* Logout — only the hover state turns red, no border-top patches */
.navbar-dropdown-item.logout-item {
    color: var(--gray-700);
}

.navbar-dropdown-item.logout-item:hover,
.navbar-dropdown-item.logout-item:focus-visible {
    background-color: rgba(239, 68, 68, 0.07);
    color: var(--nexus-red);
}

.navbar-dropdown-item.logout-item > i {
    color: var(--gray-500);
}

.navbar-dropdown-item.logout-item:hover > i,
.navbar-dropdown-item.logout-item:focus-visible > i {
    color: var(--nexus-red);
}

/* Navbar Links (for non-authenticated users) */
.navbar-link {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.navbar-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--bs-white) !important;
}

.navbar-link-primary {
    background-color: var(--nexus-blue);
    color: white !important;
}

.navbar-link-primary:hover {
    background-color: var(--nexus-blue-dark);
    color: white !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-modern-container {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }

    .navbar-search-section {
        display: none;
    }

    .navbar-brand-name {
        font-size: 1.125rem;
    }

    .navbar-user-name {
        display: none;
    }
}

/* ============================================
   Global Search Modal — slice D.10
   Spotlight / Linear / GitHub Cmd+K language:
   - input IS the header (no h2, no dual surface)
   - backdrop blurred for depth
   - results live on a clean white panel (no dashed placeholder border)
   - footer with keyboard hints
   - Bootstrap Icons only (skill `frontend` rule — no inline SVG)
   ============================================ */
.global-search-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 2000;
}

.global-search-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.global-search-modal {
    width: min(640px, 92vw);
    background: #fff;
    border-radius: 0.85rem;
    box-shadow:
        0 24px 64px -12px rgba(15, 23, 42, 0.35),
        0 4px 12px -2px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 8rem);
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 0.2s ease;
}

.global-search-overlay.is-open .global-search-modal {
    transform: translateY(0);
    opacity: 1;
}

/* --------- Search bar (acts as header) ------------ */
.global-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    background: #fff;
    position: relative;
}

.global-search-bar-icon {
    color: var(--gray-400);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.global-search-input-field {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-900);
    outline: none;
    line-height: 1.5;
    letter-spacing: -0.005em;
}

.global-search-input-field::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.global-search-input-field:focus {
    outline: none;
}

/* Inline loading spinner — visible only while HTMX is fetching */
.global-search-loading {
    display: none;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.global-search-loading.htmx-request {
    display: inline-flex;
}

.global-search-spinner {
    width: 100%;
    height: 100%;
    border: 2px solid var(--gray-200);
    border-top-color: var(--nexus-blue);
    border-radius: 50%;
    animation: globalSearchSpin 0.7s linear infinite;
}

@keyframes globalSearchSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.global-search-close-btn {
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.global-search-close-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* --------- Results container ------------ */
.global-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.5rem;
    background: #fff;
    color: var(--gray-700);
    font-size: 0.9rem;
    min-height: 12rem;
}

.global-search-results::-webkit-scrollbar {
    width: 6px;
}

.global-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.global-search-results::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 999px;
}

.global-search-results::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* --------- Empty state ------------ */
.global-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    gap: 0.4rem;
}

.global-search-empty-icon {
    font-size: 1.6rem;
    color: var(--gray-300);
    margin-bottom: 0.4rem;
}

.global-search-empty-text {
    color: var(--gray-700);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.global-search-empty-hint {
    color: var(--gray-500);
    font-size: 0.82rem;
    margin: 0;
}

/* --------- Sections + items ------------ */
.global-search-results-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.5rem;
}

.global-search-section {
    display: flex;
    flex-direction: column;
}

.global-search-section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    padding: 0.6rem 0.75rem 0.35rem;
}

.global-search-section-title i {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.global-search-items {
    display: flex;
    flex-direction: column;
}

.global-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    background: transparent;
    text-decoration: none;
    transition: background-color 0.12s ease;
    cursor: pointer;
}

.global-search-item:hover,
.global-search-item:focus-visible,
.global-search-item.is-active {
    background: var(--gray-100);
    outline: none;
}

.global-search-item-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    background: var(--gray-100);
    color: var(--gray-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.global-search-item:hover .global-search-item-icon,
.global-search-item:focus-visible .global-search-item-icon,
.global-search-item.is-active .global-search-item-icon {
    background: #fff;
    color: var(--gray-800);
}

.global-search-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.global-search-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-item-description {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 0.15rem;
}

.global-search-item-meta i {
    font-size: 0.7rem;
    color: var(--gray-400);
}

/* Enter affordance icon — visible only when the item is hovered/active */
.global-search-item-enter {
    color: var(--gray-400);
    font-size: 0.85rem;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    flex-shrink: 0;
}

.global-search-item:hover .global-search-item-enter,
.global-search-item:focus-visible .global-search-item-enter,
.global-search-item.is-active .global-search-item-enter {
    opacity: 1;
    transform: translateX(0);
}

/* --------- Footer with keyboard hints ------------ */
.global-search-footer {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    font-size: 0.72rem;
    color: var(--gray-500);
}

.global-search-footer-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.global-search-footer kbd {
    background: #fff;
    border: 1px solid var(--gray-300);
    border-bottom-width: 2px;
    border-radius: 0.3rem;
    padding: 0.05rem 0.35rem;
    font-size: 0.7rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", monospace;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1;
    min-width: 1rem;
    text-align: center;
}

@media (max-width: 640px) {
    .global-search-overlay {
        padding-top: 3rem;
    }

    .global-search-modal {
        max-height: calc(100vh - 4rem);
    }

    .global-search-footer {
        gap: 0.85rem;
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
    }

    .global-search-bar {
        padding: 0.85rem 0.85rem;
    }
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 1.5rem;
}

/* Dashboard */
.dashboard-container {
    width: 100%;
}

.dashboard-header {
    margin-bottom: var(--spacing-xl);
}

.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bs-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--bs-border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--bs-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--nexus-primary);
}

/* Messages - Bootstrap alerts enhanced */
.messages-container {
    margin: 1rem auto;
    padding: 0 1.5rem;
}

/* Bootstrap alerts are already styled, but we can enhance them */
.alert {
    border-left: 4px solid;
    border-radius: 0.5rem;
}

/* ============================================
   Footer Component Styles
   Shared footer styles used across the application
   ============================================ */
.footer {
    background-color: var(--gray-900);
    color: var(--gray-400);
    padding: 4rem 0 1.75rem;
    border-top: 1px solid var(--gray-800, #1f2937);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Top: brand block + link columns */
.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 2.5fr;
    gap: 3rem;
    padding-bottom: 2.5rem;
}

/* --- Brand block --- */
.footer-brand {
    max-width: 22rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    margin-bottom: 0.9rem;
}

.footer-logo-mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--nexus-blue-light) 0%, var(--nexus-green-light) 100%);
}

.footer-logo-word {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.footer-logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.footer-tagline {
    color: var(--gray-400);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.footer-social {
    display: flex;
    gap: 0.6rem;
}

.footer-social-link {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.05rem;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.footer-social-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

/* --- Link columns --- */
.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-col-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500, #6b7280);
    margin-bottom: 0.9rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 0.6rem;
}

.footer-col a {
    color: var(--gray-300, #d1d5db);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.18s ease;
}

.footer-col a:hover {
    color: white;
}

/* --- Bottom bar --- */
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-700);
}

.footer-copy {
    color: var(--gray-500, #6b7280);
    font-size: 0.88rem;
    margin: 0;
}

.footer-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-mini a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.18s ease;
}

.footer-mini a:hover {
    color: white;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .footer-brand {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

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

    .footer {
        padding-top: 3rem;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Loading states for HTMX */
.htmx-request {
    opacity: 0.6;
    pointer-events: none;
}

.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--bs-border-color);
    border-top-color: var(--nexus-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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


/* ============================================
   Notification Badge (Navbar)
   ============================================ */
   .navbar-notifications-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--nexus-red);
    color: var(--bs-white);
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0 4px;
    border: 2px solid var(--gray-700);
    z-index: 10;
}

.navbar-notifications-badge span {
    line-height: 1;
}

/* ============================================
   Notifications Modal
   ============================================ */
/* ============================================
   Notifications Modal — slice D.11
   Polished Linear/Spotlight-ish surface:
   - Backdrop blur + darker veil (consistent with D.10)
   - Flat-white header, sentence-case copy, kbd-grade close button
   - Filters as a segmented control (gray-100 track, white pill on
     active) instead of solid-blue pills
   - Unread items: brand-blue dot + 3px left rail + tinted background,
     title bolded gray-900 (fixes the previous gray-500 inversion bug)
   - Bootstrap Icons throughout (no inline SVG)
   - Consistent spinner: gray-200 ring + nexus-blue top arc
   ============================================ */
.notifications-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 2000;
}

.notifications-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.notifications-modal {
    width: min(620px, 92vw);
    max-height: 85vh;
    background: #fff;
    border-radius: 0.85rem;
    box-shadow:
        0 24px 64px -12px rgba(15, 23, 42, 0.35),
        0 4px 12px -2px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 0.2s ease;
}

.notifications-overlay.is-open .notifications-modal {
    transform: translateY(0);
    opacity: 1;
}

/* ---------- Header ---------- */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    background: #fff;
    flex-shrink: 0;
}

.notifications-header-content {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.notifications-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.notifications-unread-badge {
    background-color: var(--nexus-red);
    color: #fff;
    border-radius: 999px;
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 0.45rem;
    line-height: 1;
}

.notifications-close-btn {
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.notifications-close-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* ---------- Body ---------- */
.notifications-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    background: #fff;
}

/* Toolbar: filter pills on left, "Mark all as read" on right */
.notifications-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Filters — segmented control style (iOS / Notion / Linear) */
.notifications-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem;
    background: var(--gray-100);
    border-radius: 0.55rem;
}

.notifications-filter-btn {
    background: transparent;
    border: none;
    color: var(--gray-600);
    padding: 0.35rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: -0.005em;
}

.notifications-filter-btn:hover {
    color: var(--gray-900);
}

/* Active filter pill — JS toggles `.active` on the clicked button and
   strips it from the others, so a single selector is enough. */
.notifications-filter-btn.active {
    background: #fff;
    color: var(--gray-900);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Mark-all-as-read demoted to a quiet text-link with an icon */
.notifications-mark-all-read-btn {
    background: transparent;
    border: none;
    color: var(--gray-600);
    padding: 0.35rem 0.55rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.notifications-mark-all-read-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.notifications-mark-all-read-btn i {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.notifications-mark-all-read-btn:hover i {
    color: var(--nexus-blue);
}

/* ---------- Search ---------- */
.notifications-search {
    position: relative;
    padding: 0.4rem 1rem 0.85rem;
    flex-shrink: 0;
}

.notifications-search-icon {
    position: absolute;
    left: 1.7rem;
    top: 50%;
    transform: translateY(calc(-50% - 0.2rem));
    color: var(--gray-400);
    font-size: 0.9rem;
    pointer-events: none;
}

.notifications-search-input {
    width: 100%;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0.5rem;
    padding: 0.55rem 2.4rem 0.55rem 2.3rem;
    font-size: 0.875rem;
    color: var(--gray-900);
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.notifications-search-input::placeholder {
    color: var(--gray-400);
}

.notifications-search-input:focus {
    border-color: var(--nexus-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.notifications-search-loading {
    display: none;
    position: absolute;
    right: 1.7rem;
    top: 50%;
    transform: translateY(calc(-50% - 0.2rem));
    width: 0.95rem;
    height: 0.95rem;
}

.notifications-search-loading.htmx-request {
    display: inline-flex;
}

/* Shared spinner — also reused in the list loading state */
.notifications-spinner {
    width: 100%;
    height: 100%;
    border: 2px solid var(--gray-200);
    border-top-color: var(--nexus-blue);
    border-radius: 50%;
    animation: notificationsSpin 0.7s linear infinite;
    display: inline-block;
}

.notifications-loading .notifications-spinner {
    width: 1rem;
    height: 1rem;
}

@keyframes notificationsSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- List ---------- */
.notifications-list-container {
    flex: 1;
    overflow-y: auto;
    min-height: 12rem;
    max-height: calc(85vh - 240px);
}

.notifications-list-container::-webkit-scrollbar {
    width: 6px;
}

.notifications-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.notifications-list-container::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 999px;
}

.notifications-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.notifications-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 2.5rem 1rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.notifications-list {
    display: flex;
    flex-direction: column;
}

.notifications-item {
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.15s ease;
    position: relative;
}

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

.notifications-item:hover {
    background-color: var(--gray-50);
}

/* Unread state — subtle blue left rail + tinted background.
   Fixes the previous "gray-500 title" bug that *dimmed* unread items. */
.notifications-item-unread {
    background-color: rgba(37, 99, 235, 0.04);
}

.notifications-item-unread::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--nexus-blue);
}

.notifications-item-unread:hover {
    background-color: rgba(37, 99, 235, 0.07);
}

.notifications-item-unread .notifications-item-title {
    color: var(--gray-900);
    font-weight: 700;
}

.notifications-item-unread .notifications-item-message {
    color: var(--gray-700);
}

.notifications-item-link {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1rem 0.85rem 1.1rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Icon chip — neutral gray-100 default; type-specific accents lifted
   through the bi-* in the chip (no per-type background — keeps the
   palette quiet and reduces blue) */
.notifications-item-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.5rem;
    background: var(--gray-100);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 1rem;
    flex-shrink: 0;
}

/* Subtle accent per category — only the icon colour shifts, the chip
   background stays neutral so the list doesn't flash with colour. */
.notifications-item-icon--task_assigned,
.notifications-item-icon--task_completed,
.notifications-item-icon--task_updated,
.notifications-item-icon--task_status_changed {
    color: var(--nexus-green);
}

.notifications-item-icon--task_comment {
    color: var(--gray-700);
}

.notifications-item-icon--mention_in_comment,
.notifications-item-icon--task_mentioned_in_chat {
    color: var(--nexus-orange);
}

.notifications-item-icon--project_member_added,
.notifications-item-icon--project_updated,
.notifications-item-icon--project_status_changed {
    color: var(--nexus-blue);
}

.notifications-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.notifications-item-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.35;
    letter-spacing: -0.005em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Unread dot integrated next to the title — no more position:absolute */
.notifications-item-unread-dot {
    width: 6px;
    height: 6px;
    background: var(--nexus-blue);
    border-radius: 50%;
    flex-shrink: 0;
}

.notifications-item-message {
    margin: 0;
    font-size: 0.82rem;
    color: var(--gray-600);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notifications-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.notifications-item-type {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.65rem;
    color: var(--gray-500);
}

.notifications-item-meta-dot {
    width: 3px;
    height: 3px;
    background: var(--gray-400);
    border-radius: 50%;
    display: inline-block;
}

.notifications-item-time {
    font-weight: 500;
}

/* ---------- Empty state ---------- */
.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    gap: 0.35rem;
}

.notifications-empty-icon {
    font-size: 1.8rem;
    color: var(--gray-300);
    margin-bottom: 0.35rem;
}

.notifications-empty-text {
    color: var(--gray-700);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.notifications-empty-hint {
    color: var(--gray-500);
    font-size: 0.82rem;
    margin: 0;
    max-width: 28ch;
    line-height: 1.45;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .notifications-overlay {
        padding-top: 2.5rem;
    }

    .notifications-modal {
        width: 95vw;
        max-height: calc(100vh - 4rem);
    }

    .notifications-header {
        padding: 0.85rem 1rem;
    }

    .notifications-toolbar {
        padding: 0.75rem 0.85rem 0.4rem;
    }

    .notifications-filters {
        flex-wrap: wrap;
    }

    .notifications-filter-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
    }

    .notifications-search {
        padding: 0.35rem 0.85rem 0.75rem;
    }

    .notifications-search-icon {
        left: 1.55rem;
    }

    .notifications-search-loading {
        right: 1.55rem;
    }

    .notifications-item-link {
        padding: 0.75rem 0.85rem 0.75rem 1rem;
    }

    .notifications-item-icon {
        width: 1.9rem;
        height: 1.9rem;
        font-size: 0.95rem;
    }
}

/* ============================================
   Profile Modal Styles
   ============================================ */

/* Profile Modal Overlay */
/* ============================================
   Profile Modal — slice D.13
   Aligned to the D.6/D.10/D.11 surface language:
   - Backdrop blur veil
   - Flat-white modal with deep two-layer shadow, snappy slide-up
   - Identity strip: avatar + name + contextual role badge + org line
   - Info cards as white panels on the body canvas with uppercase
     eyebrow headers (icons dropped — no decorative blue chrome)
   - Plan badges recoloured: trial/professional purple → amber
   - All inline SVG (~10) replaced by Bootstrap Icons in the template
   ============================================ */
.profile-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 2000;
    overflow-y: auto;
}

.profile-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.profile-modal {
    width: min(900px, 95vw);
    max-width: 900px;
    background: #fff;
    border-radius: 0.85rem;
    box-shadow:
        0 24px 64px -12px rgba(15, 23, 42, 0.35),
        0 4px 12px -2px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: auto;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 0.2s ease;
}

.profile-overlay.is-open .profile-modal {
    transform: translateY(0);
    opacity: 1;
}

/* ---------- Header ---------- */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    background: #fff;
    flex-shrink: 0;
}

.profile-header-content {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.profile-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.profile-close-btn {
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.profile-close-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* ---------- Body (gray-50 canvas; cards float as white panels) ---------- */
.profile-body {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    background: var(--gray-50);
}

/* ---------- Identity strip ---------- */
.profile-header-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
}

.profile-avatar-section {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
    background: var(--gray-100);
}

.profile-avatar-placeholder {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    background: var(--gray-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    border: 2px solid var(--gray-200);
}

.profile-avatar-change-btn {
    position: absolute;
    bottom: -0.1rem;
    right: -0.1rem;
    width: 1.85rem;
    height: 1.85rem;
    background: var(--nexus-blue);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    font-size: 0.78rem;
    transition: background-color 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.profile-avatar-change-btn:hover {
    background: var(--nexus-blue-dark);
    transform: scale(1.06);
}

.profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-full-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Role + organization on a single meta line under the name */
.profile-meta-line {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
    white-space: nowrap;
}

/* Same palette as the invite-modal role badges (D.8) — no lilac */
.profile-role-badge--owner {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.3);
}

.profile-role-badge--admin {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nexus-blue-dark);
    border-color: rgba(37, 99, 235, 0.2);
}

.profile-role-badge--member {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.profile-role-badge--viewer {
    background: var(--gray-50);
    color: var(--gray-600);
    border-color: var(--gray-200);
}

.profile-role-badge--none {
    background: var(--gray-50);
    color: var(--gray-500);
    border-color: var(--gray-200);
}

.profile-organization {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.82rem;
    color: var(--gray-600);
    font-weight: 500;
}

.profile-organization i {
    font-size: 0.85rem;
    color: var(--gray-400);
}

.profile-bio {
    margin: 0.35rem 0 0 0;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.55;
}

.profile-bio-empty {
    color: var(--gray-400);
    font-style: italic;
}

/* Edit profile primary CTA — same `.btn-new-org` language used elsewhere */
.profile-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--nexus-blue);
    color: #fff;
    border: 1px solid transparent;
    padding: 0.5rem 0.95rem;
    border-radius: 0.55rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow:
        0 2px 4px rgba(37, 99, 235, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.profile-edit-btn:hover {
    background: var(--nexus-blue-dark);
    transform: translateY(-1px);
    box-shadow:
        0 8px 18px -4px rgba(37, 99, 235, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

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

.profile-edit-btn i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* ---------- Info cards grid ---------- */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.profile-info-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profile-info-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem 0.75rem;
    background: #fff;
    border-bottom: none;
}

.profile-info-card-title {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-info-card-body {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-info-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.profile-info-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.profile-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profile-info-value {
    font-size: 0.9rem;
    color: var(--gray-900);
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
}

.profile-info-value-with-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-info-value-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.profile-info-value-with-icon i {
    color: var(--gray-400);
    flex-shrink: 0;
    font-size: 0.85rem;
}

.profile-info-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-style: italic;
    margin: 0.2rem 0 0 0;
}

/* ---------- Email verified / unverified badges ---------- */
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.profile-badge i {
    font-size: 0.78rem;
}

.profile-badge-verified {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.25);
}

.profile-badge-unverified {
    background: rgba(239, 68, 68, 0.08);
    color: var(--nexus-red);
    border-color: rgba(239, 68, 68, 0.25);
}

/* ---------- Subscription plan summary ---------- */
.profile-subscription-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.55rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-subscription-wrapper:hover {
    border-color: var(--gray-300);
    background: #fff;
}

.profile-subscription-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
}

.profile-plan-details {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-plan-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.profile-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.profile-plan-badge i {
    font-size: 0.7rem;
}

/* Trial — amber instead of the prior lilac gradient */
.profile-plan-badge-trial {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.3);
}

.profile-plan-badge-free {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.profile-plan-badge-starter {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nexus-blue-dark);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Professional — amber (was purple #a855f7) */
.profile-plan-badge-professional {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.3);
}

.profile-plan-badge-enterprise {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    border-color: rgba(249, 115, 22, 0.3);
}

.profile-plan-price {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    margin: 0;
}

/* View plans — secondary CTA (text-link with trailing arrow) */
.profile-plan-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    color: var(--nexus-blue);
    border: none;
    padding: 0.4rem 0.65rem;
    border-radius: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, gap 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}

.profile-plan-btn:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nexus-blue-dark);
    gap: 0.45rem;
}

.profile-plan-btn i {
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-overlay {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .profile-modal {
        width: 95vw;
        margin: 1rem;
    }

    .profile-header {
        padding: 1rem 1.25rem;
    }

    .profile-title {
        font-size: 1rem;
    }

    .profile-body {
        padding: 1.5rem 1.25rem;
        gap: 1.5rem;
    }

    .profile-header-section {
        flex-direction: column;
        gap: 1.25rem;
        padding-bottom: 1.5rem;
    }

    .profile-avatar-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .profile-info {
        align-items: center;
        text-align: center;
    }

    .profile-full-name {
        font-size: 1.5rem;
    }

    .profile-edit-btn {
        width: 100%;
        justify-content: center;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .profile-info-card-body {
        padding: 1.25rem;
    }

    .profile-info-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .profile-avatar,
    .profile-avatar-placeholder {
        width: 100px;
        height: 100px;
    }

    .profile-avatar-placeholder {
        font-size: 2rem;
    }

    .profile-full-name {
        font-size: 1.25rem;
    }

    .profile-info-card-header {
        padding: 1rem 1.25rem;
    }

    .profile-info-card-body {
        padding: 1rem;
        gap: 1rem;
    }

    .profile-subscription-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .profile-plan-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ---------- Edit-mode inputs ---------- */
.profile-info-input,
.profile-info-select {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-900);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.profile-info-input:hover:not(:focus),
.profile-info-select:hover:not(:focus) {
    border-color: var(--gray-400);
}

.profile-info-input:focus,
.profile-info-select:focus {
    outline: none;
    border-color: var(--nexus-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.profile-info-input::placeholder {
    color: var(--gray-400);
}

.profile-info-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 4.5L6 7.5l3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

.profile-bio-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-900);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
    resize: vertical;
    min-height: 4.5rem;
}

.profile-bio-input:focus {
    outline: none;
    border-color: var(--nexus-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.profile-bio-input::placeholder {
    color: var(--gray-400);
}

/* ---------- Save / Cancel row ---------- */
.profile-edit-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.6rem;
}

.profile-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--nexus-blue);
    color: #fff;
    border: 1px solid transparent;
    padding: 0.55rem 1.1rem;
    border-radius: 0.55rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow:
        0 2px 4px rgba(37, 99, 235, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.profile-save-btn:hover {
    background: var(--nexus-blue-dark);
    transform: translateY(-1px);
    box-shadow:
        0 8px 18px -4px rgba(37, 99, 235, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

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

.profile-save-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.profile-save-btn i {
    font-size: 0.95rem;
}

/* Cancel as quiet text-link */
.profile-cancel-btn {
    background: transparent;
    color: var(--gray-600);
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.profile-cancel-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Edit-mode toggle state on the primary edit button (becomes "Cancel Edit") */
.profile-edit-btn.editing {
    background: var(--gray-200);
    color: var(--gray-800);
    box-shadow: none;
}

.profile-edit-btn.editing:hover {
    background: var(--gray-300);
    color: var(--gray-900);
    box-shadow: none;
}

/* Responsive adjustments for edit mode */
@media (max-width: 768px) {
    .profile-edit-actions {
        flex-direction: column-reverse;
    }

    .profile-save-btn,
    .profile-cancel-btn {
        width: 100%;
    }
}

/* Profile modal — plan renewal / scheduled-change line (§14 QA) */
.profile-plan-renewal {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: var(--gray-500, #6b7280);
}
