/* Dark Mode Futuristic Simple Theme */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-hover: #252b3d;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    --border-color: #2d3748;
    --border-glow: rgba(0, 212, 255, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.1);
}

* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
}

/* Bottom Navigation Bar (Floating) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 1030;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    /* Safe area for mobile devices */
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 60px;
    font-size: 0.75rem;
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.75rem;
    transition: all 0.3s ease;
}

.bottom-nav-item span {
    display: none;
}

.bottom-nav-item:hover {
    color: var(--accent-primary);
    background-color: var(--bg-hover);
    transform: translateY(-2px);
}

.bottom-nav-item:hover i {
    transform: scale(1.1);
    text-shadow: 0 0 10px var(--border-glow);
}

.bottom-nav-item.active {
    color: var(--accent-primary);
    background-color: rgba(0, 212, 255, 0.15);
}

.bottom-nav-item.active i {
    text-shadow: 0 0 15px var(--border-glow);
    transform: scale(1.1);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    border-radius: 0 0 3px 3px;
}

/* Floating Payment Summary (Above Bottom Nav) */
.floating-payment-summary {
    position: fixed;
    bottom: 100px !important; /* Above bottom nav (60px height + 20px gap) */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    width: calc(100% - 2rem);
    max-width: 500px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #00b8e6 100%);
    border: 2px solid var(--border-glow);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4), 0 0 20px rgba(0, 212, 255, 0.3);
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.payment-summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    gap: 1rem;
}

.payment-summary-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.payment-summary-label i {
    font-size: 1.2rem;
}

.payment-summary-amount {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .floating-payment-summary {
        width: calc(100% - 1rem);
        bottom: 75px;
        padding: 0.875rem 1.25rem;
    }
    
    .payment-summary-label {
        font-size: 0.85rem;
    }
    
    .payment-summary-amount {
        font-size: 1.3rem;
    }
}

/* Submenu Modal Styles */
.submenu-modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.submenu-modal-header {
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
}

.submenu-modal-header .modal-title {
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submenu-modal-header .modal-title i {
    color: var(--accent-primary);
}

.submenu-modal-body {
    padding: 0.5rem;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.submenu-item:last-child {
    margin-bottom: 0;
}

.submenu-item i:first-child {
    font-size: 1.25rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
    color: var(--accent-primary);
}

.submenu-item span {
    flex: 1;
    font-weight: 500;
}

.submenu-item i:last-child {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.submenu-item:hover {
    background-color: var(--bg-hover);
    color: var(--accent-primary);
    border-color: var(--border-color);
    transform: translateX(5px);
}

.submenu-item.active {
    background-color: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.submenu-item.active i:last-child {
    color: var(--accent-primary);
}

/* Top Bar */
.topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0;
    width: 100%;
}

.topbar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-title i {
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--border-glow);
}

.topbar-search {
    flex: 1;
    max-width: 500px;
    margin: 0 1rem;
}

.topbar-search .input-group-text {
    border-right: none;
}

.topbar-search .form-control {
    border-left: none;
}

.topbar-search .form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--border-glow);
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .topbar-title {
        font-size: 1rem;
    }
    
    .topbar-search {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
}

/* Global Loading Overlay */
#global_loading_overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999999 !important; /* Highest z-index to appear above all elements including modals */
    backdrop-filter: blur(5px) !important;
    pointer-events: none; /* Allow clicks to pass through when hidden */
}

#global_loading_overlay[style*="display: flex"],
#global_loading_overlay[style*="display:flex"] {
    pointer-events: auto !important; /* Block clicks when visible */
}

.loading-overlay-content {
    text-align: center;
    color: #fff;
    z-index: 99999999 !important;
}

.loading-overlay-content .spinner-border {
    z-index: 99999999 !important;
}

.loading-overlay-content p {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #fff;
}

/* Fullscreen Modal System */
.fullscreen-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--bg-primary) !important;
    /* z-index will be set dynamically by fullscreen-modal.js based on stack position */
    /* Base z-index for first modal, subsequent modals get +10 for each level */
    z-index: 99999;
    overflow-y: auto !important;
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease;
    width: 100% !important;
    height: 100% !important;
}

