/* ============================================================
   SteelConnect — Portal Premium Overlay
   World-class visual layer for the Contractor & Designer portals.
   Loaded AFTER style.css / analytics-styles.css so equal-specificity
   rules here win the cascade. Purely visual: no layout-breaking
   metric changes, existing responsive breakpoints keep working.
   ============================================================ */

:root {
    /* Premium surface & depth tokens */
    --pp-ink: #0b1220;
    --pp-ink-soft: #101a2e;
    --pp-surface: #ffffff;
    --pp-page-bg:
        radial-gradient(1100px 500px at 85% -10%, rgba(99, 102, 241, 0.055), transparent 60%),
        radial-gradient(900px 460px at -10% 0%, rgba(37, 99, 235, 0.05), transparent 55%),
        linear-gradient(180deg, #f7f9fc 0%, #f3f6fb 100%);
    --pp-hairline: rgba(15, 23, 42, 0.07);
    --pp-hairline-strong: rgba(15, 23, 42, 0.12);
    --pp-radius-lg: 18px;
    --pp-radius-md: 14px;
    --pp-radius-sm: 10px;
    /* Layered elevation (ambient + key light) */
    --pp-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --pp-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.05);
    --pp-shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.08);
    --pp-shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.05), 0 20px 48px rgba(15, 23, 42, 0.12);
    --pp-shadow-primary: 0 8px 22px rgba(37, 99, 235, 0.28);
    --pp-shadow-primary-hover: 0 12px 30px rgba(37, 99, 235, 0.36);
    --pp-focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.22);
    --pp-grad-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #6366f1 100%);
    --pp-grad-sidebar: linear-gradient(180deg, #0b1220 0%, #101a2e 55%, #0f1b33 100%);
    --pp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Global typographic & rendering polish ---------- */
#app-content,
#app-content button,
#app-content input,
#app-content select,
#app-content textarea {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#app-content ::selection { background: rgba(99, 102, 241, 0.18); }

/* Refined page canvas behind the portal */
#app-content .main-content {
    background: var(--pp-page-bg);
    background-attachment: fixed;
}

/* Premium thin scrollbars inside the portal */
#app-content *::-webkit-scrollbar { width: 8px; height: 8px; }
#app-content *::-webkit-scrollbar-track { background: transparent; }
#app-content *::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
#app-content *::-webkit-scrollbar-thumb:hover { background-color: rgba(100, 116, 139, 0.55); }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    #app-content *, #app-content *::before, #app-content *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   SIDEBAR — deep-ink glass panel
   ============================================================ */
#app-content .sidebar {
    background: var(--pp-grad-sidebar);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05), 8px 0 32px rgba(11, 18, 32, 0.14);
}

#app-content .sidebar-user-profile {
    position: relative;
    padding: 30px 20px 24px;
    background:
        radial-gradient(220px 120px at 50% -20%, rgba(99, 102, 241, 0.22), transparent 70%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#app-content .sidebar-avatar {
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.09),
        0 0 0 7px rgba(99, 102, 241, 0.14),
        0 10px 26px rgba(0, 0, 0, 0.42);
    transition: transform 0.35s var(--pp-ease), box-shadow 0.35s var(--pp-ease);
}
#app-content .sidebar-user-profile:hover .sidebar-avatar { transform: translateY(-2px) scale(1.03); }

#app-content #sidebarUserName {
    letter-spacing: -0.01em;
    font-weight: 700;
}
#app-content #sidebarUserType {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.68rem;
    font-weight: 700;
    color: #8fa3c8;
}

/* Nav links: quiet by default, luminous when active */
#app-content .sidebar-nav-link {
    position: relative;
    border-radius: 12px;
    margin: 2px 12px;
    color: #aab8d4;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.22s var(--pp-ease), background 0.22s var(--pp-ease), transform 0.22s var(--pp-ease);
}
#app-content .sidebar-nav-link i {
    transition: transform 0.25s var(--pp-ease);
    opacity: 0.85;
}
#app-content .sidebar-nav-link:hover {
    color: #f1f5ff;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}
#app-content .sidebar-nav-link:hover i { transform: scale(1.12); opacity: 1; }
#app-content .sidebar-nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.28) 0%, rgba(99, 102, 241, 0.16) 100%);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35), 0 6px 18px rgba(37, 99, 235, 0.22);
    font-weight: 600;
    /* the glow bar below replaces the legacy border-left indicator */
    border-left-color: transparent;
}
#app-content .sidebar-nav-link.active i { color: #c7d2fe; }
#app-content .sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 3px;
    background: var(--pp-grad-primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.8);
}
#app-content .sidebar-section-title { color: #64748b; letter-spacing: 0.16em; }

/* ============================================================
   SECTION HEADERS — refine the existing gradient banner
   (style.css paints .modern-header as an indigo banner with
   white text + decorative orbs; we deepen and polish it)
   ============================================================ */
#app-content .section-header.modern-header {
    background:
        radial-gradient(480px 220px at 90% -30%, rgba(129, 140, 248, 0.45), transparent 65%),
        radial-gradient(380px 200px at 2% 130%, rgba(14, 165, 233, 0.28), transparent 60%),
        linear-gradient(130deg, #14264d 0%, #1e3a8a 45%, #3730a3 80%, #4f46e5 100%);
    box-shadow: var(--pp-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    border-radius: var(--pp-radius-lg);
}
#app-content .section-header.modern-header h2 {
    letter-spacing: -0.025em;
    font-weight: 800;
    color: #ffffff;
}
#app-content .modern-header .header-subtitle { color: rgba(226, 232, 255, 0.78); font-weight: 450; }

/* ============================================================
   DASHBOARD — hero, quick actions, widgets, KPIs, charts
   ============================================================ */
#app-content .db-hero {
    border-radius: var(--pp-radius-lg);
    overflow: hidden;
    box-shadow: var(--pp-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
#app-content .db-hero-bg {
    background:
        radial-gradient(560px 260px at 88% -20%, rgba(129, 140, 248, 0.5), transparent 65%),
        radial-gradient(420px 240px at 8% 120%, rgba(14, 165, 233, 0.32), transparent 60%),
        linear-gradient(130deg, #10203f 0%, #1e3a8a 42%, #3730a3 78%, #4f46e5 100%);
}
#app-content .db-hero-avatar {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16), 0 14px 34px rgba(0, 0, 0, 0.35);
}
#app-content .db-hero h2 { letter-spacing: -0.03em; font-weight: 800; }

/* Quick-action cards: tactile, lively */
#app-content .db-action-card {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-hairline);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
    transition: transform 0.28s var(--pp-ease), box-shadow 0.28s var(--pp-ease), border-color 0.28s var(--pp-ease);
    will-change: transform;
}
#app-content .db-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pp-shadow-md);
    border-color: rgba(99, 102, 241, 0.35);
}
#app-content .db-action-card:active { transform: translateY(-1px) scale(0.995); }
#app-content .db-action-icon {
    border-radius: 12px;
    box-shadow: var(--pp-shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.28s var(--pp-ease);
}
#app-content .db-action-card:hover .db-action-icon { transform: scale(1.1) rotate(-3deg); }
#app-content .db-action-text h4 { letter-spacing: -0.015em; font-weight: 700; color: var(--pp-ink); }
#app-content .db-action-arrow { transition: transform 0.28s var(--pp-ease), color 0.28s var(--pp-ease); }
#app-content .db-action-card:hover .db-action-arrow { transform: translateX(4px); color: #4f46e5; }

/* Status cards (profile review states) */
#app-content .db-status-card {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-hairline);
    box-shadow: var(--pp-shadow-sm);
}
#app-content .db-status-btn {
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.22s var(--pp-ease), box-shadow 0.22s var(--pp-ease);
}
#app-content .db-status-btn:hover { transform: translateY(-1px); box-shadow: var(--pp-shadow-sm); }

/* Widgets */
#app-content .db-widget {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-hairline);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
    transition: box-shadow 0.28s var(--pp-ease), transform 0.28s var(--pp-ease);
}
#app-content .db-widget:hover { box-shadow: var(--pp-shadow-md); transform: translateY(-2px); }
#app-content .db-widget-header h4 { letter-spacing: -0.01em; font-weight: 700; }

/* KPI tiles: financial-grade numerals */
#app-content .db-kpi {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-hairline);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.28s var(--pp-ease), box-shadow 0.28s var(--pp-ease);
}
#app-content .db-kpi::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--pp-grad-primary);
    opacity: 0.85;
}
#app-content .db-kpi:hover { transform: translateY(-3px); box-shadow: var(--pp-shadow-md); }
#app-content .db-kpi-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    font-weight: 800;
}
#app-content .db-kpi-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.66rem;
    font-weight: 700;
    color: #64748b;
}

