/**
 * DESKTOP FRAMELESS WINDOW STYLES
 * Zoom-Style 3-Zone Layout (Left | Center | Right)
 */

/* ===== HEADER HEIGHT VARIABLE ===== */
:root {
    --header-height: 50px;
}

/* ===== TITLE BAR - MAIN CONTAINER ===== */
#title-bar {
    position: relative !important; /* 👈 No longer fixed — stacks in flex column */
    width: 100%;
    height: var(--header-height);
    flex: 0 0 auto !important; /* 👈 Don't shrink or grow */
    background: #2d2d2d; /* Dark Zoom-style background */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    -webkit-app-region: drag; /* 🔥 CRITICAL: Makes window draggable */
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    box-sizing: border-box;
}

/* ===== LEFT ZONE ===== */
.tb-left {
    display: flex;
    align-items: center;
    gap: 15px;
    -webkit-app-region: no-drag;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.app-logo i {
    font-size: 20px;
    color: var(--color-primary, #0EA5E9);
}

.app-logo .logo-text {
    font-size: 14px;
}

.company-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    -webkit-app-region: no-drag;
}

.company-select:hover {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.company-select:active {
    background: rgba(255, 255, 255, 0.18);
}

.company-select i {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
}

.company-select:hover i {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== HEADER COMPANY DROPDOWN ===== */
.company-select {
    position: relative; /* anchor for dropdown */
}

.header-company-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: #383838;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 4px;
    z-index: 10000;
    -webkit-app-region: no-drag;
}

.header-company-dropdown.open {
    display: flex;
    flex-direction: column;
}

.hcd-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    width: 100%;
}

.hcd-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hcd-option.active {
    background: rgba(52, 152, 219, 0.2);
    color: #ffffff;
}

.hcd-option.active i {
    color: #3498db;
    font-size: 14px;
}

.hcd-name {
    flex: 1;
}

/* ===== CENTER ZONE - PERFECTLY CENTERED NAVIGATION ===== */
.tb-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    -webkit-app-region: no-drag;
}

.tb-center .nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-app-region: no-drag;
    margin: 0 2px;
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.tb-center .nav-item i {
    font-size: 16px;
    opacity: 0.8;
}

.tb-center .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.tb-center .nav-item.active {
    background: rgba(34, 197, 94, 0.08);
    color: #ffffff;
    border-bottom-color: var(--color-primary);
    border-right: none !important;
}

.tb-center .nav-item.active i {
    opacity: 1;
    color: var(--color-primary);
}

/* ===== RIGHT ZONE ===== */
.tb-right {
    display: flex;
    align-items: center;
    gap: 12px;
    -webkit-app-region: no-drag;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-profile .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}

