/* ═══════════════════════════════════════ */
/* PROJECT WORKSPACE - LIGHT THEME         */
/* ═══════════════════════════════════════ */

:root {
    --sidebar-width: 246px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e8ecf1;
    --sidebar-text: #475569;
    --sidebar-text-hover: #1e293b;
    --sidebar-text-active: #4f46e5;
    --sidebar-active-bg: #eef2ff;
    --sidebar-active-border: #0b3eae;
    --sidebar-group-text: #94a3b8;
    --sidebar-hover-bg: #f8fafc;
    --topbar-height: 52px;
    --primary: #0b3eae;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: #f4f6f9;
    color: #1e293b;
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ═══════════════════════════════════════ */
/* SIDEBAR                                 */
/* ═══════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    border-right: 1px solid var(--sidebar-border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

/* ── Logo ── */
.sidebar-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header .logo table { border-spacing: 0; }
.sidebar-header .logo img { height: 32px; }

#home_logo_dev {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    margin-left: 6px;
    background: var(--sidebar-active-bg);
    padding: 2px 7px;
    border-radius: 4px;
}

/* ── Project Selector ── */
.project-selector {
    padding: 14px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    position: relative;
}

.project-selector-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

.project-selector-current:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.project-selector-current i:first-child {
    color: var(--primary);
    font-size: 15px;
}

.project-selector-current span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-chevron {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.project-selector.open .project-chevron { transform: rotate(180deg); }

.project-selector-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 12px;
    right: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 340px;
    flex-direction: column;
}

.project-selector.open .project-selector-dropdown { display: flex; }

.project-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.project-search i { color: #94a3b8; font-size: 13px; }

.project-search input {
    flex: 1;
    background: none;
    border: none;
    color: #1e293b;
    font-size: 14px;
    outline: none;
}

.project-search input::placeholder { color: #cbd5e1; }

.project-list {
    list-style: none;
    overflow-y: auto;
    max-height: 220px;
    padding: 6px;
}

.project-list li {
    padding: 9px 14px;
    color: var(--sidebar-text);
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s;
}

.project-list li:hover { background: #f8fafc; color: #1e293b; }
.project-list li.active { background: var(--sidebar-active-bg); color: var(--sidebar-text-active); font-weight: 600; }

.project-selector-footer {
    padding: 8px 12px;
    border-top: 1px solid #f1f5f9;
}

.btn-all-projects {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 8px;
    transition: background 0.12s;
}

.btn-all-projects:hover { background: var(--sidebar-active-bg); }

/* ── Sidebar Content (Scrollable) ── */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.sidebar-content::-webkit-scrollbar { width: 5px; }
.sidebar-content::-webkit-scrollbar-track { background: transparent; }
.sidebar-content::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* ── Nav Groups (always expanded) ── */
.nav-group {
    margin-bottom: 20px;
}

.nav-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 22px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #131416;
    user-select: none;
}

.nav-group-label i {
    font-size: 11px;
    width: 14px;
    text-align: center;
}

.nav-group-items {
    list-style: none;
    padding: 0 10px;
}

/* ── Nav Items ── */
.nav-item {
    margin: 1px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.12s;
    position: relative;
    line-height: 1.3;
}

.nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-hover);
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.nav-link.active .nav-icon {
    color: var(--sidebar-text-active);
}

.nav-icon {
    width: 18px;
    font-size: 14px;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
    transition: color 0.12s;
}

.nav-link:hover .nav-icon {
    color: #64748b;
}

/* Count Badge */
.nav-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: var(--sidebar-active-bg);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

/* Action Status - Building Animation */
.nav-action-spinner {
    margin-left: auto;
    width: 16px;
    height: 16px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.nav-action-spinner .spinner-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #0b3eae;
    border-right-color: #0b3eae;
    animation: navActionSpin 0.8s linear infinite;
}

.nav-action-spinner .spinner-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: #0b3eae;
    animation: navActionPulse 1s ease-in-out infinite;
}

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

@keyframes navActionPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.6); }
}

/* Floating tooltip (appended to body via JS) */
.nav-action-floating-tooltip {
    position: fixed;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 400;
    padding: 10px 14px;
    border-radius: 8px;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    line-height: 1.5;
    max-width: 280px;
    white-space: normal;
    opacity: 0;
    transition: opacity 0.15s;
}

.nav-action-floating-tooltip.visible {
    opacity: 1;
}

.nav-action-floating-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1e293b;
}

/* When running, slightly highlight the nav-link */
.nav-link.action-running {
    background: rgba(99, 102, 241, 0.06);
}

.nav-link.action-running .nav-icon {
    color: #0b3eae;
    animation: navIconGlow 1.5s ease-in-out infinite;
}

@keyframes navIconGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Sidebar Footer ── */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 10px 14px 14px;
    position: relative;
}

.sidebar-footer-links {
    display: flex;
    gap: 2px;
    padding-bottom: 10px;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.12s;
}

.footer-link:hover { background: #f8fafc; color: #64748b; }

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    transition: background 0.12s;
}

