/**
 * Kubre OS - ERP Modern Desktop & Mobile UI Framework
 * macOS-Style Floating Dock, App Squircles with Sub-Dock Decks, Glassmorphism, and Command Launchpad
 */

/* ==========================================================================
   1. KUBRE OS DOCK (FLOATING MACOS STYLE WITH OVERFLOW FREEDOM)
   ========================================================================== */
#kubre-os-dock-container {
    position: fixed;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    z-index: 1040;
    padding: 0 16px;
    overflow: visible !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.kubre-os-dock {
    pointer-events: auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 8px 14px 6px 14px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 
                0 0 0 1px rgba(0, 0, 0, 0.25), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    max-width: 98vw;
    overflow: visible !important; /* Allow icons to pop out of the dock! */
}

/* App Item Wrapper */
.kubre-dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none !important;
    outline: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    padding: 2px 4px;
    border-radius: 14px;
    transform-origin: bottom center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover Magnification: Pops freely outside the dock boundary! */
.kubre-dock-item:hover {
    transform: translateY(-14px) scale(1.18);
    z-index: 100;
}

.kubre-dock-item.has-subdock-open {
    transform: translateY(-10px) scale(1.12);
    z-index: 110;
}

.kubre-dock-item:active {
    transform: translateY(-4px) scale(1.04);
}

/* App Squircle Tile */
.kubre-app-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.kubre-dock-item:hover .kubre-app-tile,
.kubre-dock-item.has-subdock-open .kubre-app-tile {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 18px rgba(251, 76, 10, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.45);
}

.kubre-app-tile svg,
.kubre-app-tile i {
    width: 22px;
    height: 22px;
    font-size: 20px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
}

.kubre-dock-item:hover .kubre-app-tile svg,
.kubre-dock-item:hover .kubre-app-tile i {
    transform: scale(1.08);
}