/* Chart cards */
#app-content .dashboard-chart-card {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-hairline);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
    transition: box-shadow 0.28s var(--pp-ease);
}
#app-content .dashboard-chart-card:hover { box-shadow: var(--pp-shadow-md); }
#app-content .chart-badge,
#app-content .db-section-badge {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.62rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(99, 102, 241, 0.12));
    color: #4338ca;
    border: 1px solid rgba(99, 102, 241, 0.22);
}
#app-content .db-section-header h3 { letter-spacing: -0.02em; font-weight: 800; color: var(--pp-ink); }

/* ============================================================
   CARDS — projects, quotes, estimations, settings
   ============================================================ */
#app-content .premium-card,
#app-content .job-card,
#app-content .settings-card {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-hairline);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
    transition: transform 0.28s var(--pp-ease), box-shadow 0.28s var(--pp-ease), border-color 0.28s var(--pp-ease);
}
#app-content .premium-card:hover,
#app-content .job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pp-shadow-md);
    border-color: rgba(99, 102, 241, 0.3);
}
#app-content .job-title { letter-spacing: -0.02em; font-weight: 700; color: var(--pp-ink); }

/* Status badges: crisp pills */
#app-content .job-status-badge,
#app-content .widget-item-status {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.64rem;
    box-shadow: var(--pp-shadow-xs);
}

/* Quote stats row */
#app-content .mq-stat {
    border-radius: var(--pp-radius-md);
    border: 1px solid var(--pp-hairline);
    background: var(--pp-surface);
    box-shadow: var(--pp-shadow-sm);
    transition: transform 0.28s var(--pp-ease), box-shadow 0.28s var(--pp-ease);
}
#app-content .mq-stat:hover { transform: translateY(-2px); box-shadow: var(--pp-shadow-md); }
#app-content .mq-stat-num { font-variant-numeric: tabular-nums; letter-spacing: -0.03em; font-weight: 800; }

/* ============================================================
   BUTTONS — confident, tactile, accessible
   ============================================================ */
.btn {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.005em;
    transition: transform 0.22s var(--pp-ease), box-shadow 0.22s var(--pp-ease),
                background 0.22s var(--pp-ease), border-color 0.22s var(--pp-ease),
                color 0.22s var(--pp-ease), filter 0.22s var(--pp-ease);
}
.btn:focus-visible { outline: none; box-shadow: var(--pp-focus-ring); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn.btn-primary {
    background: var(--pp-grad-primary);
    border: none;
    box-shadow: var(--pp-shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--pp-shadow-primary-hover), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    filter: saturate(1.06);
}
.btn.btn-outline {
    border: 1.5px solid var(--pp-hairline-strong);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
}
.btn.btn-outline:hover {
    border-color: rgba(99, 102, 241, 0.55);
    color: #4338ca;
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--pp-shadow-sm);
}
.btn.btn-danger { box-shadow: 0 6px 18px rgba(239, 68, 68, 0.24); }
.btn.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(239, 68, 68, 0.32); }
.btn:disabled { transform: none; filter: grayscale(0.25) opacity(0.65); box-shadow: none; }

/* ============================================================
   FORMS — calm fields, luminous focus
   ============================================================ */
#app-content .premium-input,
#app-content .premium-select,
#app-content .form-input,
#app-content .form-select,
#app-content .form-textarea {
    border-radius: 12px;
    border: 1.5px solid var(--pp-hairline-strong);
    background: #fbfcfe;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s var(--pp-ease), box-shadow 0.2s var(--pp-ease), background 0.2s var(--pp-ease);
}
#app-content .premium-input:hover,
#app-content .premium-select:hover,
#app-content .form-input:hover,
#app-content .form-select:hover,
#app-content .form-textarea:hover { border-color: rgba(99, 102, 241, 0.4); }
#app-content .premium-input:focus,
#app-content .premium-select:focus,
#app-content .form-input:focus,
#app-content .form-select:focus,
#app-content .form-textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: #6366f1;
    box-shadow: var(--pp-focus-ring), inset 0 1px 2px rgba(15, 23, 42, 0.02);
}
#app-content .form-label { font-weight: 600; color: #1e293b; letter-spacing: 0.005em; }

/* Upload dropzones */
#app-content .custom-file-input {
    border: 2px dashed rgba(99, 102, 241, 0.35);
    border-radius: var(--pp-radius-md);
    background:
        radial-gradient(320px 120px at 50% 0%, rgba(99, 102, 241, 0.06), transparent 70%),
        #fbfcff;
    transition: border-color 0.25s var(--pp-ease), background 0.25s var(--pp-ease), transform 0.25s var(--pp-ease);
}
#app-content .custom-file-input:hover,
#app-content .custom-file-input.drag-over {
    border-color: #6366f1;
    background: #f4f6ff;
    transform: scale(1.005);
}
#app-content .file-list-item {
    border-radius: 10px;
    border: 1px solid var(--pp-hairline);
    background: #ffffff;
    box-shadow: var(--pp-shadow-xs);
}

/* ============================================================
   EMPTY / RESTRICTED / ERROR STATES — considered, not bare
   ============================================================ */
#app-content .empty-state,
#app-content .restricted-access-container,
#app-content .error-state {
    border-radius: var(--pp-radius-lg);
    border: 1px dashed rgba(100, 116, 139, 0.3);
    background:
        radial-gradient(420px 180px at 50% 0%, rgba(99, 102, 241, 0.05), transparent 70%),
        #ffffff;
    box-shadow: var(--pp-shadow-xs);
}
#app-content .empty-icon,
#app-content .restricted-icon {
    filter: drop-shadow(0 6px 14px rgba(99, 102, 241, 0.25));
}

/* Loading spinner: refined */
#app-content .spinner {
    border-width: 3px;
    border-top-color: #4f46e5;
    filter: drop-shadow(0 2px 6px rgba(79, 70, 229, 0.3));
}

/* ============================================================
   NOTIFICATIONS PANEL & MENU BADGES
   ============================================================ */
#app-content .notification-item {
    border-radius: 12px;
    transition: background 0.2s var(--pp-ease), transform 0.2s var(--pp-ease);
}
#app-content .notification-item:hover { background: #f4f6fb; transform: translateX(2px); }
#app-content .notification-item.unread {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.07), transparent 70%);
}
#app-content .menu-notif-badge {
    box-shadow: 0 0 0 2px rgba(11, 18, 32, 0.9), 0 4px 10px rgba(244, 63, 94, 0.45);
}

/* ============================================================
   SUBSCRIPTION PLAN CARDS — the money moment
   ============================================================ */
#app-content .sc-plans-title { letter-spacing: -0.02em; font-weight: 800; }
#app-content [class*="plan-card"],
#app-content .sc-plan-card {
    border-radius: var(--pp-radius-lg);
    transition: transform 0.3s var(--pp-ease), box-shadow 0.3s var(--pp-ease);
}
#app-content [class*="plan-card"]:hover,
#app-content .sc-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pp-shadow-lg);
}

/* ============================================================
   TABLES (estimation results, invoices)
   ============================================================ */
#app-content table {
    border-collapse: separate;
    border-spacing: 0;
}
#app-content table th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
}
#app-content table td { font-variant-numeric: tabular-nums; }
#app-content table tbody tr { transition: background 0.18s var(--pp-ease); }
#app-content table tbody tr:hover { background: #f6f8fd; }

/* ============================================================
   MODALS & POPUPS — soft glass depth
   ============================================================ */
#app-content .modal-content,
#app-content [class*="popup"] > div > div {
    border-radius: var(--pp-radius-lg);
}

/* Section fade-in: content arrives, doesn't pop */
@keyframes ppSectionIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
#app-content .main-container > * { animation: ppSectionIn 0.4s var(--pp-ease) both; }

/* ============================================================
   INLINE FORM VALIDATION — field-level errors for mandatory
   inputs (portal estimation tool + landing free-estimation form)
   ============================================================ */
.sc-inline-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #dc2626;
    animation: ppSectionIn 0.25s var(--pp-ease) both;
}
.sc-inline-error i { font-size: 12px; flex-shrink: 0; }