/* Ensure z-index can be overridden by JavaScript */
.fullscreen-modal.fullscreen-modal-active {
    /* z-index is managed dynamically by fullscreen-modal.js */
}

.fullscreen-modal.fullscreen-modal-active {
    display: block !important;
    opacity: 1 !important;
}

/* Modal untuk tambah peruntukkan harus di atas modal tambah cashout */
#addCashoutItemModal {
    z-index: 100000 !important;
}

#addCashoutItemModal.fullscreen-modal-active {
    z-index: 100000 !important;
}

.fullscreen-modal-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.fullscreen-modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fullscreen-modal-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.fullscreen-modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Ensure Bootstrap modals are above loading overlay */
.modal {
    z-index: 1055 !important;
    pointer-events: auto !important;
}

.modal.show {
    display: block !important;
    pointer-events: auto !important;
}

.modal-content {
    pointer-events: auto !important;
}

.modal-backdrop {
    z-index: 1054 !important;
    pointer-events: auto !important;
}

.modal-backdrop.show {
    pointer-events: auto !important;
}

/* Settings Form Popup - Slide-up style (70% height) */
.fullscreen-modal[id$="FormModal"],
.fullscreen-modal[id$="ActionModal"],
.fullscreen-modal[id="categoryModal"],
.fullscreen-modal[id="addCashoutModal"],
.fullscreen-modal[id="addCashoutItemModal"],
.fullscreen-modal[id="invoiceDetailModal"],
.fullscreen-modal[id="invoiceFormModal"],
.fullscreen-modal[id="itemSaleInvoiceModal"],
.fullscreen-modal[id="customerDetailFullscreen"],
.fullscreen-modal[id="loginModal"],
.fullscreen-modal[id="updateInfoModal"] {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px);
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 100px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
    z-index: 99999 !important;
}

.fullscreen-modal[id$="FormModal"].fullscreen-modal-active,
.fullscreen-modal[id$="ActionModal"].fullscreen-modal-active,
.fullscreen-modal[id="categoryModal"].fullscreen-modal-active,
.fullscreen-modal[id="addCashoutModal"].fullscreen-modal-active,
.fullscreen-modal[id="addCashoutItemModal"].fullscreen-modal-active,
.fullscreen-modal[id="invoiceDetailModal"].fullscreen-modal-active,
.fullscreen-modal[id="invoiceFormModal"].fullscreen-modal-active,
.fullscreen-modal[id="itemSaleInvoiceModal"].fullscreen-modal-active,
.fullscreen-modal[id="customerDetailFullscreen"].fullscreen-modal-active,
.fullscreen-modal[id="loginModal"].fullscreen-modal-active,
.fullscreen-modal[id="updateInfoModal"].fullscreen-modal-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.fullscreen-modal[id$="FormModal"] .fullscreen-modal-content,
.fullscreen-modal[id$="ActionModal"] .fullscreen-modal-content,
.fullscreen-modal[id="categoryModal"] .fullscreen-modal-content,
.fullscreen-modal[id="addCashoutModal"] .fullscreen-modal-content,
.fullscreen-modal[id="addCashoutItemModal"] .fullscreen-modal-content,
.fullscreen-modal[id="invoiceDetailModal"] .fullscreen-modal-content,
.fullscreen-modal[id="invoiceFormModal"] .fullscreen-modal-content,
.fullscreen-modal[id="itemSaleInvoiceModal"] .fullscreen-modal-content,
.fullscreen-modal[id="customerDetailFullscreen"] .fullscreen-modal-content,
.fullscreen-modal[id="loginModal"] .fullscreen-modal-content,
.fullscreen-modal[id="updateInfoModal"] .fullscreen-modal-content {
    background: var(--bg-card) !important;
    border-radius: 20px 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 80vh !important;
    max-height: 80vh !important;
    transform: translateY(calc(100% + 120px)) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 1 !important;
}

