:root {
    --primary: #123c69;
    --accent: #0b7285;
    --muted: #f4f7fb;
    --border: #d8e0ea;
    --danger: #b42318;
    --ok: #087f5b;
    --text: #1f2937;
    --warning: #d68910;
    --light-blue: #eef6ff;
    --light-green: #eafaf1;
}

/* =========================
   Base Layout
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f9fc;
    color: var(--text);
}

.container {
    max-width: 1180px;
    margin: 24px auto;
    padding: 0 16px;
}

.footer {
    text-align: center;
    color: #6b7280;
    padding: 30px;
}

/* =========================
   Top Navigation
========================= */

.topbar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
    padding: 4px;
}

.topbar span {
    opacity: 0.85;
    margin-left: 0;
}

.topbar a {
    color: white;
    text-decoration: none;
    margin-left: 14px;
    font-size: 14px;
    font-weight: 600;
}

.topbar a:hover {
    text-decoration: underline;
}

/* =========================
   Cards
========================= */

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 6px 18px rgba(18, 60, 105, 0.06);
}

/* =========================
   Dashboard Stats
========================= */

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.stat h3 {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.stat p {
    font-size: 24px;
    font-weight: bold;
    margin: 8px 0 0;
}

/* =========================
   Menu Cards
========================= */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 22px;
}

.menu-card {
    background: white;
    border-radius: 14px;
    padding: 28px 18px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.10);
    border: 1px solid #e0e0e0;
    transition: 0.2s ease;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.menu-title {
    font-size: 19px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--primary);
}

.menu-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* =========================
   Forms
========================= */

.vehicle-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.vehicle-section {
    border: 1px solid #dce6f2;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 5px 16px rgba(18, 60, 105, 0.06);
}

.vehicle-section-header {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: #ffffff;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.vehicle-section .form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 22px;
    padding: 18px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
    font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    margin-top: 6px;
    background: #ffffff;
}