/* App Label Below Tile (Legible & Crisp) */
.kubre-dock-label {
    font-size: 10px;
    font-weight: 600;
    color: #CBD5E1;
    margin-top: 4px;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    letter-spacing: 0.2px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.kubre-dock-item:hover .kubre-dock-label,
.kubre-dock-item.has-subdock-open .kubre-dock-label {
    color: #FFFFFF;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 1), 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Specific App Gradients */
.tile-kubre-logo {
    background: linear-gradient(135deg, #FF6B35 0%, #FB4C0A 50%, #D83600 100%);
    box-shadow: 0 4px 16px rgba(251, 76, 10, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.tile-dashboard {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
}

.tile-sales {
    background: linear-gradient(135deg, #818CF8 0%, #4F46E5 100%);
}

.tile-products {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
}

.tile-purchases {
    background: linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
}

.tile-finance {
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
}

.tile-expenses {
    background: linear-gradient(135deg, #F87171 0%, #DC2626 100%);
}

.tile-contacts {
    background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
}

.tile-consultorio {
    background: linear-gradient(135deg, #2DD4BF 0%, #0D9488 100%);
}

.tile-manufacturing {
    background: linear-gradient(135deg, #94A3B8 0%, #475569 100%);
}

.tile-reports {
    background: linear-gradient(135deg, #C084FC 0%, #7E22CE 100%);
}

.tile-settings {
    background: linear-gradient(135deg, #64748B 0%, #334155 100%);
}

.tile-pos {
    background: linear-gradient(135deg, #FB923C 0%, #EA580C 100%);
}

.tile-superadmin {
    background: linear-gradient(135deg, #E879F9 0%, #A21CAF 100%);
}

/* Active Dot Indicator */
.kubre-dock-item .active-dot {
    width: 4px;
    height: 4px;
    background: #FB4C0A;
    border-radius: 50%;
    margin-top: 2px;
    box-shadow: 0 0 6px #FB4C0A;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: scale(0.5);
}

.kubre-dock-item.is-active .active-dot {
    opacity: 1;
    transform: scale(1);
    background: #FFFFFF;
    box-shadow: 0 0 8px #FFFFFF, 0 0 12px rgba(251, 76, 10, 0.8);
}

/* Dock Divider */
.kubre-dock-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 3px;
    align-self: center;
}

/* ==========================================================================
   2. FLOATING CONTEXTUAL SUB-DOCK (FLYOUT DECK PER MODULE)
   ========================================================================== */
.kubre-subdock-deck {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.95);
    width: 250px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 
                0 0 0 1px rgba(0, 0, 0, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.18);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.22s ease;
    z-index: 1080;
}

/* Bottom Pointer Arrow */
.kubre-subdock-deck::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.94) transparent transparent transparent;
    z-index: 2;
}

/* Invisible Bridge to prevent mouse loss between dock and subdock */
.kubre-subdock-deck::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 1;
}

/* While Sub-Dock is open, LOCK the scale and position so moving cursor doesn't shift links */
.kubre-dock-item.has-subdock-open,
.kubre-dock-item.has-subdock-open:hover {
    transform: translateY(-10px) scale(1.12) !important;
    z-index: 1090 !important;
}

.kubre-dock-item.has-subdock-open .kubre-subdock-deck {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Sub-dock Header */
.kubre-subdock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
}

.kubre-subdock-title {
    font-size: 12px;
    font-weight: 700;
    color: #F8FAFC;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kubre-subdock-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kubre-subdock-mainlink {
    font-size: 11px;
    color: #FB4C0A;
    font-weight: 600;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(251, 76, 10, 0.1);
    transition: all 0.15s ease;
}

.kubre-subdock-mainlink:hover {
    background: #FB4C0A;
    color: #FFFFFF;
}

.kubre-subdock-unpin-btn {
    background: transparent;
    border: none;
    color: #64748B;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kubre-subdock-unpin-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
}

/* Sub-dock Option Links */
.kubre-subdock-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #E2E8F0;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
    background: transparent;
}

.kubre-subdock-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    transform: translateX(3px);
}

.kubre-subdock-link.is-active-sub {
    background: rgba(251, 76, 10, 0.18);
    color: #FF8F6B;
    font-weight: 600;
    border: 1px solid rgba(251, 76, 10, 0.25);
}

.kubre-subdock-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #94A3B8;
    transition: color 0.15s ease;
}

.kubre-subdock-link:hover .kubre-subdock-icon {
    color: #FB4C0A;
}

/* ==========================================================================
   3. KUBRE LAUNCHPAD / COMMAND CENTER (SPOTLIGHT & APP HUB)
   ========================================================================== */
#kubre-launchpad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 29, 0.78);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    z-index: 2000;
    display: none !important;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
    padding: 24px;
}

#kubre-launchpad-overlay.is-open {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.kubre-launchpad-modal {
    width: 100%;
    max-width: 880px;
    max-height: 88vh;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.94) translateY(10px);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#kubre-launchpad-overlay.is-open .kubre-launchpad-modal {
    transform: scale(1) translateY(0);
}

/* Launchpad Header */
.kubre-launchpad-header {
    padding: 20px 28px 16px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.kubre-launchpad-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kubre-search-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.kubre-search-container svg {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: #94A3B8;
    pointer-events: none;
}

.kubre-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px 18px 12px 46px;
    font-size: 15px;
    color: #F8FAFC;
    outline: none;
    transition: all 0.2s ease;
}

.kubre-search-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #FB4C0A;
    box-shadow: 0 0 0 3px rgba(251, 76, 10, 0.25);
}

.kubre-search-input::placeholder {
    color: #64748B;
}

.kubre-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kubre-close-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
}

/* Launchpad Body */
.kubre-launchpad-body {
    padding: 24px 28px;
    overflow-y: auto;
    max-height: calc(88vh - 150px);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Quick Actions Strip */
.kubre-quick-actions-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kubre-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748B;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kubre-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.kubre-quick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #E2E8F0;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.kubre-quick-btn:hover {
    background: rgba(251, 76, 10, 0.12);
    border-color: rgba(251, 76, 10, 0.35);
    color: #FFFFFF;
    transform: translateY(-2px);
}

.kubre-quick-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* Apps Grid */
.kubre-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

.kubre-app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 16px;
    text-decoration: none !important;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: transparent;
}

.kubre-app-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px);
}

.kubre-app-card .kubre-app-tile {
    width: 54px;
    height: 54px;
    border-radius: 14px;
}

.kubre-app-card .kubre-app-tile svg,
.kubre-app-card .kubre-app-tile i {
    width: 26px;
    height: 26px;
    font-size: 24px;
}

.kubre-app-label {
    font-size: 12px;
    font-weight: 600;
    color: #CBD5E1;
    line-height: 1.25;
    transition: color 0.2s ease;
}