.fullscreen-modal[id$="FormModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id$="ActionModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="categoryModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="addCashoutModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="addCashoutItemModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="invoiceDetailModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="invoiceFormModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="itemSaleInvoiceModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="customerDetailFullscreen"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="loginModal"].fullscreen-modal-active .fullscreen-modal-content,
.fullscreen-modal[id="updateInfoModal"].fullscreen-modal-active .fullscreen-modal-content {
    transform: translateY(0) !important;
}

.fullscreen-modal[id$="FormModal"] .fullscreen-modal-header,
.fullscreen-modal[id$="ActionModal"] .fullscreen-modal-header,
.fullscreen-modal[id="categoryModal"] .fullscreen-modal-header,
.fullscreen-modal[id="addCashoutModal"] .fullscreen-modal-header,
.fullscreen-modal[id="addCashoutItemModal"] .fullscreen-modal-header,
.fullscreen-modal[id="invoiceDetailModal"] .fullscreen-modal-header,
.fullscreen-modal[id="invoiceFormModal"] .fullscreen-modal-header,
.fullscreen-modal[id="itemSaleInvoiceModal"] .fullscreen-modal-header,
.fullscreen-modal[id="customerDetailFullscreen"] .fullscreen-modal-header,
.fullscreen-modal[id="loginModal"] .fullscreen-modal-header,
.fullscreen-modal[id="updateInfoModal"] .fullscreen-modal-header {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    flex-shrink: 0 !important;
}

.fullscreen-modal[id$="FormModal"] .fullscreen-modal-body,
.fullscreen-modal[id$="ActionModal"] .fullscreen-modal-body,
.fullscreen-modal[id="categoryModal"] .fullscreen-modal-body,
.fullscreen-modal[id="addCashoutModal"] .fullscreen-modal-body,
.fullscreen-modal[id="addCashoutItemModal"] .fullscreen-modal-body,
.fullscreen-modal[id="invoiceDetailModal"] .fullscreen-modal-body,
.fullscreen-modal[id="invoiceFormModal"] .fullscreen-modal-body,
.fullscreen-modal[id="itemSaleInvoiceModal"] .fullscreen-modal-body,
.fullscreen-modal[id="customerDetailFullscreen"] .fullscreen-modal-body,
.fullscreen-modal[id="loginModal"] .fullscreen-modal-body,
.fullscreen-modal[id="updateInfoModal"] .fullscreen-modal-body {
    padding: 1.5rem !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Voice Command Modal - Override padding for wizard */
.fullscreen-modal[id="voiceCommandModal"] .fullscreen-modal-body {
    padding: 0 !important;
    overflow: hidden !important;
    flex: 1 !important;
    height: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Enable scrolling when completion slide is active */
.fullscreen-modal[id="voiceCommandModal"] .fullscreen-modal-body:has(#wizard_slide_complete.active) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.fullscreen-modal[id="invoiceDetailModal"] .fullscreen-modal-footer,
.fullscreen-modal[id="loginModal"] .fullscreen-modal-footer,
.fullscreen-modal[id="updateInfoModal"] .fullscreen-modal-footer {
    padding: 1rem 1.25rem !important;
    border-top: 1px solid var(--border-color) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    gap: 0.5rem !important;
    justify-content: flex-end !important;
}

/* Submenu modal specific - Slide-up style */
/* Backdrop dark transparent */
.fullscreen-modal[id^="submenu"] {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px);
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 100px !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
    z-index: 99999 !important;
}

.fullscreen-modal[id^="submenu"].fullscreen-modal-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Submenu content - slide up from bottom */
.fullscreen-modal[id^="submenu"] .fullscreen-modal-content {
    background: var(--bg-card) !important;
    border-radius: 20px 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    max-height: calc(80vh - 120px) !important;
    transform: translateY(calc(100% + 120px)) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 1 !important;
    margin-bottom: 0 !important;
}

.fullscreen-modal[id^="submenu"].fullscreen-modal-active .fullscreen-modal-content {
    transform: translateY(0) !important;
}

/* Submenu header - compact */
.fullscreen-modal[id^="submenu"] .fullscreen-modal-header {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    flex-shrink: 0 !important;
}

/* Submenu body - auto height based on items */
.fullscreen-modal[id^="submenu"] .fullscreen-modal-body {
    padding: 0.5rem 0 !important;
    overflow-y: auto !important;
    flex: 0 1 auto !important;
    max-height: calc(80vh - 80px) !important;
}

.submenu-modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 1056 !important;
}

.submenu-modal-body {
    pointer-events: auto !important;
}

.submenu-item {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 1057 !important;
    user-select: none;
    -webkit-user-select: none;
    display: flex !important;
    align-items: center !important;
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    transition: background-color 0.2s ease !important;
    text-decoration: none !important;
    color: var(--text-primary) !important;
    gap: 0.75rem !important;
}

.submenu-item:last-child {
    border-bottom: none !important;
}

.submenu-item i:first-child {
    font-size: 1.25rem !important;
    width: 24px !important;
    text-align: center !important;
}

.submenu-item span {
    flex: 1 !important;
    font-size: 1rem !important;
}

.submenu-item i:last-child {
    font-size: 0.875rem !important;
    opacity: 0.5 !important;
}

.submenu-item:hover {
    background-color: var(--bg-hover) !important;
}

.submenu-item:active {
    background-color: var(--bg-hover) !important;
}

.submenu-item.active {
    background-color: rgba(0, 212, 255, 0.1) !important;
    color: var(--accent-primary) !important;
}

/* Prevent backdrop from blocking modal content */
.modal-backdrop + .modal {
    pointer-events: none;
}

.modal-backdrop + .modal .modal-content {
    pointer-events: auto;
}

/* Photo Source Modal - High z-index to appear above all other elements including fullscreen modals */
/* photoSourceModal (from camera.js) is still Bootstrap modal, needs high z-index */
/* itemPhotoSourceModal (from invoice_process.js) is now fullscreen modal, uses fullscreen modal system */
#photoSourceModal {
    z-index: 200000 !important;
}

