/* ============================================================
   FWAY AR & Inventory System - Mobile-First Styles
   ============================================================ */

:root {
    /* ---- Brand / Core color palette (edit these to rebrand) ---- */
    --primary:       #011f60;   /* Petron primary blue           */
    --primary-dark:  #001747;   /* Primary, darkened             */
    --primary-light: #e2e8fb;   /* Primary, light tint           */
    --secondary:     #c9a227;   /* Gold accent (Petron)          */
    --warning:       #e67e22;   /* Amber / warning               */
    --info:          #2980b9;   /* Blue / info                   */
    --success:       #27ae60;   /* Green / success               */
    --danger:        #c0392b;   /* Red / danger                  */

    /* ---- Neutral / UI scale ---- */
    --text:       #1f2d3b;
    --text-muted: #6b7684;
    --bg:         #f4f6fa;
    --white:      #ffffff;
    --border:     #e2e8ee;
    --shadow:     0 2px 8px rgba(31, 45, 59, 0.08);
    --radius:     12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 16px;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* ---------- Layout container (max width for desktop) ---------- */
.container {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 16px;
    flex: 1 0 auto;   /* grow to fill viewport, pushing footer to the bottom */
}

/* ---------- Top app bar ---------- */
.app-bar {
    background: var(--primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.app-bar .brand {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.app-bar .user-chip {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-bar .user-chip .role-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.05s ease;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: auto;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.15);
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* ---------- Form card (login) ---------- */
.auth-card {
    margin-top: 30px;
    padding: 28px 22px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo .logo-mark {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 auto 10px;
}

.auth-logo h1 {
    font-size: 1.3rem;
    color: var(--primary-dark);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------- Flash messages ---------- */
.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash-success { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #bcd8c8; }
.flash-error   { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.flash-info    { background: #e7f1f8; color: #1f5f8b; border: 1px solid #b8d8ee; }

/* ---------- Dashboard welcome ---------- */
.welcome-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.welcome-card h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* ---------- Dashboard menu ---------- */
.menu-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin: 18px 4px 8px;
}

.menu-list {
    list-style: none;
}

.menu-list li {
    margin-bottom: 8px;
}

.menu-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    transition: background 0.15s, border-color 0.15s;
    color: var(--text);
}

.menu-list a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.menu-list a .menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.menu-list a .menu-label {
    flex: 1;
    font-weight: 600;
}

.menu-list a .menu-chev {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Placeholder / under construction ---------- */
.placeholder {
    text-align: center;
    padding: 40px 20px;
}

.placeholder .ph-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.placeholder h2 {
    margin-bottom: 6px;
}

.placeholder p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* ---------- Footer/logout ---------- */
.app-footer {
    text-align: center;
    background: var(--primary);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    padding: 16px 16px 28px;
    margin-top: 20px;
    flex-shrink: 0;   /* keep footer at bottom (body is flex column) */
}

/* ---------- App bar with logo ---------- */
.app-bar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    min-width: 0;
}

.app-bar .brand img {
    height: 26px;
    width: auto;
}

.app-bar .brand .brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Page secondary bar / header row ---------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-head .page-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* ---------- Buttons (fits mobile + desktop) ---------- */
.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

/* ---------- Table (DataTables) ---------- */
.table-wrap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 480px;   /* allow horizontal scroll on small screens */
}

.table-wrap th, .table-wrap td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table-wrap thead th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Money column — right aligned */
.money {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Row actions */
.row-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.row-actions .btn {
    width: auto;
    padding: 5px 10px;
    font-size: 0.78rem;
}

/* Active / inactive badge */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active   { background: #d5f2e3; color: #1d7a4a; }
.status-inactive { background: #fdecea; color: var(--danger); }

/* Vehicle count link */
.vehicle-count a { font-weight: 700; }

/* ---------- DataTables responsive & control UI ---------- */
.dataTables_wrapper {
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.9rem;
    margin-left: 6px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 10px;
    margin-left: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.dataTables_wrapper .dataTables_info {
    padding-top: 10px;
    color: var(--text-muted);
}

table.dataTable {
    border-collapse: collapse;
}

/* Elementor / child responsive row disclosure */
table.dataTable td.dataTables_empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* ---------- Form actions (form control row) ---------- */
.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Hidden (non-input) message row */
.is-muted { color: var(--text-muted); }

/* ---------- Inline details list (used in "view" contexts) ---------- */
.detail-list { margin: 0; }
.detail-list dt { font-weight: 700; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 10px; }
.detail-list dd { margin: 2px 0 0; font-size: 0.95rem; }

/* ---------- Client summary chips ---------- */
.summary-chip {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---------- Hamburger / off-canvas navigation ---------- */
.nav-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
}

.app-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hidden navigation drawer (slides in from right) */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 200;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-drawer.open { transform: translateX(0); }

.nav-drawer .nav-drawer-head {
    background: var(--primary);
    color: #fff;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-drawer .nav-drawer-head .nav-user { font-weight: 700; }
.nav-drawer .nav-drawer-head .nav-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

/* Drawer nav lists */
.nav-drawer .menu-section-title {
    margin: 16px 16px 6px;
    color: var(--text-muted);
}

.nav-drawer .menu-list {
    padding: 0 10px;
}

.nav-drawer .menu-list a {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--text);
}

.nav-drawer .menu-list a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-drawer .menu-list a .menu-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.nav-drawer .nav-logout {
    margin-top: auto;
    padding: 16px;
}

/* Overlay behind drawer */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 190;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.nav-overlay.open { opacity: 1; visibility: visible; }

/* ---------- Dashboard stat cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.stat-card .stat-icon {
    font-size: 1.3rem;
}

/* ---------- DataTables Buttons toolbar (Bfrtip) ---------- */
div.dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

div.dt-buttons .dt-button {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

div.dt-buttons .dt-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ColVis dropdown list styling */
div.dt-button-collection {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 6px;
}

div.dt-button-collection .dt-button {
    background: #fff;
    color: var(--text);
    border: none;
    display: block;
    width: 100%;
    text-align: left;
    border-radius: 6px;
}

div.dt-button-collection .dt-button:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ---------- Desktop tweaks ---------- */
@media (min-width: 768px) {
    /* Desktop: use the FULL VIEWPORT width (the prior 1100px cap made it feel
       confined). Content now spans the container edge-to-edge with side padding. */
    .container {
        width: 100%;
        max-width: none;
        padding: 28px 24px;
    }
    .btn {
        width: auto;
    }
    .btn-block-mobile-only {
        width: auto !important;
    }
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* ============================================================
   FWAY Charge Invoices - additions (appended to style.css)
   Period filter toolbar, summary footer total, form grid,
   and the inline line-item editor.
   ============================================================ */

/* ---------- Transaction period filter toolbar ---------- */
.period-toolbar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: 16px;
}

.period-toolbar .toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.input-group {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 220px;
}

.input-group .input-group-prepend {
    display: flex;
    align-items: center;
}

.input-group .input-group-text {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    white-space: nowrap;
    font-size: 0.9rem;
}

.input-group .daterangepicker-input {
    border-radius: 0 var(--radius) var(--radius) 0;
    min-width: 0;
}

.period-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.daterangepicker {
    font-family: inherit;
}

.period-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

.period-note strong {
    color: var(--primary-dark);
}

@media (min-width: 768px) {
    .period-toolbar .toolbar-row {
        flex-wrap: nowrap;
        align-items: center;
    }
    .input-group {
        max-width: 400px;
    }
}

/* ---------- DataTables summary footer total (tfoot) ---------- */
.table-wrap tfoot td {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 8px;
    border-top: 2px solid var(--primary);
}

.table-wrap tfoot td.money {
    text-align: right !important;
}

/* ---------- Invoice header form grid ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 14px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Inline charge line items editor ---------- */
.line-row td {
    padding: 6px 4px;
}

.line-row select,
.line-row input {
    width: 100%;
    padding: 7px 9px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
}

.line-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.3rem;
    cursor: pointer;
}

.line-total.money,
.grand-total-row {
    text-align: right;
}

.grand-total-row {
    font-weight: 700;
    font-size: 1rem;
    padding-top: 8px;
    border-top: 2px solid var(--border);
}


/* ---------- Select2 searchable dropdowns (Client / Vehicle / Product) ---------- */
.select2-container .select2-selection--single {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    padding-top: 2px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 14px;
    color: var(--text);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.15);
}

/* Force the native select to match height while Select2 styles the rendered box */
select.form-control.select2-init {
    width: 100% !important;
}

/* Line-item product dropdowns stay inside table cells */
.line-row .select2 {
    width: 100% !important;
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* ============================================================
   Collections & Adjustments - transaction type badges
   (Collection = green/active, Debit = amber, Credit = blue)
   ============================================================ */
.status-warn  { background: #fdeedd; color: #b3690c; }   /* Debit    */
.status-info  { background: #deedfb; color: #1b5ba8; }   /* Credit / info */

/* ============================================================
   Clients summary - live Balance column colouring (reuses tokens).
   0                -> default        (settled / current)
   > 0 (receivable) -> blue (.bal-owe)
   < 0 (over-paid)  -> red   (.bal-credit)
   ============================================================ */
.money .bal-value { font-variant-numeric: tabular-nums; }
td.bal-owe .bal-value    { color: var(--primary); }  /* outstanding (you are owed) */
td.bal-credit .bal-value { color: var(--danger); }   /* over-payment / credit to the client */

/* ============================================================
   FUELS INVENTORY - Pricing History & Purchases additions
   ============================================================ */

/* Stacked (Cost / Selling / Margin) cell inside a fuel tank column.
   Mirrors the legacy per-tank 3-line figure. Tabular-nums keeps columns aligned. */
.fuel3 {
    display: inline-block;
    text-align: right;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}
.fuel3 span { display: block; }

/* Name + product-kind subtitle above each tank's price pair in the form. */
.fuel-tank-block {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}
.fuel-tank-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.fuel-kind { color: var(--text-muted); font-weight: 400; }

.card-subtitle.fuel3-title { margin-bottom: 6px; }

/* "Show Inactive" filter in the fuel period toolbar (kept right after the
   Period Covered control; wraps to its own area neatly on mobile). */
.active-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.active-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Price input cells: constrain width so the form reads like a table of
   cost/selling per tank without wrapping awkwardly on mobile. */
.price-cell { font-variant-numeric: tabular-nums; }

/* A clear note under a field group in a fuels form. */
.form-hint { color: var(--text-muted); font-size: 0.85rem; margin: -6px 0 12px; }




/* ============================================================
   Charge Invoice form - 2-row header layout
   Row 1 = 4 columns (Shift Date | Invoice Date | Invoice No. | Amount)
   Row 2 = 2 columns (Client & Vehicle | Remarks)
   ============================================================ */
.form-grid.four-col {
    grid-template-columns: 1fr;
}
.form-grid.two-col {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .form-grid.four-col { grid-template-columns: repeat(4, 1fr); }
    .form-grid.two-col  { grid-template-columns: 2fr 1fr; }
}

/* Amount vs Grand Total status row: left message + far-right difference. */
.amount-status-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}
.amount-status-row .amount-diff {
    font-weight: 700;
    white-space: nowrap;
}

/* Disabled Save button (Invoice Amount != Grand Total). */
.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Disabled / read-only form controls (VIEW pages render values this way
   so they look consistent with the Create/Edit forms). */
.form-control:disabled,
.form-control[readonly] {
    background: #f2f4f8;
    color: var(--text);
    cursor: default;
    opacity: 1;
}
.form-control.money {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Amount-status right cluster: difference + exact-quantity suggestion + Apply. */
.amount-status-row .amount-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.amount-status-row .amount-suggest {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.amount-status-row .amount-suggest .btn {
    width: auto;
    padding: 3px 10px;
    font-size: 0.8rem;
}