.kubre-app-card:hover .kubre-app-label {
    color: #FFFFFF;
}

/* Launchpad Footer */
.kubre-launchpad-footer {
    padding: 14px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    font-size: 12px;
    color: #64748B;
}

.kubre-footer-shortcuts {
    display: flex;
    gap: 14px;
    align-items: center;
}

.kubre-shortcut-badge {
    background: rgba(255, 255, 255, 0.18);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    color: #E2E8F0;
}

.kubre-footer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94A3B8;
}

.kubre-user-avatar-mini {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FB4C0A, #D83600);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   4. LAYOUT RESPONSIVENESS & ADJUSTMENTS
   ========================================================================== */

/* Full Canvas Padding: prevent dock from overlapping buttons at bottom */
@media (min-width: 768px) {
    #scrollable-container {
        padding-bottom: 90px !important;
    }
}

/* Mobile Screens (< 768px): Hide Desktop Dock and rely on upgraded Bottom Nav */
@media (max-width: 767px) {
    #kubre-os-dock-container {
        display: none !important;
    }
    
    .kubre-launchpad-modal {
        max-height: 94vh;
        border-radius: 20px;
    }
    
    .kubre-launchpad-header {
        padding: 16px;
    }
    
    .kubre-launchpad-body {
        padding: 16px;
        gap: 18px;
    }
    
    .kubre-apps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .kubre-quick-actions-grid {
        grid-template-columns: 1fr;
    }

    #scrollable-container {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }
}

/* ==========================================================================
   5. KUBRE OS FLOATING ISLAND SIDEBAR (SMOOTH PUSH)
   ========================================================================== */
#kubre-classic-sidebar.side-bar {
    position: relative !important;
    height: calc(100vh - 28px) !important;
    max-height: calc(100vh - 28px) !important;
    margin: 14px 0 14px 14px !important;
    border-radius: 22px !important;
    background: rgba(11, 15, 29, 0.94) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 1px 0 rgba(0, 0, 0, 0.4),
        0 20px 45px -8px rgba(0, 0, 0, 0.65),
        0 0 25px rgba(99, 102, 241, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 1000 !important;
    flex-shrink: 0 !important;
    transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                min-width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                max-width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                margin 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.32s ease !important;
}

/* Colapsed State: smoothly zeroed, hidden and pushed back */
body.sidebar-collapse #kubre-classic-sidebar.side-bar {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin: 14px 0 14px 0 !important;
    padding: 0 !important;
    border-width: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(-24px) scale(0.98) !important;
    box-shadow: none !important;
}

/* Expanded State: floating island smoothly pushed */
body:not(.sidebar-collapse) #kubre-classic-sidebar.side-bar {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    margin: 14px 0 14px 14px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(0) scale(1) !important;
}

/* Floating Sidebar Internal Elements */
.audaz-sidebar-header {
    height: 60px !important;
    min-height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    background: rgba(7, 10, 20, 0.6) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top-left-radius: 22px !important;
    border-top-right-radius: 22px !important;
}

.audaz-sidebar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
}

.kubre-sidebar-close-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kubre-sidebar-close-btn:hover {
    background: rgba(251, 76, 10, 0.2);
    border-color: #FB4C0A;
    color: #FB4C0A;
    transform: scale(1.08);
}

.kubre-sidebar-menu-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.kubre-sidebar-menu-wrapper::-webkit-scrollbar {
    width: 4px;
}
.kubre-sidebar-menu-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.kubre-sidebar-menu-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.kubre-sidebar-footer {
    height: 42px;
    min-height: 42px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 10, 20, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
    font-size: 11px;
    color: #64748B;
}

.kubre-sidebar-footer .kubre-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    box-shadow: 0 0 8px #10B981;
}

/* Canvas Smooth Push on main */
.thetop > main {
    transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                flex 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@media (max-width: 991px) {
    #kubre-classic-sidebar.side-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: calc(100vh - 28px) !important;
        margin: 14px !important;
        z-index: 1050 !important;
    }
}

/* ==========================================================================
   6. DOCK CUSTOMIZER MODAL & PIN/UNPIN SYSTEM
   ========================================================================== */
#kubre-dock-customizer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 29, 0.8);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    z-index: 2100;
    display: none !important;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
    padding: 20px;
}

