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

/* Custom Scrollbar for desktop */
@media (min-width: 992px) {
    .main-content::-webkit-scrollbar,
    .nav-panel::-webkit-scrollbar {
        width: 6px;
    }
    .main-content::-webkit-scrollbar-track,
    .nav-panel::-webkit-scrollbar-track {
        background: transparent;
    }
    .main-content::-webkit-scrollbar-thumb,
    .nav-panel::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }
    .main-content::-webkit-scrollbar-thumb:hover,
    .nav-panel::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}

/* Prevent iOS text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Platform Admin elements - Hidden by default, only shown for Founder via JS */
.platform-admin-nav {
    display: none !important;
}
.platform-admin-nav.visible {
    display: flex !important;
}
#platformAdminNav.visible,
#userManagementNav.visible,
#platformControlNav.visible {
    display: flex !important;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; 
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 15px;
    color: #334155;
}

/* Responsive body padding */
@media (max-width: 1024px) and (orientation: portrait) {
    body {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
}

/* Main Layout */
.app-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .app-container {
        grid-template-columns: 300px 1fr;
        height: 100vh;
        overflow: hidden;
    }
    
    .nav-panel {
        height: calc(100vh - 30px);
        overflow-y: auto;
        position: sticky;
        top: 15px;
    }
    
    .main-content {
        height: calc(100vh - 30px);
        overflow-y: auto;
        padding-right: 5px;
    }
}

/* ==================== SIDEBAR TOGGLE BUTTONS ==================== */
/* Hidden by default - only show in tablet/phone landscape mode */
.sidebar-toggle-btn,
.sidebar-show-btn,
.floating-nav-toggle {
    display: none;
}

/* Landscape mode on phones & tablets (up to iPad Pro 12.9") */
@media (max-width: 1366px) and (min-width: 568px) and (orientation: landscape) {
    /* Hide the old toggle button inside nav - we use floating toggle now */
    .sidebar-toggle-btn {
        display: none !important;
    }
    
    /* Hide old show button - we use floating toggle now */
    .sidebar-show-btn {
        display: none !important;
    }
    
    /* Old Sidebar Toggle & Show buttons - kept for fallback but hidden */
    /* .sidebar-toggle-btn and .sidebar-show-btn are replaced by .floating-nav-toggle */
    
    /* Sidebar Show Button (in main-content, when sidebar hidden) - HIDDEN, using floating toggle instead */
    .sidebar-show-btn {
        display: none !important;
    }
    
    /* FLOATING NAV TOGGLE - Tab sticking out from sidebar edge */
    .floating-nav-toggle {
        display: flex !important;
        position: fixed !important;
        left: 200px !important; /* Right edge of 200px sidebar */
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        width: 16px;
        height: 50px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(148, 163, 184, 0.3);
        border-left: none;
        border-radius: 0 6px 6px 0;
        color: #64748b;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
        transition: width 0.2s ease, background 0.2s ease, color 0.2s ease, left 0.3s ease;
        font-size: 9px;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .floating-nav-toggle i {
        transition: transform 0.3s ease;
    }
    
    .floating-nav-toggle:hover {
        width: 22px;
        background: rgba(255, 255, 255, 1);
        color: #2563eb;
        box-shadow: 3px 0 10px rgba(0, 0, 0, 0.12);
    }
    
    .floating-nav-toggle:active {
        transform: translateY(-50%) scale(0.95) !important;
    }
    
    /* When sidebar is hidden - show button on left edge of screen */
    .app-container.sidebar-hidden .floating-nav-toggle {
        left: 0 !important;
    }
    
    .app-container.sidebar-hidden .floating-nav-toggle i {
        transform: rotate(180deg);
        transition: transform 0.3s ease;
    }
    
    /* When sidebar is hidden */
    .app-container.sidebar-hidden {
        grid-template-columns: 1fr !important;
    }
    
    /* Remove display:none - use transform animation instead in landscape media query below */
}

/* Landscape mode layout for phones & tablets */
@media (max-width: 1366px) and (min-width: 568px) and (orientation: landscape) {
    .app-container {
        display: block !important;
        grid-template-columns: none;
    }
    
    .nav-panel {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 200px !important;
        height: 100vh !important;
        max-height: 100vh;
        overflow-y: auto;
        padding: 12px;
        padding-top: 40px; /* Space for toggle button */
        font-size: 13px;
        z-index: 999;
        /* Slide animation */
        transition: transform 0.3s ease, opacity 0.3s ease;
        transform: translateX(0);
    }
    
    /* When sidebar is hidden - slide out to left */
    .app-container.sidebar-hidden .nav-panel {
        transform: translateX(-100%) !important;
        opacity: 0;
        pointer-events: none;
    }
    
    .main-content {
        margin-left: 200px !important;
        width: calc(100% - 200px) !important;
        min-height: 100vh;
        /* Slide animation */
        transition: margin-left 0.3s ease, width 0.3s ease;
    }
    
    /* When sidebar is hidden */
    .app-container.sidebar-hidden .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Content sections - use full width */
    .content-section {
        grid-template-columns: 1fr !important;
    }
    
    .content-section.active {
        display: grid;
        width: 100%;
    }
    
    /* Content cards - full width in landscape */
    .content-card {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure nav categories are expanded in landscape */
    .nav-category {
        max-height: 1000px !important;
        display: flex !important;
    }
    
    .nav-category.collapsed {
        max-height: 1000px !important;
    }
    
    .nav-separator .collapse-icon {
        display: none !important;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .logo .tagline {
        font-size: 10px;
    }
    
    .logo .version {
        font-size: 10px;
    }
    
    .mobile-menu-btn {
        display: none !important;
    }
    
    .mobile-overlay {
        display: none !important;
    }
    
    /* Main content adjustments for landscape */
    .main-content {
        padding: 10px;
    }
    
    .content-card {
        padding: 15px;
    }
    
    .card-header h3 {
        font-size: 14px;
    }
    
    /* Top auth bar compact - HORIZONTAL ROW */
    .top-auth-bar {
        padding: 0 !important;
        font-size: 12px;
        flex-direction: row !important;
    }
    
    /* Dashboard grid adjustments */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    /* Form adjustments */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Table adjustments */
    .table-container {
        font-size: 11px;
    }
    
    /* Modal adjustments */
    .modal-content {
        max-width: 90vw;
        max-height: 85vh;
        margin: 5vh auto;
    }
    
    /* ==================== POS LANDSCAPE MODE - Desktop Layout ==================== */
    .pos-container {
        display: grid !important;
        grid-template-columns: 1fr 320px !important;
        gap: 12px !important;
        min-height: 60vh !important;
    }
    
    .pos-products-panel {
        min-height: auto !important;
        padding: 12px !important;
    }
    
    .pos-panel-header {
        margin-bottom: 10px !important;
        padding-bottom: 10px !important;
    }
    
    .pos-panel-header h3 {
        font-size: 14px !important;
    }
    
    .pos-search input {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    
    .pos-categories {
        gap: 6px !important;
        margin-bottom: 10px !important;
    }
    
    .pos-category-btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }
    
    .pos-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
        min-height: 150px !important;
        max-height: calc(60vh - 150px) !important;
    }
    
    .pos-product-card {
        padding: 8px !important;
        min-height: 100px !important;
    }
    
    .pos-product-image {
        height: 60px !important;
        margin-bottom: 5px !important;
    }
    
    .pos-product-sku {
        font-size: 8px !important;
    }
    
    .pos-product-name {
        font-size: 9px !important;
    }
    
    .pos-product-price {
        font-size: 10px !important;
    }
    
    .pos-cart-panel {
        min-height: auto !important;
        padding: 12px !important;
    }
    
    .pos-cart-header h3 {
        font-size: 14px !important;
    }
    
    .pos-cart-items {
        min-height: 100px !important;
        max-height: calc(60vh - 280px) !important;
    }
    
    .cart-item {
        padding: 8px !important;
        gap: 8px !important;
    }
    
    .cart-item-name {
        font-size: 12px !important;
    }
    
    .cart-item-price {
        font-size: 11px !important;
    }
    
    .pos-cart-summary {
        padding: 10px !important;
    }
    
    .cart-total-row {
        font-size: 12px !important;
    }
    
    .cart-total-row.grand-total {
        font-size: 14px !important;
    }
    
    .pos-checkout-btn {
        padding: 10px !important;
        font-size: 13px !important;
    }
    
    /* Table management in landscape */
    .table-management-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 10px !important;
    }
    
    .table-card {
        padding: 12px !important;
    }
    
    .table-number {
        font-size: 18px !important;
    }
    
    /* Order type selector compact */
    .order-type-selector {
        gap: 8px !important;
    }
    
    .order-type-btn {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
}

/* Navigation Panel - EZCubic Theme */
.nav-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(37, 99, 235, 0.1);
    position: relative;
    z-index: 10;
}

.logo {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2563eb;
}

.logo h1 {
    color: #2563eb;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo h1 i {
    color: #f59e0b;
    font-size: 20px;
}

.logo .tagline {
    color: #64748b;
    font-size: 13px;
    margin-top: 5px;
    font-weight: 500;
}

.logo .version {
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Cloud Sync Badge - Inline next to version */
.cloud-sync-badge-inline {
    display: inline-flex;
    align-items: center;
    color: #10b981;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cloud-sync-badge-inline:hover {
    color: #059669;
    transform: scale(1.1);
}

.cloud-sync-badge-inline.syncing {
    color: #3b82f6;
}

.cloud-sync-badge-inline.syncing i {
    animation: spin 1s linear infinite;
}

.cloud-sync-badge-inline.offline {
    color: #f59e0b;
}

.cloud-sync-badge-inline.error {
    color: #ef4444;
}

.cloud-sync-badge-inline.success {
    color: #10b981;
}

.cloud-sync-badge-inline.pending {
    color: #8b5cf6;
}

/* Legacy cloud-sync-badge for backwards compatibility */
.cloud-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cloud-sync-badge:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: scale(1.05);
}

.cloud-sync-badge.syncing {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.cloud-sync-badge.syncing i {
    animation: spin 1s linear infinite;
}

.cloud-sync-badge.offline {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.cloud-sync-badge.error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

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

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8fafc;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    color: #475569;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateX(5px);
}

.nav-btn.active {
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #f59e0b;
}

.nav-btn i {
    font-size: 16px;
    width: 20px;
    transition: transform 0.3s;
    color: #64748b;
}

.nav-btn:hover i {
    transform: scale(1.1);
    color: #1e293b;
}

.nav-btn.active i {
    color: white;
}

.nav-badge {
    margin-left: auto;
    background: #f59e0b;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Navigation Separators */
.nav-separator {
    padding: 15px 15px 8px 15px;
    margin-top: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-separator span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 700;
}

.nav-separator .collapse-icon {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.3s ease;
    display: none;
}

.nav-separator .collapse-icon.rotated {
    transform: rotate(-90deg);
}

/* Navigation category wrapper */
.nav-category {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mobile collapsible categories */
@media (max-width: 768px) {
    .nav-separator .collapse-icon {
        display: inline-block;
    }
    
    .nav-category {
        max-height: 1000px;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-category.collapsed {
        max-height: 0;
        gap: 0;
    }
}

.quick-actions {
    margin-top: 20px;
    padding: 15px;
    background: #fef3c7;
    border-radius: 10px;
    border: 2px dashed #f59e0b;
}

.quick-actions h3 {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #2563eb;
    border-radius: 8px;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quick-action-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.quick-action-btn.alt {
    border-color: #f59e0b;
    color: #92400e;
}

.quick-action-btn.alt:hover {
    background: #f59e0b;
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Content Sections - Only one active at a time */
.content-section {
    display: none;
    grid-template-columns: 1fr;
    gap: 15px;
}

.content-section.active {
    display: grid;
}

/* POS Section - Full width layout */
#pos.content-section.active {
    display: block;
}

/* Branches Section - Full width layout */
#branches.content-section.active {
    display: block;
}

/* User Management Section - Full width layout */
#user-management.content-section.active {
    display: block;
}

/* Audit Log Section - Full width layout */
#audit-log.content-section.active {
    display: block;
}

/* LHDN Export Section - Full width layout */
#lhdn-export.content-section.active {
    display: block;
}

@media (min-width: 768px) {
    .content-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

.content-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.12);
}

.content-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2 {
    color: #1e293b;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin: 0;
}

.card-header h2 i {
    color: #2563eb;
}

/* Card header select styling */
.card-header select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #1e293b;
    font-size: 14px;
    cursor: pointer;
}

.card-header select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(30deg);
}

.stat-card.income {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.stat-card.expense {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin: 8px 0 4px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 11px;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-change {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.stat-change.positive {
    color: #bbf7d0;
}

.stat-change.negative {
    color: #fecaca;
}

/* Transaction Form */
.transaction-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    margin-bottom: 10px;
}

/* Help Tooltip Box Styling */
.help-tooltip-box {
    background: #1e293b;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    animation: fadeIn 0.2s ease;
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 2px solid #e2e8f0 !important;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

/* Outline Button Variant */
.btn-outline {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: #2563eb;
    color: white;
}

.btn-outline.danger {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-outline.danger:hover {
    background: #ef4444;
    color: white;
}

/* Small Button Variant */
.btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: 2px solid #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: 2px solid #f59e0b;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.btn-success {
    background: #10b981;
    color: white;
    border: 2px solid #10b981;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* Transaction List */
.transaction-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.3s;
}

.transaction-item:hover {
    background: #f8fafc;
}

.transaction-info {
    flex: 1;
}

.transaction-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.transaction-category {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
}

.transaction-date {
    font-size: 12px;
    color: #94a3b8;
}

.transaction-amount {
    font-weight: 700;
    font-size: 16px;
}

.transaction-amount.positive {
    color: #10b981;
}

.transaction-amount.negative {
    color: #ef4444;
}

.transaction-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s;
    color: #64748b;
}

.action-btn:hover {
    background: #f1f5f9;
    transform: scale(1.1);
}

.action-btn.edit:hover {
    color: #2563eb;
}

.action-btn.delete:hover {
    color: #ef4444;
}

/* Reports Section */
.reports-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .reports-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.report-card {
    padding: 20px;
    border-radius: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.report-card:hover {
    border-color: #2563eb;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.report-header h3 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.report-value {
    font-size: 28px;
    font-weight: 700;
    margin: 10px 0;
    color: #2563eb;
}

.chart-container {
    height: 200px;
    margin-top: 15px;
    position: relative;
}

.chart-container canvas,
.monthly-chart-container canvas {
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

/* Monthly Revenue/Expense Chart Container */
.monthly-chart-container {
    height: 300px;
    margin-top: 15px;
    position: relative;
}

/* Bill Tracking */
.bills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.bill-card {
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
}

.bill-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.bill-card.overdue {
    border-color: #ef4444;
    background: #fef2f2;
}

.bill-card.upcoming {
    border-color: #f59e0b;
    background: #fffbeb;
}

.bill-card.paid {
    border-color: #10b981;
    background: #f0fdf4;
}

.bill-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e293b;
}

.bill-amount {
    font-size: 20px;
    font-weight: 700;
    margin: 10px 0;
    color: #1e293b;
}

.bill-due-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bill-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-overdue {
    background: #ef4444;
    color: white;
}

.status-upcoming {
    background: #f59e0b;
    color: white;
}

.status-paid {
    background: #10b981;
    color: white;
}

/* Recurring Bill Styles */
.recurring-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}

.recurring-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.recurring-toggle:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
}

.recurring-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.recurring-toggle span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #475569;
}

.recurring-toggle span i {
    color: #3b82f6;
}

#recurringOptions {
    margin-top: 15px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

.recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: capitalize;
    margin-left: 8px;
}