.full {
    grid-column: 1 / -1;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.money-input {
    text-align: right;
}

.stock-search-input {
    font-size: 15px;
    padding: 9px 12px;
    width: 280px;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

/* Make vehicle stock search input larger */
.vehicle-filter input[type="text"],
.card form input[name="q"],
.card form input[type="search"] {
    font-size: 15px;
    padding: 9px 12px;
    min-width: 260px;
    height: 38px;
    border-radius: 8px;
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.compact-vehicle-form input[readonly],
.compact-vehicle-form .readonly-input {
    background: #f1f3f5 !important;
    color: #6b7280 !important;
    border-color: #d5d9de !important;
    cursor: not-allowed !important;
}

/* =========================
   Buttons
========================= */

button,
.btn {
    white-space: nowrap;
    display: inline-block;
    background: var(--primary);
    color: white;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

button:hover,
.btn:hover {
    opacity: 0.92;
}

.btn.secondary {
    background: #495057;
}

.btn.ok {
    background: var(--ok);
}

.btn.danger {
    background: var(--danger);
}

.btn.excel {
    background: #217346;
    color: #ffffff;
}

.btn.excel:hover {
    background: #1a5c38;
    color: #ffffff;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-edit {
    background: #0d3d6e;
    color: #ffffff;
}

.btn-edit:hover {
    background: #092d52;
    color: #ffffff;
}
/* =========================
   Tables
========================= */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    font-size: 14px;
}

th {
    background: var(--muted);
    font-weight: 700;
}

tr:last-child th,
tr:last-child td {
    border-bottom: none;
}

.amount {
    text-align: right;
}

.actions {
    white-space: nowrap;
    min-width: 128px;
}

.actions .btn,
.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    margin-bottom: 0;
    vertical-align: middle;
}

/* =========================
   Badges / Status
========================= */

.badge {
    padding: 5px 9px;
    border-radius: 999px;
    background: #e7f5ff;
    color: #0b7285;
    font-size: 12px;
    font-weight: 700;
}

.badge.sold {
    background: #e6fcf5;
    color: #087f5b;
}

.badge.unpaid {
    background: #fff3bf;
    color: #8d6b00;
}

/* =========================
   Images
========================= */

.thumb {
    width: 95px;
    height: 65px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* =========================
   Alerts / Errors
========================= */

.error {
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    color: #b42318;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* =========================
   Printable Reports
========================= */

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

.report-logo {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
}

/* =========================
   Account Summary Report
========================= */

.report-filter-card {
    max-width: 1100px;
    margin: 20px auto;
}

.report-title {
    margin-bottom: 18px;
    font-size: 26px;
    font-weight: 700;
    color: #08233f;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.report-filter-grid label {
    font-weight: 600;
    font-size: 13px;
    color: #34495e;
}

.report-filter-grid input {
    margin-top: 6px;
}

.report-summary-grid {
    max-width: 1100px;
    margin: 18px auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.report-kpi-grid {
    max-width: 1180px;
    margin-bottom: 18px;
}

.report-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.report-box-title {
    font-size: 13px;
    color: #5d6d7e;
    font-weight: 700;
    margin-bottom: 8px;
}

.report-box-amount {
    font-size: 25px;
    font-weight: 800;
    color: #08233f;
}

.report-box.sales {
    border-left: 5px solid #0b6b8f;
}

.report-box.payment {
    border-left: 5px solid #159957;
}

.report-box.purchase {
    border-left: 5px solid var(--warning);
}

.report-box.expense {
    border-left: 5px solid var(--danger);
}

.report-box.profit {
    border-left: 5px solid #087f5b;
}

.report-box.outstanding {
    border-left: 5px solid #d68910;
}

.report-detail-card {
    max-width: 1100px;
    margin: 18px auto;
}

.report-detail-card h3 {
    margin-top: 0;
    color: #08233f;
}

.report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 12px;
}

.report-table th {
    background: #eef3f8;
    color: #08233f;
    text-align: left;
    padding: 13px 14px;
    font-size: 14px;
}

.report-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.report-table td.amount,
.report-table th.amount {
    text-align: right;
    font-weight: 700;
}

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

.row-muted {
    color: #596777;
}

.row-deduct {
    color: #922b21;
}

.row-gross {
    background: var(--light-blue);
    font-weight: 800;
}

.row-net {
    background: var(--light-green);
    font-weight: 900;
    color: #0b5d34;
}

.report-note {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border-left: 4px solid #0b6b8f;
    color: #566573;
    border-radius: 8px;
    font-size: 13px;
}

.statement-heading {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1f2937;
}

.statement-heading h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: #08233f;
}

.statement-heading p {
    margin: 6px 0 0;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
}

.statement-table {
    border: 1px solid #9ca3af;
    border-radius: 0;
    border-collapse: collapse;
}

.statement-table th,
.statement-table td {
    border: 1px solid #cbd5e1;
    padding: 9px 12px;
}

.statement-table th:first-child,
.statement-table td:first-child {
    width: 72%;
}

.statement-table th.amount,
.statement-table td.amount {
    width: 28%;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

.statement-section th {
    background: #f1f5f9;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
}

.statement-indent {
    padding-left: 28px !important;
}

.statement-total {
    background: #f8fafc;
    font-weight: 900;
}

.statement-total td {
    border-top: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
}

.statement-subtotal {
    background: #eef6ff;
    font-weight: 900;
}

.statement-net {
    background: #eafaf1;
    color: #075e3a;
    font-weight: 900;
    font-size: 15px;
}

.statement-net td {
    border-top: 3px double #0f5132;
    border-bottom: 3px double #0f5132;
}

.statement-spacer td {
    height: 18px;
    padding: 0;
    background: #ffffff;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
}

/* account summary filter */

.report-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 28px;
    align-items: end;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.filter-label span {
    min-width: 40px;
}

.filter-label input[type="date"] {
    min-width: 150px;
}

.filter-button-wrap {
    display: flex;
    justify-content: flex-end;
}

/* =========================
   Responsive
========================= */

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

    .report-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-filter-grid {
        grid-template-columns: 1fr;
    }

    .topbar nav a {
        display: inline-block;
        margin: 6px 8px 0 0;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .container {
        margin: 16px auto;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
    }
}

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

    th,
    td,
    .report-table th,
    .report-table td {
        font-size: 13px;
        padding: 10px;
    }

    button,
    .btn {
        padding: 9px 12px;
        font-size: 13px;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .topbar,
    .footer,
    .no-print {
        display: none !important;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .card,
    .report-box {
        box-shadow: none;
        border-color: #cbd5e1;
    }

    .report-summary-grid {
        break-inside: avoid;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* =========================
   Consignment Additions
========================= */
.badge.consignment {
    background: #fff4e6;
    color: #d9480f;
}

.badge.partially_paid,
.badge.partially-paid {
    background: #fff3bf;
    color: #8d6b00;
}

.badge.paid {
    background: #e6fcf5;
    color: #087f5b;
}

.info-box {
    background: #f8fafc;
    border-left: 5px solid var(--accent);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0;
    line-height: 1.5;
    color: #334155;
}

.report-box.commission {
    border-left: 5px solid #d9480f;
}

.note {
    background: #f8fafc;
    border-left: 4px solid var(--accent);
    padding: 10px 12px;
    border-radius: 8px;
    color: #536171;
}


/* Login Screen */
.login-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #eef5ff 0%, #f8fafc 55%, #edfdf6 100%);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    box-sizing: border-box;
}

.login-card {
    width: 100%;
    max-width: 410px;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 18px;
    padding: 32px 30px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 14px;
}

.login-logo {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
}

.login-card h2 {
    margin: 0;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: #0f2747;
}

.login-subtitle {
    margin: 7px 0 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.login-form label {
    display: block;
    margin-bottom: 17px;
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
}

.login-form label span {
    display: block;
    margin-bottom: 7px;
}

.login-form input {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 15px;
    box-sizing: border-box;
    background: #f8fafc;
}

.login-form input:focus {
    outline: none;
    border-color: #0f4c81;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

.login-btn {
    width: 100%;
    margin-top: 4px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: #0f4c81;
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}

.login-btn:hover {
    background: #0b3d66;
}

.login-note {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.login-error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff1f2;
    color: #be123c;
    font-size: 14px;
    font-weight: 600;
}

/* change password page */

.password-page {
    display: flex;
    justify-content: center;
    padding: 35px 15px;
}

.password-card {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #d8e3ec;
    border-radius: 16px;
    padding: 28px 30px 30px;
    box-shadow: 0 10px 28px rgba(15, 45, 75, 0.08);
}

.password-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5edf4;
}

.password-header h2 {
    margin: 0;
    font-size: 24px;
    color: #0b1f33;
}

.password-header p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 14px;
}

.password-form label {
    display: block;
    margin-bottom: 18px;
    font-weight: 700;
    color: #0f172a;
}

.password-form label span {
    display: block;
    margin-bottom: 7px;
}

.password-form input {
    width: 100%;
    height: 42px;
    padding: 9px 12px;
    border: 1px solid #cbd8e3;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
}

.password-form input:focus {
    outline: none;
    border-color: #0f5b78;
    box-shadow: 0 0 0 3px rgba(15, 91, 120, 0.12);
}

.password-form small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-weight: 400;
    font-size: 12px;
}

.password-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding-top: 18px;
    border-top: 1px solid #e5edf4;
}

.password-actions button,
.password-actions .btn {
    min-width: 130px;
    text-align: center;
}

/* =========================
   Company Setup Page
========================= */

.company-setup-page {
    max-width: 1180px;
    margin: 24px auto;
    padding: 0 16px;
}

.company-setup-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(18, 60, 105, 0.07);
}

.company-setup-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5edf5;
}

.company-setup-header h2 {
    margin: 0;
    font-size: 26px;
    color: var(--primary);
}

.company-setup-header p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}

.company-setup-grid {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 28px;
    align-items: start;
}

.company-setup-section {
    background: #f8fbff;
    border: 1px solid #e0eaf5;
    border-radius: 14px;
    padding: 22px;
}

.company-setup-section h3 {
    margin: 0 0 18px;
    font-size: 17px;
    color: var(--primary);
    padding-left: 12px;
    border-left: 5px solid var(--primary);
}

.company-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
}