#kubre-dock-customizer-modal.is-open {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.kubre-customizer-card {
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#kubre-dock-customizer-modal.is-open .kubre-customizer-card {
    transform: scale(1) translateY(0);
}

.kubre-customizer-header {
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.kubre-customizer-title {
    font-size: 16px;
    font-weight: 800;
    color: #F8FAFC;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.kubre-customizer-subtitle {
    font-size: 12px;
    color: #64748B;
    margin: 2px 0 0 0;
}

.kubre-customizer-body {
    padding: 18px 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kubre-customizer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    transition: all 0.2s ease;
}

.kubre-customizer-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
}

.kubre-customizer-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kubre-customizer-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #F8FAFC;
}

.kubre-customizer-item-desc {
    font-size: 11px;
    color: #64748B;
}

/* iOS / macOS Style Toggle Switch */
.kubre-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
    cursor: pointer;
}

.kubre-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kubre-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.14);
    transition: .25s ease;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.kubre-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.kubre-switch input:checked + .kubre-switch-slider {
    background-color: #FB4C0A;
    border-color: #FB4C0A;
}

.kubre-switch input:checked + .kubre-switch-slider:before {
    transform: translateX(20px);
}

/* Customizer Footer */
.kubre-customizer-footer {
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.kubre-btn-reset-dock {
    background: rgba(255, 255, 255, 0.08);
    color: #94A3B8;
    border: none;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kubre-btn-reset-dock:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.kubre-btn-done-dock {
    background: linear-gradient(135deg, #FB4C0A 0%, #D83600 100%);
    color: #FFFFFF;
    border: none;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(251, 76, 10, 0.35);
    transition: all 0.2s ease;
}

.kubre-btn-done-dock:hover {
    box-shadow: 0 6px 16px rgba(251, 76, 10, 0.5);
    transform: translateY(-1px);
}

/* Pin Badges on Launchpad Apps */
.kubre-app-card {
    position: relative;
}

.kubre-app-pin-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #64748B;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.kubre-app-card:hover .kubre-app-pin-btn {
    opacity: 1;
}

.kubre-app-pin-btn:hover {
    background: rgba(251, 76, 10, 0.25);
    color: #FB4C0A;
    border-color: rgba(251, 76, 10, 0.4);
}

.kubre-dock-item.is-unpinned {
    display: none !important;
}

.kubre-header-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kubre-header-btn:hover {
    background: rgba(251, 76, 10, 0.2);
    color: #FB4C0A;
}

.kubre-footer-link-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #94A3B8;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kubre-footer-link-btn:hover {
    background: rgba(251, 76, 10, 0.2);
    color: #FB4C0A;
}

.kubre-app-pin-btn.is-pinned {
    color: #FB4C0A;
    background: rgba(251, 76, 10, 0.15);
    border-color: rgba(251, 76, 10, 0.3);
    opacity: 0.85;
}

/* Print Cleanliness */
@media print {
    #kubre-os-dock-container,
    #kubre-launchpad-overlay,
    #kubre-dock-customizer-modal,
    #kubre-classic-sidebar {
        display: none !important;
    }
}

/* ==========================================================================
   7. KUBRE OS GLOBAL QUICK CREATE (+ CREAR) BUTTON & POPOVER
   ========================================================================== */
.kubre-quick-create-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.kubre-btn-quick-create {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF5C1F 0%, #FB4C0A 100%);
    color: #FFFFFF !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(251, 76, 10, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.kubre-btn-quick-create:hover {
    transform: translateY(-1.5px) scale(1.02);
    box-shadow: 0 6px 20px rgba(251, 76, 10, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #FFFFFF !important;
}

.kubre-btn-quick-create:active {
    transform: translateY(0) scale(0.98);
}

.kubre-create-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
}

.kubre-create-caret {
    font-size: 10px;
    opacity: 0.8;
    transition: transform 0.25s ease;
}

.kubre-quick-create-wrap.is-open .kubre-create-caret {
    transform: rotate(180deg);
}

