:root {
    color-scheme: dark;
    /* Color Palette - Blue, White, Grey */
    --bg-dark: #12141a; /* Dark Grey */
    --bg-panel: rgba(45, 55, 72, 0.4); /* Slate Grey */
    --bg-card: #181b24; /* Solid Dark Grey Card */
    --bg-input: #1e212b; /* Med Grey */
    
    --text-main: #ffffff; /* White */
    --text-muted: #a0aec0; /* Light Grey */
    
    --accent-primary: #3182ce; /* Bright Blue */
    --accent-secondary: #2b6cb0; /* Deep Blue */
    --accent-success: #00f260;
    --accent-error: #ff4b2b;
    
    /* Layout & Effects */
    --border-subtle: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(49, 130, 206, 0.5);
    
    --shadow-glow: 0 0 15px rgba(49, 130, 206, 0.3);
    --shadow-dropdown: 0 10px 25px rgba(0,0,0,0.5);
    
    --transition-snappy: 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-smooth: 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 15% 50%, rgba(43, 108, 176, 0.08), transparent 40%),
                      radial-gradient(circle at 85% 20%, rgba(49, 130, 206, 0.05), transparent 40%);
}

/* Universal typography consistency across all form controls and tables */
input, select, textarea, button, optgroup, table, th, td {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.input-modern {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background: var(--bg-input, #1e293b);
    color: var(--text-main, #f8fafc);
    border: 1px solid var(--border-subtle, #334155);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}
.input-modern:focus {
    outline: none;
    border-color: var(--accent-primary, #38bdf8);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.input-modern,
.ro-extra-desc, .proc-desc,
.ro-extra-parts, .proc-price,
.ro-extra-lab-time, .proc-lab-time,
.ro-extra-sa-time, .proc-sa-time,
.ro-extra-outwork, .proc-outwork,
.ro-extra-action, .proc-action,
.ro-extra-part-type, .proc-cap,
.ro-extra-paint, .proc-paint,
.ro-extra-labour, .proc-lab-cost {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

body.desktop-body {
    height: 100vh;
    overflow: hidden;
}

#app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-dropdown);
}

/* --- Typography --- */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; color: var(--text-main); }
h3 { font-size: 1.25rem; }

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Form Elements --- */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-snappy);
    outline: none;
    width: 100%;
}

/* Disable number spinner arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

select option {
    background-color: var(--bg-input);
    color: var(--text-main);
}

input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-snappy);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    background: rgba(49, 130, 206, 0.08);
}

/* --- Login Module --- */
#login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    animation: fadeIn var(--transition-smooth);
    background-image: url('Wallpaper.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    font-weight: 700;
    background: -webkit-linear-gradient(135deg, #f0f2f5, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

.login-error {
    color: var(--accent-error);
    font-size: 0.85rem;
    margin-top: -1rem;
    margin-bottom: 1rem;
    height: 1rem;
    display: block;
}

/* --- Dashboard Layout --- */
#dashboard-view {
    display: flex;
    height: 100vh;
    animation: slideInRight var(--transition-smooth);
}

.sidebar {
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin: 0.25rem 1rem;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-snappy);
    text-align: left;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(49, 130, 206, 0.15), transparent);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-dark);
}

.topbar {
    height: 70px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-area {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* --- Quoting Module Variants --- */
.quote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar input {
    border-radius: 8px;
}

.search-bar::before {
    content: 'Search:';
    position: static;
    transform: none;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 0.8rem;
    white-space: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

tbody tr {
    transition: background var(--transition-snappy);
}

tbody tr:hover {
    cursor: pointer;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-draft { background: rgba(139, 146, 165, 0.2); color: var(--text-muted); }
.badge-active { background: rgba(0, 242, 96, 0.2); color: var(--accent-success); }
.badge-error { background: rgba(255, 75, 43, 0.2); color: var(--accent-error); }

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Utilities */
.hidden { display: none !important; }
.flex-row { display: flex; gap: 1rem; }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }



/* Locked Quote Read-Only UI */
.quote-locked-ui input:disabled,
.quote-locked-ui select:disabled,
.quote-locked-ui textarea:disabled {
    color: var(--text-main) !important;
    font-weight: 500;
    cursor: default;
}

.quote-locked-ui input[type=number]:disabled::-webkit-inner-spin-button, 
.quote-locked-ui input[type=number]:disabled::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
.quote-locked-ui input[type=checkbox]:disabled {
    opacity: 0.9 !important;
    cursor: default;
    border-color: var(--border-subtle) !important;
}

.quote-locked-ui input[type=checkbox]:disabled {
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    opacity: 0.9 !important;
}

/* Amended Procedure Rows Highlight */
.proc-amended-row {
    background: rgba(245, 158, 11, 0.06) !important;
}
.proc-amended-row td:first-child {
    border-left: 3px solid #f59e0b !important;
}

/* Individual amended amount input highlights */
.proc-input-amended {
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
    font-weight: bold !important;
}

/* Print / Approve Album List Containers */
#print-albums-list, #approve-albums-list {
    min-height: 150px;
    max-height: 250px;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    border: 1px solid var(--border-subtle);
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
}

/* Folder Card Component */
.print-folder-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.print-folder-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

.print-folder-card.selected {
    background: rgba(49, 130, 206, 0.15) !important;
    border-color: rgba(49, 130, 206, 0.4) !important;
}

/* Maintenance Module Tab Navigation */
.maintenance-nav-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    align-items: center;
}

.btn-maint-tab {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.6rem 1.15rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    outline: none;
    user-select: none;
}

.btn-maint-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-maint-tab.active {
    background: var(--accent-primary, #3182ce) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(49, 130, 206, 0.35);
    border-color: transparent !important;
}

.maint-tab-content {
    animation: fadeInMaint 0.2s ease-out;
}

@keyframes fadeInMaint {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Maintenance: Suppliers & Invoicing Directory --- */
.maint-filter-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #cbd5e1;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    user-select: none;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.maint-filter-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.maint-filter-pill.active {
    font-weight: 700 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.maint-filter-pill.active[data-cat="all"] {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 16px rgba(2, 132, 199, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-cat="OEM Dealer"] {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 16px rgba(2, 132, 199, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-cat="CAP Supplier"] {
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-cat="Sublet / Service"] {
    background: linear-gradient(135deg, #ea580c, #c2410c) !important;
    border-color: #fb923c !important;
    box-shadow: 0 0 16px rgba(234, 88, 12, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-cat="Consumables"] {
    background: linear-gradient(135deg, #0d9488, #0f766e) !important;
    border-color: #2dd4bf !important;
    box-shadow: 0 0 16px rgba(13, 148, 136, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-method="all"] {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-method="Account"] {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    border-color: #4ade80 !important;
    box-shadow: 0 0 16px rgba(22, 163, 74, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-method="Praxis"] {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-filter-pill.active[data-method="COD"] {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    border-color: #fbbf24 !important;
    box-shadow: 0 0 16px rgba(217, 119, 6, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.maint-sup-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.maint-sup-table th {
    padding: 14px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 2px solid rgba(56, 189, 248, 0.2);
}

.maint-sup-table td {
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.maint-sup-table tr:hover td {
    background: rgba(56, 189, 248, 0.04);
}

.maint-sup-edit-btn {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(3, 105, 161, 0.3));
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #e0f2fe;
    padding: 7px 15px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.maint-sup-edit-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

.maint-sup-delete-btn {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.maint-sup-delete-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #f87171;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

/* Final Costing Modal Action Buttons */
.fc-action-btns-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}
@media (max-width: 580px) {
    .fc-action-btns-grid {
        grid-template-columns: 1fr;
    }
}
.fc-action-btn {
    min-height: 48px;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    text-align: center;
    line-height: 1.25;
    white-space: normal;
    word-break: normal;
    transition: all 0.15s ease;
}
.fc-action-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}