.user-info:hover { background: #f8fafc; }

.user-dropdown-btn {
    margin-left: auto;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--sidebar-active-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.user-avatar:hover {
    background: var(--primary);
    color: white;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.user-dropdown-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 6px;
    transition: all 0.12s;
}

.user-dropdown-btn:hover { background: #f1f5f9; color: #64748b; }

/* User Dropdown */
.user-dropdown-menu {
    display: none;
    position: absolute;
    bottom: 80px;
    left: 14px;
    right: 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 200;
    padding: 6px;
}

.user-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.user-dropdown-menu .dropdown-item i:first-child {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.user-dropdown-menu .dropdown-item span {
    flex: 1;
}

.user-dropdown-menu.open { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.12s;
    justify-content: flex-start;
}

.dropdown-item:hover { background: #f8fafc; color: #1e293b; }
.dropdown-item.danger { color: #ef4444; }
.dropdown-item.danger:hover { background: #fef2f2; }
.dropdown-divider { height: 1px; background: #f1f5f9; margin: 4px 0; }

/* ═══════════════════════════════════════ */
/* MAIN CONTENT                            */
/* ═══════════════════════════════════════ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    background: white;
    border-bottom: 1px solid #e8ecf1;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.topbar-breadcrumb a { color: #64748b; text-decoration: none; transition: color 0.12s; }
.topbar-breadcrumb a:hover { color: var(--primary); }
.topbar-breadcrumb span { color: #1e293b; font-weight: 600; }
.topbar-breadcrumb > i { font-size: 8px; color: #cbd5e1; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; padding-right: 0;}

.btn-topbar {
    background: none;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}

.btn-topbar:hover { background: #f8fafc; border-color: #cbd5e1; color: #334155; }

/* Labeled variant — used for "Switch to Developer Mode" and any other
   topbar action that needs visible text alongside its icon. */
.btn-topbar.btn-topbar--labeled {
    width: auto;
    padding: 0 14px;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
}
.btn-topbar.btn-topbar--labeled i { font-size: 13px; }

/* Credit balance pill — surfaces the user's remaining credits in the
   project topbar and on the project-selector popup. Clicking it opens
   the shared credit popup (via the .buy-credits-trigger class). */
.topbar-credit-pill {
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    border: 1px solid #facc15;
    color: #854d0e;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    white-space: nowrap;
}
.topbar-credit-pill:hover {
    background: linear-gradient(135deg, #fef08a 0%, #fcd34d 100%);
    border-color: #eab308;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.18);
    transform: translateY(-1px);
}
.topbar-credit-pill i { font-size: 13px; color: #b45309; }
.topbar-credit-pill .topbar-credit-label {
    color: #92400e;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.topbar-credit-pill .topbar-credit-amount {
    color: #422006;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.topbar-credit-pill.is-low {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
    color: #991b1b;
}
.topbar-credit-pill.is-low i { color: #b91c1c; }
.topbar-credit-pill.is-low .topbar-credit-label,
.topbar-credit-pill.is-low .topbar-credit-amount { color: #7f1d1d; }

/* Page Container */
.page-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f4f6f9;
}

.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 300px;
    color: #94a3b8;
    font-size: 14px;
}

.page-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Floating Chat */
.floating-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    transition: all 0.2s;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chat-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(99, 102, 241, 0.45); }

/* ═══════════════════════════════════════ */
/* MOBILE                                  */
/* ═══════════════════════════════════════ */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1001;
        box-shadow: 4px 0 24px rgba(0,0,0,0.1);
    }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu-overlay.open { display: block; }
    .mobile-menu-toggle { display: block; }
    .page-container { padding: 16px; }
}

/* UI Designs Tab Styles */
.ui-designs-container {
    padding: 10px;
}

.concept-designs-section {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.concept-design-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.concept-design-title i {
    color: #f59e0b;
}

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

.ui-design-tile {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    height: 100%;
    min-height: 120px;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.ui-design-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
    background: #fff;
}

.ui-design-tile .tile-icon {
    font-size: 32px;
    color: #64748b;
    margin-bottom: 15px;
    background: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ui-design-tile:hover .tile-icon {
    color: #3b82f6;
    transform: scale(1.1);
    transition: transform 0.2s;
}

.ui-design-tile.full-app-tile .tile-icon {
    color: #10b981;
    background: #ecfdf5;
}

.ui-design-tile .tile-content {
    width: 100%;
}

.ui-design-tile .tile-name {
    font-weight: 600;
    color: #334155;
    font-size: 15px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ui-design-tile .tile-meta {
    font-size: 12px;
    color: #94a3b8;
}

/* Design Preview Popup Styles */
.design-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.design-popup-overlay.open {
    display: flex;
    opacity: 1;
}

.design-popup-overlay.animating-in {
    display: flex;
    opacity: 0;
}

.design-popup-overlay.animating-out {
    display: flex;
    opacity: 0;
}

.design-popup {
    background: #ffffff;
    border-radius: 12px;
    width: 96vw;
    height: 94vh;
    max-width: 96vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
    opacity: 0;
}

/* Device-specific popup sizes */
.design-popup.device-tablet {
    width: 820px;
    max-width: 820px;
    height: 94vh;
}

.design-popup.device-mobile {
    width: 400px;
    max-width: 400px;
    height: 94vh;
}

.design-popup-overlay.open .design-popup {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.design-popup-overlay.animating-in .design-popup {
    transform: scale(0.9) translateY(30px);
    opacity: 0;
}

.design-popup-overlay.animating-out .design-popup {
    transform: scale(0.9) translateY(30px);
    opacity: 0;
}

.design-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    gap: 16px;
}

.design-popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Device Switcher in Design Popup */
.design-popup-device-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
}

.design-popup-device-switcher .device-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}

.design-popup-device-switcher .device-btn:hover {
    color: #475569;
    background: #e2e8f0;
}

.design-popup-device-switcher .device-btn.active {
    background: #ffffff;
    color: #0b3eae;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.design-popup-close {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.design-popup-close:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    transform: rotate(90deg);
}

.design-popup-body {
    flex: 1;
    overflow: hidden;
    background: #ffffff;
}

.design-popup-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: width 0.3s ease;
}

/* Iframe centering for device modes */
.design-popup-body {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.design-popup-body.device-tablet iframe {
    width: 768px;
    max-width: 100%;
}

.design-popup-body.device-mobile iframe {
    width: 375px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .design-popup-overlay {
        padding: 10px;
    }
    
    .design-popup {
        width: 100%;
        height: 100%;
        border-radius: 8px;
    }
    
    .design-popup-header {
        padding: 10px 14px;
    }
    
    .design-popup-title {
        font-size: 14px;
    }
}

/* Requirements List Styles */
.req-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.req-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.req-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.req-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eef2ff;
    color: #0b3eae;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.req-details h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.req-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.req-status.active {
    background: #dcfce7;
    color: #166534;
}

.req-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.req-actions {
    display: flex;
    gap: 8px;
}

.req-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.req-btn:hover {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.req-btn.edit:hover { color: #3b82f6; background: #eff6ff; border-color: #bfdbfe; }
.req-btn.view:hover { color: #10b981; background: #f0fdf4; border-color: #bbf7d0; }
.req-btn.delete:hover { color: #ef4444; background: #fef2f2; border-color: #fecaca; }

.req-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    color: #64748b;
}

.req-empty i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

/* Technical Flows Tile Grid */
.technical-flows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.tech-flow-tile {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    height: 100%;
    min-height: 120px;
    align-items: center;
    text-align: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.tech-flow-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
    background: #fff;
}

.tech-flow-tile .tile-icon {
    font-size: 32px;
    color: #0b3eae;
    margin-bottom: 15px;
    background: #eef2ff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.tech-flow-tile:hover .tile-icon {
    transform: scale(1.1);
}

.tech-flow-tile .tile-content {
    width: 100%;
}

.tech-flow-tile .tile-name {
    font-weight: 600;
    color: #334155;
    font-size: 15px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tech-flow-tile .tile-meta {
    font-size: 12px;
    color: #94a3b8;
}

.tech-flow-tile-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tech-flow-tile:hover .tech-flow-tile-actions {
    opacity: 1;
}

/* ═══════════════════════════════════════ */
/* MODAL & FORM STYLES                     */
/* ═══════════════════════════════════════ */

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

/* Modal Dialog */
.modal-dialog {
    background: #ffffff;
    border-radius: 19px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

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

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}

.close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Modal Body */
.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1e293b;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0b3eae;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn-primary {
    background: #0b3eae;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background: #ffffff;
    color: #475569;
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}
/* Documents Grid Styles */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.document-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.document-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.document-card-body {
    padding: 24px;
    flex: 1;
}

.document-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.document-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.document-card-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}

.document-card-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.doc-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.doc-status-missing {
    background: #f3f4f6;
    color: #64748b;
}

.doc-status-ready {
    background: #dcfce7;
    color: #166534;
}

/* Layer Empty State (for UI Designs and other pages) */
.layer-empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #94a3b8;
}

.layer-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
    color: #cbd5e1;
}

.layer-empty-state h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #64748b;
}

.layer-empty-state p {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
}

/* ═══════════════════════════════════════ */
/* PROJECT SELECTOR POPUP - FULL SCREEN    */
/* ═══════════════════════════════════════ */
/* ── Living gradient blobs for project selector ── */
.pw-selector-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: #f0f2ff;
}

.pw-selector-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(45px);
    opacity: 0.9;
    will-change: transform;
    pointer-events: none;
    z-index: 0;
}

.pw-blob-1 {
    width: 45vmax; height: 45vmax;
    background: radial-gradient(circle, rgba(139,92,246,0.75) 0%, transparent 65%);
    top: -12%; left: -10%;
    animation: pwBl1 12s ease-in-out infinite alternate;
}
.pw-blob-2 {
    width: 50vmax; height: 50vmax;
    background: radial-gradient(circle, rgba(59,130,246,0.7) 0%, transparent 65%);
    bottom: -18%; right: -14%;
    animation: pwBl2 14s ease-in-out infinite alternate;
}
.pw-blob-3 {
    width: 38vmax; height: 38vmax;
    background: radial-gradient(circle, rgba(236,72,153,0.65) 0%, transparent 65%);
    top: 30%; left: -5%;
    animation: pwBl3 10s ease-in-out infinite alternate;
}
.pw-blob-4 {
    width: 42vmax; height: 42vmax;
    background: radial-gradient(circle, rgba(251,113,133,0.65) 0%, transparent 65%);
    top: -8%; right: -8%;
    animation: pwBl4 16s ease-in-out infinite alternate;
}
.pw-blob-5 {
    width: 35vmax; height: 35vmax;
    background: radial-gradient(circle, rgba(52,211,153,0.6) 0%, transparent 65%);
    bottom: -10%; left: 10%;
    animation: pwBl5 13s ease-in-out infinite alternate;
}
.pw-blob-6 {
    width: 30vmax; height: 30vmax;
    background: radial-gradient(circle, rgba(251,146,60,0.55) 0%, transparent 65%);
    top: 40%; left: 45%;
    animation: pwBl6 18s ease-in-out infinite alternate;
}

@keyframes pwBl1 {
    0%{transform:translate(0,0) scale(1)}33%{transform:translate(20vw,15vh) scale(1.25)}66%{transform:translate(-10vw,25vh) scale(.85)}100%{transform:translate(15vw,-10vh) scale(1.1)}
}
@keyframes pwBl2 {
    0%{transform:translate(0,0) scale(1)}33%{transform:translate(-22vw,-18vh) scale(1.15)}66%{transform:translate(12vw,-28vh) scale(.9)}100%{transform:translate(-18vw,10vh) scale(1.2)}
}
@keyframes pwBl3 {
    0%{transform:translate(0,0) scale(1)}33%{transform:translate(28vw,-20vh) scale(1.3)}66%{transform:translate(16vw,14vh) scale(.8)}100%{transform:translate(-14vw,-12vh) scale(1.15)}
}
@keyframes pwBl4 {
    0%{transform:translate(0,0) scale(1)}33%{transform:translate(-18vw,22vh) scale(.85)}66%{transform:translate(-26vw,10vh) scale(1.2)}100%{transform:translate(10vw,18vh) scale(.9)}
}
@keyframes pwBl5 {
    0%{transform:translate(0,0) scale(1)}33%{transform:translate(24vw,-14vh) scale(1.15)}66%{transform:translate(14vw,-22vh) scale(1.3)}100%{transform:translate(-12vw,-8vh) scale(.85)}
}
@keyframes pwBl6 {
    0%{transform:translate(0,0) scale(1)}33%{transform:translate(-16vw,-18vh) scale(1.2)}66%{transform:translate(20vw,12vh) scale(.8)}100%{transform:translate(-8vw,20vh) scale(1.15)}
}

.pw-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 5000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    animation: pwFadeIn 0.4s ease;
    overflow: hidden;
}

@keyframes pwFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pw-selector-dialog {
    background: transparent;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pwContentIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

@keyframes pwContentIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.pw-selector-header {
    padding: 28px 48px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 24px;
    align-items: center;
}

.pw-selector-logo {
    grid-row: 1 / span 2;
    margin-bottom: 0;
}

.pw-selector-logo table {
    border-spacing: 0;
}

.pw-selector-logo img {
    height: 64px;
}

.pw-selector-logo #home_logo_dev {
    font-size: 20px;
    padding: 4px 14px;
    margin-left: 12px;
    border-radius: 8px;
}

.pw-selector-header h3 {
    grid-column: 2;
    grid-row: 1;
    margin: 0 0 4px 0;
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: -0.5px;
    align-self: end;
}

.pw-selector-create-btn-top {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    padding: 15px 32px;
    font-size: 16px;
    border-width: 2px;
}

.pw-selector-header h3 i {
    color: #0b3eae;
    font-size: 26px;
}

.pw-selector-header-subtitle {
    grid-column: 2;
    grid-row: 2;
    font-size: 15px;
    color: #64748b;
    margin-bottom: 0;
    font-weight: 400;
    align-self: start;
}

/* ── Body ── */
.pw-selector-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* ── Search Bar ── */
.pw-selector-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 48px 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.pw-selector-search i {
    color: #94a3b8;
    font-size: 16px;
    flex-shrink: 0;
}

.pw-selector-search input {
    flex: 1;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 15px;
    outline: none;
    background: rgba(255, 255, 255, 0.6);
    color: #1e293b;
    transition: all 0.2s;
    max-width: 480px;
}

.pw-selector-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background: #fff;
}

.pw-selector-search input::placeholder {
    color: #94a3b8;
}

/* ── Project Grid List ── */
.pw-selector-list {
    flex: 1;
    overflow-y: auto;
    padding: 28px 44px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.pw-selector-list::-webkit-scrollbar { width: 6px; }
.pw-selector-list::-webkit-scrollbar-track { background: transparent; }
.pw-selector-list::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); border-radius: 6px; }
.pw-selector-list::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.6); }