/* Quick Create Dropdown Popover */
.kubre-quick-create-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: rgba(14, 20, 36, 0.98) !important;
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 25px rgba(251, 76, 10, 0.1) !important;
    padding: 12px;
    z-index: 10005;
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-8px) scale(0.96);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.kubre-quick-create-dropdown:not(.is-open) {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.kubre-quick-create-dropdown.is-open,
.kubre-quick-create-wrap.is-open .kubre-quick-create-dropdown {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
    animation: kubrePopoverIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes kubrePopoverIn {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kubre-create-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
}

.kubre-create-popover-title {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kubre-create-popover-subtitle {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 2px;
}

.kubre-create-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    background: rgba(251, 76, 10, 0.15);
    color: #FB4C0A;
    border: 1px solid rgba(251, 76, 10, 0.3);
}

.kubre-create-popover-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kubre-popover-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    text-decoration: none !important;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.kubre-popover-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.kubre-popover-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: transform 0.2s ease;
}

.kubre-popover-item:hover .kubre-popover-icon {
    transform: scale(1.1);
}

.kubre-popover-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.kubre-popover-name {
    font-size: 13px;
    font-weight: 600;
    color: #F1F5F9;
    line-height: 1.3;
}

.kubre-popover-desc {
    font-size: 11px;
    color: #94A3B8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kubre-popover-arrow {
    font-size: 11px;
    color: #64748B;
    opacity: 0;
    transition: all 0.2s ease;
    transform: translateX(-4px);
}

.kubre-popover-item:hover .kubre-popover-arrow {
    opacity: 1;
    color: #F8FAFC;
    transform: translateX(0);
}

/* Quick Create Tile in Dock */
.tile-quick-create {
    background: linear-gradient(135deg, #FF6A38 0%, #FB4C0A 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(251, 76, 10, 0.45) !important;
}

.tile-quick-create svg {
    color: #FFFFFF !important;
}

/* ==========================================================================
   7. KUBRE OS - TRANSPARENT TOPBAR (SEAMLESS CANVAS INTEGRATION)
   ========================================================================== */
.audaz-topbar {
    background: transparent !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    box-shadow: none !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

/* Icon Buttons in Transparent Topbar */
.audaz-topbar .audaz-top-btn {
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #1E293B !important;
}

.audaz-topbar .audaz-top-btn:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #0F172A !important;
    border-color: rgba(15, 23, 42, 0.18) !important;
}

.audaz-topbar .audaz-top-btn-badge {
    border-color: #F8FAFC !important;
}

/* Global Search Input in Transparent Topbar */
.audaz-topbar .audaz-global-search-input {
    background: #FFFFFF !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: #0F172A !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.audaz-topbar .audaz-global-search-input::placeholder {
    color: #94A3B8 !important;
}

.audaz-topbar .audaz-global-search-input:focus {
    background: #FFFFFF !important;
    border-color: var(--audaz-primary) !important;
    box-shadow: 0 0 0 3px rgba(251, 76, 10, 0.18) !important;
}

.audaz-topbar .audaz-global-search-icon {
    color: #64748B !important;
}

.audaz-topbar .audaz-search-kbd {
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #64748B !important;
}

/* User Profile in Transparent Topbar */
.audaz-topbar .audaz-user-profile-btn {
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #0F172A !important;
}

.audaz-topbar .audaz-user-profile-btn:hover {
    background: rgba(15, 23, 42, 0.09) !important;
    border-color: rgba(15, 23, 42, 0.18) !important;
}

.audaz-topbar .audaz-user-name {
    color: #0F172A !important;
}

.audaz-topbar .audaz-user-role {
    color: #64748B !important;
}

/* Live clock widget */
.audaz-topbar .tw-bg-white\/5 {
    background: rgba(15, 23, 42, 0.05) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: #334155 !important;
}

/* Notification Button in Transparent Topbar */
.audaz-topbar .notifications-menu a.load_notifications {
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #1E293B !important;
}

.audaz-topbar .notifications-menu a.load_notifications:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #0F172A !important;
}

/* Close button inside Quick Create Popover Header */
.kubre-popover-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94A3B8;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    padding: 0;
}

.kubre-popover-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}

/* Quick Create Mobile Responsive Viewport Protection */
@media (max-width: 768px) {
    .audaz-topbar {
        background: transparent !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
        padding: 0 12px !important;
        box-shadow: none !important;
    }

    .kubre-quick-create-dropdown.is-open,
    .kubre-quick-create-wrap.is-open .kubre-quick-create-dropdown {
        position: fixed !important;
        top: 62px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(85vh - 70px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 20px !important;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 9999px rgba(0, 0, 0, 0.5) !important;
        z-index: 999999 !important;
    }
}