.sc-field-invalid input,
.sc-field-invalid textarea,
.sc-field-invalid select {
    border-color: #dc2626 !important;
    background: #fef7f7 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}
.sc-field-invalid label { color: #b91c1c !important; }

.sc-upload-invalid {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

@keyframes scShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.sc-shake { animation: scShake 0.4s var(--pp-ease); }

/* ============================================================
   MOBILE POLISH — keep existing breakpoints, refine surfaces
   ============================================================ */
@media (max-width: 768px) {
    #app-content .main-content { background: #f6f8fc; }
    #app-content .db-action-card:hover { transform: none; }
    #app-content .premium-card:hover,
    #app-content .job-card:hover { transform: none; }
}

/* ============================================================
   V3 — PREMIUM MENU SYSTEM (icon tiles, refined sections,
   right-aligned badges, pinned install CTA)
   ============================================================ */

/* Row anatomy: tile + label + badge pushed right */
#app-content .sidebar-nav-link { gap: 11px; }
#app-content .sidebar-nav-link .nav-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Icon tiles: quiet glass squares that light up */
#app-content .nav-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: background 0.25s var(--pp-ease), box-shadow 0.25s var(--pp-ease), transform 0.25s var(--pp-ease);
}
#app-content .nav-ico i { font-size: 0.82rem; opacity: 0.9; transition: color 0.25s var(--pp-ease); }
#app-content .sidebar-nav-link:hover .nav-ico {
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}
#app-content .sidebar-nav-link:hover .nav-ico i { transform: none; }
#app-content .sidebar-nav-link.active .nav-ico {
    background: var(--pp-grad-primary);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
#app-content .sidebar-nav-link.active .nav-ico i { color: #ffffff; opacity: 1; }

/* Section labels: engraved captions with a fading hairline */
#app-content .sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 16px 6px;
    padding: 0;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #5c6c8f;
}
#app-content .sidebar-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}
#app-content .sidebar-section-title:first-child { margin-top: 10px; }

/* Badge system: consistent pills, right-aligned by the flexible label */
#app-content .nav-badge {
    margin-left: 6px;
    padding: 2.5px 7px;
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
#app-content .nav-badge--new  { background: linear-gradient(135deg, #0ea5e9, #2563eb); color: #fff; }
#app-content .nav-badge--pro  { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
#app-content .nav-badge--free { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
#app-content .nav-badge--get  { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
#app-content .nav-badge--alert{ background: linear-gradient(135deg, #f43f5e, #dc2626); color: #fff; }

/* Pinned Install CTA: separated, luminous edge */
#app-content .sidebar-footer-cta {
    margin: 18px 12px 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
#app-content .sidebar-footer-cta .sidebar-nav-link {
    margin: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.06));
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.22);
}
#app-content .sidebar-footer-cta .sidebar-nav-link:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
    transform: translateY(-1px);
}
#app-content .sidebar-footer-cta .nav-ico { background: rgba(16, 185, 129, 0.18); }
#app-content .sidebar-footer-cta .nav-ico i { color: #34d399; }

/* Profile header: glass identity chip */
#app-content .sidebar-user-profile { text-align: center; }
#app-content #sidebarUserType {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.14);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

/* Unread counter aligns with the badge system */
#app-content .sidebar-unread-badge {
    margin-left: 6px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.62rem;
    box-shadow: 0 3px 10px rgba(244, 63, 94, 0.4);
}

/* Sidebar scroll: hide rail until hover (calm at rest) */
#app-content .sidebar::-webkit-scrollbar { width: 6px; }
#app-content .sidebar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 6px; }
#app-content .sidebar:hover::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); }

/* Legacy dividers (if any remain) become subtle fades */
#app-content .sidebar-divider {
    border: none;
    height: 1px;
    margin: 12px 16px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}

/* ============================================================
   V3.1 — COLLAPSIBLE RAIL, GLASS TOP BAR, BREADCRUMB
   ============================================================ */

/* Glass top bar while inside the portal (graceful no-op on old browsers) */
body:has(#app-content:not([style*="none"])) .header {
    background: rgba(11, 18, 32, 0.86);
    backdrop-filter: blur(14px) saturate(1.35);
    -webkit-backdrop-filter: blur(14px) saturate(1.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 28px rgba(11, 18, 32, 0.25);
}

/* Header breadcrumb: quiet wayfinding next to the menu button */
#sc-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #94a3b8;
    white-space: nowrap;
}
#sc-breadcrumb i { font-size: 0.6rem; opacity: 0.6; }
#sc-breadcrumb span { color: #cbd5e1; }
@media (max-width: 640px) { #sc-breadcrumb { display: none !important; } }

/* Collapse control: pinned to the sidebar foot */
#app-content .sidebar-nav { flex: 1 1 auto; }
#sidebarCollapseBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 10px 12px 14px;
    padding: 9px 12px;
    border: none;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
    color: #8fa3c8;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.22s var(--pp-ease), color 0.22s var(--pp-ease), transform 0.22s var(--pp-ease);
}
#sidebarCollapseBtn:hover { background: rgba(255, 255, 255, 0.09); color: #e2e8f0; }
#sidebarCollapseBtn i { transition: transform 0.3s var(--pp-ease); font-size: 0.72rem; }
@media (max-width: 1024px) { #sidebarCollapseBtn { display: none; } } /* drawer mode on mobile */

/* Icon-only rail (desktop). Labels/badges/captions melt away; tiles center. */
@media (min-width: 1025px) {
    #app-content.sc-side-collapsed .sidebar { width: 86px; }
    #app-content.sc-side-collapsed .sidebar-nav-link {
        justify-content: center;
        padding: 10px 0;
        margin: 2px 10px;
    }
    #app-content.sc-side-collapsed .nav-label,
    #app-content.sc-side-collapsed .nav-badge,
    #app-content.sc-side-collapsed .sidebar-unread-badge,
    #app-content.sc-side-collapsed .menu-notif-badge { display: none; }
    #app-content.sc-side-collapsed .sidebar-section-title { margin: 14px 18px 4px; }
    #app-content.sc-side-collapsed .sidebar-section-title span { display: none; }
    #app-content.sc-side-collapsed .sidebar-section-title::after {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    }
    #app-content.sc-side-collapsed .sidebar-avatar {
        width: 42px !important;
        height: 42px !important;
        font-size: 1rem !important;
    }
    #app-content.sc-side-collapsed #sidebarUserName,
    #app-content.sc-side-collapsed #sidebarUserType { display: none; }
    #app-content.sc-side-collapsed .sidebar-user-profile { padding: 20px 8px 16px; }
    #app-content.sc-side-collapsed .sidebar-footer-cta { margin: 14px 10px; }
    #app-content.sc-side-collapsed #sidebarCollapseBtn span { display: none; }
    #app-content.sc-side-collapsed #sidebarCollapseBtn i { transform: rotate(180deg); }
    /* active glow bar hugs the rail edge */
    #app-content.sc-side-collapsed .sidebar-nav-link.active::before { left: -10px; }
}

/* ============================================================
   V4 — "SAPPHIRE AURORA" IDENTITY (v5 recolor of the v4 system)
   A committed design direction: graphite-black surfaces (steel)
   lit by a molten amber accent (hot metal). Replaces the default
   indigo everywhere inside the portal, and adds the motion layer
   that makes interactions feel alive.
   ============================================================ */

:root {
    /* Molten Steel tokens — override the earlier indigo set */
    --pp-grad-primary: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #22d3ee 100%);
    --pp-grad-sidebar: linear-gradient(180deg, #0a0c10 0%, #0e1116 60%, #12151c 100%);
    --pp-shadow-primary: 0 8px 24px rgba(56, 189, 248, 0.32);
    --pp-shadow-primary-hover: 0 14px 34px rgba(56, 189, 248, 0.42);
    --pp-focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.28);
    --pp-page-bg:
        radial-gradient(1100px 520px at 88% -12%, rgba(56, 189, 248, 0.05), transparent 60%),
        radial-gradient(900px 460px at -8% 2%, rgba(56, 63, 75, 0.06), transparent 55%),
        linear-gradient(180deg, #f8f8f7 0%, #f3f4f4 100%);
    --ms-amber: #0ea5e9;
    --ms-amber-soft: rgba(56, 189, 248, 0.14);
    --ms-amber-line: rgba(56, 189, 248, 0.34);
    --ms-steel-text: #9aa4b5;
}

/* ---------- Sidebar: forged graphite with a heat vignette ---------- */
#app-content .sidebar {
    background:
        radial-gradient(340px 200px at 50% -60px, rgba(56, 189, 248, 0.12), transparent 70%),
        var(--pp-grad-sidebar);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 10px 0 36px rgba(5, 7, 10, 0.35);
}
#app-content .sidebar-user-profile {
    background: radial-gradient(240px 130px at 50% -30%, rgba(56, 189, 248, 0.16), transparent 72%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#app-content .sidebar-avatar {
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.07),
        0 0 0 7px rgba(56, 189, 248, 0.18),
        0 10px 28px rgba(0, 0, 0, 0.5);
}
#app-content #sidebarUserType {
    background: var(--ms-amber-soft);
    box-shadow: inset 0 0 0 1px var(--ms-amber-line);
    color: #7dd3fc;
}
#app-content .sidebar-section-title { color: #6b7484; }
#app-content .sidebar-section-title::after {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.22), transparent);
}