#photoSourceModal.show {
    z-index: 200000 !important;
    display: block !important;
}

/* Ensure photo source modal backdrop appears correctly - will be set via JavaScript */

.loading-overlay-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-overlay-content .spinner-border {
    border-width: 4px;
    animation: spinner-border 0.75s linear infinite;
}

.loading-overlay-content p {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--accent-primary);
    font-weight: 500;
}

/* Ensure loading overlay is always on top of all modals */
#global_loading_overlay {
    z-index: 99999999 !important;
}

/* Body padding for bottom nav */
body {
    padding-top: 0; /* Topbar is sticky, no padding needed */
    padding-bottom: 80px; /* Space for bottom navigation */
    margin: 0;
}

/* Desktop Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default, shown on desktop */
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-header .logo i {
    font-size: 1.5rem;
    text-shadow: 0 0 10px var(--border-glow);
    flex-shrink: 0;
}

.sidebar-header .logo-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background-color: var(--bg-hover);
    color: var(--accent-primary);
}

.sidebar-menu {
    padding: 1rem 0.5rem;
}

.sidebar-menu-item {
    margin-bottom: 0.5rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    gap: 0.75rem;
}

.sidebar-menu-link:hover {
    background-color: var(--bg-hover);
    color: var(--accent-primary);
    transform: translateX(3px);
}