.recurring-badge.auto-generated {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Tax Estimator - Malaysian Specific */
.tax-estimator {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.tax-estimator::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.tax-estimator h3 {
    color: white;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.tax-amount {
    font-size: 36px;
    font-weight: 700;
    margin: 15px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.tax-breakdown {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}

.tax-slider-container {
    margin: 15px 0;
}

.tax-slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* Tax Rate Table for Malaysia */
.tax-rate-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.tax-rate-table th, .tax-rate-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tax-rate-table th {
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}

.tax-rate-table tr:last-child td {
    border-bottom: none;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #e2e8f0;
}

.empty-state h4 {
    color: #64748b;
    margin-bottom: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    z-index: 2000 !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.modal-title {
    font-size: 20px;
    color: #1e293b;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #ef4444;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #ef4444;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

.tab:hover {
    color: #2563eb;
}

.tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #2563eb;
    color: white;
}

.badge.success {
    background: #10b981;
}

.badge.warning {
    background: #f59e0b;
}

.badge.danger {
    background: #ef4444;
}

/* Tooltips */
.help-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    cursor: help;
    margin-left: 5px;
    color: #64748b;
    font-weight: 600;
}

/* Footer */
.data-security {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

.data-security i {
    color: #10b981;
    margin-right: 5px;
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
}

.mobile-overlay {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        background: white;
        color: white;
        border: none;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        z-index: 1003;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
        transition: all 0.3s;
        font-size: 20px;
        padding: 0;
        overflow: hidden;
    }
    
    .mobile-menu-btn img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        border-radius: 50%;
    }
    
    .mobile-menu-btn:hover,
    .mobile-menu-btn:active {
        transform: scale(1.08);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3), 0 3px 10px rgba(0, 0, 0, 0.2);
    }

    .nav-panel {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 5px 0 20px rgba(0,0,0,0.2);
        overflow-y: auto;
    }
    
    .nav-panel.active {
        left: 0;
    }
    
    .mobile-overlay.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.7);
        z-index: 1000;
        backdrop-filter: blur(3px);
    }
    
    .chatbot-toggle-btn {
        bottom: 80px;
        right: 20px;
    }
    
    /* Enhanced Mobile UI - Better touch targets and spacing */
    .btn-primary, .btn-secondary, .btn-outline {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 44px; /* iOS touch target */
    }
    
    .form-control, .form-select {
        padding: 12px;
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 44px;
    }
    
    .stat-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .content-card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }
    
    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
        width: 100%;
    }
    
    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .modal-body {
        padding: 16px;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 16px;
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
    }
    
    /* Better table display on mobile */
    .data-table {
        font-size: 14px;
    }
    
    .data-table th {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .data-table td {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    /* Stack buttons vertically on mobile */
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
        margin: 4px 0;
    }
    
    /* Better card grid on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .chart-container {
        height: 300px;
        margin-bottom: 20px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Print Styles */
@media print {
    .nav-panel, .quick-action-btn, .btn-secondary, .mobile-menu-btn {
        display: none !important;
    }
    
    .content-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-banner h2 {
    color: white;
    margin-bottom: 5px;
}

.welcome-banner p {
    opacity: 0.9;
    font-size: 14px;
}

.banner-actions {
    display: flex;
    gap: 10px;
}

/* Tips & Suggestions */
.tips-section {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.tips-section h4 {
    color: #92400e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tip-item {
    font-size: 13px;
    color: #92400e;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tip-item i {
    color: #f59e0b;
    margin-top: 2px;
}

/* Month selector for charts */
.chart-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.chart-controls select, .chart-controls input {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #1e293b;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

.chart-controls select:focus, .chart-controls input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Report period selector */
.report-header select {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #1e293b;
    font-size: 12px;
    cursor: pointer;
}

.report-header select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Currency Display */
.currency-symbol {
    font-size: 0.8em;
    margin-right: 2px;
}

/* Balance Sheet Styles */
.balance-sheet-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .balance-sheet-section {
        grid-template-columns: 1fr;
    }
}

.balance-column {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.balance-header {
    border-bottom: 2px solid;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.assets-header {
    color: #10b981;
    border-bottom-color: #10b981;
}

.liabilities-header {
    color: #ef4444;
    border-bottom-color: #ef4444;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
}

.balance-total {
    border-top: 2px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 15px;
    font-weight: 700;
    font-size: 18px;
}

.accounting-equation {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 30px;
}

/* AI Chatbot Styles */
.ai-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    border: 1px solid #e2e8f0;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.ai-chatbot-container.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.ai-chatbot-container.minimized {
    height: 60px;
}

.chatbot-header {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

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

.chatbot-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chatbot-message.user {
    align-self: flex-end;
}

.chatbot-message.bot {
    align-self: flex-start;
}

.message-content {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user .message-avatar {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
}

.bot .message-avatar {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.message-text {
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    line-height: 1.5;
}

.user .message-text {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border-radius: 12px 12px 0 12px;
}

.bot .message-text {
    background: white;
    color: #334155;
    border-radius: 12px 12px 12px 0;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 5px;
    padding: 0 8px;
}

.user .message-time {
    text-align: right;
}

.chatbot-input-container {
    border-top: 1px solid #e2e8f0;
    padding: 15px;
    background: white;
    border-radius: 0 0 12px 12px;
}

.quick-question-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-question {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-question:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatbotInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
}

#chatbotInput:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* Chatbot Toggle Button */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.chatbot-toggle-btn i {
    font-size: 24px;
}

.chatbot-notification {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
}

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

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

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

/* Loading animation */
.loading-dots {
    display: inline-flex;
    gap: 2px;
    padding-left: 5px;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: loading 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Chatbot suggestions */
.chatbot-suggestions {
    margin-top: 10px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.suggestion-title {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
}

.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 11px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Personal Tax Specific Styles */
.personal-tax-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .personal-tax-grid {
        grid-template-columns: 1fr;
    }
}

.relief-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.relief-item input {
    width: 150px;
    text-align: right;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.relief-item input:disabled {
    background: #f1f5f9;
    color: #64748b;
}

.tax-summary-card {
    background: #1e293b;
    color: white;
    border: none;
    padding: 20px;
    border-radius: 10px;
}

.tax-summary-card h3 {
    color: #94a3b8;
    margin-bottom: 20px;
}

.tax-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.tax-total {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 15px;
    padding-top: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #f59e0b;
    display: flex;
    justify-content: space-between;
}

.progress-container {
    margin: 20px 0;
}

.progress-bar-dark {
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill-dark {
    height: 100%;
    background: #f59e0b;
    width: 0%;
    transition: 0.5s;
}

.balance-equation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.balance-equation .balance-item {
    padding: 20px;
    border-radius: 10px;
    min-width: 150px;
    text-align: center;
}

.balance-equation .assets {
    background: #eff6ff;
    border: 2px solid #2563eb;
}

.balance-equation .liabilities {
    background: #fef2f2;
    border: 2px solid #ef4444;
}

.balance-equation .equity {
    background: #f0fdf4;
    border: 2px solid #10b981;
}

.balance-equation .balance-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.balance-equation .balance-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 5px;
}

.equation-operator {
    font-size: 36px;
    font-weight: bold;
    color: #94a3b8;
}

.tax-tabs {
    margin-bottom: 20px;
}

.tax-tab-content {
    display: none;
}

.tax-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
/* ============================================
   SIMPLIFIED BALANCE SHEET FOR SMALL BUSINESS
   ============================================ */

/* Simplified Balance Sheet Container */
.simple-balance-sheet {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* What I Have vs What I Owe */
.balance-simple-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.balance-box {
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    border: 2px solid;
    transition: transform 0.2s ease;
}

.balance-box:hover {
    transform: translateY(-5px);
}

.balance-box.assets {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border-color: #3b82f6;
}

.balance-box.liabilities {
    background: linear-gradient(135deg, #fee2e2, #fef2f2);
    border-color: #ef4444;
}

.balance-box-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.balance-box-title.assets {
    color: #1e40af;
}

.balance-box-title.liabilities {
    color: #b91c1c;
}

.balance-box-amount {
    font-size: 32px;
    font-weight: 700;
    margin: 10px 0;
}

.balance-box-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-top: 10px;
}

/* Net Worth Card */
.net-worth-card {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.net-worth-label {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.net-worth-amount {
    font-size: 42px;
    font-weight: 800;
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.net-worth-status {
    font-size: 14px;
    padding: 6px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    font-weight: 600;
}

/* Simple Equation */
.simple-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.equation-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    min-width: 150px;
    text-align: center;
    border: 2px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.equation-item.assets {
    border-color: #3b82f6;
}

.equation-item.liabilities {
    border-color: #ef4444;
}

.equation-item.equity {
    border-color: #10b981;
}

.equation-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #475569;
}

.equation-value {
    font-size: 24px;
    font-weight: 700;
}

/* Cash Flow Indicators */
.cash-flow-indicator {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
}

.cash-flow-indicator h4 {
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.cash-flow-meter {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.cash-flow-bar {
    flex-grow: 1;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.cash-flow-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #ef4444, #f97316, #10b981);
}

.cash-flow-marker {
    position: absolute;
    top: -2px;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid;
    border-radius: 50%;
    transform: translateX(-50%);
}

.cash-flow-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

/* Quick Balance Check */
.quick-balance-check {
    background: linear-gradient(135deg, #fef3c7, #fefce8);
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.quick-balance-check h4 {
    color: #92400e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.quick-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.quick-check-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.quick-check-value {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0;
}

.quick-check-label {
    font-size: 12px;
    color: #92400e;
    font-weight: 600;
}

/* Balance Sheet Tips */
.balance-tips {
    background: #eff6ff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #bfdbfe;
}

.balance-tips h4 {
    color: #1e40af;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.balance-tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dbeafe;
}

.balance-tip-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.balance-tip-item i {
    color: #3b82f6;
    flex-shrink: 0;
    margin-top: 2px;
}

.balance-tip-text {
    color: #1e293b;
    font-size: 14px;
}

/* Simplified Transaction View */
.simple-transaction-view {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
}

.simple-transaction-view h4 {
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.simple-transaction-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.simple-transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid;
}

.simple-transaction-item.income {
    border-left-color: #10b981;
}

.simple-transaction-item.expense {
    border-left-color: #ef4444;
}

.simple-transaction-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.simple-transaction-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.simple-transaction-date {
    font-size: 12px;
    color: #64748b;
}

.simple-transaction-amount {
    font-weight: 700;
    font-size: 16px;
}

.simple-transaction-amount.positive {
    color: #10b981;
}

.simple-transaction-amount.negative {
    color: #ef4444;
}

/* Responsive Design for Simple Balance Sheet */
@media (max-width: 768px) {
    .balance-simple-view {
        grid-template-columns: 1fr;
    }
    
    .balance-box {
        padding: 20px;
    }
    
    .balance-box-amount {
        font-size: 28px;
    }
    
    .net-worth-amount {
        font-size: 32px;
    }
    
    .simple-equation {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .equation-item {
        min-width: auto;
    }
    
    .quick-check-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   DETAILED BALANCE SHEET STYLES
   ============================================ */

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.view-toggle-btn {
    padding: 10px 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle-btn:hover {
    background: #e2e8f0;
}

.view-toggle-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Balance Views */
.balance-view {
    display: none;
}

.balance-view.active {
    display: block;
}

/* Detailed Balance Sheet */
.detailed-balance-sheet {
    background: white;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.balance-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 1200px) {
    .balance-sheet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .balance-sheet-grid {
        grid-template-columns: 1fr;
    }
}

.balance-column {
    display: flex;
    flex-direction: column;
}

.balance-column h3 {
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-column.assets-column h3 {
    border-bottom-color: #2563eb;
    color: #2563eb;
}

.balance-column.liabilities-column h3 {
    border-bottom-color: #ef4444;
    color: #ef4444;
}

.balance-column.equity-column h3 {
    border-bottom-color: #10b981;
    color: #10b981;
}

.balance-section {
    margin-bottom: 25px;
}

.balance-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.balance-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.balance-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.balance-item span:first-child {
    color: #1e293b;
    font-weight: 500;
    flex-grow: 1;
}

.balance-amount {
    font-weight: 600;
    color: #1e293b;
    min-width: 120px;
    text-align: right;
}

.balance-input {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
}

.balance-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.add-balance-btn {
    width: 100%;
    padding: 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed #3b82f6;
    border-radius: 6px;
    color: #3b82f6;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-balance-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Balance Totals */
.balance-total {
    margin-top: auto;
    padding: 20px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.balance-total .total-amount {
    font-size: 20px;
}

.assets-column .balance-total {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.liabilities-column .balance-total {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.equity-column .balance-total {
    background: linear-gradient(135deg, #10b981, #34d399);
}

/* Balance History */
.balance-history {
    background: white;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.history-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #e2e8f0;
}

.history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.history-table tr:hover {
    background: #f8fafc;
}

.history-table .assets-cell {
    color: #2563eb;
    font-weight: 600;
}

.history-table .liabilities-cell {
    color: #ef4444;
    font-weight: 600;
}

.history-table .equity-cell {
    color: #10b981;
    font-weight: 600;
}

.history-change {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.history-change.positive {
    background: #d1fae5;
    color: #065f46;
}

.history-change.negative {
    background: #fee2e2;
    color: #991b1b;
}

/* Quick Setup Wizard */
.setup-wizard {
    background: white;
    border-radius: 10px;
    padding: 30px;
    border: 1px solid #e2e8f0;
    margin-top: 20px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

.wizard-header {
    text-align: center;
    margin-bottom: 30px;
}

.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.wizard-progress:before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.wizard-step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.wizard-step-indicator.active {
    background: #3b82f6;
    color: white;
}

.wizard-step-indicator.completed {
    background: #10b981;
    color: white;
}

.wizard-content {
    min-height: 200px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* ============================================
   BULK ENTRY STYLES
   ============================================ */

.bulk-entry-guide {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.bulk-entry-guide h4 {
    margin-bottom: 10px;
    color: #1e293b;
}

.bulk-entry-guide ol {
    margin: 15px 0 15px 20px;
    color: #475569;
}

.bulk-entry-guide ol li {
    margin-bottom: 8px;
}

.template-btn {
    padding: 10px 15px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.template-btn i {
    color: #3b82f6;
}

.bulk-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
}

.bulk-input:focus {
    outline: none;
    border-color: #3b82f6;
}

#bulkEntryTable {
    width: 100%;
    border-collapse: collapse;
}

#bulkEntryTable th {
    text-align: left;
    padding: 10px;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
}

#bulkEntryTable td {
    padding: 8px;
}

#bulkEntryTable tr:hover {
    background: #f8fafc;
}

/* Opening Balance Wizard */
.opening-balance-wizard {
    background: white;
    border-radius: 10px;
    padding: 25px;
}

.wizard-intro {
    text-align: center;
    margin-bottom: 30px;
}

.wizard-intro i {
    font-size: 48px;
    color: #3b82f6;
    margin-bottom: 15px;
}

.balance-input-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .balance-input-group {
        grid-template-columns: 1fr;
    }
}

.balance-field {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.balance-field label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.balance-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
}

.balance-field .field-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

/* ============================================
   BANK ACCOUNT MANAGEMENT STYLES
   ============================================ */

.bank-account-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-bank-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

.balance-item .balance-amount {
    display: flex;
    align-items: center;
    gap: 5px;
}

.balance-item .balance-input {
    width: 100px;
    text-align: right;
}

/* Bank account item layout fix */
.bank-account-item .balance-amount {
    flex-shrink: 0;
}

/* ============================================
   EXPORT MODAL STYLES
   ============================================ */

.export-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.export-type-btn i {
    font-size: 24px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.export-type-btn span {
    font-size: 12px;
    font-weight: 600;
}

.export-type-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.export-type-btn.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.export-type-btn.active i {
    color: #2563eb;
}

.export-format-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    font-weight: 500;
}

.export-format-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.export-format-btn.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.export-format-btn.active[data-format="excel"] {
    background: #f0fdf4;
    border-color: #10b981;
    color: #10b981;
}

.export-format-btn i {
    font-size: 16px;
}

.export-format-btn[data-format="pdf"] i {
    color: #ef4444;
}

.export-format-btn[data-format="excel"] i {
    color: #10b981;
}

/* ============================================
   INTELLIGENT AI ASSISTANT STYLES
   ============================================ */

/* AI Dashboard Overview */
.ai-dashboard {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ai-header h2 {
    color: white;
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-header h2 i {
    color: #60a5fa;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.ai-mode-toggle {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 10px;
}

.mode-btn {
    padding: 8px 15px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mode-btn.active {
    background: #3b82f6;
    color: white;
}

/* AI Insights Grid */
.ai-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.ai-insight-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ai-insight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.ai-insight-card.high {
    border-left: 4px solid #ef4444;
}

.ai-insight-card.medium {
    border-left: 4px solid #f59e0b;
}

.ai-insight-card.low {
    border-left: 4px solid #10b981;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.insight-header i {
    font-size: 20px;
    color: #3b82f6;
}

.insight-header h4 {
    color: #1e293b;
    margin: 0;
    font-size: 16px;
    flex-grow: 1;
}

.insight-priority {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.insight-priority.high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.insight-priority.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.insight-priority.low {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.insight-body {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.insight-actions {
    display: flex;
    gap: 10px;
}

.insight-action-btn {
    padding: 8px 15px;
    border-radius: 6px;
    border: none;
    background: #eff6ff;
    color: #3b82f6;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.insight-action-btn:hover {
    background: #dbeafe;
}

/* Natural Language Query */
.ai-query-interface {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    padding: 25px;
    margin: 20px;
    color: white;
}

.ai-query-interface h3 {
    color: white;
    margin-bottom: 5px;
}

.query-input-container {
    position: relative;
    margin-bottom: 15px;
}

.query-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 16px;
    outline: none;
}

.query-input::placeholder {
    color: #94a3b8;
}

.query-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.query-mic {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.query-mic:hover {
    color: #60a5fa;
}

.query-mic.active {
    color: #ef4444;
    animation: recording 1s infinite;
}

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

.query-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.query-example {
    padding: 8px 15px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    color: #60a5fa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.query-example:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* AI Response Display */
.ai-response-container {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    padding: 25px;
    margin: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.ai-response {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.ai-response:last-child {
    margin-bottom: 0;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: transparent !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: visible;
}

.ai-avatar i {
    color: white;
    font-size: 18px;
}

.ai-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 0;
    background: transparent !important;
}

.response-content {
    flex-grow: 1;
}

.response-text {
    color: #e2e8f0;
    line-height: 1.6;
    margin-bottom: 10px;
}

.response-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.response-action {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.response-action:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

/* AI Action Buttons - New Enhanced Styles */
.ai-action-btn {
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #60a5fa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-action-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.ai-action-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-color: transparent;
}

.ai-action-btn.primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.ai-action-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: transparent;
}

.ai-action-btn.success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.ai-action-btn.secondary {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.3);
}

.ai-action-btn.secondary:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
}

.ai-action-btn.outline {
    background: transparent;
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.2);
}

.ai-action-btn.outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.ai-action-btn.small {
    padding: 6px 10px;
    font-size: 11px;
}

/* Module Tutorial Styles */
.module-tutorial {
    animation: slideIn 0.3s ease;
}

.contextual-help {
    animation: fadeIn 0.3s ease;
}

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

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

/* Tutorial Progress Bar */
.tutorial-progress {
    background: rgba(0, 0, 0, 0.2);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.tutorial-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    height: 100%;
    transition: width 0.3s ease;
}

/* AI Automation Panel */
.ai-automation-panel {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    padding: 25px;
    margin: 20px;
    color: white;
}

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

.automation-header h3 {
    color: white;
    margin: 0;
}

.automation-tasks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.automation-task {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.automation-task:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.3);
}

.task-icon {
    font-size: 28px;
    color: #60a5fa;
    margin-bottom: 12px;
}

.task-title {
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.task-description {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 15px;
}

.task-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 600;
}

.task-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.task-status.scheduled {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

/* AI Learning Modules */
.ai-learning-module {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    padding: 25px;
    margin: 20px;
    color: white;
}

.learning-progress {
    margin-bottom: 20px;
}

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

.progress-header h3 {
    color: white;
    margin: 0;
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.learning-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.learning-step {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    align-items: center;
}

.learning-step:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(5px);
}

.step-number {
    width: 30px;
    height: 30px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex-grow: 1;
}

.step-title {
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
}

.step-description {
    color: #94a3b8;
    font-size: 13px;
}

/* AI Analytics Dashboard */
.ai-analytics {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    padding: 25px;
    margin: 20px;
    color: white;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.analytics-header h3 {
    color: white;
    margin: 0;
}

.analytics-filters {
    display: flex;
    gap: 10px;
}

.analytics-filter {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.analytics-filter:hover {
    background: rgba(255, 255, 255, 0.15);
}

.analytics-filter.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-value {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.analytics-label {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 10px;
}

.analytics-trend {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}

.analytics-trend.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.analytics-trend.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Responsive Design for AI */
@media (max-width: 768px) {
    .ai-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ai-mode-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .ai-insights-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .automation-tasks {
        grid-template-columns: 1fr 1fr;
    }
    
    .analytics-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .analytics-filters {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .automation-tasks {
        grid-template-columns: 1fr;
    }
    
    .query-examples {
        flex-direction: column;
    }
    
    .query-example {
        text-align: center;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    body {
        background: white !important;
        padding: 0 !important;
    }
    
    .nav-panel,
    .mobile-overlay,
    .quick-actions,
    .data-security,
    .modal,
    .notification,
    .chatbot-container,
    .view-toggle,
    .btn-primary,
    .btn-secondary,
    .add-balance-btn,
    .insight-action-btn {
        display: none !important;
    }
    
    .app-container {
        display: block !important;
        max-width: 100% !important;
    }
    
    .content-section {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .content-card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        page-break-inside: avoid;
    }
    
    .dashboard-grid,
    .balance-sheet-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .stat-card {
        background: #f8fafc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ==================== KEYBOARD SHORTCUT HINT ==================== */
.keyboard-hint {
    display: none; /* Hidden - shortcuts still work via keyboard */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(30, 41, 59, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.keyboard-hint:hover {
    background: rgba(30, 41, 59, 1);
    transform: translateY(-2px);
}

.keyboard-hint kbd {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

/* ==================== LOADING SPINNER ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 15px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== SUCCESS ANIMATION ==================== */
.success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.4s ease;
}

.success-checkmark i {
    color: white;
    font-size: 28px;
}

@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: #64748b;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* ==================== PHASE 2: VIEW TOGGLE ==================== */
.view-toggle {
    display: inline-flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 4px;
}

.view-toggle-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.view-toggle-btn:hover {
    color: var(--primary);
}

.view-toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==================== PHASE 2: PRODUCTS GRID ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card.low-stock {
    border-left: 4px solid #f59e0b;
}

.product-card.out-of-stock {
    border-left: 4px solid #ef4444;
    opacity: 0.8;
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.product-category {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-sku {
    color: #94a3b8;
    font-size: 12px;
    font-family: monospace;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
}

.product-prices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.product-prices .label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.product-prices .value {
    font-weight: 600;
    font-size: 14px;
}

.cost-price .value { color: #64748b; }
.sell-price .value { color: #10b981; }
.margin .value { color: #2563eb; }

.product-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.stock-badge.in-stock {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stock-badge.low-stock {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stock-badge.out-of-stock {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stock-count {
    color: #64748b;
    font-weight: 500;
}

.product-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.product-actions .btn-outline.danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.product-actions .btn-outline.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== PHASE 2: POS LAYOUT ==================== */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    min-height: 75vh;
    width: 100%;
}

@media (max-width: 1200px) {
    .pos-container {
        grid-template-columns: 1fr 380px;
    }
}

@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .pos-products-panel {
        min-height: 450px;
    }
    
    .pos-products-grid {
        min-height: 300px;
        max-height: 400px;
    }
    
    .pos-cart-panel {
        min-height: 400px;
    }
    
    .pos-cart-items {
        min-height: 150px;
        max-height: 250px;
    }
}

.pos-products-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

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

.pos-panel-header h3 {
    font-size: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pos-panel-header h3 i {
    color: var(--primary);
}

.pos-search {
    margin-bottom: 15px;
}

.pos-search input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
}

.pos-search input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pos-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pos-category-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #64748b;
    transition: all 0.2s;
}

.pos-category-btn:hover {
    background: #e2e8f0;
}

.pos-category-btn.active {
    background: var(--primary);
    color: white;
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    padding: 8px;
    align-content: start;
}

.pos-product-card {
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 140px;
    overflow: hidden;
}

.pos-product-card:hover {
    border-color: var(--primary);
    background: white;
    transform: scale(1.02);
}

.pos-product-card:active {
    transform: scale(0.98);
}

.pos-product-image {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
}

.pos-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-product-no-image {
    color: #94a3b8;
}

.pos-product-no-image i {
    font-size: 32px;
}

.pos-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pos-product-sku {
    font-size: 9px;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.pos-product-name {
    font-weight: 500;
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 2px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.pos-product-price {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.pos-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.pos-product-stock {
    font-size: 9px;
    color: #94a3b8;
}

.pos-product-outlet {
    font-size: 8px;
    font-weight: 600;
    color: white;
    background: #2563eb;
    padding: 1px 5px;
    border-radius: 3px;
}

.pos-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    grid-column: 1 / -1;
}

.pos-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
    display: block;
}

.pos-empty p {
    margin-bottom: 15px;
}

.pos-empty a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.pos-empty a:hover {
    text-decoration: underline;
}

/* ==================== PHASE 2: POS CART ==================== */
.pos-cart-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--primary);
    height: 100%;
}

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

.pos-cart-header h3 {
    font-size: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pos-cart-header h3 i {
    color: var(--primary);
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    min-height: 200px;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.cart-empty i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.4;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.cart-item-info {
    min-width: 0;
}

.cart-item-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-memo-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    transition: all 0.2s;
    border-radius: 4px;
}

.cart-item-memo-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.cart-item-memo-btn .has-memo {
    color: #f59e0b;
}

.cart-item-memo {
    font-size: 11px;
    color: #f59e0b;
    margin-top: 3px;
    padding: 3px 6px;
    background: #fef3c7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-price {
    font-size: 12px;
    color: #64748b;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-item-quantity input {
    width: 40px;
    text-align: center;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 600;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--primary);
    color: white;
}

.cart-item-total {
    font-weight: 600;
    color: var(--primary);
    min-width: 70px;
    text-align: right;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
}

.cart-item-remove:hover {
    color: #ef4444;
}

/* ==================== PHASE 2: CART SUMMARY ==================== */
.pos-cart-summary {
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid #e2e8f0;
    margin-top: 10px;
    padding-top: 15px;
}

/* ==================== PHASE 2: PAYMENT BUTTONS ==================== */
.pos-payment-buttons .btn-lg {
    padding: 15px 20px;
    font-size: 16px;
}

.w-full {
    width: 100%;
}

.flex-1 {
    flex: 1;
}

/* ==================== PHASE 2: PAYMENT MODAL ==================== */
.payment-summary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.payment-total span:first-child {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.payment-total span:last-child {
    font-size: 32px;
    font-weight: 700;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.payment-method-option {
    position: relative;
    cursor: pointer;
}

.payment-method-option input {
    position: absolute;
    opacity: 0;
}

.payment-method-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s;
}

.payment-method-option input:checked + span {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.payment-method-option:hover span {
    border-color: var(--primary);
}

/* Credit Info Box */
.credit-info-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.credit-info-header {
    background: rgba(99, 102, 241, 0.15);
    padding: 10px 15px;
    font-weight: 600;
    color: #6366f1;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credit-info-details {
    padding: 12px 15px;
}

.credit-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.credit-info-row:last-child {
    border-bottom: none;
}

.credit-info-row span:first-child {
    color: #64748b;
}

.credit-info-row span:last-child {
    font-weight: 600;
    color: #334155;
}

.credit-available {
    color: #10b981 !important;
}

.credit-available.over-limit {
    color: #ef4444 !important;
}

.credit-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    margin-top: 10px;
    font-weight: 600;
}

/* ==================== PHASE 2: RECEIPT ==================== */
.receipt-preview {
    background: white;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.receipt {
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
}

.receipt-header h2 {
    font-size: 16px;
    margin-bottom: 5px;
}

.receipt-header p {
    font-size: 11px;
    color: #64748b;
}

.receipt-divider {
    text-align: center;
    color: #94a3b8;
    margin: 10px 0;
}

.receipt-info {
    font-size: 11px;
}

.receipt-info div {
    margin: 5px 0;
}

.receipt-items {
    margin: 15px 0;
}

.receipt-item {
    margin: 10px 0;
}

.item-name {
    font-weight: 600;
}

.item-details {
    display: flex;
    justify-content: space-between;
    padding-left: 10px;
    color: #64748b;
}

.receipt-totals {
    margin: 15px 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.total-row.grand-total {
    font-size: 14px;
    font-weight: bold;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 11px;
    color: #64748b;
}

/* ==================== PHASE 2: STOCK MOVEMENTS ==================== */
.movement-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.movement-type.type-in {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.movement-type.type-out {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.movement-type.type-sale {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.movement-type.type-adjustment {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

td.positive {
    color: #10b981;
    font-weight: 600;
}

td.negative {
    color: #ef4444;
    font-weight: 600;
}

/* ==================== PHASE 2: LOW STOCK ALERTS ==================== */
.low-stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.low-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
}

.low-stock-item.critical {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.02);
}

.low-stock-item.warning {
    border-left-color: #f59e0b;
}

.low-stock-info h4 {
    margin-bottom: 5px;
}

.stock-details {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.stock-details .current {
    color: #ef4444;
}

.stock-details .minimum {
    color: #64748b;
}

.low-stock-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.suggested-reorder {
    font-size: 12px;
    color: #64748b;
}

/* ==================== PHASE 2: STOCK VALUATION ==================== */
.valuation-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.valuation-row {
    display: grid;
    grid-template-columns: 150px 1fr 180px;
    gap: 15px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.valuation-category {
    display: flex;
    flex-direction: column;
}

.category-name {
    font-weight: 500;
}

.category-count {
    font-size: 12px;
    color: #94a3b8;
}

.valuation-bar-container {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.valuation-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: 4px;
    transition: width 0.3s;
}

.valuation-values {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.cost-value {
    color: #64748b;
}

.retail-value {
    color: var(--primary);
    font-weight: 500;
}

.percentage {
    color: #94a3b8;
    min-width: 40px;
    text-align: right;
}

/* ==================== PHASE 2: CUSTOMERS ==================== */
.customer-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.loyalty-points {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

/* ==================== PHASE 2: CUSTOMER HISTORY ==================== */
.customer-history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: grid;
    grid-template-columns: 100px 120px 80px 1fr;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.history-date {
    color: #64748b;
}

.history-receipt {
    font-family: monospace;
    color: var(--primary);
}

.history-items {
    color: #94a3b8;
}

.history-total {
    text-align: right;
    font-weight: 600;
}

/* ==================== PHASE 2: HELD SALES ==================== */
.held-sales-list {
    max-height: 400px;
    overflow-y: auto;
}

.held-sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.held-sale-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.held-sale-info span {
    font-size: 12px;
    color: #64748b;
}

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

/* ==================== POS ORDER TYPE SELECTION ==================== */
.order-type-buttons {
    display: flex;
    gap: 5px;
}

.order-type-btn {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.order-type-btn i {
    font-size: 16px;
}

.order-type-btn:hover {
    background: #e2e8f0;
}

.order-type-btn.active {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1d4ed8;
}

.order-type-btn.active[data-type="dine-in"] {
    border-color: #059669;
    background: #d1fae5;
    color: #047857;
}

.order-type-btn.active[data-type="takeaway"] {
    border-color: #d97706;
    background: #fef3c7;
    color: #b45309;
}

.order-type-btn.active[data-type="delivery"] {
    border-color: #dc2626;
    background: #fee2e2;
    color: #b91c1c;
}

/* Held Sale Order Type Badges */
.held-order-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.held-order-type-badge.dine-in {
    background: #d1fae5;
    color: #047857;
}

.held-order-type-badge.takeaway {
    background: #fef3c7;
    color: #b45309;
}

.held-order-type-badge.delivery {
    background: #fee2e2;
    color: #b91c1c;
}

.held-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* ==================== POS TABLE MANAGEMENT (RESTAURANT MODE) ==================== */
.pos-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.pos-table-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
    min-height: 70px;
}

.pos-table-btn.available {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    border-color: #7dd3fc;
}

.pos-table-btn.available:hover {
    background: linear-gradient(135deg, #bae6fd, #e0f2fe);
    transform: translateY(-2px);
}

.pos-table-btn.occupied {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    border-color: #fcd34d;
}

.pos-table-btn.occupied:hover {
    background: linear-gradient(135deg, #fde68a, #fef3c7);
}

.pos-table-btn.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.pos-table-btn .table-number {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.pos-table-btn .table-name {
    font-size: 9px;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.pos-table-btn .table-status {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 10px;
    color: #d97706;
}

.pos-table-btn .table-amount {
    font-size: 10px;
    color: #059669;
    font-weight: 600;
    margin-top: 2px;
}

/* Current Table Badge */
.current-table-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.current-table-badge i {
    font-size: 16px;
}

.current-table-badge .badge-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-left: 5px;
}

.current-table-badge .badge-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Held Sale Table Badge */
.held-table-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Table Management Modal List */
.table-mgmt-item {
    transition: all 0.2s;
}

.table-mgmt-item:hover {
    background: #f8fafc;
}

/* ==================== PHASE 2: FORM GRID ==================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== DATA TABLE STYLES ==================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-table thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 14px 16px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.in-stock {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.low-stock {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.out-of-stock {
    background: #fee2e2;
    color: #dc2626;
}

/* Table Action Buttons */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

/* ==================== STOCK CONTROL STYLES ==================== */
.stock-tab {
    display: none;
}

.stock-tab.active {
    display: block;
}

.movement-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.movement-type.type-in {
    background: #dcfce7;
    color: #16a34a;
}

.movement-type.type-out {
    background: #fee2e2;
    color: #dc2626;
}

.movement-type.type-adjustment {
    background: #e0f2fe;
    color: #0284c7;
}

.positive {
    color: #16a34a;
    font-weight: 500;
}

.negative {
    color: #dc2626;
    font-weight: 500;
}

/* Low Stock Alerts */
.low-stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.low-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    background: #fff;
    border-left: 4px solid #f59e0b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.low-stock-item.critical {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.low-stock-item.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.low-stock-info h4 {
    margin: 0 0 5px 0;
    color: #1e293b;
    font-size: 15px;
}

.stock-details {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #64748b;
}

.low-stock-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.suggested-reorder {
    font-size: 12px;
    color: #64748b;
}

/* Stock Valuation */
.valuation-breakdown {
    margin-top: 20px;
}

.valuation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.valuation-row:last-child {
    border-bottom: none;
}

.valuation-category {
    display: flex;
    align-items: center;
    gap: 10px;
}

.valuation-category h4 {
    margin: 0;
    font-size: 14px;
    color: #334155;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin: 10px 0;
    font-size: 16px;
}

/* ==================== CUSTOMER STYLES ==================== */
.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.loyalty-points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: #334155;
}

/* Customer History */
.customer-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    align-items: center;
}

.history-date {
    color: #64748b;
}

.history-receipt {
    font-weight: 500;
    color: #2563eb;
}

.history-items {
    color: #64748b;
}

.history-total {
    font-weight: 600;
    color: #16a34a;
    text-align: right;
}

/* ==================== ORDER STATUS BADGES ==================== */
.order-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.status-completed {
    background: #dcfce7;
    color: #16a34a;
}

.order-status.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.order-status.status-processing {
    background: #e0f2fe;
    color: #0284c7;
}

.order-status.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.order-status.status-voided {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #fbbf24;
    text-decoration: line-through;
    font-weight: 600;
}

/* Order Details Modal */
.order-details {
    padding: 10px 0;
}

.order-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.order-items-list {
    max-height: 200px;
    overflow-y: auto;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.order-totals {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
}

/* Tax Exempt Badge */
.tax-exempt {
    color: #16a34a !important;
    font-weight: 600;
}

.product-tax-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.product-tax-badge.exempt {
    background: #dcfce7;
    color: #16a34a;
}

.product-tax-badge.taxable {
    background: #f1f5f9;
    color: #64748b;
}

/* ==================== PRODUCT IMAGE UPLOAD ==================== */
.image-upload-container {
    margin-bottom: 15px;
}

.image-upload-container label {
    display: block;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
    font-size: 14px;
}

.image-preview {
    width: 100%;
    height: 120px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: #f8fafc;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.image-preview:hover {
    border-color: #2563eb;
    background: #f1f5f9;
}

.image-preview i {
    font-size: 32px;
    margin-bottom: 8px;
}

.image-preview span {
    font-size: 13px;
}

.image-preview.has-image {
    border-style: solid;
    border-color: #2563eb;
    padding: 0;
}

.image-preview.has-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.image-upload-actions .btn-outline {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #475569;
}

.image-upload-actions .btn-outline:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #f1f5f9;
}

.image-upload-actions .btn-outline.danger {
    color: #dc2626;
}

.image-upload-actions .btn-outline.danger:hover {
    border-color: #dc2626;
    background: #fee2e2;
}

/* ==================== OUTLET CHECKBOX CONTAINER ==================== */
.outlet-checkbox-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-height: 44px;
    align-items: center;
}

/* Branch Stock Grid for Inventory */
.branch-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.branch-stock-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.branch-stock-item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.branch-stock-item .branch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.branch-stock-item .branch-label i {
    color: #2563eb;
    font-size: 12px;
}

.branch-stock-item .branch-code {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.branch-stock-item input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

.branch-stock-item input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.branch-stock-item.low-stock input {
    border-color: #f59e0b;
    background: #fffbeb;
}

.branch-stock-item.out-of-stock input {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Stock Badge by Branch in Product Cards */
.stock-by-branch {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 10px;
}

.branch-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 11px;
    color: #475569;
}

.branch-stock-badge.low {
    background: #fef3c7;
    color: #92400e;
}

.branch-stock-badge.out {
    background: #fee2e2;
    color: #991b1b;
}

.branch-stock-badge i {
    font-size: 9px;
}

.outlet-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.outlet-checkbox-item:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.outlet-checkbox-item.checked {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.outlet-checkbox-item input[type="checkbox"] {
    display: none;
}

.outlet-checkbox-item i {
    font-size: 11px;
}

/* ==================== CRM STYLES ==================== */
.crm-customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.crm-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.crm-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.crm-customer-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.crm-customer-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.crm-customer-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.crm-customer-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.crm-customer-info {
    flex: 1;
    min-width: 0;
}

.crm-customer-name {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-customer-company {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-customer-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.crm-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    background: #64748b;
}

.crm-badge.inactive {
    background: #94a3b8;
}

.crm-badge.active {
    background: #10b981;
}

.crm-customer-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #64748b;
}

.crm-customer-contact span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.crm-customer-contact i {
    font-size: 11px;
    color: #94a3b8;
}

.crm-customer-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.crm-stat {
    flex: 1;
    text-align: center;
}

.crm-stat-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.crm-stat-label {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.crm-stat.outstanding .crm-stat-value {
    color: #ef4444;
    font-weight: 700;
}

.crm-stat.outstanding {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    padding: 5px;
    margin: -5px;
}

.crm-customer-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* ==================== CRM VIEW TOGGLE ==================== */
.crm-view-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.crm-view-btn:hover {
    background: #334155;
    color: white;
}

.crm-view-btn.active {
    background: #2563eb;
    color: white;
}

/* ==================== CRM TABLE VIEW ==================== */
.crm-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.crm-table th {
    background: #f8fafc;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.crm-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.crm-table tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.crm-table tbody tr:hover {
    background: #f8fafc;
}

.crm-table tr.inactive-row {
    opacity: 0.6;
}

.crm-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.crm-badge-sm {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

/* ==================== MEMBERSHIP TIER BADGES ==================== */
.crm-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.crm-tier-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

.crm-membership-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    margin: 10px 0;
}

.crm-points-display {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.crm-tier-discount {
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ==================== POS CUSTOMER SEARCH ==================== */
.pos-customer-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pos-customer-search-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 70px 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.pos-customer-search-wrapper input[type="text"]:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    outline: none;
}

.pos-customer-search-wrapper input[type="text"].has-customer {
    border-color: #10b981;
    background: #f0fdf4;
    font-weight: 600;
}

.pos-customer-clear-btn {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    background: #fee2e2;
    color: #dc2626;
}

.pos-customer-clear-btn:hover {
    background: #fecaca;
}

.pos-customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pos-customer-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.pos-customer-dropdown-item:last-child {
    border-bottom: none;
}

.pos-customer-dropdown-item:hover,
.pos-customer-dropdown-item.highlighted {
    background: #fef3c7;
}

.pos-customer-dropdown-item.walk-in {
    background: #f8fafc;
    color: #64748b;
    font-style: italic;
}

.pos-customer-dropdown-item.walk-in:hover {
    background: #f1f5f9;
}

.pos-customer-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.pos-customer-item-info {
    flex: 1;
    min-width: 0;
}

.pos-customer-item-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-customer-item-details {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-customer-item-tier {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.pos-customer-item-points {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
    white-space: nowrap;
}

.pos-customer-no-results {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.pos-customer-no-results i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

/* ==================== POS MEMBERSHIP DISPLAY ==================== */
.pos-membership-info {
    margin-bottom: 10px;
}

.pos-membership-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #f59e0b;
}

.pos-membership-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pos-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.pos-tier-discount {
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
    background: #d1fae5;
    padding: 3px 8px;
    border-radius: 10px;
}

.pos-membership-points {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.pos-points-value {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
}

.pos-points-worth {
    font-size: 12px;
    color: #78716c;
}

.pos-membership-progress {
    font-size: 11px;
    color: #78716c;
    text-align: center;
    padding-top: 6px;
    border-top: 1px dashed #d97706;
}

/* POS Points Redemption Styles */
.pos-redeem-section {
    text-align: center;
    margin: 8px 0;
}

.pos-redeem-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pos-redeem-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.pos-redeem-hint {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
}

.pos-points-redeemed {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pos-points-redeemed span {
    color: #047857;
    font-size: 12px;
    font-weight: 600;
}

.pos-cancel-redeem {
    background: transparent;
    border: 1px solid #6ee7b7;
    color: #047857;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pos-cancel-redeem:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

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

.btn-icon-sm:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #2563eb;
}

.btn-icon-sm.danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #dc2626;
}

.crm-table-footer {
    padding: 10px 15px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-align: right;
    border-radius: 0 0 10px 10px;
}

/* ==================== CRM COMPACT VIEW ==================== */
.crm-compact-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.crm-compact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.crm-compact-item:hover {
    background: #f8fafc;
}

.crm-compact-item.inactive {
    opacity: 0.6;
}

.crm-compact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.crm-compact-info {
    flex: 1;
    min-width: 0;
}

.crm-compact-name {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-compact-details {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.crm-compact-details i {
    margin-right: 4px;
    font-size: 10px;
}

.crm-compact-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-compact-spent {
    font-weight: 600;
    color: #10b981;
    font-size: 13px;
}

.crm-compact-actions {
    display: flex;
    gap: 4px;
}

/* View mode container adjustments */
.crm-view-card .crm-customer-grid {
    display: grid;
}

.crm-view-table,
.crm-view-compact {
    display: block !important;
}

/* CRM Detail Modal */
.crm-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.crm-detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
}

.crm-detail-info {
    flex: 1;
}

.crm-detail-info h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #1e293b;
}

.crm-detail-company {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 8px;
}

.crm-detail-badges {
    display: flex;
    gap: 8px;
}

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

.crm-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crm-detail-section {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
}

.crm-detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-detail-section h4 i {
    color: #2563eb;
}

/* CRM Membership Detail Section */
.crm-membership-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
}

.crm-membership-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crm-membership-tier-display {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.crm-tier-badge-lg {
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.crm-tier-discount-lg {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}

.crm-membership-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.crm-stat-box {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.crm-stat-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.crm-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.crm-stat-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-tier-progress-section {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px;
    border-radius: 10px;
}

.crm-tier-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.crm-tier-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.crm-tier-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.crm-tier-max-reached {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

.crm-tier-max-reached i {
    margin-right: 6px;
}

.crm-points-history h5 {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-points-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.crm-points-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
}

.crm-points-history-item.earn {
    border-left-color: #10b981;
}

.crm-points-history-item.redeem {
    border-left-color: #ef4444;
}

.crm-points-history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-points-history-type {
    font-weight: 600;
    font-size: 13px;
}

.crm-points-history-item.earn .crm-points-history-type {
    color: #10b981;
}

.crm-points-history-item.redeem .crm-points-history-type {
    color: #ef4444;
}

.crm-points-history-ref {
    font-size: 11px;
    color: #94a3b8;
}

.crm-points-history-date {
    font-size: 11px;
    color: #94a3b8;
}

.crm-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.crm-detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.crm-detail-item.full-width {
    grid-column: 1 / -1;
}

.crm-detail-item label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-detail-item span {
    font-size: 14px;
    color: #1e293b;
}

.crm-sales-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
}

.crm-sale-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-sale-ref {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.crm-sale-date {
    font-size: 11px;
    color: #94a3b8;
}

.crm-sale-amount {
    font-weight: 600;
    color: #10b981;
}

.crm-interactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-interaction-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #2563eb;
}

.crm-interaction-item.payment-note {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

.crm-interaction-date {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.crm-interaction-text {
    font-size: 13px;
    color: #334155;
}

.crm-customer-note {
    margin-top: 10px;
    padding: 10px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
}

/* CRM Quotations List */
.crm-quotations-list,
.crm-projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-quotation-item,
.crm-project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.crm-quotation-item:hover,
.crm-project-item:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.crm-quotation-info,
.crm-project-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.crm-quotation-no,
.crm-project-no {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.crm-quotation-subject,
.crm-project-name {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.crm-quotation-date {
    font-size: 11px;
    color: #94a3b8;
}

.crm-quotation-right,
.crm-project-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.crm-quotation-amount,
.crm-project-amount {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.status-badge-sm {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Project Progress in CRM */
.crm-project-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.mini-progress-bar {
    width: 60px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 2px;
}

.crm-project-progress .progress-text {
    font-size: 10px;
    color: #64748b;
}

/* CRM Projects Summary */
.crm-projects-summary {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    margin-bottom: 12px;
}

.crm-projects-summary .summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-projects-summary .label {
    font-size: 11px;
    color: #64748b;
}

.crm-projects-summary .value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.text-muted {
    color: #94a3b8;
    font-size: 13px;
}

.text-success {
    color: #10b981;
}

.text-warning {
    color: #f59e0b;
}

/* ==================== PROJECTS MODULE ==================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.projects-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.projects-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
    display: block;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.project-info {
    flex: 1;
}

.project-no {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 4px 0;
}

.project-customer {
    font-size: 12px;
    color: #64748b;
}

.project-status {
    font-size: 11px;
    font-weight: 600;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-amounts {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
}

.project-amount-item {
    flex: 1;
    text-align: center;
}

.amount-label {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.amount-value {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.amount-value.received {
    color: #10b981;
}

.amount-value.pending {
    color: #f59e0b;
}

.project-progress {
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar.large {
    height: 12px;
    border-radius: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    color: #64748b;
    text-align: right;
    display: block;
}

.project-milestones-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.milestone-chip {
    font-size: 10px;
    padding: 3px 8px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
}

.milestone-chip.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.milestone-chip.partial {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.milestone-more {
    font-size: 10px;
    color: #94a3b8;
}

.project-dates {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: #94a3b8;
}

.project-dates i {
    margin-right: 4px;
}

/* Project Detail Modal */
.project-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.project-detail-info h3 {
    margin: 5px 0;
    font-size: 20px;
    color: #1e293b;
}

.project-detail-no {
    font-size: 12px;
    color: #94a3b8;
}

.project-detail-customer {
    color: #64748b;
    font-size: 14px;
    margin: 5px 0;
}

.project-detail-customer i {
    margin-right: 5px;
}

.project-detail-desc {
    font-size: 13px;
    color: #64748b;
    margin-top: 10px;
}

.project-detail-status {
    font-size: 12px;
    font-weight: 600;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
}

.project-detail-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    flex: 1;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.summary-card.total {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.summary-card.received {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.summary-card.remaining {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.summary-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.summary-card.received .summary-value {
    color: #059669;
}

.summary-card.remaining .summary-value {
    color: #dc2626;
}

.project-detail-progress {
    margin-bottom: 25px;
}

.project-detail-section {
    margin-bottom: 25px;
}

.project-detail-section h4 {
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-detail-section h4 i {
    color: #2563eb;
}

/* Milestones List */
.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.milestone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #94a3b8;
}

.milestone-item.paid {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.milestone-item.partial {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.milestone-info {
    flex: 1;
}

.milestone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.milestone-name {
    font-weight: 600;
    color: #1e293b;
}

.milestone-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.milestone-badge.pending {
    background: #f1f5f9;
    color: #64748b;
}

.milestone-badge.partial {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.milestone-badge.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.milestone-details {
    font-size: 13px;
    color: #64748b;
    display: flex;
    gap: 15px;
}

.milestone-due {
    color: #94a3b8;
}

.milestone-paid-info {
    font-size: 12px;
    color: #10b981;
    margin-top: 5px;
}

.milestone-actions {
    margin-left: 15px;
}

/* Payment History */
.payment-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-history-item {
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.payment-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.payment-milestone {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
}

.payment-date {
    font-size: 12px;
    color: #94a3b8;
}

.payment-details {
    display: flex;
    justify-content: space-between;
}

.payment-amount {
    font-weight: 600;
    color: #10b981;
}

.payment-method {
    font-size: 12px;
    color: #64748b;
    text-transform: capitalize;
}

.payment-ref {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 5px;
}

.project-detail-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    justify-content: flex-end;
}

/* Milestone Input Form */
.milestones-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

.milestones-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.milestones-header h4 {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.milestone-total-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.milestone-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.milestone-input-row .milestone-name {
    flex: 2;
}

.milestone-input-row .milestone-percent {
    width: 70px;
}

.milestone-input-row .milestone-date {
    width: 140px;
}

/* ==================== QUOTATIONS MODULE ==================== */
.quotations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.quotations-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.quotations-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
    display: block;
}

.quotation-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quotation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.quotation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quotation-number {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.quotation-card-customer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.quotation-card-customer i {
    color: #94a3b8;
}

.quotation-card-subject {
    font-size: 12px;
    color: #475569;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
}

.quotation-card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quotation-card-date {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quotation-card-amount {
    font-size: 16px;
    color: #1e293b;
}

.quotation-card-valid {
    font-size: 11px;
    color: #94a3b8;
}

/* Quotation Modal Styles */
.quotation-items-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

.quotation-items-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.quotation-items-section .section-header h4 {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.quotation-items-header {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.quotation-item-row {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.quotation-item-row:last-child {
    border-bottom: none;
}

.item-main {
    flex: 3;
}

.item-qty {
    width: 70px;
}

.item-price {
    width: 120px;
}

.item-total {
    width: 100px;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
}

.item-actions {
    width: 40px;
    text-align: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #e2e8f0;
}

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

.quotation-totals-section {
    margin-top: 15px;
}

.totals-display {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
}

.total-row:last-child {
    border-bottom: none;
}

.total-row.grand {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid #e2e8f0;
}

/* Customer Info in Quotation */
.customer-info-card {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
}

.customer-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #64748b;
    padding: 4px 0;
}

.customer-info-row i {
    width: 16px;
    color: #94a3b8;
}

/* Quotation Detail View */
.quotation-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.quotation-detail-header h2 {
    font-size: 22px;
    margin: 0 0 10px 0;
    color: #1e293b;
}

.quotation-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quotation-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 600px) {
    .quotation-detail-grid {
        grid-template-columns: 1fr;
    }
}

.quotation-detail-section {
    margin-bottom: 20px;
}

.quotation-detail-section h3 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quotation-detail-section.highlight {
    padding: 15px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 10px;
    border: 1px solid #bfdbfe;
}

.detail-rows {
    background: #f8fafc;
    padding: 12px 15px;
    border-radius: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.detail-row .label {
    color: #64748b;
}

.detail-row .value {
    color: #1e293b;
    font-weight: 500;
}

.quotation-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.quotation-items-table th {
    background: #f8fafc;
    padding: 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.quotation-items-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.quotation-totals {
    margin-left: auto;
    width: 280px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
}

.quotation-totals .total-row {
    border-bottom: 1px solid #e2e8f0;
}

.quotation-totals .total-row.discount {
    color: #ef4444;
}

.quotation-totals .total-row.tax {
    color: #64748b;
}

.quotation-notes,
.quotation-terms {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.status-badge.large {
    font-size: 12px;
    padding: 6px 14px;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline.danger {
    border-color: #fecaca;
    color: #ef4444;
}

.btn-outline.danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

/* Linked Quotation Badge in Project Detail */
.linked-quotation-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #3b82f6;
    background: #eff6ff;
    padding: 6px 12px;
    border-radius: 20px;
    margin-top: 10px;
    border: 1px solid #bfdbfe;
}

.linked-quotation-badge i {
    font-size: 14px;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 5px;
}

.btn-link:hover {
    color: #1d4ed8;
}

/* ==================== COST CALCULATION HELPERS ==================== */
.cost-input-wrapper {
    position: relative;
}

.cost-suggestion {
    margin-top: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fef3c7, #fef9c3);
    border-radius: 8px;
    border: 1px solid #fcd34d;
}

.cost-suggestion small {
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.cost-suggestion i {
    color: #f59e0b;
}

.margin-display {
    padding: 6px 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.margin-display.negative {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ==================== SUPPLIER MODULE STYLES ==================== */
.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.supplier-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.supplier-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.supplier-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.supplier-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.supplier-info {
    flex: 1;
    min-width: 0;
}

.supplier-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supplier-contact {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.supplier-category {
    display: inline-block;
    font-size: 10px;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.supplier-card-body {
    padding: 12px 15px;
}

.supplier-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}

.supplier-detail-row:last-child {
    margin-bottom: 0;
}

.supplier-detail-row i {
    width: 16px;
    color: #94a3b8;
    font-size: 12px;
}

.supplier-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.supplier-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.supplier-balance span {
    color: #64748b;
}

.supplier-balance strong {
    color: #1e293b;
}

.supplier-balance.pending strong {
    color: #f59e0b;
}

.supplier-balance.overdue strong {
    color: #ef4444;
}

.overdue-badge {
    font-size: 9px;
    background: #fef2f2;
    color: #ef4444;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.supplier-actions {
    display: flex;
    gap: 5px;
}

/* Supplier Detail Modal */
.supplier-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.supplier-detail-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
}

.supplier-detail-info h3 {
    margin: 0 0 5px 0;
    font-size: 22px;
    color: #1e293b;
}

.supplier-detail-info .contact-name {
    color: #64748b;
    font-size: 14px;
    margin: 0 0 8px 0;
}

.supplier-detail-info .contact-name i {
    margin-right: 5px;
}

.supplier-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.supplier-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.supplier-stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.supplier-stat-card .stat-icon.payable {
    background: #fef2f2;
    color: #ef4444;
}

.supplier-stat-card .stat-icon.purchases {
    background: #ecfdf5;
    color: #10b981;
}

.supplier-stat-card .stat-icon.terms {
    background: #eff6ff;
    color: #3b82f6;
}

.supplier-stat-card .stat-icon.limit {
    background: #fef3c7;
    color: #f59e0b;
}

.supplier-stat-card .stat-info {
    flex: 1;
}

.supplier-stat-card .stat-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.supplier-stat-card .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.supplier-stat-card .stat-value.text-danger {
    color: #ef4444;
}

.supplier-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

.detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 i {
    color: #3b82f6;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 14px;
    color: #1e293b;
}

.detail-item .action-link {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
}

.notes-content {
    margin: 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    white-space: pre-wrap;
}

.no-history {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 15px;
}

.purchase-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.purchase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.purchase-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.purchase-date {
    font-size: 11px;
    color: #94a3b8;
}

.purchase-desc {
    font-size: 13px;
    color: #1e293b;
}

.purchase-amount {
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.purchase-status {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    margin-top: 2px;
}

.purchase-status.paid {
    color: #10b981;
}

.purchase-status.pending {
    color: #f59e0b;
}

.more-history {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    margin-top: 8px;
}

.supplier-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ==================== LOW STOCK SUPPLIER TAG ==================== */
.supplier-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #6366f1;
    background: #eef2ff;
    padding: 3px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.supplier-tag i {
    font-size: 10px;
}

.low-stock-actions .action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ==================== REORDER MODAL ==================== */
.reorder-summary {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.reorder-product {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reorder-product strong {
    font-size: 16px;
    color: #1e293b;
}

.reorder-product .sku {
    font-size: 12px;
    color: #64748b;
}

.reorder-supplier {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #6366f1;
}

.reorder-supplier i {
    color: #8b5cf6;
}
/* ==================== HR & PAYROLL MODULE STYLES ==================== */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.employee-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.2s;
    position: relative;
}

.employee-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.employee-card.inactive {
    opacity: 0.7;
    background: #f8fafc;
}

.employee-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 auto;
}

.employee-info {
    text-align: center;
}

.employee-info h4 {
    margin: 0 0 5px;
    font-size: 16px;
    color: #1e293b;
}

.employee-position {
    font-size: 14px;
    color: #3b82f6;
    margin: 0 0 5px;
    font-weight: 500;
}

.employee-department {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 5px;
}

.employee-salary {
    font-size: 13px;
    color: #10b981;
    font-weight: 600;
    margin: 0;
}

.employee-status {
    position: absolute;
    top: 15px;
    right: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.status-badge.processed {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.paid {
    background: #dcfce7;
    color: #16a34a;
}

.employee-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

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

.btn-icon:hover {
    background: #f1f5f9;
    color: #3b82f6;
    border-color: #3b82f6;
}

.btn-icon.danger:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #ef4444;
}

/* Employee Detail Modal */
.employee-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    margin-bottom: 20px;
}

.employee-detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
}

.employee-detail-title h3 {
    margin: 0 0 5px;
    font-size: 22px;
    color: #1e293b;
}

.employee-detail-title p {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 14px;
}

.employee-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
}

.detail-section h4 {
    margin: 0 0 15px;
    font-size: 14px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 i {
    color: #3b82f6;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-item .label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
}

.detail-item .value {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

.employee-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.employee-detail-actions button {
    flex: 1;
}

/* Form Sections */
.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-of-type {
    border-bottom: none;
}

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

.form-section h4 i {
    color: #3b82f6;
}

/* Payroll Preview */
.payroll-preview {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}

.payroll-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .payroll-preview-grid {
        grid-template-columns: 1fr;
    }
}

.preview-section {
    background: white;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

.preview-section h5 {
    margin: 0 0 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-section.earnings h5 { color: #10b981; }
.preview-section.deductions h5 { color: #ef4444; }
.preview-section.employer h5 { color: #6366f1; }

.preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
}

.preview-row.total {
    border-top: 1px solid #e2e8f0;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: 600;
    color: #1e293b;
}

.preview-section.net-pay {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    text-align: center;
}

.net-pay-box {
    padding: 20px;
}

.net-pay-box span:first-child {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.8;
}

.net-amount {
    display: block;
    font-size: 36px;
    font-weight: 700;
    margin-top: 5px;
    color: #4ade80;
}

.total-cost {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
}

/* Payroll Table */
.payroll-table {
    width: 100%;
    border-collapse: collapse;
}

.payroll-table th,
.payroll-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.payroll-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
}

.payroll-table td {
    font-size: 14px;
    color: #1e293b;
}

.payroll-table tr:hover {
    background: #f8fafc;
}

/* Payslip Styles */
.payslip {
    background: white;
    max-width: 800px;
    margin: 0 auto;
}

.payslip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #1e293b;
}

.payslip-header .company-info h2 {
    margin: 0;
    font-size: 24px;
    color: #1e293b;
}

.payslip-header .company-info p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 14px;
}

.payslip-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
}

.payslip-employee-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}

.payslip-employee-info .info-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payslip-employee-info .label {
    font-size: 11px;
    color: #94a3b8;
}

.payslip-employee-info .value {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

.payslip-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.payslip-column h4 {
    margin: 0 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.payslip-column.earnings h4 {
    color: #10b981;
    border-color: #10b981;
}

.payslip-column.deductions h4 {
    color: #ef4444;
    border-color: #ef4444;
}

.payslip-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
}

.payslip-line.total {
    border-top: 1px solid #e2e8f0;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: 600;
    color: #1e293b;
}

.payslip-employer {
    background: #f0fdf4;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.payslip-employer h4 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    color: #166534;
}

.payslip-employer .employer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.payslip-net {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.payslip-net .net-pay-label {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.8;
}

.payslip-net .net-pay-amount {
    font-size: 42px;
    font-weight: 700;
    color: #4ade80;
    margin-top: 5px;
}

.payslip-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.payslip-footer p {
    margin: 5px 0;
    font-size: 11px;
    color: #94a3b8;
}

/* Recurring Bill Styles */
.recurring-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.recurring-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.recurring-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.recurring-toggle span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.recurring-toggle i {
    color: #3b82f6;
}

#recurringOptions {
    margin-top: 15px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
}

.recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    background: #dbeafe;
    color: #2563eb;
    margin-left: 8px;
    text-transform: capitalize;
}

.recurring-badge.auto-generated {
    background: #f0fdf4;
    color: #16a34a;
}

.recurring-badge i {
    font-size: 9px;
}

@media print {
    .modal-header,
    .modal-footer,
    .nav-panel,
    .keyboard-hint {
        display: none !important;
    }
    
    .modal {
        position: static;
        background: none;
    }
    
    .modal-content {
        box-shadow: none;
        max-width: 100%;
    }
    
    .payslip {
        padding: 0;
    }
}

/* ==================== KPI MODULE STYLES ==================== */
.kpi-templates-grid,
.kpi-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.kpi-template-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s;
}

.kpi-template-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.template-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.template-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.template-icon.sales { background: linear-gradient(135deg, #10b981, #059669); }
.template-icon.operations { background: linear-gradient(135deg, #f59e0b, #d97706); }
.template-icon.admin { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.template-icon.management { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.template-icon.general { background: linear-gradient(135deg, #64748b, #475569); }

.template-info h4 {
    margin: 0;
    font-size: 15px;
    color: #1e293b;
}

.template-category {
    font-size: 12px;
    color: #64748b;
}

.default-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    background: #dbeafe;
    color: #2563eb;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.template-metrics {
    padding: 15px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 13px;
}

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

.metric-item .metric-name {
    color: #475569;
}

.metric-item .metric-weight {
    color: #3b82f6;
    font-weight: 600;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.template-actions {
    display: flex;
    gap: 8px;
    padding: 15px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.template-actions .btn-secondary {
    flex: 1;
}

/* KPI Metric Editor */
.kpi-metric-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.metric-fields {
    display: grid;
    grid-template-columns: 2fr 80px 100px 80px;
    gap: 10px;
    flex: 1;
}

.metric-header-row {
    display: grid;
    grid-template-columns: 2fr 80px 100px 80px 40px;
    gap: 10px;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.weight-indicator {
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
}

.weight-indicator.weight-valid,
.weight-valid {
    background: #dcfce7;
    color: #16a34a;
}

.weight-indicator.weight-invalid,
.weight-invalid {
    background: #fef2f2;
    color: #dc2626;
}

/* KPI Assignment Card */
.kpi-assignment-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s;
}

.kpi-assignment-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.kpi-assignment-card.pending {
    border-left: 4px solid #f59e0b;
}

.kpi-assignment-card.scored {
    border-left: 4px solid #10b981;
}

.assignment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8fafc;
}

.employee-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.assignment-info {
    flex: 1;
}

.assignment-info h4 {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.assignment-template {
    font-size: 12px;
    color: #64748b;
}

.assignment-period {
    font-size: 12px;
    color: #3b82f6;
    font-weight: 600;
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 15px;
}

.assignment-score {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
}

.score-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.score-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rating-stars {
    font-size: 18px;
}

.rating-label {
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
}

.assignment-pending {
    padding: 20px;
    text-align: center;
    color: #f59e0b;
}

.assignment-pending i {
    font-size: 24px;
    margin-bottom: 8px;
}

/* ==================== STAFF PERFORMANCE SCORECARD ==================== */
.scorecard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

.staff-scorecard {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.staff-scorecard:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.scorecard-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.scorecard-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    border: 3px solid rgba(255,255,255,0.4);
}

.scorecard-employee-info {
    flex: 1;
}

.scorecard-employee-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.scorecard-employee-info .department {
    font-size: 13px;
    opacity: 0.9;
}

.scorecard-employee-info .position {
    font-size: 12px;
    opacity: 0.75;
}

.scorecard-overall {
    text-align: center;
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
}

.scorecard-overall .score {
    font-size: 28px;
    font-weight: 700;
}

.scorecard-overall .label {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.8;
}

.scorecard-metrics {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.scorecard-metric {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.scorecard-metric .metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 18px;
    color: white;
}

.scorecard-metric .metric-icon.sales { background: linear-gradient(135deg, #10b981, #059669); }
.scorecard-metric .metric-icon.attendance { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.scorecard-metric .metric-icon.tasks { background: linear-gradient(135deg, #f59e0b, #d97706); }
.scorecard-metric .metric-icon.quality { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.scorecard-metric .metric-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.scorecard-metric .metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.scorecard-metric .metric-detail {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
}

.scorecard-metric .metric-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.scorecard-metric .metric-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.scorecard-metric .metric-bar-fill.excellent { background: linear-gradient(90deg, #10b981, #34d399); }
.scorecard-metric .metric-bar-fill.good { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.scorecard-metric .metric-bar-fill.average { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.scorecard-metric .metric-bar-fill.poor { background: linear-gradient(90deg, #ef4444, #f87171); }

.scorecard-footer {
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scorecard-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scorecard-rating .stars {
    font-size: 16px;
    color: #fbbf24;
}

.scorecard-rating .rating-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

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

.scorecard-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}

.scorecard-actions .btn-view {
    background: #eff6ff;
    color: #3b82f6;
}

.scorecard-actions .btn-print {
    background: #f0fdf4;
    color: #10b981;
}

/* Rating badges */
.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.rating-badge.excellent { background: #d1fae5; color: #059669; }
.rating-badge.good { background: #dbeafe; color: #2563eb; }
.rating-badge.average { background: #fef3c7; color: #d97706; }
.rating-badge.poor { background: #fee2e2; color: #dc2626; }

.assignment-pending span {
    display: block;
    font-size: 14px;
}

.assignment-metrics-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 15px 15px;
}

.metric-mini {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.metric-mini.exceptional { background: #dcfce7; color: #166534; }
.metric-mini.excellent { background: #d1fae5; color: #065f46; }
.metric-mini.good { background: #fef3c7; color: #92400e; }
.metric-mini.needs-improvement { background: #ffedd5; color: #9a3412; }
.metric-mini.poor { background: #fef2f2; color: #dc2626; }

.assignment-actions {
    display: flex;
    gap: 8px;
    padding: 15px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.assignment-actions button {
    flex: 1;
}

/* Score KPI Modal */
.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 15px;
}

.score-employee strong {
    display: block;
    font-size: 16px;
    color: #1e293b;
}

.score-employee span {
    font-size: 13px;
    color: #64748b;
}

.score-template {
    font-size: 13px;
    color: #3b82f6;
    font-weight: 600;
    background: #eff6ff;
    padding: 6px 12px;
    border-radius: 15px;
}

.score-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
}

.guide-item {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 10px;
    background: white;
}

.guide-item.exceptional { color: #10b981; }
.guide-item.excellent { color: #22c55e; }
.guide-item.good { color: #f59e0b; }
.guide-item.needs-improvement { color: #f97316; }
.guide-item.poor { color: #ef4444; }

.score-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-weight: 600;
    color: #1e293b;
}

.metric-target {
    font-size: 12px;
    color: #64748b;
}

.metric-weight-badge {
    font-size: 11px;
    background: #dbeafe;
    color: #2563eb;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.metric-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-input input {
    width: 100px;
}

.metric-score-display {
    width: 60px;
    text-align: center;
    font-weight: 600;
    padding: 5px;
    border-radius: 6px;
    background: #f1f5f9;
}

.metric-score-display.exceptional { background: #dcfce7; color: #166534; }
.metric-score-display.excellent { background: #d1fae5; color: #065f46; }
.metric-score-display.good { background: #fef3c7; color: #92400e; }
.metric-score-display.needs-improvement { background: #ffedd5; color: #9a3412; }
.metric-score-display.poor { background: #fef2f2; color: #dc2626; }

.overall-score-preview {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e2e8f0;
}

.overall-score-value {
    font-size: 42px;
    font-weight: 700;
}

.overall-score-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.overall-score-rating .rating-stars {
    font-size: 24px;
}

.overall-score-rating .rating-label {
    font-size: 16px;
}

/* Performance History Modal */
.performance-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.employee-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
}

.performance-summary h3 {
    margin: 0;
    font-size: 20px;
}

.performance-summary p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.performance-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.perf-stat {
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.perf-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.perf-stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

.performance-history {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-period {
    font-weight: 600;
    color: #1e293b;
    min-width: 80px;
}

.history-template {
    flex: 1;
    color: #64748b;
    font-size: 13px;
}

.history-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-badge {
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
}

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

/* Secondary tabs */
.tabs.secondary {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 5px;
}

.tabs.secondary .tab {
    background: transparent;
    border: none;
}

.tabs.secondary .tab.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Payroll Preview */
.payroll-preview {
    margin-top: 20px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.payroll-preview-grid {
    display: grid;
    gap: 15px;
}

.preview-section {
    padding: 15px;
    border-radius: 8px;
    background: white;
}

.preview-section h5 {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-section.earnings h5 { color: #10b981; }
.preview-section.deductions h5 { color: #ef4444; }
.preview-section.employer h5 { color: #6366f1; }

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
}

.preview-row.total {
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 10px;
    font-weight: 600;
    color: #1e293b;
}

.preview-section.net-pay {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
}

.net-pay-box {
    text-align: center;
    padding: 15px 0;
}

.net-pay-box span:first-child {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.net-amount {
    font-size: 32px;
    font-weight: 700;
}

.total-cost {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 13px;
    opacity: 0.9;
}

/* Payroll Table */
.payroll-table {
    width: 100%;
    border-collapse: collapse;
}

.payroll-table th,
.payroll-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.payroll-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
}

.payroll-table tr:hover {
    background: #f8fafc;
}

/* Status Badge for Payroll */
.status-badge.processed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.paid {
    background: #dbeafe;
    color: #1e40af;
}

/* Commission Rules Styling */
.commission-rule-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.commission-rule-row select,
.commission-rule-row input {
    font-size: 13px;
}

.commission-rule-row .rule-currency {
    font-weight: 600;
    color: #64748b;
    min-width: 25px;
}

/* Tiered Commission Rows */
.commission-tier-row {
    display: grid;
    grid-template-columns: 1fr 1fr 100px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.commission-tier-row:hover {
    background: #f1f5f9;
}

.commission-tier-row input {
    font-size: 13px;
}

#commissionTiersContainer:empty::after {
    content: 'No commission tiers defined. Click "Add Tier" to create one.';
    display: block;
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    font-size: 13px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

#commissionRulesContainer:empty::after {
    content: 'No commission rules defined. Click "Add Rule" to create one.';
    display: block;
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    font-size: 13px;
}

/* ==================== KPI REPORT STYLES ==================== */
#kpiReportSection .section-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

#kpiReportSection .section-header h3 i {
    color: #3b82f6;
    margin-right: 8px;
}

.highlight-success {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), transparent) !important;
}

.highlight-warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), transparent) !important;
}

.score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    min-width: 50px;
}

.score-badge.exceptional { background: #10b981; color: white; }
.score-badge.excellent { background: #22c55e; color: white; }
.score-badge.good { background: #f59e0b; color: white; }
.score-badge.needs-improvement { background: #f97316; color: white; }
.score-badge.poor { background: #ef4444; color: white; }

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Auto-score section in score modal */
.auto-score-section {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
    border-radius: 10px;
    padding: 15px;
}

.auto-score-section button {
    white-space: nowrap;
}

/* Performance modal enhancements */
.performance-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    margin-bottom: 20px;
}

.employee-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.performance-summary h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.performance-summary p {
    margin: 5px 0 0;
    font-size: 13px;
    color: #64748b;
}

.performance-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.perf-stat {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

.perf-stat-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.perf-stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
}

.performance-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.history-period {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    min-width: 80px;
}

.history-template {
    flex: 1;
    font-size: 13px;
    color: #475569;
}

.history-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Badge outline style */
.badge.outline {
    background: transparent;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
}

/* ==================== LEAVE & ATTENDANCE STYLES ==================== */

/* Status badges for leave/attendance */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.danger {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.info {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.secondary {
    background: #f1f5f9;
    color: #64748b;
}

/* Leave type badges */
.badge.info {
    background: #dbeafe;
    color: #2563eb;
}

.badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.badge.danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge.secondary {
    background: #f1f5f9;
    color: #64748b;
}

.badge.primary {
    background: #e0e7ff;
    color: #4f46e5;
}

/* Leave balance card styling */
.leave-balance-card {
    transition: all 0.2s ease;
}

.leave-balance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Attendance clock section */
.attendance-clock-section {
    border: 1px solid #e2e8f0;
}

/* Button icon variants */
.btn-icon.success {
    color: #10b981;
}

.btn-icon.success:hover {
    background: #dcfce7;
}

.btn-icon.danger {
    color: #ef4444;
}

.btn-icon.danger:hover {
    background: #fee2e2;
}

/* Form grid spacing */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 500px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal footer spacing */
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
}

/* ==================== PHASE 5: MULTI-BRANCH STYLES ==================== */

/* Section Header for Branches */
#branches .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 15px;
}

#branches .section-header h2 {
    color: #1e293b;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin: 0;
}

#branches .section-header h2 i {
    color: #2563eb;
}

#branches .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Stats Row for Branches */
#branches .stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* Branches Stat Cards with Colors */
.stat-card.branches-stat {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    position: relative;
    overflow: hidden;
    border: none;
}

.stat-card.branches-stat::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(30deg);
}

.stat-card.branches-stat.blue {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.stat-card.branches-stat.green {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.stat-card.branches-stat.orange {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.stat-card.branches-stat.purple {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.stat-card.branches-stat .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card.branches-stat .stat-info {
    flex: 1;
}

.stat-card.branches-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card.branches-stat .stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (min-width: 768px) {
    #branches .stats-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tabs Styling for Branches */
#branches .tabs {
    display: flex;
    margin-bottom: 0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

#branches .tabs .tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

#branches .tabs .tab:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

#branches .tabs .tab.active {
    color: #2563eb;
    background: white;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tab Content Styling */
#branches .tab-content {
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Filter Bar */
#branches .filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

#branches .filter-bar .search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

#branches .filter-bar .search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Branch Grid Layout */
.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Branch Card */
.branch-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.branch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.12);
    border-color: #2563eb;
}

.branch-card.headquarters {
    border-top: 4px solid #f59e0b;
}

.branch-card.retail {
    border-top: 4px solid #2563eb;
}

.branch-card.warehouse {
    border-top: 4px solid #8b5cf6;
}

.branch-card.office {
    border-top: 4px solid #10b981;
}

.branch-card-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
}

.branch-card-header .branch-info h4 {
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.branch-card-header .branch-info .branch-code {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.branch-card-header .branch-type {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.branch-type.headquarters {
    background: #fef3c7;
    color: #92400e;
}

.branch-type.retail {
    background: #dbeafe;
    color: #1e40af;
}

.branch-type.warehouse {
    background: #ede9fe;
    color: #6d28d9;
}

.branch-type.office {
    background: #d1fae5;
    color: #065f46;
}

.branch-card-body {
    padding: 15px 20px;
}

.branch-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #475569;
}

.branch-detail i {
    color: #94a3b8;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.branch-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.branch-stat {
    text-align: center;
}

.branch-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.branch-stat-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
}

.branch-card-footer {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}

.branch-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.branch-status.active {
    color: #10b981;
}

.branch-status.inactive {
    color: #94a3b8;
}

.branch-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

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

/* Global Branch Selector */
#globalBranchSelector {
    background: white;
    border: 2px solid #2563eb;
    color: #2563eb;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 8px;
}

#globalBranchSelector:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Transfer Table Styles */
#transfersTable tbody tr {
    transition: background 0.2s ease;
}

#transfersTable tbody tr:hover {
    background: #f8fafc;
}

.transfer-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.transfer-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.transfer-status.intransit {
    background: #dbeafe;
    color: #1e40af;
}

.transfer-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.transfer-status.cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

/* Branch Report Cards */
.branch-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.branch-report-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.branch-report-card h4 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.branch-performance-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
}

.branch-performance-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.branch-performance-fill.excellent {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.branch-performance-fill.good {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.branch-performance-fill.average {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.branch-performance-fill.poor {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Transfer Detail Modal */
.transfer-detail-section {
    margin-bottom: 20px;
}

.transfer-detail-section h4 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.transfer-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.transfer-detail-row:last-child {
    border-bottom: none;
}

.transfer-items-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.transfer-items-summary table {
    width: 100%;
}

.transfer-items-summary th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    padding-bottom: 8px;
}

.transfer-items-summary td {
    padding: 6px 0;
    font-size: 13px;
}

/* Branch comparison table */
.branch-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.branch-comparison-table th {
    text-align: left;
    padding: 12px 15px;
    background: #f1f5f9;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}

.branch-comparison-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.branch-comparison-table tbody tr:hover {
    background: #f8fafc;
}

.branch-comparison-table .branch-name {
    font-weight: 600;
    color: #1e293b;
}

.branch-comparison-table .positive {
    color: #10b981;
}

.branch-comparison-table .negative {
    color: #ef4444;
}

/* Empty state for branches */
.branches-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.branches-empty-state i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.branches-empty-state h3 {
    color: #475569;
    margin-bottom: 10px;
}

.branches-empty-state p {
    margin-bottom: 20px;
}

/* Transfers Table Styling */
#transfersTable {
    width: 100%;
    border-collapse: collapse;
}

#transfersTable th {
    text-align: left;
    padding: 12px 15px;
    background: #f8fafc;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

#transfersTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #334155;
}

#transfersTable tbody tr:hover {
    background: #f8fafc;
}

/* Empty State for Tab Content */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

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

.empty-state h4 {
    color: #475569;
    margin-bottom: 10px;
    font-size: 18px;
}

.empty-state p {
    margin-bottom: 20px;
    color: #94a3b8;
}

/* ==================== USER MANAGEMENT STYLES ==================== */

/* Top Auth Bar - Desktop */
.top-auth-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(37, 99, 235, 0.1);
    flex-shrink: 0;
    gap: 8px;
}

/* Top bar actions container - horizontal alignment */
.top-bar-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Icon buttons in top bar */
.top-bar-actions .btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-bar-actions .btn-icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.top-bar-actions .btn-icon i {
    font-size: 14px;
    color: #64748b;
}

/* Auth container base styles */
#authContainer {
    display: flex;
    align-items: center;
    gap: 8px;
}

#authContainer .btn-primary,
#authContainer .btn-outline {
    padding: 8px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-auth-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.branch-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 25px;
    font-size: 13px;
    color: #0369a1;
    font-weight: 500;
}

.branch-indicator i {
    color: #0284c7;
}

.top-auth-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* User UID Display - Hidden, now shown in dropdown */
.user-uid-display {
    display: none; /* Moved to dropdown */
}

/* UID Badge inside dropdown */
.user-uid-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    border: 1px solid #a5b4fc;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #4338ca;
    font-family: 'Monaco', 'Consolas', monospace;
    letter-spacing: 0.5px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.user-role {
    font-size: 11px;
    color: #64748b;
}

.user-menu-btn .fa-chevron-down {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dropdown-user-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-user-info strong {
    display: block;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

.dropdown-user-info small {
    display: block;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-header strong {
    display: block;
    color: #1e293b;
    font-size: 14px;
}

.dropdown-header small {
    color: #64748b;
    font-size: 12px;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 13px;
}

.user-dropdown a:hover {
    background: #f8fafc;
    color: #2563eb;
}

.user-dropdown a.logout-link {
    color: #dc2626;
}

.user-dropdown a.logout-link:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* Login Modal Styles */
.login-header {
    text-align: center;
    padding: 30px 20px 20px;
}

.login-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.login-logo i {
    font-size: 32px;
    color: white;
}

.login-header h2 {
    color: #1e293b;
    font-size: 24px;
    margin-bottom: 5px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

.input-icon input {
    padding-left: 45px;
}

.login-footer {
    padding: 0 20px 20px;
}

/* User Management Stats */
.user-management-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.user-management-stats .stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.user-management-stats .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.user-management-stats .stat-info {
    display: flex;
    flex-direction: column;
}

.user-management-stats .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.user-management-stats .stat-label {
    font-size: 12px;
    color: #64748b;
}

/* Role Sections */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.role-section {
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

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

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

.role-title i {
    font-size: 18px;
}

.role-count {
    background: #e2e8f0;
    color: #64748b;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.role-users {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.no-users {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    font-size: 13px;
}

/* User Cards */
.user-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.user-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.user-card.inactive {
    opacity: 0.6;
    background: #f8fafc;
}

.user-card .user-avatar {
    width: 45px;
    height: 45px;
    font-size: 16px;
    flex-shrink: 0;
}

.user-card .user-details {
    flex: 1;
    min-width: 0;
}

.user-card .user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-card .user-email {
    color: #64748b;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card .user-uid {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    border: 1px solid #a5b4fc;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #4338ca;
    width: fit-content;
}

.user-card .user-uid i {
    font-size: 10px;
}

.user-card .user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.status-badge {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

.permissions-count {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.permissions-count i {
    font-size: 10px;
    color: #f59e0b;
}

.user-card .user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #475569;
}

.btn-icon.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.current-user-badge {
    font-size: 11px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    border-radius: 20px;
    font-weight: 600;
}

/* Permissions Grid */
.permissions-grid {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 6px;
}

.permission-item:hover {
    background: #f0f9ff;
}

.permission-item.full-access {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    margin-bottom: 15px;
    border: 1px solid #f59e0b;
}

.permission-item.full-access:hover {
    background: linear-gradient(135deg, #fde68a, #fcd34d);
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.permission-item span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.permission-item span i {
    width: 18px;
    text-align: center;
    color: #64748b;
}

.permissions-modules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}

/* Access Denied */
.access-denied {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
}

.access-denied i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
    display: block;
}

.access-denied h3 {
    color: #475569;
    margin-bottom: 10px;
    font-size: 20px;
}

.access-denied p {
    color: #94a3b8;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.loading-state i {
    font-size: 32px;
    color: #2563eb;
    margin-bottom: 15px;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide elements on mobile */
    .hide-mobile,
    .desktop-only {
        display: none !important;
    }
    
    /* ===== MOBILE TOP BAR - SINGLE ROW ===== */
    .top-auth-bar {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        left: auto !important;
        width: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        min-height: auto !important;
        z-index: 100 !important;
    }
    
    /* Actions container - single row */
    .top-bar-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* ALL ICONS - smaller uniform size */
    .top-auth-bar .btn-icon,
    .top-bar-actions .btn-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: white !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
        flex-shrink: 0 !important;
    }
    
    .top-auth-bar .btn-icon i,
    .top-bar-actions .btn-icon i {
        font-size: 13px !important;
        color: #64748b !important;
        margin: 0 !important;
    }
    
    .top-auth-bar .btn-icon:active {
        background: #f1f5f9 !important;
        transform: scale(0.95);
    }
    
    /* Auth container - hide in portrait when logged in */
    /* Note: When user is logged in, userMenuContainer is visible and authContainer should be hidden */
    /* The !important was forcing it to show. Now we only show it when NOT hidden by inline style */
    #authContainer:not([style*="display: none"]) {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #authContainer .btn-primary {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #2563eb !important;
        border: none !important;
        box-shadow: 0 1px 4px rgba(37,99,235,0.25) !important;
    }
    
    #authContainer .btn-primary i {
        margin: 0 !important;
        font-size: 13px !important;
        color: white !important;
    }
    
    #authContainer .btn-primary span {
        display: none !important;
    }
    
    /* User menu - same size as icons */
    .user-menu {
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .user-menu-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: white !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
    }
    
    .user-avatar {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
    }
    
    .user-info {
        display: none !important;
    }
    
    .user-menu-btn .fa-chevron-down {
        display: none !important;
    }
    
    /* Hide tenant selector completely on mobile */
    #tenantSelector,
    .top-auth-bar select,
    .top-auth-bar > select {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        opacity: 0 !important;
        position: absolute !important;
        pointer-events: none !important;
    }
    
    .user-management-stats {
        grid-template-columns: 1fr;
    }
    
    .user-card {
        flex-wrap: wrap;
    }
    
    .user-card .user-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f1f5f9;
    }
    
    .permissions-modules {
        grid-template-columns: 1fr;
    }
    
    /* Tenant selector on mobile */
    #tenantSelector {
        min-width: 120px !important;
        max-width: 150px !important;
        font-size: 11px !important;
        padding: 6px 8px !important;
    }
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 500px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Button Styles for User Management */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #2563eb;
    color: #2563eb;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-outline:hover {
    background: #2563eb;
    color: white;
}

/* ==================== FOUNDER DASHBOARD / MULTI-TENANT STYLES ==================== */

/* Tenant Selector */
.tenant-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tenant-selector select {
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
}

/* Founder Stats Grid */
.founder-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.founder-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.founder-stat-card .stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.founder-stat-card.primary .stat-icon { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.founder-stat-card.success .stat-icon { background: linear-gradient(135deg, #10b981, #34d399); }
.founder-stat-card.info .stat-icon { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.founder-stat-card.warning .stat-icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

.founder-stat-card .stat-content {
    flex: 1;
}

.founder-stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.founder-stat-card .stat-label {
    font-size: 13px;
    color: #64748b;
}

/* Founder Section */
.founder-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.founder-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.founder-section .section-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    font-size: 16px;
    margin: 0;
}

/* Business Cards Grid */
.business-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.business-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.business-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.business-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.business-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.business-title {
    flex: 1;
}

.business-title h4 {
    margin: 0 0 4px 0;
    color: #1e293b;
    font-size: 15px;
}

.business-status {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.business-status.active { background: #dcfce7; color: #166534; }
.business-status.suspended { background: #fef3c7; color: #92400e; }
.business-status.inactive { background: #fee2e2; color: #991b1b; }

.business-actions {
    display: flex;
    gap: 5px;
}

.business-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.biz-stat {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.biz-stat-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.biz-stat-value.income { color: #10b981; }
.biz-stat-value.expense { color: #ef4444; }

.biz-stat-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
}

.business-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

.business-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.business-footer {
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.business-footer small {
    color: #94a3b8;
    font-size: 11px;
}

/* Activity List */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.activity-icon.login {
    background: #dcfce7;
    color: #16a34a;
}

.activity-icon.logout {
    background: #fee2e2;
    color: #dc2626;
}

.activity-content {
    flex: 1;
    font-size: 13px;
    color: #475569;
}

.activity-content strong {
    color: #1e293b;
}

.activity-time {
    font-size: 11px;
    color: #94a3b8;
}

/* Founder Dashboard Section Display */
#founder-dashboard.content-section.active {
    display: block;
}

/* Platform Admin Nav Button */
#founderDashboardNav {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: 1px solid #7c3aed;
}

#founderDashboardNav:hover {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
}

#founderDashboardNav i {
    color: #fbbf24;
}

/* ==================== PLATFORM CONTROL STYLES ==================== */
#platform-control.content-section.active,
#user-management.content-section.active {
    display: block;
}

.platform-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.platform-stat {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #64748b;
}

.platform-stat.primary { border-left-color: #2563eb; }
.platform-stat.success { border-left-color: #10b981; }
.platform-stat.info { border-left-color: #0ea5e9; }
.platform-stat.warning { border-left-color: #f59e0b; }

.platform-stat i {
    font-size: 28px;
    color: #94a3b8;
}

.platform-stat.primary i { color: #2563eb; }
.platform-stat.success i { color: #10b981; }
.platform-stat.info i { color: #0ea5e9; }
.platform-stat.warning i { color: #f59e0b; }

.platform-stat .stat-content {
    display: flex;
    flex-direction: column;
}

.platform-stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.platform-stat .stat-label {
    font-size: 13px;
    color: #64748b;
}

.platform-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.platform-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.platform-section .section-header h3 {
    font-size: 18px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-section .section-header h3 i {
    color: #2563eb;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.settings-group {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
}

.settings-group h4 {
    font-size: 14px;
    color: #475569;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-group h4 i {
    color: #2563eb;
}

.toggle-setting {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.toggle-setting input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

/* Subscriptions Table */
.subscriptions-table {
    overflow-x: auto;
}

.subscriptions-table table {
    width: 100%;
    border-collapse: collapse;
}

.subscriptions-table th,
.subscriptions-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.subscriptions-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscriptions-table td {
    color: #334155;
    font-size: 14px;
}

.subscriptions-table tbody tr:hover {
    background: #f8fafc;
}

.plan-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.trial-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #fef3c7;
    color: #b45309;
    margin-left: 5px;
}

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

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #dc2626;
}

/* Pricing Plans Grid */
.pricing-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.pricing-plan-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.pricing-plan-card .plan-name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
}

.pricing-plan-card .plan-price {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
}

.pricing-plan-card .plan-price span {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

.pricing-plan-card .plan-limits {
    text-align: left;
    font-size: 12px;
    color: #64748b;
}

.pricing-plan-card .plan-limits div {
    padding: 4px 0;
}

.pricing-plan-card .plan-limits i {
    width: 20px;
    color: #94a3b8;
}

/* Button Icons */
.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #2563eb;
}

.btn-icon.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-icon.success:hover {
    background: #dcfce7;
    color: #16a34a;
}

/* ==================== REGISTRATION MODAL ==================== */
.registration-steps {
    padding: 20px;
}

.reg-step {
    display: none;
}

.reg-step.active {
    display: block;
}

.reg-step h4 {
    margin-bottom: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reg-step h4 i {
    color: #2563eb;
}

.plans-grid {
    display: grid;
    gap: 15px;
}

.plan-option {
    cursor: pointer;
}

.plan-option input {
    display: none;
}

.plan-option .plan-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.plan-option input:checked + .plan-card {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.plan-option.recommended .plan-card::after {
    content: 'RECOMMENDED';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f59e0b;
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
}

.plan-card {
    position: relative;
}

.plan-card .plan-header {
    padding: 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-card .plan-name {
    font-weight: 600;
}

.plan-card .plan-price {
    font-size: 18px;
    font-weight: 700;
}

.plan-card .plan-features {
    padding: 15px;
    font-size: 12px;
    color: #64748b;
}

.plan-card .plan-limit {
    padding: 4px 0;
}

.plan-card .plan-limit i {
    width: 20px;
    color: #94a3b8;
}

.plan-card .plan-trial {
    background: #f0fdf4;
    color: #16a34a;
    text-align: center;
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
}

/* Auth Bar */
.top-auth-bar {
    background: white;
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#authContainer,
#userMenuContainer {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tenant Selector */
#tenantSelector {
    min-width: 280px;
    max-width: 350px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer;
}

/* Platform Admin Nav Buttons */
#platformAdminNav {
    border-top: 2px solid #7c3aed;
}

#userManagementNav,
#platformControlNav {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(124, 58, 237, 0.2);
}

#userManagementNav:hover,
#platformControlNav:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(168, 85, 247, 0.1));
    border-color: #7c3aed;
}

#userManagementNav i,
#platformControlNav i {
    color: #7c3aed;
}

/* Pricing Plan Card Edit Buttons */
.pricing-plan-card {
    position: relative;
}

.pricing-plan-card .plan-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.pricing-plan-card:hover .plan-actions {
    opacity: 1;
}

.pricing-plan-card .plan-actions .btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.pricing-plan-card .plan-actions .btn-icon:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #2563eb;
}

.pricing-plan-card .plan-actions .btn-icon.danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #dc2626;
}

/* ==================== LOGIN PAGE OVERLAY ==================== */
.login-page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-page-overlay.hidden {
    display: none;
}

.login-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 450px;
    margin: auto;
    padding: 20px 0;
}

.login-page-brand {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.login-page-brand .brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-page-brand .brand-logo i {
    font-size: 40px;
    color: white;
}

.login-page-brand h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-page-brand .tagline {
    font-size: 14px;
    opacity: 0.9;
}

.login-page-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-page-card h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: center;
}

.login-page-card .subtitle {
    color: #64748b;
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

.login-page-card .form-group {
    margin-bottom: 20px;
}

.login-page-card .form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}

.login-page-card .input-wrapper {
    position: relative;
}

.login-page-card .input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

.login-page-card .input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
}

.login-page-card .input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-page-card .options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.login-page-card .remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #64748b;
}

.login-page-card .remember-me input {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

.login-page-card .forgot-link {
    color: #3b82f6;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.login-page-card .forgot-link:hover {
    text-decoration: underline;
}

.login-page-card .login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.login-page-card .login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.login-page-card .divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #94a3b8;
    font-size: 13px;
}

.login-page-card .divider::before,
.login-page-card .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.login-page-card .divider span {
    padding: 0 16px;
}

.login-page-card .register-btn {
    width: 100%;
    padding: 14px;
    background: white;
    color: #10b981;
    border: 2px solid #10b981;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.login-page-card .register-btn:hover {
    background: #ecfdf5;
}

.login-page-card .demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

.login-page-card .demo-credentials strong {
    display: block;
    margin-bottom: 5px;
    color: #475569;
}

.login-page-footer {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
}

.login-page-footer a {
    color: white;
    text-decoration: none;
}

.login-page-footer a:hover {
    text-decoration: underline;
}

/* App Container Hidden State (when logged out) */
.app-container.logged-out {
    display: none !important;
}

body.logged-out {
    padding: 0;
    overflow: auto;
}

/* Mobile Responsive for Login Page */
@media (max-width: 480px) {
    .login-page-overlay {
        padding: 10px;
        align-items: flex-start;
    }
    
    .login-page-container {
        padding: 10px 0 30px;
    }
    
    .login-page-card {
        padding: 24px 20px;
    }
    
    .login-page-card h2 {
        font-size: 20px;
    }
    
    .login-page-card .subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .login-page-card .form-group {
        margin-bottom: 15px;
    }
    
    .login-page-card .input-wrapper input {
        padding: 10px 12px 10px 38px;
    }
    
    .login-page-card .login-btn,
    .login-page-card .register-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .login-page-card .divider {
        margin: 16px 0;
    }
    
    .login-page-brand {
        margin-bottom: 20px;
    }
    
    .login-page-brand h1 {
        font-size: 24px;
    }
    
    .login-page-brand .brand-logo {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }
    
    .login-page-brand .brand-logo i {
        font-size: 26px;
    }
    
    .login-page-brand .tagline {
        font-size: 12px;
    }
    
    .login-page-footer {
        margin-top: 20px;
    }
}

/* ==================== AUDIT LOG STYLES ==================== */

/* Audit Log Filter Bar */
#audit-log .filter-bar {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

#audit-log .filter-bar .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

#audit-log .filter-bar .form-group {
    flex: 1;
    min-width: 140px;
}

/* Audit Log Stats - Override default stat-card */
#audit-log .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

#audit-log .stat-card {
    padding: 15px 10px;
    min-width: 0;
}

#audit-log .stat-card .stat-value {
    font-size: 24px;
}

#audit-log .stat-card .stat-label {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 480px) {
    #audit-log .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #audit-log .stat-card .stat-label {
        font-size: 10px;
    }
}

.audit-log-table {
    width: 100%;
}

.audit-log-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.audit-log-row:hover {
    background-color: #f1f5f9;
}

.audit-log-date .audit-date-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.audit-log-date .audit-date {
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
}

.audit-log-date .audit-time {
    color: #64748b;
    font-size: 11px;
}

.audit-log-user .audit-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audit-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.audit-user-name {
    display: block;
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
}

.audit-user-role {
    display: block;
    font-size: 11px;
    color: #64748b;
    text-transform: capitalize;
}

/* Audit Action Badges */
.audit-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.audit-action-badge.action-create {
    background: #dcfce7;
    color: #15803d;
}

.audit-action-badge.action-update {
    background: #dbeafe;
    color: #1d4ed8;
}

.audit-action-badge.action-delete {
    background: #fee2e2;
    color: #dc2626;
}

.audit-action-badge.action-void {
    background: #fef3c7;
    color: #d97706;
}

.audit-action-badge.action-restore {
    background: #e0e7ff;
    color: #4f46e5;
}

.audit-action-badge.action-export {
    background: #f3e8ff;
    color: #7c3aed;
}

.audit-action-badge.action-login {
    background: #cffafe;
    color: #0891b2;
}

.audit-action-badge.action-logout {
    background: #f1f5f9;
    color: #64748b;
}

.audit-action-badge.action-default {
    background: #f1f5f9;
    color: #475569;
}

/* Audit Module Badge */
.audit-module-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

/* Audit Description */
.audit-log-description .audit-desc-text {
    max-width: 300px;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

.audit-log-description .audit-desc-text strong {
    color: #1e293b;
}

/* Audit Log Detail Modal */
.audit-detail-header {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.audit-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.audit-detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audit-detail-row.full-width {
    grid-column: span 2;
}

.audit-detail-row label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audit-detail-row label i {
    color: #94a3b8;
}

.audit-detail-row span {
    font-size: 14px;
    color: #1e293b;
}

.audit-record-id {
    font-family: monospace;
    font-size: 12px !important;
    color: #64748b !important;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Audit Changes Section */
.audit-changes-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.audit-changes-section h4 {
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-changes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.audit-change-panel {
    border-radius: 8px;
    overflow: hidden;
}

.audit-change-panel h5 {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.audit-change-panel.old-value {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.audit-change-panel.old-value h5 {
    background: #fee2e2;
    color: #dc2626;
}

.audit-change-panel.new-value {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.audit-change-panel.new-value h5 {
    background: #dcfce7;
    color: #15803d;
}

.audit-change-panel pre {
    padding: 12px 14px;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
}

.audit-meta-info {
    margin-top: 24px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.audit-meta-info small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}

/* ==================== BANK RECONCILIATION STYLES ==================== */
.bank-recon-container {
    padding: 20px;
}

.recon-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.recon-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.recon-section .section-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.recon-column {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.recon-column .column-header {
    padding: 12px 15px;
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recon-column .item-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.recon-column .transaction-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
}

.recon-item {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: grid;
    grid-template-columns: 80px 1fr 100px 24px;
    align-items: center;
    gap: 10px;
}

.recon-item:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.recon-item.selected {
    border-color: #8b5cf6;
    background: #f5f3ff;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.recon-item.matched {
    background: #f0fdf4;
    border-color: #10b981;
    opacity: 0.7;
}

.recon-item .item-date {
    font-size: 11px;
    color: #64748b;
}

.recon-item .item-desc {
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recon-item .item-amount {
    font-weight: 600;
    text-align: right;
    font-size: 13px;
}

.recon-item .item-amount.positive {
    color: #10b981;
}

.recon-item .item-amount.negative {
    color: #ef4444;
}

.recon-item .matched-icon {
    color: #10b981;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.summary-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-card .summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.summary-card .summary-content h4 {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
}

.summary-card .summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.summary-card .summary-amount {
    font-size: 13px;
    color: #64748b;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
}

@media (max-width: 768px) {
    .recon-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recon-item {
        grid-template-columns: 60px 1fr 80px 20px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .audit-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .audit-detail-row.full-width {
        grid-column: span 1;
    }
    
    .audit-changes-grid {
        grid-template-columns: 1fr;
    }
    
    .audit-log-description .audit-desc-text {
        max-width: 150px;
    }
}

/* Login Error Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-error-message {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: none;
}

.login-error-message .error-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dc2626;
}

.login-error-message .error-icon {
    font-size: 1.2em;
}

/* ==================== LHDN & Audit Export Module ==================== */

/* Quick Export Buttons - White Card Style */
.export-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
    text-align: center;
}

.export-quick-btn:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.export-quick-btn:active {
    transform: translateY(0);
}

.export-quick-btn i {
    font-size: 28px;
    margin-bottom: 10px;
}

.export-quick-btn span {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: block;
}

.export-quick-btn small {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* Report Category Cards */
.report-category {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.report-category:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.report-category h4 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

/* Report Checkboxes */
.report-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 4px 0;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: white;
    border: 1px solid transparent;
}

.report-checkbox:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.report-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.report-checkbox span {
    font-size: 12px;
    color: #475569;
    flex: 1;
}

.report-checkbox input[type="checkbox"]:checked + span {
    color: #1e293b;
    font-weight: 500;
}

/* Export History Table */
#exportHistoryList .data-table {
    margin: 0;
}

#exportHistoryList .data-table th,
#exportHistoryList .data-table td {
    padding: 10px 12px;
    font-size: 12px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .export-quick-btn {
        padding: 15px 10px;
        min-height: 80px;
    }
    
    .export-quick-btn i {
        font-size: 24px;
    }
    
    .export-quick-btn span {
        font-size: 12px;
    }
    
    .report-category {
        padding: 12px;
    }
    
    .report-checkbox {
        padding: 6px 8px;
    }
    
    .report-checkbox span {
        font-size: 11px;
    }
}

/* ==================== MOBILE STYLING ==================== */
@media (max-width: 768px) {
    /* Basic mobile layout */
    .app-container {
        padding: 10px;
        padding-top: 70px;
    }
    
    .main-content {
        gap: 12px;
    }
    
    /* Cards */
    .content-card {
        padding: 15px;
        border-radius: 10px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 10px;
    }
    
    .stat-value {
        font-size: 16px !important;
    }
    
    .stat-label {
        font-size: 11px !important;
    }
    
    /* Form inputs - 16px to prevent iOS zoom */
    input, select, textarea {
        font-size: 16px;
    }
    
    /* Tables - allow horizontal scroll */
    .data-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    /* Filter bars */
    .filter-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }
    
    /* Tabs - scrollable */
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 5px;
    }
    
    .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* ==================== INVOICE STYLES ==================== */
.invoice-item-row {
    border-bottom: 1px solid #e2e8f0;
}

.invoice-item-row:last-child {
    border-bottom: none;
}

.invoice-item-grid {
    display: grid;
    grid-template-columns: 2fr 80px 120px 120px 40px;
    gap: 10px;
    padding: 10px;
    align-items: center;
}

.invoice-item-grid input {
    font-size: 13px;
    padding: 8px 10px;
}

.invoice-item-grid .item-amount {
    text-align: right;
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.invoice-preview {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.invoice-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

/* Invoice Status Badges */
.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-pending {
    background: #e0e7ff;
    color: #3730a3;
}

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

.status-cancelled {
    background: #f1f5f9;
    color: #64748b;
}

.status-draft {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Responsive Invoice Items */
@media (max-width: 768px) {
    .invoice-item-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .invoice-item-grid input {
        width: 100%;
    }
    
    .invoice-items-header {
        display: none;
    }
    
    .invoice-header-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .invoice-title-section {
        text-align: left !important;
    }
}

/* ==================== PLATFORM CONTROL MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    /* Platform Stats Grid */
    .platform-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .platform-stat {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .platform-stat i {
        font-size: 22px;
    }
    
    .platform-stat .stat-value {
        font-size: 18px;
    }
    
    .platform-stat .stat-label {
        font-size: 11px;
    }
    
    /* Platform Section */
    .platform-section {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .platform-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .platform-section .section-header h3 {
        font-size: 16px;
    }
    
    .platform-section .section-header .btn-outline,
    .platform-section .section-header .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    /* Settings Grid */
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .settings-group {
        padding: 15px;
    }
    
    .settings-group h4 {
        font-size: 13px;
    }
    
    .toggle-setting {
        font-size: 13px;
    }
    
    /* Subscriptions Table */
    .subscriptions-table {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .subscriptions-table table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .subscriptions-table th,
    .subscriptions-table td {
        padding: 8px 10px;
    }
    
    .subscriptions-table th {
        font-size: 10px;
    }
    
    /* Pricing Plans Grid */
    .pricing-plans-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .pricing-plan-card {
        padding: 15px;
    }
    
    .pricing-plan-card .plan-name {
        font-size: 14px;
    }
    
    .pricing-plan-card .plan-price {
        font-size: 22px;
    }
    
    .pricing-plan-card .plan-limits {
        font-size: 11px;
    }
    
    .pricing-plan-card .plan-actions {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .pricing-plan-card .plan-actions .btn-icon {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    /* Plan Limits Table */
    #planLimitsTable {
        font-size: 11px;
    }
    
    #planLimitsTable th,
    #planLimitsTable td {
        padding: 8px 6px;
    }
    
    #planLimitsTable .plan-limit-input {
        width: 60px !important;
        font-size: 12px;
        padding: 4px;
    }
    
    /* Plan Features Matrix */
    .plan-features-matrix table {
        font-size: 11px;
        min-width: 500px;
    }
    
    .plan-features-matrix th,
    .plan-features-matrix td {
        padding: 8px 6px;
    }
    
    /* Modals */
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    /* Form Grid */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    /* Button Icons */
    .btn-icon {
        width: 28px;
        height: 28px;
    }
    
    /* Auth Bar - keep horizontal on mobile */
    .top-auth-bar {
        flex-direction: row !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    #tenantSelector {
        display: none !important;
    }
    
    /* Upgrade Modal Plans */
    #upgradeModal .modal-content > div:last-of-type {
        grid-template-columns: 1fr !important;
    }
    
    .upgrade-plan-card {
        padding: 15px;
    }
    
    .upgrade-plan-card h4 {
        font-size: 16px;
    }
    
    .upgrade-plan-card div[style*="font-size: 28px"] {
        font-size: 24px !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .platform-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .platform-stat {
        flex-direction: row;
        text-align: left;
    }
    
    .pricing-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .subscriptions-table table {
        min-width: 500px;
    }
    
    #planLimitsTable .plan-limit-input {
        width: 50px !important;
    }
    
    .plan-features-matrix table {
        min-width: 400px;
    }
}

/* ==================== ENHANCED UI STYLES ==================== */
/* Modern Card Shadows */
.content-card,
.stat-card,
.platform-section {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.content-card:hover,
.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.08);
}

/* Enhanced Buttons */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Enhanced Form Controls */
.form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Enhanced Tables */
.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Enhanced Status Badges */
.status-badge {
    transition: transform 0.15s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

/* Enhanced Navigation */
.nav-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-btn:hover::before {
    transform: scaleY(1);
}

/* Note: .nav-btn.active styles are defined earlier in the file (line ~276) 
   with dark background and white text - don't override here */

/* Enhanced Modal */
.modal {
    backdrop-filter: blur(4px);
}

.modal-content {
    animation: modalSlideIn 0.3s ease;
}

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

/* Enhanced Stats Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(20px, -20px);
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Enhanced Notification Toast */
.notification {
    animation: toastSlideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Tooltip Enhancement */
[title] {
    position: relative;
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .nav-sidebar,
    .mobile-menu-btn,
    .top-auth-bar,
    .btn-primary,
    .btn-secondary,
    .modal {
        display: none !important;
    }
    
    .content-area {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .content-card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }
}

/* ==================== NOTIFICATION SYSTEM ==================== */
.notification-bell-container {
    position: relative;
}

.notification-bell {
    position: relative;
    background: transparent;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.notification-bell:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.2s ease-out;
}

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

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

.notification-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-panel-header h3 i {
    color: #3b82f6;
}

.notification-panel-actions {
    display: flex;
    gap: 4px;
}

.notification-panel-actions .btn-text {
    background: none;
    border: none;
    color: #64748b;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.notification-panel-actions .btn-text:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notification-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.notification-panel-footer .btn-text {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto;
}

.notification-panel-footer .btn-text:hover {
    color: #3b82f6;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #eff6ff;
}

.notification-item.unread:hover {
    background: #dbeafe;
}

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

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

.notification-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
    margin-bottom: 2px;
}

.notification-message {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.notification-dismiss {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.notification-item:hover .notification-dismiss {
    opacity: 1;
}

.notification-dismiss:hover {
    color: #ef4444;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.notification-empty i {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ==================== BOM STYLES ==================== */
.bom-section {
    padding: 20px;
}

.bom-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.bom-section .section-header h2 {
    font-size: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bom-section .section-header h2 i {
    color: #3b82f6;
}

.bom-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bom-stats .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bom-stats .stat-card i {
    font-size: 24px;
    color: #3b82f6;
    margin-bottom: 10px;
}

.bom-stats .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.bom-stats .stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

.bom-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.component-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.component-row select {
    flex: 2;
}

.component-row input {
    flex: 1;
    max-width: 100px;
}

.cost-breakdown {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.cost-row:last-child {
    border-bottom: none;
}

.cost-row.total {
    border-top: 2px solid #3b82f6;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 600;
    color: #1e293b;
}

.missing-materials {
    background: #fef2f2;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.missing-materials ul {
    margin: 10px 0 0 20px;
    color: #ef4444;
    font-size: 13px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

/* Toggle label for settings */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-label span {
    font-size: 14px;
    color: #334155;
}

/* Compact table */
.data-table.compact {
    font-size: 13px;
}

.data-table.compact th,
.data-table.compact td {
    padding: 8px 12px;
}

/* BOM Details modal */
.bom-details .detail-row {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.bom-details .detail-row:last-child {
    border-bottom: none;
}

/* Mobile responsive for notification panel */
@media (max-width: 480px) {
    .notification-panel {
        right: 10px;
        left: 10px;
        width: auto;
        top: 50px;
    }
    
    .component-row {
        flex-wrap: wrap;
    }
    
    .component-row select {
        flex: 1 1 100%;
    }
    
    .component-row input {
        flex: 1;
    }
}

/* ==================== INVOICE MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    /* Invoice section - card style on mobile */
    #invoices .data-table thead {
        display: none;
    }
    
    #invoices .data-table tbody tr {
        display: block;
        background: white;
        margin-bottom: 12px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        padding: 15px;
        border: 1px solid #e2e8f0;
    }
    
    #invoices .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9;
        text-align: right !important;
    }
    
    #invoices .data-table tbody td:last-child {
        border-bottom: none;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        padding-top: 12px;
    }
    
    #invoices .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 12px;
        text-transform: uppercase;
        text-align: left;
    }
    
    /* Invoice filters - stack on mobile */
    #invoices .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }
    
    #invoices .card-header > div {
        width: 100%;
        justify-content: center;
    }
    
    /* Stats cards - 2 per row on mobile */
    #invoices .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Filter inputs stack */
    #invoices [style*="display: flex"][style*="gap: 15px"] {
        flex-direction: column;
    }
    
    #invoices [style*="display: flex"][style*="gap: 15px"] input,
    #invoices [style*="display: flex"][style*="gap: 15px"] select {
        width: 100% !important;
        min-width: unset !important;
    }
    
    /* Summary boxes full width */
    #invoices [style*="display: flex"][style*="gap: 20px"] {
        flex-direction: column;
    }
    
    #invoices [style*="min-width: 200px"] {
        min-width: unset !important;
    }
}

/* ==================== GLOBAL MOBILE RESPONSIVE - ALL PAGES ==================== */
@media (max-width: 768px) {
    /* Global card header - stack vertically */
    .card-header {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    .card-header h3 {
        font-size: 18px !important;
        text-align: center;
    }
    
    .card-header > div,
    .card-header > .btn,
    .card-header > button {
        width: 100% !important;
    }
    
    /* Stats grid - 2 columns on mobile */
    .stats-grid,
    .stat-cards,
    .dashboard-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card,
    .stats-card {
        padding: 12px !important;
    }
    
    .stat-card h4,
    .stats-card h4 {
        font-size: 11px !important;
    }
    
    .stat-card .value,
    .stats-card .value,
    .stat-card p,
    .stats-card p {
        font-size: 16px !important;
    }
    
    /* Buttons - full width and stack */
    .btn-group,
    .action-buttons,
    .button-group {
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
    }
    
    .btn-group .btn,
    .action-buttons .btn,
    .button-group .btn,
    .btn-group button,
    .action-buttons button {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Filter sections - stack */
    .filters,
    .filter-row,
    [class*="filter"] {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .filters input,
    .filters select,
    .filter-row input,
    .filter-row select {
        width: 100% !important;
        min-width: unset !important;
    }
    
    /* Search inputs */
    input[type="search"],
    input[type="text"][placeholder*="Search"],
    .search-input {
        width: 100% !important;
    }
    
    /* Tables to card view - global */
    .data-table,
    table.styled-table {
        display: block;
    }
    
    .data-table thead,
    table.styled-table thead {
        display: none;
    }
    
    .data-table tbody,
    table.styled-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .data-table tr,
    table.styled-table tr {
        display: block;
        background: white;
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border: 1px solid #e2e8f0;
    }
    
    .data-table td,
    table.styled-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0 !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }
    
    .data-table td:last-child,
    table.styled-table td:last-child {
        border-bottom: none !important;
    }
    
    .data-table td::before,
    table.styled-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 12px;
        text-transform: uppercase;
    }
}

/* ==================== CRM MODULES MOBILE ==================== */
@media (max-width: 768px) {
    /* Quotations - cards full width */
    #quotations .quotations-grid,
    .quotations-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .quotation-card {
        padding: 15px !important;
    }
    
    .quotation-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .quotation-card-details {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    /* Projects - cards full width */
    #projects .projects-grid,
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .project-card {
        padding: 15px !important;
    }
    
    .project-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .project-amounts {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .project-status {
        align-self: flex-start !important;
    }
    
    /* Customers - cards full width */
    #customers .customers-grid,
    .customers-grid,
    #crm-customers .crm-grid,
    .crm-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .customer-card,
    .crm-card {
        padding: 15px !important;
    }
    
    /* Modal responsiveness */
    .modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 10px !important;
        max-height: 90vh !important;
    }
    
    .modal-header {
        padding: 15px !important;
    }
    
    .modal-body {
        padding: 15px !important;
    }
    
    .modal-footer {
        padding: 15px !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .modal-footer .btn,
    .modal-footer button {
        width: 100% !important;
    }
    
    /* Form inputs stack */
    .form-row,
    .form-group-row {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .form-group {
        width: 100% !important;
    }
    
    /* Detail views */
    .project-detail-summary,
    .quotation-detail-summary {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .project-detail-actions,
    .quotation-detail-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .project-detail-actions .btn,
    .quotation-detail-actions button {
        width: 100% !important;
    }
    
    /* Milestones */
    .milestone-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .milestone-actions {
        width: 100% !important;
    }
    
    .milestone-actions .btn {
        width: 100% !important;
    }
}

/* ==================== ENHANCED MOBILE MODAL STYLES ==================== */
/* Full-screen modals on mobile for better UX */
@media (max-width: 768px) {
    /* Make all modals full-screen on mobile */
    .modal,
    .modal-overlay,
    [id*="Modal"] {
        padding: 0 !important;
    }
    
    .modal-content,
    .modal > div:not(.modal-overlay),
    [id*="Modal"] > div {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 15px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Modal header - sticky at top */
    .modal-header,
    .modal-content > h2:first-child,
    .modal-content > .card-header:first-child {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        padding: 15px 0 !important;
        margin: -15px -15px 15px -15px !important;
        padding: 15px !important;
        border-bottom: 1px solid #e2e8f0;
    }
    
    /* Modal title */
    .modal-title,
    .modal-header h2,
    .modal-content > h2:first-child {
        font-size: 18px !important;
    }
    
    /* Form groups in modals */
    .modal-content .form-group,
    .modal-content .form-row {
        margin-bottom: 15px !important;
    }
    
    .modal-content .form-row {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .modal-content .form-row > * {
        width: 100% !important;
        flex: none !important;
    }
    
    /* Input fields - larger touch targets */
    .modal-content input[type="text"],
    .modal-content input[type="number"],
    .modal-content input[type="email"],
    .modal-content input[type="tel"],
    .modal-content input[type="date"],
    .modal-content input[type="password"],
    .modal-content select,
    .modal-content textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 12px !important;
        min-height: 48px !important;
    }
    
    .modal-content textarea {
        min-height: 100px !important;
    }
    
    /* Labels */
    .modal-content label {
        font-size: 14px !important;
        margin-bottom: 6px !important;
        display: block;
    }
    
    /* Buttons - full width and larger */
    .modal-content .btn,
    .modal-content button[type="submit"],
    .modal-content .btn-primary,
    .modal-content .btn-secondary,
    .modal-content .btn-danger {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        min-height: 50px !important;
        margin-bottom: 10px !important;
    }
    
    /* Button groups */
    .modal-content .btn-group,
    .modal-content .form-actions,
    .modal-content .modal-footer {
        flex-direction: column !important;
        gap: 10px !important;
        padding-top: 15px !important;
        border-top: 1px solid #e2e8f0;
        margin-top: 20px !important;
    }
    
    /* Close button - larger touch target */
    .modal-content .close-modal,
    .modal-content .modal-close,
    .modal-content [onclick*="close"],
    .modal-header .close-modal {
        font-size: 28px !important;
        padding: 10px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    /* Tables in modals - horizontal scroll */
    .modal-content .table-container,
    .modal-content table {
        overflow-x: auto !important;
        display: block !important;
        font-size: 13px !important;
    }
    
    /* Grid layouts in modals */
    .modal-content .stats-row,
    .modal-content .grid,
    .modal-content [style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Specific modal adjustments */
    #branchModal .modal-content,
    #productModal .modal-content,
    #quotationModal .modal-content,
    #projectModal .modal-content,
    #customerModal .modal-content,
    #supplierModal .modal-content,
    #employeeModal .modal-content,
    #transactionModal .modal-content {
        padding-bottom: 80px !important; /* Space for bottom actions */
    }
    
    /* Invoice/Quotation item tables */
    .modal-content .items-table,
    .modal-content .line-items {
        font-size: 12px !important;
    }
    
    .modal-content .items-table th,
    .modal-content .items-table td {
        padding: 8px 5px !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .modal-content,
    .modal > div:not(.modal-overlay),
    [id*="Modal"] > div {
        padding: 10px !important;
    }
    
    .modal-title,
    .modal-header h2 {
        font-size: 16px !important;
    }
    
    .modal-content .btn,
    .modal-content button {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
    
    /* Stack all form elements */
    .modal-content .form-inline,
    .modal-content .input-group {
        flex-direction: column !important;
    }
    
    .modal-content .input-group > * {
        width: 100% !important;
        border-radius: 8px !important;
        margin-bottom: 5px !important;
    }
}

/* ==================== COMPREHENSIVE MOBILE STYLES FOR ALL SECTIONS ==================== */
@media (max-width: 768px) {
    
    /* ===== 1. PROJECTS SECTION ===== */
    #projects .content-card {
        padding: 10px !important;
    }
    
    #projects .card-header {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    
    #projects .card-header h2 {
        font-size: 16px !important;
    }
    
    #projects .header-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    #projects .header-actions .btn,
    #projects .header-actions button {
        width: 100% !important;
    }
    
    /* Project cards grid */
    #projectsGrid,
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .project-card {
        padding: 15px !important;
    }
    
    .project-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .project-card-actions {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .project-card-actions .btn {
        flex: 1 !important;
        padding: 10px !important;
        font-size: 12px !important;
    }
    
    /* Project detail modal */
    .project-detail-summary {
        grid-template-columns: 1fr !important;
    }
    
    .project-detail-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .project-detail-actions .btn {
        width: 100% !important;
    }
    
    /* Milestones */
    .milestone-item {
        flex-direction: column !important;
        padding: 12px !important;
        gap: 10px !important;
    }
    
    .milestone-info {
        width: 100% !important;
    }
    
    .milestone-actions {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    .milestone-actions .btn {
        flex: 1 !important;
        min-width: 80px !important;
        padding: 8px !important;
        font-size: 12px !important;
    }
    
    /* ===== 2. QUOTATIONS SECTION ===== */
    #quotations .content-card {
        padding: 10px !important;
    }
    
    #quotations .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #quotationsGrid,
    .quotations-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .quotation-card {
        padding: 15px !important;
    }
    
    .quotation-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .quotation-card-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    .quotation-card-actions .btn {
        flex: 1 !important;
        min-width: 60px !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
    }
    
    /* Quotation items table */
    .quotation-items-table {
        font-size: 11px !important;
    }
    
    .quotation-items-table th,
    .quotation-items-table td {
        padding: 6px 4px !important;
    }
    
    /* ===== 3. STOCK CONTROL SECTION ===== */
    #stock .content-card,
    #stock-control .content-card {
        padding: 10px !important;
    }
    
    #stock .card-header,
    #stock-control .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #stock .stats-row,
    #stock-control .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    #stock .stat-card,
    #stock-control .stat-card {
        padding: 12px !important;
    }
    
    #stock .stat-value,
    #stock-control .stat-value {
        font-size: 18px !important;
    }
    
    #stock .stat-label,
    #stock-control .stat-label {
        font-size: 11px !important;
    }
    
    /* Stock movement table */
    .stock-movements-table {
        font-size: 11px !important;
    }
    
    .stock-movements-table th,
    .stock-movements-table td {
        padding: 8px 5px !important;
    }
    
    /* ===== 4. SUPPLIERS SECTION ===== */
    #suppliers .content-card {
        padding: 10px !important;
    }
    
    #suppliers .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #suppliersGrid,
    .suppliers-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .supplier-card {
        padding: 15px !important;
    }
    
    .supplier-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .supplier-card-actions {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }
    
    .supplier-card-actions .btn {
        flex: 1 !important;
    }
    
    /* ===== 5. EMPLOYEES SECTION ===== */
    #employees .content-card,
    #payroll .content-card {
        padding: 10px !important;
    }
    
    #employees .card-header,
    #payroll .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .employees-grid,
    #employeesGrid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .employee-card {
        padding: 15px !important;
    }
    
    .employee-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .employee-card-actions {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }
    
    .employee-card-actions .btn {
        flex: 1 !important;
    }
    
    /* Payroll table */
    .payroll-table {
        font-size: 11px !important;
    }
    
    /* ===== 6. CHART OF ACCOUNTS SECTION ===== */
    #chart-of-accounts .content-card {
        padding: 10px !important;
    }
    
    #chart-of-accounts .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .accounts-tree,
    .coa-tree {
        font-size: 13px !important;
    }
    
    .account-item {
        padding: 10px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .account-item-actions {
        width: 100% !important;
        display: flex !important;
        gap: 5px !important;
    }
    
    .account-item-actions .btn {
        flex: 1 !important;
        padding: 8px !important;
        font-size: 11px !important;
    }
    
    /* Journal entries */
    .journal-entries-table {
        font-size: 11px !important;
    }
    
    /* ===== 7. TRANSACTIONS SECTION ===== */
    #transactions .content-card {
        padding: 10px !important;
    }
    
    #transactions .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #transactions .filter-row,
    .transactions-filters {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #transactions .filter-row > *,
    .transactions-filters > * {
        width: 100% !important;
    }
    
    .transactions-table {
        font-size: 11px !important;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 8px 5px !important;
    }
    
    /* Transaction cards view */
    .transaction-card {
        padding: 12px !important;
    }
    
    .transaction-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
    }
    
    /* ===== 8. BILLS SECTION ===== */
    #bills .content-card {
        padding: 10px !important;
    }
    
    #bills .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #billsGrid,
    .bills-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .bill-card {
        padding: 15px !important;
    }
    
    .bill-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .bill-card-actions {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }
    
    .bill-card-actions .btn {
        flex: 1 !important;
    }
    
    /* Bills table */
    .bills-table {
        font-size: 11px !important;
    }
    
    /* ===== 9. REPORTS SECTION ===== */
    #reports .content-card {
        padding: 10px !important;
    }
    
    #reports .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #reports .report-filters,
    .report-controls {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #reports .report-filters > *,
    .report-controls > * {
        width: 100% !important;
    }
    
    /* Report cards */
    .report-card,
    .report-summary-card {
        padding: 15px !important;
    }
    
    .report-summary-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Report tables */
    .report-table {
        font-size: 11px !important;
    }
    
    .report-table th,
    .report-table td {
        padding: 8px 5px !important;
    }
    
    /* Charts in reports */
    .chart-container {
        height: 250px !important;
        min-height: 200px !important;
    }
    
    /* Balance sheet */
    .balance-sheet-section {
        padding: 10px !important;
    }
    
    .balance-sheet-row {
        flex-direction: column !important;
        gap: 5px !important;
    }
    
    /* P&L Report */
    .pnl-section {
        padding: 10px !important;
    }
    
    /* Cash Flow */
    .cashflow-section {
        padding: 10px !important;
    }
    
    /* ===== 10. BRANCHES/OUTLETS SECTION ===== */
    #branches .content-card {
        padding: 10px !important;
    }
    
    #branches .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #branches .header-actions {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    #branches .header-actions > * {
        width: 100% !important;
    }
    
    #branchesGrid,
    .branches-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .branch-card {
        padding: 15px !important;
    }
    
    .branch-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .branch-card-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    .branch-card-actions .btn {
        flex: 1 !important;
        min-width: 80px !important;
        padding: 10px !important;
        font-size: 12px !important;
    }
    
    /* Branch stats */
    #branches .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    #branches .stat-card {
        padding: 12px !important;
    }
    
    /* Branch selector dropdown */
    #globalBranchSelector {
        width: 100% !important;
        font-size: 14px !important;
        padding: 12px !important;
    }
    
    /* ===== 11. AI ASSISTANT SECTION ===== */
    #ai-chatbot .content-card,
    #ai-assistant .content-card {
        padding: 10px !important;
        height: calc(100vh - 120px) !important;
    }
    
    .chat-container {
        height: calc(100vh - 180px) !important;
    }
    
    .chat-messages {
        padding: 10px !important;
    }
    
    .chat-message {
        max-width: 90% !important;
        padding: 12px !important;
        font-size: 14px !important;
    }
    
    .chat-input-container {
        padding: 10px !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .chat-input-container input,
    .chat-input-container textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    .chat-input-container button {
        width: 100% !important;
        padding: 12px !important;
    }
    
    /* AI suggestions */
    .ai-suggestions {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .ai-suggestion-btn {
        width: 100% !important;
        text-align: left !important;
    }
    
    /* ===== SETTINGS SECTION ===== */
    #settings .content-card {
        padding: 10px !important;
    }
    
    #settings .card-header {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .settings-tabs {
        flex-direction: column !important;
        gap: 5px !important;
    }
    
    .settings-tab {
        width: 100% !important;
        text-align: left !important;
        padding: 12px 15px !important;
    }
    
    .settings-section {
        padding: 15px !important;
    }
    
    .settings-group {
        margin-bottom: 20px !important;
    }
    
    .settings-group h3 {
        font-size: 16px !important;
    }
    
    .settings-row {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .settings-row > * {
        width: 100% !important;
    }
    
    /* Settings form */
    #settings .form-group {
        margin-bottom: 15px !important;
    }
    
    #settings input,
    #settings select,
    #settings textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    #settings .btn {
        width: 100% !important;
        padding: 14px !important;
        margin-bottom: 10px !important;
    }
    
    /* ===== COMMON TABLE IMPROVEMENTS ===== */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table {
        min-width: 600px !important;
    }
    
    th, td {
        padding: 8px 6px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }
    
    /* Action buttons in tables */
    td .btn,
    td button {
        padding: 6px 10px !important;
        font-size: 11px !important;
        margin: 2px !important;
    }
    
    /* ===== COMMON CARD IMPROVEMENTS ===== */
    .content-card {
        padding: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .card-header {
        padding-bottom: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .card-header h2 {
        font-size: 16px !important;
    }
    
    /* ===== STATS ROW IMPROVEMENTS ===== */
    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .stat-card {
        padding: 12px !important;
    }
    
    .stat-icon {
        font-size: 20px !important;
    }
    
    .stat-value {
        font-size: 18px !important;
    }
    
    .stat-label {
        font-size: 11px !important;
    }
    
    /* ===== FILTER/SEARCH IMPROVEMENTS ===== */
    .filter-row,
    .search-row,
    .controls-row {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .filter-row > *,
    .search-row > *,
    .controls-row > * {
        width: 100% !important;
    }
    
    .search-input {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    /* ===== BUTTON IMPROVEMENTS ===== */
    .btn-group {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .btn-group .btn {
        width: 100% !important;
    }
    
    /* Floating action button */
    .fab,
    .floating-btn {
        bottom: 20px !important;
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
        font-size: 24px !important;
    }
}

/* Extra small screens - additional adjustments */
@media (max-width: 480px) {
    /* Even smaller stats grid */
    .stats-row {
        grid-template-columns: 1fr !important;
    }
    
    /* Smaller card padding */
    .content-card {
        padding: 8px !important;
    }
    
    .project-card,
    .quotation-card,
    .branch-card,
    .supplier-card,
    .employee-card,
    .bill-card {
        padding: 12px !important;
    }
    
    /* Smaller fonts */
    .card-header h2 {
        font-size: 14px !important;
    }
    
    .stat-value {
        font-size: 16px !important;
    }
    
    table {
        font-size: 10px !important;
    }
    
    th, td {
        padding: 6px 4px !important;
    }
}

/* ==================== MOBILE UI FIXES (v2.9.1) ==================== */

/* FIX 1: TABLE HORIZONTAL SCROLL - Wrap all tables in scrollable container */
@media (max-width: 768px) {
    /* Add wrapper for horizontal scroll */
    .data-table,
    .crm-table,
    .quotation-items-table,
    .payroll-table,
    .branch-comparison-table,
    .subscriptions-table table,
    .audit-log-table,
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Ensure table cells don't wrap */
    .data-table th,
    .data-table td {
        white-space: nowrap;
        min-width: 100px;
    }
    
    /* Add scroll indicator shadow */
    .content-card {
        position: relative;
    }
    
    /* Make action buttons stack on mobile */
    .table-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .table-actions button {
        width: 100%;
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* FIX 2: DASHBOARD GRID - Single column on mobile, 2 columns on tablet */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

/* FIX 3: FORMS - Full width inputs and better spacing on mobile */
@media (max-width: 768px) {
    /* App container adjustments */
    .app-container {
        gap: 8px;
    }
    
    /* Navigation panel - better mobile layout */
    .nav-panel {
        padding: 12px;
        border-radius: 10px;
    }
    
    /* Main content - better spacing */
    .main-content {
        gap: 8px;
    }
    
    /* Content cards - compact on mobile */
    .content-card {
        padding: 15px;
        border-radius: 10px;
    }
    
    /* Content section - single column */
    .content-section {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    /* Card headers - smaller on mobile */
    .card-header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .card-header h2 {
        font-size: 16px;
    }
    
    /* Form grids */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    select,
    textarea {
        width: 100% !important;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Stack form buttons */
    .form-actions,
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions button,
    .modal-buttons button {
        width: 100%;
        padding: 14px;
    }
    
    /* Stats grid - single column on small mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    /* Dashboard grid - single column */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
}

/* FIX 4: TOUCH TARGETS - Minimum 44x44px for better touch UX */
@media (max-width: 768px) {
    button,
    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .btn-danger,
    .nav-item,
    a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Icon buttons */
    .icon-btn,
    button i.fas {
        padding: 12px;
    }
    
    /* Nav items larger touch area */
    .nav-item {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* FIX 5: FLOATING AI BUTTON - Better positioning on mobile */
@media (max-width: 768px) {
    .ai-float-btn,
    #aiAssistantBtn {
        bottom: 80px !important; /* Move up to avoid bottom nav */
        right: 16px !important;
        width: 56px !important;
        height: 56px !important;
        font-size: 24px !important;
    }
    
    /* Alert badge positioning */
    .ai-float-btn .alert-badge {
        top: -4px !important;
        right: -4px !important;
        width: 22px !important;
        height: 22px !important;
        font-size: 11px !important;
    }
}

/* FIX 6: MODALS - Full screen on mobile for better UX */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
        margin: 5vh auto !important;
        border-radius: 12px;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .modal-body {
        padding: 16px;
    }
}

/* FIX 7: CARDS - Better spacing and padding on mobile */
@media (max-width: 768px) {
    .content-card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .card-header h2 {
        font-size: 18px;
        margin-bottom: 0;
    }
    
    /* Card actions stack on mobile */
    .card-header > div {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .card-header button {
        flex: 1;
    }
}

/* FIX 8: RESPONSIVE TEXT - Better readability */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    
    /* Stat cards */
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

/* FIX 9: SCROLLBAR - Better mobile scrolling */
@media (max-width: 768px) {
    /* Hide scrollbars but keep functionality */
    .main-content::-webkit-scrollbar {
        display: none;
    }
    
    .main-content {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* FIX 10: TABLET PORTRAIT OPTIMIZATIONS (768px - 1024px portrait) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* Adjust container gap */
    .app-container {
        gap: 10px;
    }
    
    /* Navigation panel - Full width on portrait */
    .nav-panel {
        width: 100%;
        padding: 15px;
        margin-bottom: 10px;
    }
    
    /* Main content adjustments */
    .main-content {
        gap: 10px;
    }
    
    /* Stats grid - 2 columns on tablet portrait */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    /* Dashboard grid - single column for better readability */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    /* Content cards - better spacing */
    .content-card {
        padding: 18px;
        margin-bottom: 10px;
    }
    
    /* Content section - single column */
    .content-section {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    /* Table adjustments */
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Card headers */
    .card-header h2 {
        font-size: 18px;
    }
    
    /* Form adjustments */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
}

/* TABLET LANDSCAPE OPTIMIZATIONS (768px - 1024px landscape) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-card {
        padding: 20px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* ==================== VISUAL POLISH: SMOOTH ANIMATIONS (v2.9.4) ==================== */

/* Fade-in animation for all cards */
.content-card {
    animation: fadeInUp 0.4s ease-out;
}

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

/* Smooth button transitions */
button, .btn-primary, .btn-secondary, .btn-outline, .btn-danger {
    transition: all 0.2s ease;
}

button:hover, .btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active, .btn-primary:active {
    transform: translateY(0);
}

/* Smooth stat card hover */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Modal entrance animation */
.modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Table row hover animation */
.data-table tbody tr {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.data-table tbody tr:hover {
    transform: translateX(4px);
}

/* Loading skeleton animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* AI Assistant pulse animation */
.ai-float-btn {
    transition: all 0.3s ease;
}

.ai-float-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.ai-float-btn.has-alerts {
    animation: pulse 2s infinite;
}

/* Nav item smooth transition */
.nav-item {
    transition: all 0.2s ease;
}

.nav-item:hover {
    transform: translateX(4px);
}

/* Input focus animation */
input, textarea, select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Alert badge pulse */
.alert-badge, .nav-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Smooth page transition */
.content-section {
    animation: pageSlideIn 0.3s ease-out;
}

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

/* Success/Error message animation */
.toast-notification {
    animation: toastSlideIn 0.3s ease-out;
}

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

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {
    .content-card,
    .stat-card,
    button:hover,
    .data-table tbody tr:hover {
        animation: none;
        transform: none;
    }
    
    /* Keep essential feedback animations */
    button:active {
        transform: scale(0.98);
    }
}

/* ==================== SMART SEARCH ==================== */

/* Search Button Trigger */
.smart-search-trigger {
    position: relative;
}

/* Smart Search Modal */
.smart-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 20px 20px;
    animation: fadeIn 0.15s ease-out;
}

.smart-search-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: searchSlideIn 0.2s ease-out;
}

@keyframes searchSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Search Header */
.smart-search-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.smart-search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.smart-search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.smart-search-icon {
    color: #94a3b8;
    font-size: 18px;
    margin-right: 12px;
}

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

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

.smart-search-shortcut {
    display: flex;
    gap: 4px;
}

.smart-search-shortcut kbd {
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-family: system-ui, monospace;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* Search Results */
.smart-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.search-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.search-hints span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
}

.search-hints span i {
    font-size: 12px;
    color: #94a3b8;
}

/* Search Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
}

.search-result-item:hover {
    background: #f8fafc;
}

.search-result-item:active {
    background: #f1f5f9;
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-icon i {
    font-size: 16px;
}

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

.search-result-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-subtitle {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.search-result-source {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.search-result-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Mobile optimization for search */
@media (max-width: 768px) {
    .smart-search-modal {
        padding: 0;
        background: rgba(0, 0, 0, 0.6);
    }
    
    .smart-search-container {
        max-height: 100vh;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .smart-search-input-wrapper {
        padding: 12px 16px;
        border-radius: 0;
    }
    
    .smart-search-input {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 12px 16px 12px 42px;
    }
    
    .smart-search-icon {
        left: 16px;
        font-size: 18px;
    }
    
    .smart-search-shortcut {
        display: none;
    }
    
    .smart-search-results {
        max-height: calc(100vh - 70px);
        padding: 8px;
    }
    
    .search-result-item {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    
    .search-result-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .search-result-info {
        flex: 1;
        min-width: 0;
    }
    
    .search-result-title {
        font-size: 15px;
        font-weight: 600;
    }
    
    .search-result-subtitle {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .search-result-badge {
        font-size: 13px;
        padding: 4px 10px;
        white-space: nowrap;
    }
    
    .search-hints {
        display: none;
    }
    
    .search-empty {
        padding: 40px 20px;
    }
    
    .search-empty i {
        font-size: 40px !important;
    }
}

/* Dark mode support */
.dark-mode .smart-search-container {
    background: #1e293b;
}

.dark-mode .smart-search-input-wrapper {
    background: #0f172a;
    border-color: #334155;
}

.dark-mode .smart-search-input-wrapper:focus-within {
    border-color: #3b82f6;
}

.dark-mode .smart-search-icon {
    color: #64748b;
}

.dark-mode .smart-search-input {
    color: #f1f5f9;
}

.dark-mode .smart-search-input::placeholder {
    color: #64748b;
}

.dark-mode .smart-search-shortcut kbd {
    background: #334155;
    color: #94a3b8;
    border-color: #475569;
}

.dark-mode .search-result-item:hover {
    background: #334155;
}

.dark-mode .search-result-title {
    color: #f1f5f9;
}

.dark-mode .search-result-subtitle {
    color: #94a3b8;
}

.dark-mode .search-hints span {
    background: #334155;
    color: #94a3b8;
}

.dark-mode .search-empty p {
    color: #94a3b8 !important;
}

.dark-mode .search-empty i {
    color: #475569 !important;
}

/* ============================================
   SMART CATEGORIZATION STYLES
   ============================================ */

.category-suggestion-dropdown {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: suggestionSlideIn 0.2s ease-out;
    border: 1px solid #e2e8f0;
}

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

.suggestion-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-header i {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.suggestion-item {
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

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

.suggestion-item:hover {
    background: #f8fafc;
}

.suggestion-item.recommended {
    background: linear-gradient(135deg, #faf5ff 0%, #f0f9ff 100%);
}

.suggestion-item.recommended:hover {
    background: linear-gradient(135deg, #f3e8ff 0%, #e0f2fe 100%);
}

.suggestion-category {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.suggestion-badge {
    font-size: 9px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.suggestion-reason {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.suggestion-confidence {
    height: 3px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.confidence-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #06b6d4 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Dark Mode */
.dark-mode .category-suggestion-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.dark-mode .suggestion-item {
    border-color: #334155;
}

.dark-mode .suggestion-item:hover {
    background: #334155;
}

.dark-mode .suggestion-item.recommended {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
}

.dark-mode .suggestion-item.recommended:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
}

.dark-mode .suggestion-category {
    color: #f1f5f9;
}

.dark-mode .suggestion-reason {
    color: #94a3b8;
}

.dark-mode .suggestion-confidence {
    background: #475569;
}

/* ==================== UI POLISH v2.13.6 - ENHANCED MOBILE & TABLET EXPERIENCE ==================== */

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
}

/* Better touch feedback for mobile/tablet */
@media (max-width: 1024px) {
    button,
    .btn-primary,
    .btn-secondary,
    .nav-btn,
    .quick-action-btn,
    .action-btn {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Enhanced card shadows on mobile */
    .content-card {
        box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .content-card:active {
        transform: scale(0.995);
        box-shadow: 0 1px 8px rgba(37, 99, 235, 0.08);
    }
    
    /* Better button press feedback */
    button:active,
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.97);
    }
    
    /* Stat cards with better visual hierarchy */
    .stat-card {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 1px solid rgba(37, 99, 235, 0.08);
        box-shadow: 0 2px 10px rgba(37, 99, 235, 0.05);
    }
    
    /* Navigation buttons with better spacing */
    .nav-btn {
        margin-bottom: 4px;
        border-radius: 10px;
        transition: all 0.2s ease;
    }
    
    .nav-btn.active {
        box-shadow: 0 3px 12px rgba(37, 99, 235, 0.2);
    }
    
    /* Better input focus states on mobile */
    input:focus,
    select:focus,
    textarea:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
        transform: scale(1.01);
        transition: all 0.2s ease;
    }
    
    /* Modal improvements for mobile */
    .modal-content {
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
    
    /* Table scrolling improvements */
    .table-container {
        border-radius: 12px;
        overflow: hidden;
    }
    
    .data-table {
        border-collapse: separate;
        border-spacing: 0;
    }
    
    .data-table thead th {
        position: sticky;
        top: 0;
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
        z-index: 10;
    }
}

/* Extra polish for tablet portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* Logo refinement */
    .logo {
        padding: 18px;
    }
    
    .logo h1 {
        font-size: 22px;
        font-weight: 700;
    }
    
    /* Navigation with better visual hierarchy */
    .nav-panel {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 1px solid rgba(37, 99, 235, 0.08);
    }
    
    /* Card headers with gradient */
    .card-header {
        background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
        margin: -18px -18px 15px -18px;
        padding: 18px;
        border-radius: 12px 12px 0 0;
        border-bottom: 2px solid #f1f5f9;
    }
    
    /* Better button hierarchy */
    .btn-primary {
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    }
    
    .btn-primary:active {
        transform: translateY(0) scale(0.98);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    }
    
    /* Stat cards with gradient backgrounds */
    .stat-card {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border-left: 4px solid #2563eb;
    }
    
    /* Enhanced search bars */
    .search-bar,
    input[type="search"] {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 2px solid #e2e8f0;
    }
    
    .search-bar:focus,
    input[type="search"]:focus {
        background: #ffffff;
        border-color: #2563eb;
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    }
}

/* Mobile-specific visual enhancements */
@media (max-width: 768px) {
    /* Floating nav toggle with better design */
    .floating-nav-toggle {
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
        backdrop-filter: blur(10px);
    }
    
    /* Better page headers on mobile */
    .page-header {
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
        color: white;
        padding: 16px;
        margin: -15px -15px 15px -15px;
        border-radius: 10px 10px 0 0;
    }
    
    /* Action buttons with icons */
    .action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 48px;
        font-size: 15px;
    }
    
    /* Bottom action bar for mobile (if needed) */
    .mobile-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 12px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 100;
        display: flex;
        gap: 10px;
    }
    
    .mobile-action-bar button {
        flex: 1;
        min-height: 48px;
    }
    
    /* Better empty states on mobile */
    .empty-state {
        padding: 40px 20px;
        text-align: center;
        color: #64748b;
    }
    
    .empty-state-icon {
        font-size: 48px;
        color: #cbd5e1;
        margin-bottom: 16px;
    }
    
    /* Loading states */
    .loading-skeleton {
        background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
        border-radius: 8px;
    }
    
    @keyframes shimmer {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
}

/* Accessibility improvements for all mobile devices */
@media (max-width: 1024px) {
    /* Better focus indicators */
    *:focus-visible {
        outline: 3px solid #3b82f6;
        outline-offset: 2px;
        border-radius: 4px;
    }
    
    /* Larger touch targets for accessibility */
    button,
    a,
    .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Better contrast for readability */
    .text-muted {
        color: #475569 !important;
    }
    
    /* Spacing improvements */
    .section-spacing {
        margin-bottom: 20px;
    }
    
    /* Card grid improvements */
    .card-grid {
        display: grid;
        gap: 12px;
        grid-template-columns: 1fr;
    }
}

/* Small mobile devices (phones) */
@media (max-width: 480px) {
    /* Even more compact spacing */
    .content-card {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .card-header h2 {
        font-size: 15px;
    }
    
    /* Smaller buttons on tiny screens */
    .btn-primary,
    .btn-secondary {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Compact tables */
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Stack stat cards vertically */
    .stats-grid {
        gap: 6px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
}

/* Ultra-wide mobile devices (e.g., iPhone Pro Max landscape) */
@media (min-width: 768px) and (max-width: 926px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==================== MODERN DESIGN SYSTEM UTILITIES ==================== */

/* Glassmorphism effects for modern UI */
@media (min-width: 768px) {
    .glass-card {
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
    }
}

/* Smooth transitions for everything */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better text rendering on all devices */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent layout shift */
img {
    max-width: 100%;
    height: auto;
}

/* ==================== END UI POLISH v2.13.6 ==================== */

/* ==================== RESPONSIVE DESIGN v2.19.0 - DEVICE-SPECIFIC OPTIMIZATION ==================== */

/* ============================================
   DESKTOP FIRST (1400px+) - Optimal Experience
   ============================================ */
@media (min-width: 1400px) {
    .app-container {
        max-width: 1600px;
    }
    
    .content-card {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Larger fonts for comfortable desktop viewing */
    body {
        font-size: 15px;
    }
}

/* ============================================
   LARGE DESKTOP (1200px-1399px)
   ============================================ */
@media (min-width: 1200px) and (max-width: 1399px) {
    .app-container {
        max-width: 1200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   TABLET LANDSCAPE (992px-1199px) - iPad Pro Landscape
   ============================================ */
@media (min-width: 992px) and (max-width: 1199px) {
    .app-container {
        grid-template-columns: 260px 1fr;
        gap: 12px;
    }
    
    .nav-panel {
        padding: 15px;
        background: white;
    }
    
    /* Fix navigation button alignment - smaller icons */
    .nav-btn {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 12px;
        min-height: 40px;
    }
    
    .nav-btn i {
        font-size: 16px;
        width: 18px;
        text-align: center;
        flex-shrink: 0;
    }
    
    /* Content cards with proper visibility */
    .content-card {
        padding: 18px;
        background: white;
        color: #334155;
    }
    
    .card-header h2 {
        font-size: 18px;
        color: #1e293b;
    }
    
    /* Stats grid - compact sizing */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        padding: 12px;
    }
    
    .stat-label {
        color: rgba(255, 255, 255, 0.9);
        font-size: 11px;
    }
    
    .stat-value {
        color: white;
        font-size: 20px;
    }
    
    /* Slightly smaller fonts */
    body {
        font-size: 14px;
    }
    
    /* AI Chatbot - compact for landscape with sidebar */
    .ai-chatbot-container {
        width: 360px;
        height: 55vh;
        max-height: 55vh;
        bottom: 15px;
        right: 15px;
    }
    
    .ai-chatbot-container.active {
        height: 55vh;
        max-height: 55vh;
    }
    
    .chatbot-messages {
        padding: 10px;
        gap: 10px;
    }
    
    .message-text {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .chatbot-input-container {
        padding: 10px;
    }
    
    #chatbotInput {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ============================================
   TABLET PORTRAIT (768px-991px) - iPad Portrait
   ============================================ */
@media (min-width: 768px) and (max-width: 991px) {
    body {
        padding: 12px;
        font-size: 14px;
    }
    
    .app-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Collapsible sidebar for tablet portrait */
    .nav-panel {
        position: fixed;
        left: 0;
        top: 0;
        width: 240px;
        height: 100vh;
        background: white;
        border-radius: 0;
        padding: 12px;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
        overflow-y: auto;
        z-index: 1000;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
    }
    
    .nav-panel.show {
        transform: translateX(0);
    }
    
    .logo {
        text-align: center;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 2px solid #f1f5f9;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    /* Vertical navigation - Compact with smaller icons */
    .nav-menu {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .nav-btn {
        padding: 10px 12px;
        font-size: 13px;
        text-align: left;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        min-height: 40px;
        background: #f8fafc;
        border-radius: 8px;
        transition: all 0.2s;
    }
    
    .nav-btn i {
        font-size: 16px;
        margin-bottom: 0;
        line-height: 1;
        width: 18px;
        text-align: center;
        flex-shrink: 0;
    }
    
    /* Sidebar toggle button - Visible by default */
    .sidebar-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
        display: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        transition: all 0.3s ease;
    }
    
    .sidebar-toggle i {
        font-size: 20px;
        color: white;
    }
    
    .sidebar-toggle:hover {
        background: linear-gradient(135deg, #1d4ed8, #2563eb);
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
    }
    
    .sidebar-toggle:active {
        transform: scale(0.95);
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: all;
    }
    
    /* Main content takes full width */
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .nav-btn.active {
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        color: white;
    }
    
    .nav-btn.active i {
        color: white;
    }
    
    /* Stats grid - 2 columns on tablet with compact sizing */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-change {
        font-size: 10px;
    }
    
    /* Fix white text visibility on tables */
    table {
        background: white;
    }
    
    thead th {
        background: #f8fafc;
        color: #1e293b;
    }
    
    tbody td {
        color: #334155;
        background: white;
    }
    
    tbody tr:hover td {
        background: #f8fafc;
        color: #1e293b;
    }
    
    /* Ensure all text in content cards is visible */
    .content-card,
    .content-card p,
    .content-card span:not(.stat-value):not(.stat-label),
    .content-card div {
        color: #475569;
    }
    
    .content-card h2,
    .content-card h3,
    .content-card h4 {
        color: #1e293b;
    }
    
    /* Content cards - fix visibility */
    .content-card {
        padding: 18px;
        border-radius: 12px;
        background: white;
    }
    
    .card-header {
        background: transparent;
    }
    
    .card-header h2 {
        font-size: 18px;
        color: #1e293b;
    }
    
    /* Fix stat card text visibility */
    .stat-card {
        background: linear-gradient(135deg, #2563eb, #3b82f6);
    }
    
    .stat-label {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .stat-value {
        color: white;
    }
    
    /* Fix other text colors */
    .content-card p, 
    .content-card span:not(.stat-value):not(.stat-label) {
        color: #475569;
    }
    
    /* Table text visibility */
    table {
        background: white;
        color: #334155;
    }
    
    th {
        color: #1e293b;
        background: #f8fafc;
    }
    
    td {
        color: #475569;
    }
    
    /* Tables - make scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    width: 100%;
    /* Forms - better spacing */
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    input, select, textarea {
        font-size: 15px;
        padding: 12px;
    }
    
    /* Buttons */
    .btn-primary, .btn-secondary {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 38px;
    
    /* Modals - full screen on tablet */
    .modal-content {
        width: 90%;
        max-width: 700px;
        max-height: 85vh;
        border-radius: 16px;
    }
    
    /* Chatbot - compact for tablet (keyboard friendly) */
    .ai-chatbot-container {
        width: 380px;
        height: 50vh;
        max-height: 50vh;
        bottom: 10px;
        right: 10px;
    }
    
    .ai-chatbot-container.active {
        height: 50vh;
        max-height: 50vh;
    }
    
    /* Adjust chatbot messages for smaller window */
    .chatbot-messages {
        padding: 10px;
        gap: 10px;
    }
    
    .chatbot-message {
        max-width: 90%;
    }
    
    .message-text {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* Compact input area */
    .chatbot-input-container {
        padding: 10px;
    }
    
    .quick-question-buttons {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .quick-question {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    #chatbotInput {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    #sendChatBtn {
        padding: 10px;
        min-height: 40px;
    }
}

/* ============================================
   MOBILE LANDSCAPE (568px-767px) - Phone Landscape
   ============================================ */
@media (min-width: 568px) and (max-width: 767px) and (orientation: landscape) {
    body {
        padding: 8px;
        font-size: 13px;
    }
    
    .app-container {
        gap: 8px;
    }
    
    /* Compact header */
    .logo {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    .logo .tagline {
        font-size: 10px;
    }
    
    /* Stats in 4 columns for landscape */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* Compact navigation */
    .nav-menu {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
    }
    
    .nav-btn {
        padding: 8px;
        font-size: 11px;
    }
    
    .nav-btn i {
        font-size: 16px;
    }
    
    /* Content */
    .content-card {
        padding: 12px;
    }
    
    .card-header h2 {
        font-size: 15px;
    }
    
    /* Forms - single column */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ============================================
   MOBILE PORTRAIT (481px-567px) - Large Phones
   ============================================ */
@media (min-width: 481px) and (max-width: 567px) {
    body {
        padding: 8px;
        font-size: 14px;
    }
    
    .app-container {
        gap: 10px;
    }
    
    /* Logo */
    .logo {
        padding: 14px;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    /* Stats - 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    /* Navigation */
    .nav-btn {
        padding: 14px;
        font-size: 14px;
    }
    
    .nav-btn i {
        font-size: 18px;
        margin-right: 10px;
    }
    
    /* Content */
    .content-card {
        padding: 16px;
        margin-bottom: 10px;
    }
    
    .card-header h2 {
        font-size: 17px;
    }
    
    /* Forms */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    input, select, textarea {
        font-size: 16px;
        padding: 14px;
    }
    
    /* Buttons - full width, larger */
    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 16px;
        font-size: 15px;
        min-height: 52px;
    }
    
    /* Tables - card view */
    .transaction-item {
        flex-direction: column;
        gap: 8px;
        padding: 14px;
    }
}

/* ============================================
   SMALL MOBILE (320px-480px) - Small Phones
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: 6px;
        font-size: 13px;
    }
    
    .app-container {
        gap: 8px;
    }
    
    /* Compact logo */
    .logo {
        padding: 12px;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    .logo .tagline {
        font-size: 10px;
    }
    
    .version {
        font-size: 10px;
    }
    
    /* Stats - single column on very small screens */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    /* Navigation - compact vertical */
    .nav-menu {
        gap: 6px;
    }
    
    .nav-btn {
        padding: 12px;
        font-size: 13px;
    }
    
    .nav-btn i {
        font-size: 16px;
        margin-right: 8px;
    }
    
    /* Content cards */
    .content-card {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 10px;
    }
    
    .card-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .card-header h2 {
        font-size: 15px;
    }
    
    /* Forms - full width everything */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    input, select, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Buttons - large touch targets */
    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 14px;
        font-size: 14px;
        min-height: 48px;
        border-radius: 8px;
    }
    
    /* Tables - switch to card view */
    table {
        display: none; /* Hide tables on small mobile */
    }
    
    .transaction-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .transaction-item {
        flex-direction: column;
        gap: 6px;
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Modals - full screen */
    .modal-content {
        width: 95%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 12px;
        margin: 4vh auto;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    /* Chatbot - full screen */
    .ai-chatbot-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
    
    .chatbot-header {
        border-radius: 0;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for all interactive elements */
    button, a, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover states on touch devices */
    .nav-btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    /* Better active states */
    .nav-btn:active {
        transform: scale(0.97);
        background: #2563eb;
        color: white;
    }
    
    button:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Prevent text selection on buttons */
    button, .nav-btn, .clickable {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
}

/* ============================================
   LANDSCAPE MODE SPECIFIC FIXES
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    /* Reduce vertical padding when height is limited */
    .content-card {
        padding: 10px 16px;
    }
    
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .ai-chatbot-container {
        height: 95vh;
        max-height: 95vh;
    }
}

/* ============================================
   PRINT STYLES (for reports)
   ============================================ */
@media print {
    body {
        padding: 0;
        background: white;
    }
    
    .nav-panel,
    .mobile-menu-btn,
    .chatbot-toggle-btn,
    .ai-chatbot-container,
    button {
        display: none !important;
    }
    
    .app-container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .content-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        page-break-inside: avoid;
    }
    
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* ==================== END RESPONSIVE DESIGN v2.19.0 ==================== */