/* Nav rows: steel at rest, molten when chosen */
#app-content .sidebar-nav-link { color: var(--ms-steel-text); }
#app-content .sidebar-nav-link:hover { color: #f4f6f9; background: rgba(255, 255, 255, 0.05); }
#app-content .sidebar-nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0.05) 100%);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.28), 0 6px 20px rgba(56, 189, 248, 0.1);
}
#app-content .sidebar-nav-link.active i { color: #ffffff; }
#app-content .sidebar-nav-link.active::before {
    background: var(--pp-grad-primary);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}
#app-content .nav-ico {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
#app-content .sidebar-nav-link:hover .nav-ico {
    background: rgba(56, 189, 248, 0.12);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}
#app-content .sidebar-nav-link:hover .nav-ico i { color: #7dd3fc; }
#app-content .sidebar-nav-link.active .nav-ico {
    background: var(--pp-grad-primary);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: msTilePop 0.45s var(--pp-ease);
}
@keyframes msTilePop {
    0% { transform: scale(0.82); }
    55% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* Sheen sweep: a light streak crosses the row you hover — pure wow */
#app-content .sidebar-nav-link { overflow: hidden; }
#app-content .sidebar-nav-link::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: -70%;
    width: 45%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: skewX(-18deg);
    transition: left 0.5s var(--pp-ease);
    pointer-events: none;
}
#app-content .sidebar-nav-link:hover::after { left: 125%; }

/* Badges tuned to the molten palette */
#app-content .nav-badge--new  { background: linear-gradient(135deg, #0891b2, #06b6d4); }
#app-content .nav-badge--pro  { background: var(--pp-grad-primary); color: #ffffff; }
#app-content .nav-badge--free { background: linear-gradient(135deg, #059669, #10b981); }
#app-content .sidebar-footer-cta .sidebar-nav-link {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0.04));
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}
#app-content .sidebar-footer-cta .nav-ico { background: rgba(56, 189, 248, 0.16); }
#app-content .sidebar-footer-cta .nav-ico i { color: #7dd3fc; }
#sidebarCollapseBtn:hover { color: #7dd3fc; }

/* ---------- Top bar: graphite glass with a molten hairline ---------- */
body:has(#app-content:not([style*="none"])) .header {
    background: rgba(10, 12, 16, 0.88);
    border-bottom: 1px solid rgba(56, 189, 248, 0.14);
    box-shadow: 0 10px 30px rgba(5, 7, 10, 0.35);
}
#sc-breadcrumb i { color: var(--ms-amber); opacity: 0.8; }

/* ---------- Content: warm-lit canvas, molten accents ---------- */
#app-content .section-header.modern-header {
    background:
        radial-gradient(520px 240px at 92% -30%, rgba(56, 189, 248, 0.35), transparent 62%),
        radial-gradient(380px 200px at 0% 130%, rgba(56, 63, 75, 0.5), transparent 60%),
        linear-gradient(130deg, #0c0f14 0%, #171b22 55%, #0b1a33 100%);
}
#app-content .db-hero-bg {
    background:
        radial-gradient(560px 280px at 90% -20%, rgba(56, 189, 248, 0.4), transparent 62%),
        radial-gradient(420px 240px at 6% 120%, rgba(56, 63, 75, 0.55), transparent 60%),
        linear-gradient(130deg, #0b0e13 0%, #161a21 50%, #0a1830 100%);
}
#app-content .db-kpi::before { background: var(--pp-grad-primary); }
#app-content .chart-badge,
#app-content .db-section-badge {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(125, 211, 252, 0.14));
    color: #0369a1;
    border: 1px solid rgba(56, 189, 248, 0.28);
}
#app-content .premium-card:hover,
#app-content .job-card:hover,
#app-content .db-action-card:hover { border-color: rgba(56, 189, 248, 0.4); }
#app-content .db-action-card:hover .db-action-arrow { color: #0284c7; }
#app-content .custom-file-input {
    border-color: rgba(56, 189, 248, 0.35);
    background:
        radial-gradient(320px 120px at 50% 0%, rgba(56, 189, 248, 0.05), transparent 70%),
        #fbfdff;
}
#app-content .custom-file-input:hover,
#app-content .custom-file-input.drag-over { border-color: var(--ms-amber); background: #eff8ff; }
#app-content .spinner { border-top-color: var(--ms-amber); filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.35)); }
#app-content .notification-item.unread {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.08), transparent 70%);
}
#app-content ::selection { background: rgba(56, 189, 248, 0.22); }

/* Primary buttons: molten metal (portal only; landing keeps its brand) */
#app-content .btn.btn-primary {
    background: var(--pp-grad-primary);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(7, 20, 40, 0.35);
    box-shadow: var(--pp-shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
#app-content .btn.btn-primary:hover { box-shadow: var(--pp-shadow-primary-hover), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
#app-content .btn.btn-outline:hover { border-color: rgba(56, 189, 248, 0.55); color: #0369a1; }
#app-content .premium-input:focus,
#app-content .form-input:focus,
#app-content .form-select:focus,
#app-content .form-textarea:focus { border-color: var(--ms-amber); }

/* ---------- Motion layer: content arrives in a choreographed stagger ---------- */
@keyframes msRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
#app-content .main-container > * { animation: msRise 0.5s var(--pp-ease) both; }
#app-content .main-container > *:nth-child(1) { animation-delay: 0.02s; }
#app-content .main-container > *:nth-child(2) { animation-delay: 0.08s; }
#app-content .main-container > *:nth-child(3) { animation-delay: 0.14s; }
#app-content .main-container > *:nth-child(4) { animation-delay: 0.2s; }
#app-content .main-container > *:nth-child(5) { animation-delay: 0.26s; }

/* Press feedback everywhere clickable in the menu */
#app-content .sidebar-nav-link:active { transform: scale(0.97); }

/* Fix: with the sheen's overflow clip, the active bar must live INSIDE the row */
#app-content .sidebar-nav-link.active::before { left: 0; top: 18%; bottom: 18%; width: 3px; }
@media (min-width: 1025px) {
    #app-content.sc-side-collapsed .sidebar-nav-link.active::before { left: 0; }
}

/* ============================================================
   V5.2 — PROJECT ROOMS 🔒 components
   ============================================================ */
.pr-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.05);
}
.pr-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.pr-tabs button:hover { background: #f1f5f9; color: #0f172a; }
.pr-tabs button.active {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}
.pr-count {
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.68rem;
    font-weight: 800;
}
.pr-tabs button.active .pr-count { background: rgba(255, 255, 255, 0.25); }
.pr-k {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 3px;
}
.pr-av {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #2563eb, #22d3ee);
    color: #fff; font-weight: 800; font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.pr-role {
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(37, 99, 235, 0.1); color: #1d4ed8;
}
@media (max-width: 700px) {
    .pr-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .pr-tabs button { white-space: nowrap; }
}

/* ============================================================
   V6 — "POLAR SAPPHIRE": light premium theme
   Kills the dark feel: white glass header, ice-light sidebar,
   bright sapphire banners. The sapphire gradient stays as the
   single accent; all surfaces go light (admin-style).
   ============================================================ */

/* ---------- Sidebar: ice panel with sapphire accents ---------- */
#app-content .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.06), 6px 0 24px rgba(15, 23, 42, 0.04);
}
#app-content .sidebar-user-profile {
    background: radial-gradient(240px 130px at 50% -30%, rgba(14, 165, 233, 0.1), transparent 72%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
#app-content #sidebarUserName { color: #0f172a; }
#app-content .sidebar-avatar {
    box-shadow:
        0 0 0 3px #ffffff,
        0 0 0 6px rgba(14, 165, 233, 0.25),
        0 10px 24px rgba(37, 99, 235, 0.18);
}
#app-content #sidebarUserType {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);
    color: #1d4ed8;
}
#app-content .sidebar-section-title { color: #94a3b8; }
#app-content .sidebar-section-title::after {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.25), transparent);
}
#app-content .sidebar-nav-link { color: #475569; }
#app-content .sidebar-nav-link:hover { color: #0f172a; background: #f1f5f9; }
#app-content .sidebar-nav-link::after {
    background: linear-gradient(105deg, transparent, rgba(37, 99, 235, 0.07), transparent);
}
#app-content .sidebar-nav-link.active {
    color: #1d4ed8;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.09), rgba(14, 165, 233, 0.04));
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22), 0 4px 14px rgba(37, 99, 235, 0.08);
}
#app-content .sidebar-nav-link.active::before { box-shadow: 0 0 10px rgba(14, 165, 233, 0.55); }
#app-content .nav-ico {
    background: #eef2f7;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
    color: #475569;
}
#app-content .sidebar-nav-link:hover .nav-ico {
    background: rgba(14, 165, 233, 0.1);
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.3);
}
#app-content .sidebar-nav-link:hover .nav-ico i { color: #0284c7; }
#app-content .sidebar-nav-link.active .nav-ico i { color: #ffffff; }
#app-content .sidebar-footer-cta { border-top: 1px solid rgba(15, 23, 42, 0.06); }
#app-content .sidebar-footer-cta .sidebar-nav-link {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.03));
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}
#app-content .sidebar-footer-cta .nav-ico { background: rgba(16, 185, 129, 0.12); }
#app-content .sidebar-footer-cta .nav-ico i { color: #059669; }
#sidebarCollapseBtn {
    background: #eef2f7;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    color: #64748b;
}
#sidebarCollapseBtn:hover { background: #e2e8f0; color: #1d4ed8; }
#app-content .menu-notif-badge { box-shadow: 0 0 0 2px #ffffff, 0 4px 10px rgba(244, 63, 94, 0.35); }
#app-content .sidebar-close-btn { color: #475569; }