.company-field {
    margin-bottom: 16px;
}

.company-field.full {
    grid-column: 1 / -1;
}

.company-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    font-size: 13px;
    color: #102a43;
}

.company-field input,
.company-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 14px;
    background: #ffffff;
}

.company-field input:focus,
.company-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 60, 105, 0.12);
}

.company-field textarea {
    min-height: 125px;
    resize: vertical;
}

.company-field small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
}

.company-logo-panel {
    background: #f8fbff;
    border: 1px solid #e0eaf5;
    border-radius: 14px;
    padding: 22px;
}

.company-logo-preview {
    width: 100%;
    height: 185px;
    background: #ffffff;
    border: 1px dashed #b9c8d8;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    padding: 16px;
}

.company-logo-preview img {
    max-width: 220px;
    max-height: 140px;
    object-fit: contain;
}

.company-no-logo {
    color: #94a3b8;
    font-size: 14px;
}

.company-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5edf5;
    display: flex;
    gap: 12px;
    align-items: center;
}

.company-actions .btn,
.company-actions button {
    min-height: 40px;
    padding: 9px 16px;
}

@media (max-width: 900px) {
    .company-setup-grid,
    .company-fields-grid {
        grid-template-columns: 1fr;
    }

    .company-field.full {
        grid-column: auto;
    }
}

