/* ==========================================
   SOLAR ERP SUITE - DESIGN SYSTEM & LAYOUT
   ========================================== */

:root {
    --bg-app: #f3f8f5;            /* Soft light mint app backdrop */
    --bg-sidebar: #ffffff;        /* Clean white sidebar */
    --bg-card: #ffffff;           /* Clean white cards */
    --bg-panel: #ffffff;
    --border-color: rgba(5, 46, 36, 0.12); /* Subtle dark-green border */
    
    --text-primary: #0b2e24;      /* Deep forest green main text */
    --text-secondary: #1a4d3f;    /* Medium forest green text */
    --text-muted: #4e7a6e;        /* Muted forest green text */
    
    --primary: #e15a17;           /* Signature Amber/Orange primary accent */
    --primary-light: rgba(225, 90, 23, 0.08);
    --primary-gradient: linear-gradient(135deg, #f26a25 0%, #e15a17 100%);
    --primary-hover: #c94b0d;
    
    --secondary: #064e3b;         /* Deep forest green secondary accent */
    --success: #059669;           /* Green status accent */
    --success-light: #e6f7f0;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --card-shadow: 0 4px 6px -1px rgba(5, 46, 36, 0.03), 0 2px 4px -2px rgba(5, 46, 36, 0.03);
    --hover-shadow: 0 10px 15px -3px rgba(5, 46, 36, 0.06), 0 4px 6px -4px rgba(5, 46, 36, 0.06);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* BASE RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}

/* SCROLLBARS */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb {
    background: rgba(225, 90, 23, 0.45);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(225, 90, 23, 0.7);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ==========================================
   AUTHENTICATION VIEWPORT (LOGIN)
   ========================================== */
body.auth-logged-out {
    background-color: #f1f5f9 !important;
}

.app-auth-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 4000;
}

body.auth-logged-out .app-container { display: none !important; }
body.auth-logged-out .app-auth-screen { display: flex !important; }
body.auth-logged-in .app-container { display: flex !important; }
body.auth-logged-in .app-auth-screen { display: none !important; }

.auth-card {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px;
    padding: 35px 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08) !important;
    color: var(--text-primary) !important;
}

.app-auth-screen h2, 
.app-auth-screen h3, 
.app-auth-screen label,
.app-auth-screen p {
    color: var(--text-primary) !important;
}