.user-profile .user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile .user-name,
#header-user-name {
    color: var(--color-text-main, #f8fafc);
    font-size: 13px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== USER DROPDOWN MENU ===== */
.user-profile {
    position: relative; /* anchor for dropdown */
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    -webkit-app-region: no-drag;
    overflow: hidden;
}
.user-dropdown.open {
    display: block;
}

/* ── Header (user info) ── */
.ud-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ud-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary, #3498db), #2980b9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.ud-info {
    min-width: 0;
}
.ud-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ud-email {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ud-role {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

/* ── Section (tenant list) ── */
.ud-section {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ud-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, 0.35);
    padding: 4px 8px 6px;
    margin: 0;
}

/* ── Tenant buttons ── */
.ud-tenant-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    position: relative;
}
.ud-tenant-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
.ud-tenant-btn.active {
    background: rgba(var(--color-primary-rgb, 52, 152, 219), 0.15);
}
.ud-tenant-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.ud-tenant-name {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ud-tenant-tag {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    display: none; /* shown on wider dropdowns if needed */
}
.ud-check {
    color: var(--color-primary, #3498db);
    font-size: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Footer (sign out) ── */
.ud-footer {
    padding: 8px;
}
.ud-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(239, 68, 68, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
}
.ud-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ── Brightness Toggle Row ── */
.ud-brightness-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}
.ud-brightness-row:hover {
    background: var(--color-bg-hover, #2a2a2a);
}
.ud-brightness-label {
    font-size: 13px;
    color: var(--color-text-main, #f8fafc);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
}
.ud-brightness-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}
.ud-toggle-track {
    display: inline-flex;
    align-items: center;
    width: 34px;
    height: 18px;
    border-radius: 9px;
    background: var(--color-border, #3A3B3E);
    position: relative;
    transition: background 0.2s;
}
.ud-brightness-toggle.on .ud-toggle-track {
    background: var(--color-primary, #22c55e);
}
.ud-toggle-thumb {
    position: absolute;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}
.ud-brightness-toggle.on .ud-toggle-thumb {
    transform: translateX(16px);
}

/* Window Controls */
.window-controls {
    display: flex;
    gap: 0;
    -webkit-app-region: no-drag;
}

.window-controls .control-btn {
    width: 46px;
    height: 48px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-app-region: no-drag;
}

.window-controls .control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.window-controls .control-btn.close:hover {
    background: #e74c3c;
    color: #ffffff;
}

/* ===== APP SHELL ADJUSTMENTS ===== */
#app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    margin-top: 0 !important; /* 👈 No margin — flex column handles stacking */
}

#app-viewport {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    background: #0f172a;
    padding-bottom: 40px;
}

/* ===== FIX: Main Content Fills Remaining Space ===== */
body.platform-electron #main-content {
    margin-top: 0 !important; /* 👈 No margin — header is in normal flow */
    padding-top: 20px;
    flex: 1 !important; /* 👈 Grow to fill ALL remaining space */
    overflow-y: auto !important;
    background-color: #0f172a !important; /* Dark blue — no footer gap */
    width: 100% !important;
    box-sizing: border-box;
}

body.platform-electron #title-bar {
    height: var(--header-height) !important;
    flex: 0 0 var(--header-height) !important;
}

/* ===== 🚫 NUCLEAR OPTION: FORCE-KILL THE SIDEBAR ===== */
#app-sidebar,
#sidebar,
aside#app-sidebar,
nav.sidebar,
.sidebar-container,
.sidebar-menu,
.alzar-sidebar-header,
.sidebar-footer {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ===== 🔧 FIX GHOST MARGIN: Kill CSS Grid Layout ===== */
#app-shell,
#app-shell.shell-expanded,
#app-shell.shell-collapsed {
    display: flex !important; /* 👈 Flex column instead of grid */
    flex-direction: column !important;
    grid-template-columns: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ===== ↔️ FULL WIDTH CONTENT - NO GHOST MARGIN ===== */
#app-viewport,
#main-content,
.main-wrapper,
main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

/* ===== BODY ADJUSTMENTS ===== */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important; /* 👈 No window scrollbars */
    height: 100vh !important;
    background-color: #0f172a !important; /* 👈 Prevent any red/brown bleed */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== FLEX COLUMN CONTAINER ===== */
body.platform-electron {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
}

/* ===== SCROLLBAR STYLING ===== */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        #app-viewport::-webkit-scrollbar {
            width: 10px;
        }

        #app-viewport::-webkit-scrollbar-track {
            background: #e0e0e0;
        }

        #app-viewport::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 5px;
        }

        #app-viewport::-webkit-scrollbar-thumb:hover {
            background: #555;
        }
    }
}

/* ===== WEB MODE: Hide Desktop-Only Controls ===== */
body:not(.platform-electron) .window-controls {
    display: none !important;
}

/* ===== WEB MODE: Fix Title Bar Visibility ===== */
body:not(.platform-electron) #title-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin-top: 0 !important;
    z-index: 9999 !important;
    -webkit-app-region: none !important; /* No drag region in web mode */
}

/* ===== WEB MODE: Push content below fixed header ===== */
body:not(.platform-electron) #app-viewport {
    margin-top: var(--header-height);
}

/* ===== DESKTOP MODE: Natural flex column layout ===== */
body.platform-electron {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
}

body.platform-electron #app-shell {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.platform-electron #title-bar {
    flex: 0 0 var(--header-height) !important;
}

/* ===== DESKTOP MODE: Show Window Controls ===== */
body.platform-electron .window-controls {
    display: flex !important;
}

/* ===========================
   RESPONSIVE NAVIGATION
   =========================== */

/* Hamburger Menu Button (hidden on desktop) */
.hamburger-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    margin-left: 8px;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.hamburger-menu i {
    font-size: 24px;
}

/* Mobile Navigation Drawer (hidden by default) */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.mobile-nav-drawer.is-active {
    pointer-events: all;
}

/* Dark Overlay */
.mobile-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-drawer.is-active .mobile-nav-overlay {
    opacity: 1;
}

/* Drawer Panel */
.mobile-nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #1a1d23;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-nav-drawer.is-active .mobile-nav-content {
    transform: translateX(0);
}

/* Drawer Header */
.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 60px;
}

.mobile-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-brand .app-logo {
    font-size: 18px;
    font-weight: 700;
    color: #00D9FF;
}