/* =========================
   Pagination
========================= */

.pagination-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    color: #475569;
    font-size: 14px;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination-links .btn {
    min-width: 38px;
}

.pagination-gap {
    color: #64748b;
    font-weight: 700;
    padding: 0 4px;
}

/* =========================
   Vehicle List Mobile Layout
========================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.vehicle-list-card {
    overflow: visible;
}

.vehicle-stock-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.vehicle-stock-summary-grid .report-box-amount,
.general-expense-summary-grid .report-box-amount {
    overflow-wrap: anywhere;
}

.vehicle-filter {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}

.vehicle-filter label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-weight: 700;
    color: #34495e;
}

.vehicle-filter select,
.vehicle-filter input {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.vehicle-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

@media (max-width: 980px) {
    .vehicle-filter {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vehicle-filter label,
    .vehicle-filter select,
    .vehicle-filter input {
        width: 100%;
    }

    .vehicle-filter-actions {
        grid-column: 1 / -1;
        margin-left: 0;
    }
}

.vehicle-list-table .actions {
    min-width: 150px;
}

.vehicle-list-table .actions .btn {
    min-width: 64px;
}

@media (max-width: 700px) {
    .vehicle-stock-summary-grid {
        grid-template-columns: 1fr;
    }

    .vehicle-filter {
        display: grid;
        grid-template-columns: 1fr;
    }

    .vehicle-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
        margin-left: 0;
    }

    .vehicle-filter-actions .btn,
    .vehicle-filter-actions button {
        width: 100%;
    }

    .vehicle-table-wrap {
        overflow-x: visible;
    }

    .vehicle-list-table,
    .vehicle-list-table thead,
    .vehicle-list-table tbody,
    .vehicle-list-table tr,
    .vehicle-list-table th,
    .vehicle-list-table td {
        display: block;
        width: 100%;
    }

    .vehicle-list-table thead {
        display: none;
    }

    .vehicle-list-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 4px 14px rgba(18, 60, 105, 0.06);
    }

    .vehicle-list-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 10px 12px;
        border-bottom: 1px solid #eef2f7;
        text-align: right;
        word-break: break-word;
    }

    .vehicle-list-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 800;
        color: #475569;
    }

    .vehicle-list-table td[data-label="Image"] {
        justify-content: center;
        background: #f8fafc;
    }

    .vehicle-list-table td[data-label="Image"]::before {
        display: none;
    }

    .vehicle-list-table .thumb {
        width: 100%;
        max-width: 220px;
        height: 130px;
    }

    .vehicle-list-table .actions {
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
        background: #f8fafc;
    }

    .vehicle-list-table .actions::before {
        align-self: center;
    }

    .vehicle-list-table .actions .btn,
    .vehicle-list-table .actions a {
        margin: 0 0 0 6px;
        min-width: 72px;
    }

    .stock-search-input,
    .vehicle-filter input[type="text"],
    .card form input[name="q"],
    .card form input[type="search"] {
        min-width: 0;
        width: 100%;
    }
}


/* =========================
   General Expenses Mobile Layout
========================= */

.general-expense-card {
    overflow: visible;
}

.general-expense-table-wrap {
    width: 100%;
}

.general-expense-table .table-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.general-expense-table .mobile-actions .btn,
.general-expense-table .mobile-actions button {
    min-width: 82px;
}

.general-expense-form-actions {
    margin-top: 14px;
    flex-wrap: wrap;
}

.general-expense-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.general-expense-filter-card {
    padding: 16px 18px;
}

.general-expense-filter {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}

.general-expense-filter .filter-field {
    display: grid;
    grid-template-columns: 58px 150px;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-weight: 700;
}

.general-expense-filter .filter-field span {
    color: #34495e;
    font-size: 13px;
}