.sidebar-menu-link.active {
    background-color: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.sidebar-menu-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu-link span {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-menu-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-menu-link .chevron {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar-menu-link.expanded .chevron {
    transform: rotate(90deg);
}

.sidebar.collapsed .sidebar-menu-link .chevron {
    display: none;
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.5rem;
    margin-top: 0.25rem;
}

.sidebar-submenu.expanded {
    max-height: 1000px;
}

.sidebar-submenu-item {
    display: block;
    padding: 0.75rem 1rem 0.75rem 3rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.sidebar-submenu-item:hover {
    background-color: var(--bg-hover);
    color: var(--accent-primary);
    transform: translateX(3px);
}

.sidebar-submenu-item.active {
    background-color: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    border-left: 2px solid var(--accent-primary);
}

.sidebar-submenu-item i {
    font-size: 1rem;
    margin-right: 0.75rem;
    width: 18px;
    text-align: center;
}

.sidebar.collapsed .sidebar-submenu {
    display: none;
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.sidebar-footer-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    gap: 0.75rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-footer-item:hover {
    background-color: var(--bg-hover);
    color: var(--accent-danger);
}

.sidebar-footer-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer-item span {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-footer-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Main content wrapper for sidebar */
.main-content-wrapper {
    transition: margin-left 0.3s ease;
}

.main-content-wrapper.with-sidebar {
    margin-left: 280px;
}

.main-content-wrapper.with-sidebar.collapsed {
    margin-left: 70px;
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .sidebar {
        display: block !important;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .main-content-wrapper {
        margin-left: 280px;
    }
    
    .main-content-wrapper.collapsed {
        margin-left: 70px;
    }
}

/* Mobile: Hide sidebar, show bottom nav */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
    
    .main-content-wrapper {
        margin-left: 0 !important;
    }
    
    .bottom-nav {
        display: flex !important;
    }
    
    body {
        padding-bottom: 80px;
    }
}

/* Navbar Dark Mode (Legacy - keep for compatibility) */
.navbar {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-glow);
    display: none; /* Hide old navbar */
}

.navbar-light {
    background-color: var(--bg-card) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent-primary) !important;
    text-shadow: 0 0 10px var(--border-glow);
}

.nav-link {
    color: var(--text-secondary) !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-primary) !important;
    text-shadow: 0 0 8px var(--border-glow);
}

.nav-link.active {
    color: var(--accent-primary) !important;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-primary);
    text-shadow: 0 0 8px var(--border-glow);
}

.nav-link-outline {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.nav-link-outline:hover {
    border-color: var(--accent-primary);
    background-color: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.nav-link-outline.active {
    border-color: var(--accent-primary);
    background-color: rgba(0, 212, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.navbar-toggler {
    border-color: var(--border-color);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28229, 231, 235, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 30px var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%) !important;
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    color: var(--text-primary) !important;
}

.card-body {
    color: var(--text-primary);
}

/* Bootstrap Color Overrides */
.bg-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0099cc 100%) !important;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 15px var(--border-glow);
}

.bg-success {
    background: linear-gradient(135deg, var(--accent-success) 0%, #059669 100%) !important;
    border: 1px solid var(--accent-success);
}

.bg-warning {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #d97706 100%) !important;
    border: 1px solid var(--accent-warning);
    color: #fff !important;
}

.bg-info {
    background: linear-gradient(135deg, var(--accent-info) 0%, #0891b2 100%) !important;
    border: 1px solid var(--accent-info);
}

.text-white {
    color: var(--text-primary) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0099cc 100%);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 15px var(--border-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00b8e6 0%, var(--accent-primary) 100%);
    box-shadow: 0 0 25px var(--border-glow);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success) 0%, #059669 100%);
    border-color: var(--accent-success);
}

.btn-success:hover {
    background: linear-gradient(135deg, #34d399 0%, var(--accent-success) 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-outline-primary {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 20px var(--border-glow);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline-success {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.btn-outline-success:hover {
    background-color: var(--accent-success);
    color: #fff;
}

.btn-secondary {
    background-color: var(--bg-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #d97706 100%);
    border-color: var(--accent-warning);
    color: #fff;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, var(--accent-warning) 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-info) 0%, #0891b2 100%);
    border-color: var(--accent-info);
    color: #fff;
}

.btn-info:hover {
    background: linear-gradient(135deg, #22d3ee 0%, var(--accent-info) 100%);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    transform: translateY(-2px);
}

.btn.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 15px var(--border-glow);
}

/* Forms */
.form-control, .form-select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem var(--border-glow);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-control:disabled,
.form-select:disabled,
.form-control[disabled],
.form-select[disabled],
input:disabled,
select:disabled,
textarea:disabled,
input[disabled],
select[disabled],
textarea[disabled] {
    background-color: #ffffff !important;
    color: #000000 !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none !important;
    font-weight: 600 !important;
    border: 1px solid #ced4da !important;
    -webkit-text-fill-color: #000000 !important;
    text-fill-color: #000000 !important;
}

/* Specific override for invoice number and other disabled inputs in dark theme */
#invoice_number:disabled,
#invoice_number[disabled],
input.form-control:disabled,
input.form-control[disabled] {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    text-fill-color: #000000 !important;
    font-weight: 600 !important;
    border: 1px solid #ced4da !important;
}

.form-control[readonly],
.form-select[readonly],
input[readonly],
select[readonly],
textarea[readonly] {
    background-color: #e9ecef !important;
    color: #495057 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none !important;
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Tables */
.table {
    color: var(--text-primary);
}

.table th {
    background-color: var(--bg-hover);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.table td {
    border-color: var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-hover);
    transition: background-color 0.2s ease;
}

.table-responsive {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Camera Container */
.camera-container {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 15px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    transition: all 0.3s ease;
}

.camera-container:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--shadow-glow);
}

#video {
    background-color: #000;
    border-radius: 8px;
}

#photo_preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Invoice Items */
.invoice-item-card {
    border-left: 4px solid var(--accent-primary);
    margin-bottom: 10px;
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.invoice-item-card .item-image {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-DITERIMA {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.status-DIPROSES {
    background: linear-gradient(135deg, var(--accent-info) 0%, #0891b2 100%);
    color: #fff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.status-SELESAI {
    background: linear-gradient(135deg, var(--accent-success) 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.status-DIAMBIL {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #fff;
    box-shadow: 0 0 10px rgba(107, 114, 128, 0.3);
}

/* Customer Search */
.customer-search-item {
    cursor: pointer;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 5px;
    background-color: var(--bg-card);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.customer-search-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--shadow-glow);
    transform: translateX(5px);
}

/* Alerts */
.alert {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

.alert-info {
    background-color: #06b6d4;
    border-color: #06b6d4;
    color: #ffffff;
}

.alert-success {
    background-color: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.alert-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

.alert-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

/* Alert close button - ensure visibility on colored backgrounds */
.alert .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* Modal */
.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-title {
    color: var(--text-primary);
}

.btn-close {
    filter: invert(1);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

h2 {
    font-weight: 700;
}

/* Text Colors */
.text-success {
    color: var(--accent-success) !important;
}

.text-danger {
    color: var(--accent-danger) !important;
}

.text-warning {
    color: var(--accent-warning) !important;
}

.text-info {
    color: var(--accent-info) !important;
}

.text-primary {
    color: var(--accent-primary) !important;
}

/* Shadows */
.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

/* Border */
.border-bottom {
    border-bottom-color: var(--border-color) !important;
}

/* Mobile-First Modern App Layout */
.container-fluid {
    padding: 1rem;
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 0.75rem;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 16px;
    }
    
    /* Hide tables on mobile, show cards instead */
    .table-responsive {
        display: none;
    }
    
    .mobile-card-view {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .mobile-card-view {
        display: none;
    }
    
    .table-responsive {
        display: block;
    }
}

/* Mobile Card Layout */
.mobile-card-view {
    display: none;
}

.mobile-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mobile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.2);
    border-color: var(--accent-primary);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.mobile-card-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.mobile-card-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: right;
    font-weight: 500;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.mobile-card-actions .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem;
}

/* Modern Mobile App Styling */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Card Grid for Mobile */
.mobile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 576px) {
    .mobile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .mobile-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Modern Input Styling for Mobile */
.form-control, .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem 1rem;
    border-radius: 12px;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px; /* iOS touch target */
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    min-height: 36px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Safe area for mobile */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Input Groups */
.input-group-text {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Dropdown */
.dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--accent-primary);
}

.dropdown-item.active {
    background-color: var(--accent-primary);
    color: #fff;
}

/* List Groups */
.list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.list-group-item:hover {
    background-color: var(--bg-hover);
}

/* Badges */
.badge {
    background-color: var(--accent-primary);
    color: #fff;
}

/* Links */
a {
    color: var(--accent-primary);
    text-decoration: none;
}

a:hover {
    color: #00b8e6;
    text-shadow: 0 0 8px var(--border-glow);
}

/* HR */
hr {
    border-color: var(--border-color);
    opacity: 0.5;
}

/* Fullscreen Camera Modal */
.camera-modal-content {
    background-color: #000 !important;
    border: none !important;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.camera-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn-close-camera {
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    padding: 0;
    transition: all 0.3s ease;
}

.btn-close-camera:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: scale(1.1);
}

.camera-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(1); /* Normal orientation */
}

.camera-video.flipped {
    transform: scaleX(-1); /* Mirror for front camera */
}

.camera-modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.btn-camera-capture {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #fff;
    border: 4px solid rgba(255, 255, 255, 0.5);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    position: relative;
}

.btn-camera-capture::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.btn-camera-capture i {
    position: relative;
    z-index: 1;
    color: #000;
    font-size: 0.8rem;
}

.btn-camera-capture:active {
    transform: scale(0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.btn-camera-capture:active::before {
    background-color: rgba(255, 255, 255, 0.8);
}

.btn-camera-flip {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-camera-flip:hover {
    background-color: rgba(255, 255, 255, 0.5);
    border-color: #fff;
    transform: scale(1.1);
}

.btn-camera-flip:active {
    transform: scale(0.95);
}

.photo-preview-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.photo-preview-img {
    border: 2px solid var(--border-color);
}

/* Code */
code {
    background-color: var(--bg-secondary);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Pre */
pre {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--accent-primary);
    background-color: var(--bg-secondary);
    padding: 10px 15px;
    border-radius: 4px;
}

/* Settings List Item (Clickable) */
.settings-list-container {
    padding: 0;
    margin: 0;
}

.settings-list-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-list-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.15);
}

.settings-list-item:active {
    transform: translateX(2px);
    opacity: 0.9;
}

.settings-list-item-content {
    flex: 1;
    min-width: 0;
}

.settings-list-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.settings-list-item-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.settings-list-item-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.settings-list-item-meta-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.settings-list-item-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.settings-list-item-arrow {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-left: 1rem;
    transition: all 0.3s ease;
}

.settings-list-item:hover .settings-list-item-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

.settings-list-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

/* Update Info Modal Styles */
.update-features-list {
    max-height: calc(70vh - 200px);
    overflow-y: auto;
}

.update-feature-item {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.update-feature-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.update-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.update-feature-category {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 2rem;
}

.update-feature-category h6 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-list-loading {
    text-align: center;
    padding: 2rem;
}

/* Voice Wizard Styles */
.voice-wizard-body {
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Enable scrolling when completion slide is shown */
.fullscreen-modal[id="voiceCommandModal"] .voice-wizard-body:has(#wizard_slide_complete.active) {
    overflow-y: auto;
    overflow-x: hidden;
}

.voice-wizard-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 120px);
    overflow: hidden;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Allow scrolling when completion slide is active */
.voice-wizard-container:has(#wizard_slide_complete.active) {
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    justify-content: flex-start;
}

.voice-wizard-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}

.voice-wizard-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 10;
}

/* Completion slide should allow scrolling */
#wizard_slide_complete.active {
    position: relative;
    height: auto;
    min-height: 100%;
    align-items: flex-start;
    overflow-y: visible;
}

.voice-wizard-slide.slide-out {
    transform: translateX(-100%);
    opacity: 0;
}

.voice-wizard-content {
    text-align: center;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
}

.voice-wizard-label {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.voice-wizard-value {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    word-break: break-word;
    line-height: 1.2;
}

.voice-wizard-value.success {
    color: var(--accent-success);
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
    animation: value-appear 0.5s ease-out;
}

.voice-wizard-value.listening {
    color: var(--accent-danger);
    animation: pulse-listening 1.5s ease-in-out infinite;
}

.voice-wizard-status {
    font-size: 1.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.voice-wizard-status i {
    color: var(--accent-danger);
    animation: pulse-mic 1s ease-in-out infinite;
}

.voice-wizard-status.success i {
    color: var(--accent-success);
    animation: none;
}

@keyframes value-appear {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse-listening {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes pulse-mic {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Voice Wizard Completion Summary */
.voice-complete-summary {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100%;
}

.voice-complete-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.voice-complete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.voice-complete-item:last-child {
    border-bottom: none;
}

.voice-complete-item:hover {
    background-color: var(--bg-hover);
}

.voice-complete-item-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 0 0 180px;
}

.voice-complete-item-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-align: right;
    flex: 1;
    word-break: break-word;
}

@media (max-width: 768px) {
    .voice-wizard-label {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .voice-wizard-value {
        font-size: 2.5rem;
        min-height: 80px;
    }
    
    .voice-wizard-status {
        font-size: 1.2rem;
    }
    
    .voice-complete-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem;
    }
    
    .voice-complete-item-label {
        flex: none;
        font-size: 0.9rem;
    }
    
    .voice-complete-item-value {
        text-align: left;
        font-size: 1rem;
        width: 100%;
    }
}

/* AI Future-Style Voice Button */
.ai-voice-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.ai-voice-button {
    position: relative;
    width: 200px;
    height: 200px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.3s ease;
}

.ai-voice-button:hover {
    transform: scale(1.05);
}

.ai-voice-button:active {
    transform: scale(0.95);
}

.ai-voice-button-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-voice-button-core {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 
        0 0 30px rgba(102, 126, 234, 0.6),
        0 0 60px rgba(118, 75, 162, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.ai-voice-button-core i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.ai-voice-button.recording .ai-voice-button-core {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 50%, #ff4444 100%);
    box-shadow: 
        0 0 40px rgba(255, 0, 0, 0.8),
        0 0 80px rgba(255, 68, 68, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.3);
    animation: pulse-core 1.5s ease-in-out infinite;
}

.ai-voice-button.recording .ai-voice-button-core i {
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 1);
}

@keyframes pulse-core {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 40px rgba(255, 0, 0, 0.8),
            0 0 80px rgba(255, 68, 68, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 
            0 0 60px rgba(255, 0, 0, 1),
            0 0 120px rgba(255, 68, 68, 0.8),
            inset 0 0 40px rgba(255, 255, 255, 0.4);
    }
}

.ai-voice-button-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px solid rgba(102, 126, 234, 0.5);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    animation: rotate-ring 3s linear infinite;
}

.ai-voice-button-ring-2 {
    width: 180px;
    height: 180px;
    border-color: rgba(118, 75, 162, 0.4);
    animation: rotate-ring-reverse 4s linear infinite;
}

.ai-voice-button.recording .ai-voice-button-ring {
    border-color: rgba(255, 0, 0, 0.6);
    animation: rotate-ring 2s linear infinite, pulse-ring 1.5s ease-in-out infinite;
}

.ai-voice-button.recording .ai-voice-button-ring-2 {
    border-color: rgba(255, 68, 68, 0.5);
    animation: rotate-ring-reverse 2.5s linear infinite, pulse-ring 1.5s ease-in-out infinite;
}

@keyframes rotate-ring {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotate-ring-reverse {
    from {
        transform: translate(-50%, -50%) rotate(360deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

@keyframes pulse-ring {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.ai-voice-button-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.ai-voice-button-ring,
.ai-voice-button-ring-2 {
    pointer-events: none;
}

.ai-voice-button-inner {
    pointer-events: none;
}

.ai-voice-button-core {
    pointer-events: none;
}

.ai-voice-button-particles::before,
.ai-voice-button-particles::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.8) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: particle-float 3s ease-in-out infinite;
}

.ai-voice-button-particles::after {
    animation-delay: 1.5s;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.8) 0%, transparent 70%);
}

.ai-voice-button.recording .ai-voice-button-particles::before,
.ai-voice-button.recording .ai-voice-button-particles::after {
    background: radial-gradient(circle, rgba(255, 0, 0, 0.8) 0%, transparent 70%);
    animation: particle-float-fast 1s ease-in-out infinite;
}

@keyframes particle-float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) translateY(-30px) scale(1.5);
        opacity: 1;
    }
}

@keyframes particle-float-fast {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) translateY(-40px) scale(2);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .ai-voice-button {
        width: 160px;
        height: 160px;
    }
    
    .ai-voice-button-core {
        width: 100px;
        height: 100px;
    }
    
    .ai-voice-button-core i {
        font-size: 2.5rem;
    }
    
    .ai-voice-button-ring {
        width: 130px;
        height: 130px;
    }
    
    .ai-voice-button-ring-2 {
        width: 145px;
        height: 145px;
    }
}