/* ---------- Top bar: white glass (admin-style), dark text ---------- */
body:has(#app-content:not([style*="none"])) .header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}
body:has(#app-content:not([style*="none"])) .header .logo { color: #0f172a; }
body:has(#app-content:not([style*="none"])) .header .portal-menu-btn { color: #0f172a; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb { color: #64748b; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb span { color: #0f172a; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb i { color: #0ea5e9; }

/* ---------- Banners: bright sapphire, not black ---------- */
#app-content .section-header.modern-header {
    background:
        radial-gradient(520px 240px at 92% -30%, rgba(125, 211, 252, 0.5), transparent 62%),
        radial-gradient(380px 200px at 0% 130%, rgba(30, 64, 175, 0.55), transparent 60%),
        linear-gradient(130deg, #1e40af 0%, #2563eb 48%, #0ea5e9 100%);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
#app-content .db-hero-bg {
    background:
        radial-gradient(560px 280px at 90% -20%, rgba(125, 211, 252, 0.45), transparent 62%),
        radial-gradient(420px 240px at 6% 120%, rgba(30, 64, 175, 0.5), transparent 60%),
        linear-gradient(130deg, #1e40af 0%, #2563eb 50%, #0ea5e9 100%);
}

/* ============================================================
   V7 — "SLATE CHROME" (GitHub-style)
   Chrome only: header + sidebar go refined dark-slate (like
   GitHub / the admin), content stays light with sapphire accents.
   Overrides v6's chrome rules; keeps every v6 content rule.
   ============================================================ */

/* ---------- Sidebar: slate-navy panel ---------- */
#app-content .sidebar {
    background:
        radial-gradient(320px 180px at 50% -50px, rgba(56, 189, 248, 0.1), transparent 70%),
        linear-gradient(180deg, #212d42 0%, #1a2334 100%);
    box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.09), 8px 0 28px rgba(15, 23, 42, 0.18);
}
#app-content .sidebar-user-profile {
    background: radial-gradient(240px 130px at 50% -30%, rgba(56, 189, 248, 0.14), transparent 72%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
#app-content #sidebarUserName { color: #f1f5f9; }
#app-content .sidebar-avatar {
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.08),
        0 0 0 7px rgba(56, 189, 248, 0.16),
        0 10px 26px rgba(8, 13, 24, 0.5);
}
#app-content #sidebarUserType {
    background: rgba(56, 189, 248, 0.13);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}
#app-content .sidebar-section-title { color: #6e7f9b; }
#app-content .sidebar-section-title::after {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.22), transparent);
}
#app-content .sidebar-nav-link { color: #a9b6cc; }
#app-content .sidebar-nav-link:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }
#app-content .sidebar-nav-link::after {
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.07), transparent);
}
#app-content .sidebar-nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.3) 0%, rgba(14, 165, 233, 0.12) 100%);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.32), 0 6px 18px rgba(14, 165, 233, 0.14);
}
#app-content .sidebar-nav-link.active::before { box-shadow: 0 0 12px rgba(56, 189, 248, 0.85); }
#app-content .nav-ico {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    color: #a9b6cc;
}
#app-content .sidebar-nav-link:hover .nav-ico {
    background: rgba(56, 189, 248, 0.13);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}
#app-content .sidebar-nav-link:hover .nav-ico i { color: #7dd3fc; }
#app-content .sidebar-footer-cta { border-top: 1px solid rgba(148, 163, 184, 0.1); }
#app-content .sidebar-footer-cta .sidebar-nav-link {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.05));
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.24);
}
#app-content .sidebar-footer-cta .nav-ico { background: rgba(16, 185, 129, 0.16); }
#app-content .sidebar-footer-cta .nav-ico i { color: #34d399; }
#sidebarCollapseBtn {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
    color: #8ea1bd;
}
#sidebarCollapseBtn:hover { background: rgba(255, 255, 255, 0.09); color: #7dd3fc; }
#app-content .menu-notif-badge { box-shadow: 0 0 0 2px rgba(26, 35, 52, 0.95), 0 4px 10px rgba(244, 63, 94, 0.45); }
#app-content .sidebar-close-btn { color: #cbd5e1; }

/* ---------- Top bar: slate glass (GitHub-style), light text ---------- */
body:has(#app-content:not([style*="none"])) .header {
    background: rgba(24, 32, 47, 0.94);
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
    border-bottom: 1px solid rgba(56, 189, 248, 0.14);
    box-shadow: 0 8px 26px rgba(11, 18, 32, 0.28);
}
body:has(#app-content:not([style*="none"])) .header .logo { color: #ffffff; }
body:has(#app-content:not([style*="none"])) .header .portal-menu-btn { color: #e2e8f0; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb { color: #8ea1bd; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb span { color: #e2e8f0; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb i { color: #38bdf8; }

/* ============================================================
   V8 — "SMOKE WHITE" CHROME (final): pale smoke-white header +
   sidebar, light content, sapphire accents. Overrides v7 slate.
   ============================================================ */
#app-content .sidebar {
    background: linear-gradient(180deg, #fcfcfd 0%, #f4f6f9 100%);
    box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.08), 6px 0 22px rgba(15, 23, 42, 0.05);
}
#app-content .sidebar-user-profile {
    background: radial-gradient(240px 130px at 50% -30%, rgba(14, 165, 233, 0.08), transparent 72%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}
#app-content #sidebarUserName { color: #111827; }
#app-content .sidebar-avatar {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px rgba(14, 165, 233, 0.22), 0 8px 20px rgba(37, 99, 235, 0.15);
}
#app-content #sidebarUserType {
    background: rgba(37, 99, 235, 0.07);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
    color: #1d4ed8;
}
#app-content .sidebar-section-title { color: #9aa3b2; }
#app-content .sidebar-section-title::after { background: linear-gradient(90deg, rgba(14, 165, 233, 0.22), transparent); }
#app-content .sidebar-nav-link { color: #4b5563; }
#app-content .sidebar-nav-link:hover { color: #0f172a; background: #eef2f6; }
#app-content .sidebar-nav-link::after { background: linear-gradient(105deg, transparent, rgba(37, 99, 235, 0.06), transparent); }
#app-content .sidebar-nav-link.active {
    color: #1d4ed8;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.09), rgba(14, 165, 233, 0.04));
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2), 0 4px 12px rgba(37, 99, 235, 0.07);
}
#app-content .sidebar-nav-link.active::before { box-shadow: 0 0 10px rgba(14, 165, 233, 0.5); }
#app-content .nav-ico { background: #edf1f6; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05); color: #4b5563; }
#app-content .sidebar-nav-link:hover .nav-ico { background: rgba(14, 165, 233, 0.1); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.28); }
#app-content .sidebar-nav-link:hover .nav-ico i { color: #0284c7; }
#app-content .sidebar-footer-cta { border-top: 1px solid rgba(15, 23, 42, 0.07); }
#app-content .sidebar-footer-cta .sidebar-nav-link {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(16, 185, 129, 0.03));
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}
#app-content .sidebar-footer-cta .nav-ico { background: rgba(16, 185, 129, 0.11); }
#app-content .sidebar-footer-cta .nav-ico i { color: #059669; }
#sidebarCollapseBtn { background: #edf1f6; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06); color: #64748b; }
#sidebarCollapseBtn:hover { background: #e2e8f0; color: #1d4ed8; }
#app-content .menu-notif-badge { box-shadow: 0 0 0 2px #ffffff, 0 4px 10px rgba(244, 63, 94, 0.35); }
#app-content .sidebar-close-btn { color: #475569; }