/* ── Project Card Tiles ── */
.pw-selector-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid rgba(200, 210, 230, 0.6);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

.pw-selector-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    border-radius: 0 4px 4px 0;
    transition: background 0.2s;
}

.pw-selector-item:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.12), 0 2px 6px rgba(0,0,0,0.04);
    transform: translateY(-3px);
}

.pw-selector-item:hover::before {
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
}

.pw-selector-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.pw-selector-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s;
    user-select: none;
}

.pw-selector-item:hover .pw-selector-item-icon {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    transform: scale(1.05);
}

.pw-selector-item-info {
    flex: 1;
    min-width: 0;
}

.pw-selector-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.pw-selector-item-desc {
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pw-selector-item-arrow {
    color: #cbd5e1;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.pw-selector-item:hover .pw-selector-item-arrow {
    color: #6366f1;
    transform: translateX(4px);
}

/* ── ⋮ Menu trigger on each project row ── */
.pw-selector-item-menu {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    margin-right: 4px;
}

.pw-selector-item-menu:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.2);
}

/* ── Floating action menu (Tech Stack / Rename / Delete) ── */
.pw-project-action-menu {
    position: fixed;
    z-index: 10010;
    min-width: 200px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
    animation: pwActionMenuFade 0.12s ease-out;
}

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