.general-expense-filter .filter-field input,
.general-expense-filter .filter-field select {
    width: 150px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.general-expense-filter .general-expense-search {
    grid-template-columns: 62px minmax(190px, 1fr);
}

.general-expense-filter .general-expense-search input {
    width: 220px;
}

.general-expense-filter .filter-button-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .general-expense-filter {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .general-expense-filter .filter-field,
    .general-expense-filter .general-expense-search {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .general-expense-filter .filter-field input,
    .general-expense-filter .filter-field select,
    .general-expense-filter .general-expense-search input {
        width: 100%;
    }

    .general-expense-filter .filter-button-wrap {
        grid-column: 1 / -1;
        margin-left: 0;
    }
}

.general-expense-breakdown {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 18px;
}

.general-expense-breakdown div {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border: 1px solid #d8e0ea;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.general-expense-breakdown span {
    color: #475569;
    font-weight: 700;
}

.general-expense-breakdown strong {
    color: #0f2747;
}

@media (max-width: 700px) {
    .general-expense-table-wrap {
        overflow-x: visible;
    }

    .general-expense-table,
    .general-expense-table tbody,
    .general-expense-table tr,
    .general-expense-table th,
    .general-expense-table td {
        display: block;
        width: 100%;
    }

    .general-expense-table tr:first-child {
        display: none;
    }

    .general-expense-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 4px 14px rgba(18, 60, 105, 0.06);
    }

    .general-expense-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 10px 12px;
        border-bottom: 1px solid #eef2f7;
        text-align: right;
        word-break: break-word;
    }

    .general-expense-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 800;
        color: #475569;
    }

    .general-expense-table .mobile-actions {
        background: #f8fafc;
        align-items: flex-start;
    }

    .general-expense-table .mobile-actions .table-action-row {
        justify-content: flex-end;
        flex: 1;
    }

    .general-expense-table .mobile-actions .btn,
    .general-expense-table .mobile-actions button {
        min-width: 94px;
        margin: 0;
    }

    .general-expense-table .mobile-actions form {
        margin: 0;
    }

    .general-expense-table .mobile-empty {
        display: block;
        text-align: left;
    }

    .general-expense-table .mobile-empty::before {
        display: none;
    }
}

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

    .general-expense-filter {
        display: grid;
        grid-template-columns: 1fr;
    }

    .general-expense-filter .filter-field,
    .general-expense-filter .general-expense-search {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .general-expense-filter .filter-field input,
    .general-expense-filter .filter-field select,
    .general-expense-filter .general-expense-search input {
        width: 100%;
    }

    .general-expense-filter .filter-button-wrap {
        display: grid;
        grid-template-columns: 1fr;
        margin-left: 0;
    }

    .general-expense-filter .filter-button-wrap .btn,
    .general-expense-filter .filter-button-wrap button {
        width: 100%;
    }

    .general-expense-form-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .general-expense-form-actions .btn,
    .general-expense-form-actions button {
        width: 100%;
    }
}

/* =========================
   Sales Report Mobile Layout
========================= */

.sales-report-table-wrap {
    width: 100%;
}

.sales-report-table .mobile-actions .table-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.sales-report-table .mobile-actions .btn {
    min-width: 86px;
}

@media (max-width: 700px) {
    .sales-report-table-wrap {
        overflow-x: visible;
    }

    .sales-report-table,
    .sales-report-table tbody,
    .sales-report-table tr,
    .sales-report-table th,
    .sales-report-table td {
        display: block;
        width: 100%;
    }

    .sales-report-table tr:first-child {
        display: none;
    }

    .sales-report-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 4px 14px rgba(18, 60, 105, 0.06);
    }

    .sales-report-table td,
    .sales-report-table th[data-label] {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 10px 12px;
        border-bottom: 1px solid #eef2f7;
        text-align: right;
        word-break: break-word;
    }

    .sales-report-table td::before,
    .sales-report-table th[data-label]::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 800;
        color: #475569;
    }

    .sales-report-table .mobile-actions {
        background: #f8fafc;
        align-items: flex-start;
    }

    .sales-report-table .mobile-actions .table-action-row {
        justify-content: flex-end;
        flex: 1;
    }

    .sales-report-table .mobile-actions .btn {
        min-width: 94px;
        margin: 0;
    }

    .sales-report-table .mobile-empty {
        display: block;
        text-align: left;
    }

    .sales-report-table .mobile-empty::before {
        display: none;
    }

    .sales-report-table .sales-report-total-row {
        background: #f8fafc;
        font-weight: 800;
    }
}