body:has(#app-content:not([style*="none"])) .header {
    background: rgba(252, 252, 253, 0.92);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}
body:has(#app-content:not([style*="none"])) .header .logo { color: #0f172a; }
body:has(#app-content:not([style*="none"])) .header .portal-menu-btn { color: #0f172a; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb { color: #64748b; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb span { color: #0f172a; }
body:has(#app-content:not([style*="none"])) #sc-breadcrumb i { color: #0ea5e9; }

/* ============================================================
   V8.1 — TRULY PRIVATE ROOMS
   Inside a room the portal disappears (immersive mode); guests
   get a clean full-page room with a minimal branded top bar.
   ============================================================ */

/* Immersive mode: no left menu — the room's controls are the only menu */
#app-content.pr-immersive .sidebar,
#app-content.pr-immersive .sidebar-overlay { display: none !important; }
/* Inside a room the workspace is IMMERSIVE — it owns the whole viewport
   width (gentle gutters, capped only on ultra-wide monitors) so the room
   never floats in blank space. */
#app-content.pr-immersive .main-content { padding: 20px 30px 44px; }
#app-content.pr-immersive .main-container { max-width: 1880px; width: 100%; }
body:has(#app-content.pr-immersive) .portal-menu-btn { display: none !important; }
@media (max-width: 768px) {
    #app-content.pr-immersive .main-content { padding: 18px 16px; }
}

.pr-exit { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 8px 14px; }

/* Guest full-page room */
body.pr-guest-mode { background: #f4f6f9 !important; }
.pr-guest-topbar {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 22px;
    background: rgba(252, 252, 253, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}
.pr-guest-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; color: #0f172a; font-size: 0.95rem; }
.pr-guest-mark {
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff; display: grid; place-items: center;
    font-size: 0.72rem; font-weight: 900;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}
.pr-guest-title {
    font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em;
    color: #1d4ed8; background: rgba(37, 99, 235, 0.08);
    padding: 5px 12px; border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* ============================================================
   V9 — "TACTILE 3D" MENU (on Smoke White chrome)
   Keycap-style depth: raised icon tiles with bevels, embossed
   lettering, rows that lift on hover and sink on press — plus a
   signature standout treatment for Project Rooms.
   ============================================================ */

/* Rows: flat at rest, raised card on hover, pressed = sinks */
#app-content .sidebar-nav-link {
    transition: color 0.2s var(--pp-ease), background 0.2s var(--pp-ease),
                transform 0.2s var(--pp-ease), box-shadow 0.2s var(--pp-ease);
}
#app-content .sidebar-nav-link:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 6px 16px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#app-content .sidebar-nav-link:active { transform: translateY(0) scale(0.985); box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.08); }

/* Embossed lettering on the light panel */
#app-content .sidebar-nav-link .nav-label { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85); }
#app-content .sidebar-section-title { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9); }
#app-content #sidebarUserName { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9); letter-spacing: -0.01em; }

/* Icon tiles become 3D keycaps: top light, bottom shade, real drop */
#app-content .nav-ico {
    background: linear-gradient(180deg, #ffffff 0%, #e9eef5 100%);
    box-shadow:
        inset 0 1px 0 #ffffff,
        inset 0 -1px 0 rgba(15, 23, 42, 0.07),
        0 0 0 1px rgba(15, 23, 42, 0.07),
        0 2px 4px rgba(15, 23, 42, 0.08);
}
#app-content .sidebar-nav-link:hover .nav-ico {
    background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 100%);
    box-shadow:
        inset 0 1px 0 #ffffff,
        inset 0 -1px 0 rgba(2, 132, 199, 0.15),
        0 0 0 1px rgba(14, 165, 233, 0.3),
        0 3px 8px rgba(14, 165, 233, 0.18);
    transform: translateY(-1px);
}
#app-content .sidebar-nav-link.active {
    background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
    transform: translateY(-1px);
    box-shadow:
        0 1px 2px rgba(37, 99, 235, 0.08),
        0 8px 20px rgba(37, 99, 235, 0.12),
        inset 0 1px 0 #ffffff,
        inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}
#app-content .sidebar-nav-link.active .nav-ico {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #0ea5e9 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 3px rgba(7, 40, 100, 0.35),
        0 3px 8px rgba(37, 99, 235, 0.45),
        0 1px 2px rgba(15, 23, 42, 0.2);
}
/* Avatar gets the same lifted keycap presence */
#app-content .sidebar-avatar {
    box-shadow:
        0 0 0 3px #ffffff,
        0 0 0 6px rgba(14, 165, 233, 0.22),
        0 6px 14px rgba(37, 99, 235, 0.22),
        0 2px 4px rgba(15, 23, 42, 0.12);
}

/* ---------- PROJECT ROOMS: the signature entry ---------- */
#app-content .sidebar-nav-link.pr-menu-special {
    margin: 10px 12px;
    padding: 12px;
    background:
        linear-gradient(#ffffff, #f6faff) padding-box,
        linear-gradient(135deg, #2563eb, #0ea5e9 55%, #8b5cf6) border-box;
    border: 1.5px solid transparent;
    border-left: 1.5px solid transparent !important;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14), inset 0 1px 0 #ffffff;
    animation: prGlow 3.2s ease-in-out infinite;
}
@keyframes prGlow {
    0%, 100% { box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14), inset 0 1px 0 #ffffff; }
    50% { box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3), 0 0 0 4px rgba(56, 189, 248, 0.07), inset 0 1px 0 #ffffff; }
}
#app-content .sidebar-nav-link.pr-menu-special .nav-label {
    font-weight: 800;
    background: linear-gradient(90deg, #1d4ed8, #0284c7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}
#app-content .sidebar-nav-link.pr-menu-special .nav-ico {
    background: linear-gradient(180deg, #4f8df9 0%, #2563eb 55%, #7c3aed 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 3px rgba(30, 27, 75, 0.4),
        0 4px 10px rgba(79, 70, 229, 0.4);
}
#app-content .sidebar-nav-link.pr-menu-special .nav-ico i { color: #ffffff; opacity: 1; }
#app-content .sidebar-nav-link.pr-menu-special:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.24), inset 0 1px 0 #ffffff;
}
#app-content .sidebar-nav-link.pr-menu-special.active::before { display: none; }
#app-content .nav-badge--priv {
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.45);
}

/* Collapsed rail keeps the special keycap visible */
@media (min-width: 1025px) {
    #app-content.sc-side-collapsed .sidebar-nav-link.pr-menu-special { padding: 10px 0; margin: 8px 10px; }
}

/* ============================================================
   V9.2 — MOBILE PARITY (drawer + PWA)
   The base mobile drawer (in style.css) forces a DARK sidebar
   with !important, but the premium Smoke-White theme sets dark
   text — dark-on-dark = invisible labels on phones and in the
   installed app. Bring the slide-out drawer to the SAME premium
   Smoke-White palette so every UI update shows on mobile too.
   ============================================================ */