.pw-project-action-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: transparent;
    border: 0;
    border-radius: 7px;
    text-align: left;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.pw-project-action-item i {
    width: 16px;
    text-align: center;
    color: #64748b;
}

.pw-project-action-item:hover {
    background: rgba(241, 245, 249, 0.6);
}

.pw-project-action-item.is-danger {
    color: #b91c1c;
}

.pw-project-action-item.is-danger i {
    color: #b91c1c;
}

.pw-project-action-item.is-danger:hover {
    background: #fef2f2;
}

/* ── Rename / Delete prompt modal ── */
.pw-prompt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pwPromptFade 0.15s ease;
}

@keyframes pwPromptFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pw-prompt-modal-dialog {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    width: 100%;
    max-width: 460px;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.pw-prompt-modal-header {
    padding: 14px 20px;
    background: #0b3eae;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pw-prompt-modal-header--danger {
    background: #b91c1c;
}

.pw-prompt-modal-title {
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pw-prompt-modal-close {
    background: rgba(255,255,255,0.18);
    border: 0;
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.pw-prompt-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.pw-prompt-modal-body {
    padding: 18px 20px 14px;
}

.pw-prompt-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.pw-prompt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.pw-prompt-input:focus {
    border-color: #0b3eae;
    box-shadow: 0 0 0 3px rgba(11, 62, 174, 0.12);
}

.pw-prompt-warning-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
    margin: 0 0 12px;
}

.pw-prompt-keyword {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 1px 6px;
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.pw-prompt-modal-footer {
    padding: 12px 20px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pw-prompt-btn {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pw-prompt-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pw-prompt-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.pw-prompt-btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.pw-prompt-btn-primary {
    background: #0b3eae;
    color: #ffffff;
    border-color: #0b3eae;
}

.pw-prompt-btn-primary:hover:not(:disabled) {
    background: #0a3596;
}

.pw-prompt-btn-danger {
    background: #b91c1c;
    color: #ffffff;
    border-color: #b91c1c;
}

.pw-prompt-btn-danger:hover:not(:disabled) {
    background: #991b1b;
}

/* ── Empty State ── */
.pw-selector-empty {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
    grid-column: 1 / -1;
}

.pw-selector-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: #cbd5e1;
}

.pw-selector-empty p {
    margin: 0;
    font-size: 16px;
}

/* ── Footer with Create Button ── */
.pw-selector-footer {
    padding: 18px 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pw-selector-create-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 28px;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #6366f1;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pw-selector-create-btn:hover {
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.pw-selector-create-btn i {
    font-size: 14px;
}

.pw-selector-project-count {
    margin-left: auto;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

/* ── Create Form (inline in footer area) ── */
.pw-selector-create-form {
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
    overflow: hidden;
}

.pw-selector-create-form-inner {
    padding: 28px 48px;
    max-width: 640px;
}

.pw-selector-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pw-selector-form-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.pw-selector-back-btn {
    background: none;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 14px;
}

.pw-selector-back-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.4);
}

.pw-selector-create-form .form-group {
    margin-bottom: 16px;
}

.pw-selector-create-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.pw-selector-create-form .form-group input,
.pw-selector-create-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.6);
    color: #1e293b;
    transition: all 0.2s;
    box-sizing: border-box;
}

.pw-selector-create-form .form-group input:focus,
.pw-selector-create-form .form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background: #fff;
}

.pw-selector-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    margin-top: 20px;
}