.app-auth-screen input,
.app-auth-screen select {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.app-auth-screen input::placeholder {
    color: var(--text-muted) !important;
}
.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}
.auth-logo {
    display: inline-flex;
    padding: 12px;
    background: var(--primary-gradient);
    border-radius: 12px;
    color: #ffffff;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

/* ==========================================
   APP MAIN GRID LAYOUT
   ========================================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* SIDEBAR */
.app-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    flex-shrink: 0;
}
.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}
.sidebar-logo-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.sidebar-logo-sub {
    font-size: 9px;
    color: var(--text-muted);
}
.sidebar-menu {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.sidebar-link:hover {
    background: var(--bg-app);
    color: var(--text-primary);
}
.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-link i {
    width: 18px;
    height: 18px;
}
.sidebar-profile {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
}

/* CONTENT CONTAINER */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* HEADER */
.app-header {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    flex-shrink: 0;
}
.header-title-section h1 {
    font-size: 18px;
    font-weight: 800;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.badge-role {
    font-size: 10px;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* VIEWPORT CONTAINER */
.app-viewport {
    flex: 1;
    padding: 30px;
    overflow-y: auto !important;
    background: var(--bg-app);
    height: calc(100vh - 70px);
    max-height: calc(100vh - 70px);
    box-sizing: border-box;
}

.app-screen {
    display: none;
    flex-direction: column;
    gap: 24px;
    height: auto;
}
.app-screen.active {
    display: flex;
}

/* ==========================================
   COMPONENTS & UI CARDS
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.card-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}
.card-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon.primary { background: #e0f2fe; color: #0284c7; }
.stat-icon.success { background: #d1fae5; color: #10b981; }
.stat-icon.danger { background: #fee2e2; color: #ef4444; }
.stat-icon.secondary { background: #e0e7ff; color: #6366f1; }

.stat-details {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 2px;
}

/* SECTIONS GRID */
.sections-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
.accounts-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
.panel-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.panel-title {
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================
   INPUTS & STANDARD FORMS
   ========================================== */
.input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.input-grid.colspan-3 {
    grid-template-columns: repeat(3, 1fr);
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.input-group.colspan-2 {
    grid-column: span 2;
}
label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 12px;
    transition: var(--transition);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

/* SLIDERS & RANGE INPUTS */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* SWITCHES */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}
.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 22px;
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .switch-slider {
    background-color: var(--success);
}
input:checked + .switch-slider:before {
    transform: translateX(22px);
}
.flex-row-align {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 14px rgba(2, 132, 199, 0.3);
}
.btn-secondary {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: var(--bg-app);
    color: var(--text-primary);
}
.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
}

/* ==========================================
   DATATABLE / GRID RENDERERS
   ========================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th {
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
}
tr:hover td {
    background: #f8fafc;
}
.badge {
    display: inline-flex;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 12px;
}
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.info { background: #e0f2fe; color: #0369a1; }

/* ==========================================
   BOTTOM SHEET / DIALOG CONTAINER OVERLAYS
   ========================================== */
.bottom-sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 2000;
}
.bottom-sheet-overlay.active {
    display: flex;
}
.bottom-sheet-card {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes slideUp {
    to { transform: translateY(0); }
}
.bottom-sheet-drag-handle {
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 0 auto 15px auto;
}
.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.btn-close-sheet {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}
.bottom-sheet-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* ==========================================
   CAD VECTOR Blueprints DESIGN PANEL
   ========================================== */
.cad-designer-card {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
@media (min-width: 768px) {
    .cad-designer-card {
        flex-direction: row;
    }
    .cad-designer-card > div,
    .cad-designer-card > .cad-canvas-board {
        flex: 1;
    }
}
.cad-canvas-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #0d131f;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 15px;
}
canvas {
    max-width: 100%;
}

/* ==========================================
   ERP WIZARD STEPPERS
   ========================================== */
.wizard-header-steps {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
    gap: 8px;
}
.wizard-step-bullet {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
}
.wizard-step-bullet.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.wizard-step-bullet.completed {
    color: var(--success);
    border-bottom-color: var(--success);
}
.wizard-step-panel {
    display: none;
}
.wizard-step-panel.active {
    display: block;
}

/* ==========================================
   PRINT STYLES FOR TECHNICAL PROPOSALS
   ========================================== */
@media print {
    @page {
        size: A4;
        margin: 0 !important;
    }
    body {
        margin: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body, .app-container, .app-content, .app-viewport {
        background: #ffffff !important;
        color: #000000 !important;
        overflow: visible !important;
        height: auto !important;
        width: auto !important;
    }
    .no-print {
        display: none !important;
    }
    .app-sidebar {
        display: none !important;
    }
    .app-viewport {
        padding: 0 !important;
    }
    .app-screen {
        display: none !important;
    }
    #view-editor {
        display: block !important;
    }
    .editor-header-bar, .editor-footer-nav {
        display: none !important;
    }
    .printable-document-container {
        display: block !important;
    }
    .a4-page-layout {
        page-break-after: always !important;
        height: 297mm !important;
        width: 210mm !important;
        padding: 10mm 15mm !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        background: #ffffff !important;
    }
    .a4-page-layout .proposal-table th,
    .a4-page-layout .proposal-table td {
        padding: 3px 5px !important;
        font-size: 8px !important;
    }
}

/* Document Previews */
.printable-document-container {
    background: #e2e8f0;
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    overflow-y: auto;
    height: calc(100vh - 120px);
}
.a4-page-layout {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    padding: 10mm 15mm;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    color: #334155;
}
.a4-page-layout .proposal-table th,
.a4-page-layout .proposal-table td {
    padding: 3px 5px !important;
    font-size: 8px !important;
}
.system-summary-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin: 10px 0;
    background: #f8fafc;
}
.summary-metric {
    padding: 12px;
    border-right: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    text-align: center;
}
.summary-metric:last-child {
    border-right: none;
}
.summary-metric .label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
}
.summary-metric .value {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2px;
}

/* ==========================================
   MOBILE & TABLET RESPONSIVE RULES
   ========================================== */
@media (max-width: 991px) {
    /* Main Layout */
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        height: 100% !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2000;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    }
    .app-sidebar.sidebar-open {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .app-header {
        padding: 0 15px;
    }
    .app-viewport {
        padding: 15px;
    }
    
    /* Stats & Dashboards */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .sections-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .accounts-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    .card-stat {
        padding: 12px 15px !important;
        gap: 10px !important;
    }
    
    /* Forms Grids */
    .input-grid, .input-grid.colspan-3 {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    /* Document Previews scaling */
    .printable-document-container {
        padding: 15px 0;
        gap: 15px;
        height: auto;
    }
    .a4-page-layout {
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        padding: 15px !important;
        transform: none !important;
    }
    
    /* Tables support */
    .proposal-table th, .proposal-table td {
        padding: 4px !important;
        font-size: 8px !important;
    }
    
    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* CAD editor responsiveness */
    #wizard-cad-canvas {
        max-width: 100% !important;
        height: auto !important;
        background: #0d131f !important;
        border-radius: 8px !important;
        border: 1px solid #1e293b !important;
    }
}

@media (max-width: 768px) {
    /* Wizard Steps Stepper responsive styling */
    .wizard-header-steps {
        gap: 4px !important;
        border-bottom: none !important;
        justify-content: space-between !important;
    }
    .wizard-step-bullet {
        padding: 6px 2px !important;
        font-size: 0px !important; /* Hides original long texts */
        border-bottom: none !important;
        flex: initial !important;
    }
    .wizard-step-bullet::before {
        content: attr(data-step); /* Shows only step numbers */
        font-size: 11px !important;
        font-weight: 800 !important;
        display: inline-block !important;
        width: 24px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        border-radius: 50%;
        background: #f1f5f9;
        color: #64748b;
        border: 1px solid #e2e8f0;
        transition: all 0.2s ease;
    }
    .wizard-step-bullet.active::before {
        background: var(--primary);
        color: #ffffff;
        border-color: var(--primary);
        box-shadow: 0 0 8px rgba(225, 90, 23, 0.4);
    }
    .wizard-step-bullet.completed::before {
        background: #10b981;
        color: #ffffff;
        border-color: #10b981;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .header-actions {
        gap: 8px;
    }
    .badge-role {
        display: none;
    }
    .panel-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .panel-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* CAD view stack layout */
    .cad-designer-card {
        padding: 10px;
    }
    .cad-canvas-board {
        padding: 8px;
    }
}

/* Inventory Category Filter Tabs */
.btn-category-tab {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-category-tab:hover {
    color: #0f172a;
    border-color: #94a3b8;
    background: #f1f5f9;
}
.btn-category-tab.active {
    color: #ffffff;
    background: #e15a17;
    border-color: #e15a17;
    box-shadow: 0 2px 4px rgba(225, 90, 23, 0.2);
}

.pdf-export-mode {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 10mm 15mm !important;
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    box-sizing: border-box !important;
}

/* ERP Mobile Staff Bottom Tab Bar */
.mobile-staff-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    background: rgba(5, 20, 15, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(20, 108, 67, 0.25);
    z-index: 1998;
    grid-template-columns: repeat(5, 1fr);
    justify-items: center;
    align-items: center;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-staff-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--font-outfit);
    font-size: 9px;
    font-weight: 500;
    gap: 3px;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-staff-tab-item i {
    width: 18px;
    height: 18px;
}

.mobile-staff-tab-item:hover, .mobile-staff-tab-item.active {
    color: #e15a17;
}

.mobile-staff-tab-item.active i {
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 5px rgba(225, 90, 23, 0.4));
}

@media (max-width: 991px) {
    .mobile-staff-tab-bar {
        display: grid;
    }
    .app-container {
        padding-bottom: 75px !important;
    }
    .bottom-sheet-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
    }
}