@media (max-width: 768px) {
    /* Drawer surface → smoke white (beats style.css !important) */
    #app-content .sidebar {
        background: linear-gradient(180deg, #fcfcfd 0%, #f4f6f9 100%) !important;
        border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
        box-shadow: 8px 0 34px rgba(15, 23, 42, 0.18) !important;
    }

    /* Profile block: dark identity text on the light panel */
    #app-content .sidebar-user-profile {
        background: radial-gradient(240px 130px at 50% -30%, rgba(14, 165, 233, 0.08), transparent 72%) !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.07) !important;
    }
    #app-content #sidebarUserName,
    #app-content .sidebar-user-profile h3 { color: #111827 !important; }
    #app-content .sidebar-user-profile p:not(#sidebarUserType) { color: #64748b !important; }

    /* Nav rows: readable slate labels, blue when active */
    #app-content .sidebar-nav-link { color: #4b5563 !important; }
    #app-content .sidebar-nav-link .nav-label { color: inherit !important; }
    #app-content .sidebar-nav-link:hover,
    #app-content .sidebar-nav-link:active { color: #0f172a !important; background: #eef2f6 !important; }
    #app-content .sidebar-nav-link.active {
        color: #1d4ed8 !important;
        background: linear-gradient(90deg, rgba(37, 99, 235, 0.09), rgba(14, 165, 233, 0.04)) !important;
        border-left-color: transparent !important;
    }

    /* Section captions + dividers legible on light */
    #app-content .sidebar .sidebar-section-title { color: #9aa3b2 !important; }
    #app-content .sidebar-divider { background: rgba(15, 23, 42, 0.08) !important; }

    /* Keycap tiles stay light; icons dark enough to read */
    #app-content .nav-ico { background: #edf1f6 !important; color: #4b5563 !important; }
    #app-content .sidebar-nav-link i { opacity: 1 !important; color: inherit !important; }
    #app-content .sidebar-nav-link.active .nav-ico { background: var(--pp-grad-primary) !important; }
    #app-content .sidebar-nav-link.active .nav-ico i,
    #app-content .sidebar-nav-link.pr-menu-special .nav-ico i { color: #ffffff !important; }

    /* The span font-size !important in style.css must not shrink the
       icon tile or bloat the badge — pin them back */
    #app-content .sidebar-nav-link .nav-badge { font-size: 0.56rem !important; line-height: 1 !important; }

    /* Project Rooms signature card survives on the light drawer */
    #app-content .sidebar-nav-link.pr-menu-special {
        margin: 10px 12px !important;
        border-left: 1.5px solid transparent !important;
    }
    #app-content .sidebar-nav-link.pr-menu-special .nav-label {
        -webkit-text-fill-color: transparent !important;
    }

    /* Close button visible on a light panel */
    #app-content .sidebar-close-btn {
        background: rgba(15, 23, 42, 0.06) !important;
        color: #475569 !important;
    }
    #app-content .sidebar-close-btn:active { background: rgba(15, 23, 42, 0.12) !important; }

    /* Menu toggle in the (light) top bar reads dark */
    body:has(#app-content:not([style*="none"])) .portal-menu-btn {
        background: rgba(15, 23, 42, 0.06) !important;
        color: #0f172a !important;
    }

    /* Install CTA keeps its green identity */
    #app-content .sidebar-footer-cta .sidebar-nav-link { color: #047857 !important; }
    #app-content .sidebar-footer-cta .nav-ico i { color: #059669 !important; }
}

/* Immersive room on phones: give guests/room a clean full-width canvas */
@media (max-width: 768px) {
    .pr-tabs { padding: 5px; gap: 5px; }
    .pr-tabs button { padding: 8px 12px; font-size: 0.78rem; }
    .pr-guest-topbar { padding: 0 14px; height: 52px; }
    .pr-guest-title { font-size: 0.58rem; padding: 4px 9px; }
}

/* ============================================================
   V10 — GLASS PORTAL (contractor & designer)
   The landing's glass language moves inside the app: one premium
   backdrop behind everything, frosted chrome, gradient-glass
   cards. Tuned for a WORK tool — stronger veil, no animation,
   tables/forms stay crisp. Portal-scoped via #app-content /
   body:has(); admin and guest pages unaffected except where noted.
   ============================================================ */

/* ---------- Backdrop behind the whole portal ---------- */
body:has(#app-content:not([style*="none"]))::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.90) 0%, rgba(243, 246, 251, 0.86) 50%, rgba(248, 250, 252, 0.90) 100%),
        radial-gradient(1000px 560px at 88% -6%, rgba(56, 189, 248, 0.14), transparent 60%),
        radial-gradient(820px 520px at 4% 96%, rgba(99, 102, 241, 0.12), transparent 60%),
        url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?q=80&w=2000&auto=format&fit=crop') center 30%/cover no-repeat;
    pointer-events: none;
}
/* Guests in a room get the same stage */
body.pr-guest-mode::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(243, 246, 251, 0.9) 100%),
        radial-gradient(900px 500px at 85% -5%, rgba(56, 189, 248, 0.12), transparent 60%),
        url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?q=80&w=2000&auto=format&fit=crop') center 30%/cover no-repeat;
    pointer-events: none;
}
body.pr-guest-mode { background: transparent !important; }

/* ---------- Surfaces open up so the backdrop reads through ---------- */
#app-content .main-content { background: rgba(246, 248, 252, 0.42) !important; }
#app-content .main-container { background: transparent; }

/* ---------- Chrome: frosted sidebar + jeweled glass top bar ---------- */
#app-content .sidebar {
    background: linear-gradient(180deg, rgba(253, 253, 254, 0.78) 0%, rgba(244, 246, 249, 0.72) 100%);
    backdrop-filter: blur(22px) saturate(1.45);
    -webkit-backdrop-filter: blur(22px) saturate(1.45);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.65), 6px 0 26px rgba(15, 23, 42, 0.06);
}
body:has(#app-content:not([style*="none"])) .header {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.07);
}
body:has(#app-content:not([style*="none"])) .header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.5) 30%, rgba(129, 140, 248, 0.5) 70%, transparent 100%);
    pointer-events: none;
}

/* ---------- Cards become gradient glass (the premium read) ---------- */
#app-content .premium-card,
#app-content .job-card,
#app-content .db-action-card,
#app-content .db-kpi,
#app-content .dashboard-card,
#app-content .stat-card,
#app-content .quote-card,
#app-content .estimation-card,
#app-content .notification-item,
#app-content .pr-tabs {
    background: linear-gradient(152deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.68) 50%, rgba(241, 247, 255, 0.74) 100%) !important;
    backdrop-filter: blur(14px) saturate(1.35);
    -webkit-backdrop-filter: blur(14px) saturate(1.35);
    border: 1px solid rgba(255, 255, 255, 0.75) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 6px rgba(15, 23, 42, 0.04),
        0 12px 32px rgba(15, 23, 42, 0.07) !important;
}
#app-content .premium-card:hover,
#app-content .job-card:hover,
#app-content .db-action-card:hover {
    background: linear-gradient(152deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(224, 242, 254, 0.82) 100%) !important;
    border-color: rgba(125, 211, 252, 0.85) !important;
    box-shadow:
        inset 0 1px 0 #ffffff,
        0 0 0 1px rgba(56, 189, 248, 0.22),
        0 18px 44px rgba(37, 99, 235, 0.14) !important;
}

/* Keycap icon tiles pick up the glass light */
#app-content .nav-ico { background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(233, 238, 245, 0.85) 100%); }