@media (max-width: 600px) {
    .report-filter-grid.report-filter-compact .filter-field {
        grid-template-columns: 1fr !important;
        row-gap: 6px;
        width: 100%;
    }

    .report-filter-grid.report-filter-compact input,
    .report-filter-grid.report-filter-compact select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .report-filter-grid.report-filter-compact .filter-button-wrap {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .report-filter-grid.report-filter-compact .filter-button-wrap .btn,
    .report-filter-grid.report-filter-compact .filter-button-wrap button {
        width: 100%;
    }
}

/* =========================
   Consignment Report Mobile Layout
========================= */

.consignment-report-table-wrap {
    width: 100%;
}

.consignment-report-table .mobile-actions .btn {
    min-width: 72px;
}

@media (max-width: 700px) {
    .consignment-report-table-wrap {
        overflow-x: visible;
    }

    .consignment-report-table,
    .consignment-report-table tbody,
    .consignment-report-table tr,
    .consignment-report-table th,
    .consignment-report-table td {
        display: block;
        width: 100%;
    }

    .consignment-report-table tr:first-child {
        display: none;
    }

    .consignment-report-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 4px 14px rgba(18, 60, 105, 0.06);
    }

    .consignment-report-table td,
    .consignment-report-table th[data-label] {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 10px 12px;
        border-bottom: 1px solid #eef2f7;
        text-align: right;
        word-break: break-word;
    }

    .consignment-report-table td::before,
    .consignment-report-table th[data-label]::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 800;
        color: #475569;
    }

    .consignment-report-table .mobile-actions {
        background: #f8fafc;
        align-items: flex-start;
    }

    .consignment-report-table .mobile-actions .btn {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .consignment-report-table .mobile-empty {
        display: block;
        text-align: left;
    }

    .consignment-report-table .mobile-empty::before {
        display: none;
    }

    .consignment-report-table tr:last-child {
        background: #f8fafc;
        font-weight: 800;
    }
}



/* =========================
   Vehicle View Mobile Layout
========================= */

.vehicle-view-card,
.vehicle-view-table-wrap {
    width: 100%;
}

.vehicle-view-table .table-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.vehicle-view-table .mobile-actions .btn {
    min-width: 104px;
}

.vehicle-view-main-image {
    max-width: 320px;
    width: 100%;
    border-radius: 14px;
    border: 1px solid #ddd;
}

.vehicle-detail-line {
    line-height: 1.7;
}

@media (max-width: 900px) {
    .vehicle-view-table-wrap {
        overflow-x: visible;
    }

    .vehicle-view-table,
    .vehicle-view-table tbody,
    .vehicle-view-table tr,
    .vehicle-view-table th,
    .vehicle-view-table td {
        display: block;
        width: 100%;
    }

    .vehicle-view-table tr:first-child {
        display: none;
    }

    .vehicle-view-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 4px 14px rgba(18, 60, 105, 0.06);
    }

    .vehicle-view-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 10px 12px;
        border-bottom: 1px solid #eef2f7;
        text-align: right;
        word-break: break-word;
    }

    .vehicle-view-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 800;
        color: #475569;
    }

    .vehicle-view-table td.mobile-actions {
        align-items: flex-start;
        background: #f8fafc;
    }

    .vehicle-view-table td.mobile-actions .table-action-row {
        justify-content: flex-end;
        flex: 1;
    }

    .vehicle-view-table td.mobile-actions .btn {
        min-width: 100%;
        margin: 0;
    }

    .vehicle-view-table td.mobile-empty {
        display: block;
        text-align: left;
    }

    .vehicle-view-table td.mobile-empty::before {
        display: none;
    }

    .vehicle-action-row {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .vehicle-action-row .btn {
        width: 100%;
        min-width: 0 !important;
    }

    .vehicle-detail-line {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid #eef2f7;
    }
}

/* =========================
   Vehicle List Desktop Width Fix
   Keeps desktop table, reduces overflow
========================= */

.vehicle-list-card {
    padding: 18px;
}

.vehicle-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.vehicle-list-table {
    width: 100%;
}

.vehicle-list-table th,
.vehicle-list-table td {
    padding: 9px 7px;
    font-size: 13px;
}

.vehicle-list-table .thumb {
    width: 82px;
    height: 58px;
}

.vehicle-list-table .badge {
    padding: 5px 8px;
    font-size: 11px;
}

.vehicle-list-table .actions {
    min-width: 118px;
}

.vehicle-list-table .actions .btn,
.vehicle-list-table .actions a {
    min-width: 56px;
    padding: 8px 9px;
    margin-right: 3px;
}