.mobile-nav-title {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mobile-nav-close i {
    font-size: 20px;
}

/* Mobile Nav Links */
.mobile-nav-links {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.mobile-nav-item.active {
    background: rgba(0, 217, 255, 0.15);
    color: #00D9FF;
}

.mobile-nav-item i {
    font-size: 22px;
    flex-shrink: 0;
}

/* ===========================
   RESPONSIVE BREAKPOINTS
   =========================== */

@media (max-width: 1023px) {
    /* Hide desktop navigation */
    .tb-center {
        display: none !important;
    }

    /* Show hamburger menu */
    .hamburger-menu {
        display: flex;
    }

    /* Show mobile drawer */
    .mobile-nav-drawer {
        display: block;
    }

    /* Condense user profile (hide username, icon only) */
    #header-user-name {
        display: none;
    }

    .user-profile {
        padding: 4px;
        min-width: auto;
    }

    .user-profile:hover .user-dropdown {
        left: auto;
        right: 0;
    }

    /* Adjust left zone spacing for mobile */
    .tb-left {
        gap: 8px;
    }

    /* Make company selector more compact */
    .company-select {
        max-width: 140px;
    }

    #header-company-name {
        font-size: 13px;
    }
}

/* ===== NAV ICONS-ONLY MODE (JS-driven auto-collapse) ===== */
#title-bar.nav-icons-only .tb-center .nav-item span {
    display: none;
}

#title-bar.nav-icons-only .tb-center .nav-item {
    padding: 6px 10px;
    gap: 0;
}

#title-bar.nav-icons-only #header-user-name {
    display: none;
}

/* ============================================================
   🔔 UPDATE BELL — header notification widget
   ============================================================ */
#update-bell-wrap {
    display: flex;
    align-items: center;
    position: relative;
}

.update-bell-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--color-text-muted, #94a3b8);
    font-size: 18px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    -webkit-app-region: no-drag;
}
.update-bell-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #f8fafc;
}

/* Shake animation when update available */
.update-bell-btn.ub-animate i {
    animation: bell-shake 1.2s ease infinite;
    transform-origin: top center;
    color: #3b82f6;
}
@keyframes bell-shake {
    0%,100% { transform: rotate(0deg); }
    10%      { transform: rotate(12deg); }
    20%      { transform: rotate(-10deg); }
    30%      { transform: rotate(8deg); }
    40%      { transform: rotate(-6deg); }
    50%      { transform: rotate(0deg); }
}

/* Pulse animation when ready to install */
.update-bell-btn.ub-pulse i {
    animation: none;
    color: #22c55e;
}
.update-bell-btn.ub-pulse {
    animation: bell-pulse 1.8s ease infinite;
}
@keyframes bell-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* Badge */
.update-bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
    color: #fff;
    pointer-events: none;
}
.update-bell-badge.ub-blue  { background: #3b82f6; }
.update-bell-badge.ub-green { background: #22c55e; }

/* Popup panel */
.update-bell-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 9999;
    overflow: hidden;
}
.ubp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f8fafc;
    border-bottom: 1px solid #334155;
}
.ubp-header i { color: #3b82f6; font-size: 16px; }
.ubp-body {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}
.ubp-progress-wrap {
    margin: 0 14px 8px;
    height: 5px;
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    overflow: hidden;
}
.ubp-progress-bar {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.ubp-install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 28px);
    margin: 4px 14px 12px;
    padding: 8px 14px;
    background: #22c55e;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.ubp-install-btn:hover:not(:disabled) { background: #16a34a; }
.ubp-install-btn:disabled { opacity: 0.6; cursor: default; }

/* =============================================================================
   BUG FIX — INPUT FOCUS TRAPPING PREVENTION
   Chromium in frameless desktop windows can silently inherit -webkit-app-region
   from a parent drag zone, making inputs unclickable until the app is restarted.
   These rules enforce interactivity on every form element at all times.
   ============================================================================= */

/* 1. Force all form elements to be interactive — no drag-region inheritance */
input,
textarea,
select,
button,
[contenteditable],
.alzar-input,
.alzar-select,
.form-control,
.form-select {
    -webkit-app-region: no-drag !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
}

/* Buttons should restore default (no text selection needed) */
button,
[role="button"],
.btn,
.btn-icon,
.nav-item {
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-app-region: no-drag !important;
    pointer-events: auto !important;
}

/* 2. Modals and overlays must never become drag proxies */
.alzar-modal,
.modal-backdrop,
.offcanvas-backdrop,
.cfo-popup-overlay,
[class*="modal"],
[class*="overlay"],
[class*="backdrop"] {
    -webkit-app-region: no-drag !important;
}

/* 3. The main content area and all scrollable views are never drag regions */
#main-content,
.view-container,
.view-content,
.app-sidebar,
#app-sidebar {
    -webkit-app-region: no-drag !important;
    pointer-events: auto !important;
}