.sidebar-link-btn:hover {
    background: rgba(225, 90, 23, 0.08) !important;
    color: #e15a17 !important;
}

/* ==========================================
   RESPONSIVE GRIDS & LAYOUT HELPER SYSTEM
   ========================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 991px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==========================================
   MODAL WINDOW DIALOGS FOR ERP & ADMIN
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 20, 15, 0.45);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 50px rgba(5, 46, 36, 0.08);
    position: relative;
    text-align: left;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.sidebar-link-gateway:hover {
    background: var(--primary-light);
    color: var(--primary) !important;
}

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

@media (max-width: 576px) {
    .modal-card {
        padding: 20px !important;
        border-radius: 12px !important;
    }
}

/* MOBILE & RESPONSIVE UX OPTIMIZATIONS */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column !important;
    }
    .app-sidebar {
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 12px !important;
    }
    .sections-grid {
        grid-template-columns: 1fr !important;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .editor-header-bar {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    .bottom-sheet-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        padding: 16px !important;
    }
    .btn {
        padding: 8px 14px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .panel-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
}

/* ==========================================
   NATIVE ERP MOBILE APP DOCK & DRAWER CSS
   ========================================== */
.mobile-staff-tab-bar {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 64px !important;
    }

    /* Fixed Top App Header on Mobile */
    .app-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        padding: 10px 14px !important;
        background: #ffffff !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important;
    }

    .app-header h1 {
        font-size: 16px !important;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 20px !important;
        color: var(--text-primary) !important;
        padding: 4px 8px !important;
        border-radius: 6px !important;
        background: var(--bg-app) !important;
    }

    /* Off-Canvas Mobile App Sidebar Drawer */
    .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 2005 !important;
        background: #ffffff !important;
        box-shadow: 5px 0 30px rgba(0,0,0,0.15) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
    }

    .app-sidebar.mobile-active,
    .app-sidebar.sidebar-open {
        transform: translateX(0) !important;
    }

    /* Mobile Bottom Navigation Bar */
    .mobile-staff-tab-bar {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 60px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(16px) !important;
        border-top: 1px solid rgba(5, 46, 36, 0.12) !important;
        box-shadow: 0 -4px 20px rgba(5, 46, 36, 0.08) !important;
        z-index: 10000 !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 2px !important;
    }

    .mobile-staff-tab-item {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        border: none !important;
        color: var(--text-muted) !important;
        font-size: 9px !important;
        font-weight: 700 !important;
        gap: 3px !important;
        transition: all 0.2s ease !important;
        padding: 6px 0 !important;
        cursor: pointer !important;
    }

    .mobile-staff-tab-item i, .mobile-staff-tab-item svg {
        width: 18px !important;
        height: 18px !important;
    }

    .mobile-staff-tab-item.active {
        color: var(--primary) !important;
    }

    .mobile-staff-tab-item.active i, .mobile-staff-tab-item.active svg {
        transform: translateY(-2px) scale(1.1) !important;
        color: var(--primary) !important;
    }

    /* Responsive Form & Table Tweaks with Bottom Dock Clearance */
    .app-viewport {
        padding: 12px 10px 85px 10px !important; /* 85px bottom clearance prevents bottom dock overlap */
        height: calc(100vh - 60px) !important;
        max-height: calc(100vh - 60px) !important;
        box-sizing: border-box !important;
    }

    .app-screen {
        padding-bottom: 75px !important;
    }

    .panel-card:last-child,
    .card:last-child,
    .data-table-container:last-child,
    .wizard-step-panel:last-child {
        margin-bottom: 75px !important;
    }

    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 10px !important;
    }

    .card {
        padding: 16px 12px !important;
        border-radius: 12px !important;
    }

    /* Mobile Proposal Configurator Stepper & Canvas Optimization */
    .editor-header-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .editor-header-bar > div {
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .wizard-header-steps {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 8px !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        margin-bottom: 16px !important;
    }

    .wizard-header-steps::-webkit-scrollbar {
        display: none !important;
    }

    .wizard-step-bullet {
        flex: 0 0 auto !important;
        padding: 8px 14px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        background: var(--bg-app) !important;
        border: 1px solid var(--border-color) !important;
        cursor: pointer !important;
    }

    .wizard-step-bullet.active {
        background: rgba(225, 90, 23, 0.1) !important;
        color: var(--primary) !important;
        border-color: var(--primary) !important;
        font-weight: 800 !important;
    }

    .wizard-step-bullet.completed {
        background: rgba(16, 185, 129, 0.1) !important;
        color: #10b981 !important;
        border-color: #10b981 !important;
    }

    .input-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
        touch-action: pan-y !important;
    }
}