/* ---------- Modals: true frosted sheets ---------- */
.modal-content.premium-modal {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.88)) !important;
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 40px 100px rgba(15, 23, 42, 0.28), inset 0 1px 0 #ffffff;
}
.modal-overlay.premium-overlay { background: rgba(8, 12, 22, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- Readability guards: data stays crisp ---------- */
#app-content table { background: rgba(255, 255, 255, 0.92) !important; }
#app-content .premium-input,
#app-content .form-input,
#app-content .form-select,
#app-content .form-textarea { background: rgba(255, 255, 255, 0.94) !important; }
#app-content .pr-guest-topbar,
.pr-guest-topbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

/* Dimensional numerals on KPIs — matches the landing's plaque type */
#app-content .db-kpi b,
#app-content .db-kpi strong,
#app-content .stat-card b {
    filter:
        drop-shadow(0 -0.5px 0 rgba(255, 255, 255, 0.9))
        drop-shadow(0 1px 0 rgba(163, 177, 198, 0.8))
        drop-shadow(0 4px 7px rgba(37, 99, 235, 0.18));
}

/* ---------- Mobile: readable-first glass ---------- */
@media (max-width: 768px) {
    body:has(#app-content:not([style*="none"]))::before {
        background:
            linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(243, 246, 251, 0.92) 100%),
            url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?q=70&w=900&auto=format&fit=crop') center 30%/cover no-repeat;
    }
    #app-content .main-content { background: rgba(246, 248, 252, 0.72) !important; }
    /* the slide-out drawer stays near-opaque for legibility */
    #app-content .sidebar {
        background: linear-gradient(180deg, rgba(252, 252, 253, 0.96) 0%, rgba(244, 246, 249, 0.94) 100%) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    /* gradient glass stays; heavy per-card blur goes */
    #app-content .premium-card,
    #app-content .job-card,
    #app-content .db-action-card,
    #app-content .db-kpi,
    #app-content .pr-tabs {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Accessibility: honor reduced transparency in the portal too */
@media (prefers-reduced-transparency: reduce) {
    body:has(#app-content:not([style*="none"]))::before,
    body.pr-guest-mode::before { background: #f6f8fc; }
    #app-content .sidebar { background: #fbfcfd; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- Discussion search / filter chips ---------- */
.pr-msg-filter {
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
    color: #475569;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s var(--pp-ease);
}
.pr-msg-filter:hover { background: #f1f5f9; }
.pr-msg-filter.active {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ============================================================
   V11 — LIQUID NEO (portal)
   Liquid-glass edges + neumorphic soft-UI inside the app, for
   contractor & designer. Meniscus and chromatic fringes on the
   panes, pillow-soft raised cards, debossed input wells, jelly
   press everywhere you touch. Interaction-only — a work tool
   stays still. Scoped to the portal; admin/guest unaffected.
   ============================================================ */

/* ---------- Liquid meniscus + chromatic edge on the glass cards ---------- */
#app-content .premium-card,
#app-content .job-card,
#app-content .db-action-card,
#app-content .db-kpi,
#app-content .dashboard-card,
#app-content .stat-card,
#app-content .quote-card,
#app-content .estimation-card,
#app-content .pr-tabs {
    box-shadow:
        /* meniscus: lit curve top + liquid rise at the bottom */
        0 1.5px 1px rgba(255, 255, 255, 0.98) inset,
        0 -1.5px 2px rgba(255, 255, 255, 0.6) inset,
        /* chromatic refraction: cyan left, violet right */
        2px 0 6px -3px rgba(34, 211, 238, 0.28) inset,
        -2px 0 6px -3px rgba(167, 139, 250, 0.28) inset,
        /* neumorphic pillow: light from top-left, shade to bottom-right */
        -4px -4px 12px rgba(255, 255, 255, 0.65),
        6px 8px 20px rgba(163, 177, 198, 0.28),
        0 14px 36px rgba(15, 23, 42, 0.06) !important;
    border-radius: 16px;
}
#app-content .premium-card:hover,
#app-content .job-card:hover,
#app-content .db-action-card:hover {
    box-shadow:
        0 1.5px 1px #ffffff inset,
        0 -1.5px 2px rgba(255, 255, 255, 0.7) inset,
        2px 0 6px -3px rgba(34, 211, 238, 0.4) inset,
        -2px 0 6px -3px rgba(167, 139, 250, 0.4) inset,
        -4px -4px 14px rgba(255, 255, 255, 0.75),
        8px 10px 26px rgba(148, 163, 184, 0.32),
        0 0 0 1px rgba(56, 189, 248, 0.22),
        0 20px 48px rgba(37, 99, 235, 0.12) !important;
}

/* ---------- Jelly physics: everything you press yields ---------- */
#app-content .premium-card:active,
#app-content .job-card:active,
#app-content .db-action-card:active,
#app-content .pr-tabs button:active,
#app-content .pr-msg-filter:active {
    transform: scale(0.985);
    transition-duration: .12s;
}
@keyframes ppSquish {
    0% { transform: scale(1); }
    35% { transform: scale(0.96, 0.985); }
    65% { transform: scale(1.015, 0.995); }
    100% { transform: scale(1); }
}
#app-content .btn.btn-primary:active,
#app-content .btn.btn-outline:active {
    animation: ppSquish .34s cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Neumorphic wells: inputs feel pressed INTO the surface ---------- */
#app-content .premium-input,
#app-content .form-input,
#app-content .form-select,
#app-content .form-textarea {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
    box-shadow:
        inset 2.5px 2.5px 6px rgba(163, 177, 198, 0.35),
        inset -2px -2px 5px rgba(255, 255, 255, 0.9) !important;
    transition: box-shadow .3s var(--pp-ease), border-color .3s var(--pp-ease);
}
#app-content .premium-input:focus,
#app-content .form-input:focus,
#app-content .form-select:focus,
#app-content .form-textarea:focus {
    box-shadow:
        inset 2px 2px 5px rgba(163, 177, 198, 0.25),
        inset -1.5px -1.5px 4px rgba(255, 255, 255, 0.9),
        0 0 0 3px rgba(56, 189, 248, 0.18) !important;
}

/* ---------- Buttons: liquid droplets with neumorphic press ---------- */
#app-content .btn.btn-primary {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 -2px 5px rgba(13, 40, 100, 0.35) inset,
        -3px -3px 10px rgba(255, 255, 255, 0.5),
        4px 6px 16px rgba(37, 99, 235, 0.35) !important;
}
#app-content .btn.btn-outline {
    background: linear-gradient(152deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 255, 0.85));
    box-shadow:
        0 1px 0.5px rgba(255, 255, 255, 0.95) inset,
        0 -1px 1.5px rgba(255, 255, 255, 0.55) inset,
        -3px -3px 9px rgba(255, 255, 255, 0.7),
        4px 5px 14px rgba(163, 177, 198, 0.3) !important;
}

/* ---------- Sidebar: keycaps gain the liquid meniscus ---------- */
#app-content .nav-ico {
    box-shadow:
        inset 0 1.5px 0.5px rgba(255, 255, 255, 0.95),
        inset 0 -1.5px 2px rgba(163, 177, 198, 0.35),
        inset 1px 0 3px -1px rgba(34, 211, 238, 0.15),
        inset -1px 0 3px -1px rgba(167, 139, 250, 0.15),
        -2px -2px 6px rgba(255, 255, 255, 0.7),
        3px 4px 9px rgba(163, 177, 198, 0.3);
}
#app-content .sidebar-nav-link.active .nav-ico {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 3px rgba(7, 40, 100, 0.35),
        -2px -2px 7px rgba(255, 255, 255, 0.6),
        4px 5px 12px rgba(37, 99, 235, 0.4);
}
/* room-tab pills and message filters become soft beads */
#app-content .pr-tabs button,
.pr-msg-filter {
    box-shadow:
        0 1px 0.5px rgba(255, 255, 255, 0.9) inset,
        0 -1px 1.5px rgba(255, 255, 255, 0.45) inset,
        -2px -2px 6px rgba(255, 255, 255, 0.55),
        3px 4px 9px rgba(163, 177, 198, 0.22);
}
#app-content .pr-tabs button.active,
.pr-msg-filter.active {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45) inset,
        0 -2px 4px rgba(7, 40, 100, 0.3) inset,
        3px 5px 14px rgba(14, 165, 233, 0.35) !important;
}

/* ---------- Modals: liquid sheets ---------- */
.modal-content.premium-modal {
    box-shadow:
        0 1.5px 1px rgba(255, 255, 255, 0.98) inset,
        0 -1.5px 2.5px rgba(255, 255, 255, 0.6) inset,
        2px 0 8px -4px rgba(34, 211, 238, 0.3) inset,
        -2px 0 8px -4px rgba(167, 139, 250, 0.3) inset,
        0 40px 100px rgba(15, 23, 42, 0.28) !important;
}

/* ---------- Deeper lens through the portal chrome ---------- */
#app-content .sidebar {
    backdrop-filter: blur(24px) saturate(1.6) brightness(1.03);
    -webkit-backdrop-filter: blur(24px) saturate(1.6) brightness(1.03);
}
body:has(#app-content:not([style*="none"])) .header {
    backdrop-filter: blur(22px) saturate(1.6) brightness(1.03);
    -webkit-backdrop-filter: blur(22px) saturate(1.6) brightness(1.03);
    box-shadow:
        0 -1px 1.5px rgba(255, 255, 255, 0.6) inset,
        0 1px 0.5px rgba(255, 255, 255, 0.9) inset,
        0 8px 30px rgba(15, 23, 42, 0.07);
}

/* ---------- Restraint ---------- */
@media (prefers-reduced-motion: reduce) {
    #app-content .btn.btn-primary:active,
    #app-content .btn.btn-outline:active { animation: none; }
}
@media (max-width: 768px) {
    /* phones: keep the soft-UI, lighten the lens; drawer stays near-opaque */
    #app-content .sidebar {
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    #app-content .premium-card,
    #app-content .job-card,
    #app-content .db-action-card,
    #app-content .db-kpi,
    #app-content .pr-tabs {
        box-shadow:
            0 1px 1px rgba(255, 255, 255, 0.95) inset,
            -3px -3px 8px rgba(255, 255, 255, 0.6),
            4px 6px 14px rgba(163, 177, 198, 0.25) !important;
    }
}
@media (prefers-reduced-transparency: reduce) {
    #app-content .sidebar { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ============================================================
   V12 — PERFORMANCE RAIL (portal)
   Same cure inside the app: cards drop live backdrop-blur (their
   near-opaque gradients read identically); true lens stays only
   on sidebar, header and modals. Scroll rides on rails.
   ============================================================ */
#app-content .premium-card,
#app-content .job-card,
#app-content .db-action-card,
#app-content .db-kpi,
#app-content .dashboard-card,
#app-content .stat-card,
#app-content .quote-card,
#app-content .estimation-card,
#app-content .notification-item,
#app-content .pr-tabs {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: linear-gradient(152deg, rgba(255, 255, 255, 0.97) 0%, rgba(252, 254, 255, 0.93) 50%, rgba(243, 248, 255, 0.95) 100%) !important;
}
#app-content .sidebar {
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
body:has(#app-content:not([style*="none"])) .header {
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