.pw-selector-form-actions .btn-primary {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: 10px;
}

.pw-selector-form-actions .btn-secondary {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════════ */
/*  PROJECT SELECTOR POPUP — credit pill, tabs, account pane   */
/* ═══════════════════════════════════════════════════════════ */

/* Header credit pill — same intent as the project topbar pill
   but sized to sit alongside the Create/Logout buttons. */
.popup-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    border: 2px solid #facc15;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #854d0e;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    line-height: 1;
}
.popup-credit-pill:hover {
    background: linear-gradient(135deg, #fef08a 0%, #fcd34d 100%);
    border-color: #eab308;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.22);
    transform: translateY(-1px);
}
.popup-credit-pill i { color: #b45309; font-size: 14px; }
.popup-credit-label { color: #92400e; font-weight: 500; }
.popup-credit-amount { color: #422006; font-weight: 800; font-variant-numeric: tabular-nums; }
.popup-credit-pill.is-low {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
    color: #991b1b;
}
.popup-credit-pill.is-low i { color: #b91c1c; }
.popup-credit-pill.is-low .popup-credit-label,
.popup-credit-pill.is-low .popup-credit-amount { color: #7f1d1d; }

/* Tab bar that sits between the header and the body. */
.pw-popup-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}
.pw-popup-tab {
    background: none;
    border: 0;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.15s;
    margin-bottom: -1px;
}
.pw-popup-tab:hover { color: #6366f1; background: rgba(255, 255, 255, 0.4); }
.pw-popup-tab.is-active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}
.pw-popup-tab i { font-size: 13px; }

/* Panes inside the body — each pane fills the body and scrolls
   independently so the tab bar and header stay pinned. */
.pw-popup-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* ── Account pane ── */
.pw-account-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 48px 40px;
    background: #f0f2f5;
}
.pw-account-loading {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.pw-account-loading i { margin-right: 8px; }
.pw-account-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.4fr);
    gap: 18px;
    margin-bottom: 18px;
}
.pw-account-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.pw-account-grid .pw-account-card { margin-bottom: 0; }
.pw-acc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 14px;
}
.pw-acc-card-head i { color: #0b3eae; margin-right: 6px; }
.pw-acc-card-hint { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* Credits card */
.pw-account-card--credits {
    background: linear-gradient(135deg, #fefce8 0%, #fffbeb 100%);
    border-color: #fde68a;
}
.pw-account-card--credits.is-low {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}
.pw-acc-credit-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 14px;
}
.pw-acc-credit-big {
    font-size: 2.4rem;
    font-weight: 800;
    color: #422006;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.pw-account-card--credits.is-low .pw-acc-credit-big { color: #7f1d1d; }
.pw-acc-credit-label {
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 600;
}
.pw-acc-credit-sub {
    font-size: 0.75rem;
    color: #b45309;
    margin-top: 2px;
}
.pw-account-card--credits.is-low .pw-acc-credit-label,
.pw-account-card--credits.is-low .pw-acc-credit-sub { color: #7f1d1d; }
.pw-acc-buy-btn {
    background: #0b3eae;
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.pw-acc-buy-btn:hover { background: #082b7a; }

/* Period totals card */
.pw-acc-select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    background: #fff;
    color: #334155;
    font-family: inherit;
}
.pw-acc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}
.pw-acc-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
}
.pw-acc-stat-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.pw-acc-stat-lbl {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

/* Tables (per-project + keys) */
.pw-acc-table-wrap { overflow-x: auto; }
.pw-acc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.pw-acc-table th,
.pw-acc-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}
.pw-acc-table th {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
}
.pw-acc-table tbody tr:hover { background: #f8fafc; }
.pw-acc-table .pw-acc-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 1px;
}
.pw-acc-empty {
    text-align: center;
    color: #94a3b8;
    padding: 30px 14px;
}
.pw-acc-empty i { margin-right: 6px; }
.pw-acc-code {
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.78rem;
    color: #334155;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
}
.pw-acc-status {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.pw-acc-status.is-active { background: #dcfce7; color: #166534; }
.pw-acc-status.is-inactive { background: #fee2e2; color: #991b1b; }
.pw-acc-project-link {
    color: #0b3eae;
    text-decoration: none;
}
.pw-acc-project-link:hover { text-decoration: underline; }
.pw-acc-actions-col { text-align: right; }
.pw-acc-icon-btn {
    background: none;
    border: 1px solid #cbd5e1;
    color: #64748b;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    margin-left: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.pw-acc-icon-btn:hover { border-color: #0b3eae; color: #0b3eae; }
.pw-acc-icon-btn--danger:hover { border-color: #dc2626; color: #dc2626; }

/* Add-key inline form */
.pw-acc-add-btn {
    background: #0b3eae;
    color: #fff;
    border: 0;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.pw-acc-add-btn:hover { background: #082b7a; }
.pw-acc-add-btn[disabled] { background: #cbd5e1; cursor: not-allowed; }

/* ── AI Key Mode card (pw-acc-mode-*) ─────────────────────── */
.pw-acc-mode-body { padding: 18px 20px; }
.pw-acc-mode-loading { text-align: center; color: #64748b; font-size: 0.875rem; padding: 6px 0; }
.pw-acc-mode-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.pw-acc-mode-label { font-size: 0.85rem; color: #475569; }
.pw-acc-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}
.pw-acc-mode-badge.mode-system   { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pw-acc-mode-badge.mode-personal { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pw-acc-mode-rate {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 9999px;
}
.pw-acc-mode-desc {
    margin: 0 0 14px;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.5;
}
.pw-acc-mode-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.pw-acc-mode-hint { font-size: 0.75rem; color: #94a3b8; }

/* ── Add / Delete API key modal ─────────────────────────────
   Matches the visual language of api-keys.html's modal but
   lives in its own namespace so the project-list popup is
   self-sufficient without that page loaded. */
.pw-keymodal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pw-keymodal-overlay.is-open { display: flex; }
.pw-keymodal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: pwKeymodalIn 0.18s ease-out;
}
.pw-keymodal--small { max-width: 420px; }
@keyframes pwKeymodalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.pw-keymodal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.pw-keymodal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}
.pw-keymodal-close {
    background: none;
    border: 0;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s;
}
.pw-keymodal-close:hover { background: #f1f5f9; color: #1e293b; }
.pw-keymodal-body { padding: 20px; }
.pw-keymodal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}
.pw-keymodal-group { margin-bottom: 1.1rem; }
.pw-keymodal-group:last-child { margin-bottom: 0; }
.pw-keymodal-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #334155;
    font-size: 0.875rem;
}
.pw-keymodal-req { color: #dc2626; font-weight: 700; }
.pw-keymodal-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    font-family: inherit;
}
.pw-keymodal-input:focus {
    outline: none;
    border-color: #0b3eae;
    box-shadow: 0 0 0 3px rgba(11, 62, 174, 0.12);
}
.pw-keymodal-input--mono {
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 0.82rem;
}
.pw-keymodal-msg {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.pw-keymodal-msg.is-error { background: #fee2e2; color: #991b1b; }
.pw-keymodal-msg.is-success { background: #dcfce7; color: #166534; }
.pw-keymodal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: all 0.15s ease;
}
.pw-keymodal-btn[disabled] { opacity: 0.65; cursor: not-allowed; }
.pw-keymodal-btn--primary {
    background: #0b3eae;
    color: #fff;
    border-color: #0b3eae;
}
.pw-keymodal-btn--primary:hover { background: #082b7a; border-color: #082b7a; }
.pw-keymodal-btn--ghost {
    background: #fff;
    color: #475569;
    border-color: #cbd5e1;
}
.pw-keymodal-btn--ghost:hover { background: #f8fafc; border-color: #94a3b8; }
.pw-keymodal-btn--danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.pw-keymodal-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* Chart container */
.pw-acc-chart-wrap {
    position: relative;
    height: 240px;
}
.pw-acc-chart-empty {
    text-align: center;
    color: #94a3b8;
    padding: 30px 10px;
    font-size: 0.85rem;
}

/* ── Responsive for Selector ── */
@media (max-width: 768px) {
    .pw-selector-header {
        padding: 20px 20px;
    }
    .pw-selector-header h3 {
        font-size: 22px;
    }
    .pw-selector-search {
        padding: 16px 20px 14px;
    }
    .pw-selector-search input {
        max-width: 100%;
    }
    .pw-selector-list {
        padding: 16px 16px 24px;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .pw-selector-footer {
        padding: 14px 20px;
    }
    .pw-selector-create-form-inner {
        padding: 20px;
    }
    .pw-popup-tabs { padding: 0 16px; }
    .pw-account-scroll { padding: 16px; }
    .pw-account-grid { grid-template-columns: 1fr; }
    .pw-acc-form-row { grid-template-columns: 1fr; }
    .popup-credit-pill { padding: 10px 14px; font-size: 14px; }
}

@media (max-width: 480px) {
    .pw-selector-item {
        padding: 16px;
    }
    .pw-selector-item-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════ */
/* CREATE PROJECT MODAL POPUP              */
/* ═══════════════════════════════════════ */
.pw-create-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pw-create-modal-overlay.open {
    pointer-events: auto;
    opacity: 1;
}

.pw-create-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pw-create-modal-dialog {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.pw-create-modal-overlay.open .pw-create-modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.pw-create-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.pw-create-modal-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.pw-create-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 245, 249, 0.6);
    border: none;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 15px;
}

.pw-create-modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.pw-create-modal-body {
    padding: 28px;
    overflow-y: auto;
}

.pw-create-modal-body .form-group {
    margin-bottom: 20px;
}

.pw-create-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.pw-create-modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
}

.pw-create-modal-body .form-group input,
.pw-create-modal-body .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.6);
    color: #1e293b;
    transition: all 0.2s;
    box-sizing: border-box;
}

.pw-create-modal-body .form-group input:focus,
.pw-create-modal-body .form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background: #fff;
}

.pw-create-modal-body .form-group input::placeholder,
.pw-create-modal-body .form-group textarea::placeholder {
    color: #94a3b8;
}

.pw-create-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(248, 250, 252, 0.5);
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.pw-create-modal-footer .btn-primary {
    padding: 11px 24px;
    font-size: 15px;
    border-radius: 10px;
}

.pw-create-modal-footer .btn-secondary {
    padding: 11px 20px;
    font-size: 15px;
    border-radius: 10px;
}

@media (max-width: 480px) {
    .pw-create-modal-dialog {
        width: 95%;
        max-width: none;
    }
    .pw-create-modal-header {
        padding: 18px 20px 16px;
    }
    .pw-create-modal-body {
        padding: 20px;
    }
    .pw-create-modal-footer {
        padding: 16px 20px;
    }
}
/* Theme Selection & Build UI Modal Styles */
.theme-card {
    transition: all 0.2s ease;
}
.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}
#theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
#build-ui-design-modal .modal-dialog {
    max-width: 600px;
}
#build-ui-design-modal textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}
#build-ui-design-modal textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Structure Live Preview Modal - make it 90% width and 90% height */
#structure-preview-modal .modal-dialog {
    max-width: 90vw;
    width: 90vw;
    max-height: 90vh;
    height: 90vh;
}

/* ═══════════════════════════════════════ */
/* CHAT MODAL STYLES                       */
/* ═══════════════════════════════════════ */

.floating-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: #0b3eae;
    color: white;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-chat-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.floating-chat-button.active {
    transform: scale(0);
    opacity: 0;
}

.chat-modal {
    position: fixed;
    bottom: 27px;
    right: 24px;
    width: 1100px;
    height: 700px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9001;
    display: none;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-info{
    margin-left: 45px;
}

.chat-modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.teamlead-container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Sidebar */
.sessions-sidebar {
    width: 260px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sessions-sidebar.hidden {
    width: 0;
    overflow: hidden;
    border-right: none;
}

.sessions-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sessions-title {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sessions-actions button {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.sessions-actions button:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.session-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s;
    position: relative;
}

.session-item:hover {
    background: #e2e8f0;
}

.session-item.active {
    background: #eff6ff;
    color: #3b82f6;
}

.session-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-preview {
    font-size: 11px;
    color: #94a3b8;
}

.session-time {
    font-size: 10px;
    color: #cbd5e1;
    margin-top: 4px;
    text-align: right;
}

.delete-session {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.session-item:hover .delete-session {
    opacity: 1;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: white;
}

.show-sidebar-btn {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 10;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: #64748b;
    display: none;
}

.sessions-sidebar.hidden + .chat-area .show-sidebar-btn {
    display: block;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.chat-title {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
}

.chat-subtitle {
    font-size: 12px;
    color: #64748b;
}

.chat-header-actions button {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
}

.chat-header-actions button:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}

.chat-header-actions .close-chat-btn {
    border: none;
    font-size: 16px;
    padding: 6px;
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.message.user .message-avatar {
    background: #e0e7ff;
    color: #4f46e5;
}

.message.assistant .message-avatar {
    background: #5b57d1;
    color: white;
}

.message.system .message-avatar {
    background: #f1f5f9;
    color: #64748b;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 12px;
}

.message.user .message-header {
    flex-direction: row-reverse;
}

.message-sender {
    font-weight: 600;
    color: #334155;
}

.message-time {
    color: #94a3b8;
}

.message-text {
    padding: 11px 36px;;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.message.user .message-text {
    background: #4f46e5;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.message.assistant .message-text {
    background: white;
    color: #1e293b;
}

/* Suggested Tasks */
.suggested-tasks-section {
    margin-top: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.suggested-tasks-header {
    padding: 10px 16px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.task-selection-controls {
    display: flex;
    gap: 8px;
}

.task-selection-controls button {
    background: none;
    border: none;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.task-selection-controls button:hover {
    background: #e2e8f0;
    color: #334155;
}

.suggested-tasks-list {
    padding: 8px;
}

.suggested-task-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
}

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

.task-checkbox {
    margin-top: 4px;
}

.suggested-task-content {
    flex: 1;
    cursor: pointer;
}

.task-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.task-priority-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.task-priority-badge.high { background: #fee2e2; color: #dc2626; }
.task-priority-badge.medium { background: #fef3c7; color: #d97706; }
.task-priority-badge.low { background: #dcfce7; color: #166534; }

.task-agent-type {
    font-size: 10px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.task-description {
    font-size: 13px;
    color: #334155;
    margin-bottom: 4px;
}

.task-reason {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}

.suggested-tasks-actions {
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

.process-selected-tasks-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.process-selected-tasks-btn:hover {
    background: #059669;
}

.process-selected-tasks-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Empty State */
.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    text-align: center;
    padding: 40px;
}

.empty-chat-icon {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-chat-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-chat-subtitle {
    font-size: 14px;
    max-width: 400px;
    margin-bottom: 32px;
}

.suggested-prompts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 600px;
}

.prompt-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.prompt-card:hover {
    border-color: #0b3eae;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.prompt-card-title {
    font-weight: 600;
    color: #334155;
    font-size: 13px;
    margin-bottom: 4px;
}

.prompt-card-text {
    font-size: 12px;
    color: #64748b;
}

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.message-input-wrapper {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    transition: all 0.2s;
}

.message-input-wrapper:focus-within {
    background: white;
    border-color: #0b3eae;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.message-input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    outline: none;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #0b3eae;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.send-btn:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 10px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* References */
.message-references-section {
    margin-top: 10px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e2e8f0;
}

.references-header {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.reference-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.reference-item:hover {
    border-color: #0b3eae;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.reference-item i {
    font-size: 16px;
    color: #0b3eae;
    margin-bottom: 4px;
}

.reference-name {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reference-path {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reference-type {
    font-size: 10px;
    color: #94a3b8;
}

.message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.message-action-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-action-btn:hover {
    color: #475569;
}

/* Context Menu */
.context-menu {
    display: none;
    position: absolute;
    z-index: 10000;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 160px;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: #f8fafc;
}


#sessions-sidebar .message.assistant .message-text{
    padding-left: 37px !important;
}

/* ═══════════════════════════════════════ */
/* USER PROFILE POPUP                      */
/* ═══════════════════════════════════════ */
.user-profile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 8000;
    align-items: center;
    justify-content: center;
}

.user-profile-overlay.open {
    display: flex;
}

.user-profile-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: upSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes upSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 16px 16px 0 0;
}

.user-profile-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile-header h3 i {
    color: #0b3eae;
}

.user-profile-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 15px;
}

.user-profile-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.user-profile-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Profile Tabs */
.user-profile-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    background: #fff;
}

.up-tab {
    padding: 14px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.up-tab:hover { color: #0b3eae; }

.up-tab.active {
    color: #0b3eae;
    font-weight: 600;
}

.up-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0b3eae;
    border-radius: 2px 2px 0 0;
}

.up-tab-content {
    display: none;
    padding: 24px;
}

.up-tab-content.active {
    display: block;
}

/* Avatar Section */
.up-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.up-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b3eae;
    font-size: 28px;
    flex-shrink: 0;
}

.up-avatar-info {
    flex: 1;
}

.up-display-name {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.up-role-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #0b3eae;
    background: #eef2ff;
    padding: 3px 10px;
    border-radius: 6px;
}

/* Form Sections */
.up-form-section {
    margin-bottom: 24px;
}

.up-form-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.up-form-section h4 i {
    color: #0b3eae;
    font-size: 14px;
}

.up-form-row {
    display: flex;
    gap: 16px;
}

.up-form-row .up-form-group {
    flex: 1;
}

.up-form-group {
    margin-bottom: 16px;
}

.up-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.up-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: all 0.2s;
    box-sizing: border-box;
}

.up-input:focus {
    outline: none;
    border-color: #0b3eae;
    box-shadow: 0 0 0 3px rgba(11, 62, 174, 0.1);
}

.up-input:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.up-hint {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Info Grid */
.up-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.up-info-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.up-info-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.up-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* Groups */
.up-groups-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.up-group-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.up-group-badge i {
    color: #0b3eae;
    font-size: 12px;
}

/* Actions */
.up-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: 8px;
}

.up-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.up-btn-primary {
    background: #0b3eae;
    color: white;
}

.up-btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 62, 174, 0.2);
}

.up-btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 640px) {
    .user-profile-modal {
        width: 95%;
        max-height: 95vh;
    }
    .up-form-row {
        flex-direction: column;
        gap: 0;
    }
    .up-info-grid {
        grid-template-columns: 1fr;
    }
    .user-profile-tabs {
        padding: 0 16px;
    }
    .up-tab-content {
        padding: 20px 16px;
    }
}


.truncated-description{
    word-break: break-all;
}

/* ═══════════════════════════════════════ */
/* HELP / USER GUIDE POPUP                 */
/* ═══════════════════════════════════════ */
.help-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    z-index: 9500;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.help-popup-overlay.open {
    display: flex;
    opacity: 1;
}

.help-popup {
    background: #ffffff;
    border-radius: 16px;
    width: 1400px;
    max-width: 96vw;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
}

.help-popup-overlay.open .help-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.help-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.help-popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.help-popup-title i {
    color: #0b3eae;
    font-size: 18px;
}

.help-popup-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}

.help-popup-close:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    transform: rotate(90deg);
}

.help-popup-body {
    flex: 1;
    overflow: hidden;
    background: #f4f6f9;
}

.help-popup-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Help button specific styling */
#topbar-help-btn {
    color: #64748b;
    font-size: 15px;
}

#topbar-help-btn:hover {
    color: #0b3eae;
    background: #eef2ff;
    border-color: #c7d2fe;
}

@media (max-width: 768px) {
    .help-popup {
        width: 100%;
        height: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .help-popup-header {
        padding: 12px 16px;
    }
}