/* ===== Fair Deals Motor Ltd - Admin Theme ===== */
:root {
    --brand-dark: #16325c;
    --brand: #1f5fbf;
    --brand-light: #e8f0fc;
    --green: #1e9e5a;
    --orange: #ea7a1c;
}

body {
    font-family: 'Poppins', system-ui, sans-serif;
}

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f2444 0%, #1f5fbf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-wrapper {
    width: 100%;
    max-width: 880px;
}

.login-card {
    display: flex;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    min-height: 500px;
}

.login-brand {
    flex: 1;
    background: linear-gradient(160deg, var(--brand-dark), #234b86);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.login-brand::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}

.brand-icon {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 12px;
}

.login-brand h1 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
}

.brand-divider {
    width: 60px;
    height: 4px;
    background: #fff;
    border-radius: 4px;
    margin: 18px 0;
    opacity: .8;
}

.brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brand-list li {
    font-size: 16px;
    padding: 6px 0;
    opacity: .95;
}

.brand-list i {
    margin-right: 10px;
}

.login-form {
    flex: 1;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lock-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.login-form .input-group-text {
    background: var(--brand-light);
    color: var(--brand);
    border-color: #ced4da;
}

.login-form .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(31, 95, 191, .15);
}

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

@media (max-width: 767px) {
    .login-card {
        flex-direction: column;
    }
    .login-brand {
        padding: 28px;
        text-align: center;
    }
    .brand-divider {
        margin: 14px auto;
    }
    .brand-list {
        display: none;
    }
    .login-form {
        padding: 32px 24px;
    }
}

/* ================= Admin layout ================= */
.admin-body {
    background: #f1f5fb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.admin-body main { flex: 1; }

.admin-nav {
    background: linear-gradient(90deg, var(--brand-dark), #1d4b8f);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    padding-top: .6rem;
    padding-bottom: .6rem;
}
.nav-logo {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .15);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.brand-title { font-size: 16px; letter-spacing: .5px; }
.brand-sub { font-size: 11px; opacity: .75; }
.admin-nav .nav-link {
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    padding: .45rem .8rem !important;
}
.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .15);
}
.admin-nav .nav-link i { margin-right: 4px; }
.user-pill { background: rgba(255, 255, 255, .1); }

.date-badge {
    background: #fff;
    color: var(--brand-dark);
    border: 1px solid #dbe4f3;
    font-weight: 500;
    padding: .55rem .8rem;
    font-size: 13px;
}

/* ---------- 3 module cards ---------- */
.module-card {
    display: block;
    position: relative;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    border-radius: 16px;
    padding: 26px 24px 20px;
    min-height: 210px;
    box-shadow: 0 8px 22px rgba(20, 40, 80, .15);
    transition: transform .2s ease, box-shadow .2s ease;
}
.module-card:hover {
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(20, 40, 80, .25);
}
.module-card::after {
    content: "";
    position: absolute;
    right: -40px; top: -40px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}
.module-blue   { background: linear-gradient(135deg, #1f5fbf, #2f7be0); }
.module-green  { background: linear-gradient(135deg, #16864b, #25b56a); }
.module-orange { background: linear-gradient(135deg, #e0691a, #f59a3b); }
.module-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
}
.module-card h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.module-card p { opacity: .9; font-size: 14px; margin-bottom: 18px; }
.module-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, .3);
    padding-top: 12px;
    font-size: 14px;
}
.module-go {
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 8px;
    padding: 4px 12px;
    font-weight: 600;
}
.module-card:hover .module-go { background: #fff; color: #333; }

/* ---------- Overall performance ---------- */
.performance-strip {
    background: #e3ecf8;
    border-radius: 16px;
    padding: 18px;
}
.perf-title {
    height: 100%;
    background: var(--brand-dark);
    color: #fff;
    border-radius: 12px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.perf-title i { font-size: 44px; }
.perf-title h3 { font-size: 22px; font-weight: 700; margin: 0; }
.perf-title p { margin: 0; opacity: .85; }
.stat-card {
    height: 100%;
    background: #fff;
    border: 1px solid #d3def0;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon { font-size: 30px; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--brand-dark); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--brand-dark); line-height: 1.2; }
.stat-sub { font-size: 12px; color: #6c7a90; }

@media (max-width: 991px) {
    .admin-nav .navbar-nav { padding-top: .5rem; }
    .brand-sub { display: none; }
}

/* ================= Inner pages ================= */
.page-head {
    color: #fff;
    border-radius: 16px;
    padding: 20px 26px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 22px rgba(20, 40, 80, .15);
}
.page-head-blue   { background: linear-gradient(135deg, #1f5fbf, #2f7be0); }
.page-head-green  { background: linear-gradient(135deg, #16864b, #25b56a); }
.page-head-orange { background: linear-gradient(135deg, #e0691a, #f59a3b); }
.page-head-icon { font-size: 44px; line-height: 1; }
.page-head h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: .5px; }
.page-head p { margin: 0; opacity: .9; }
.page-head-stats { display: flex; gap: 12px; }
.page-head-stats > div {
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 10px;
    padding: 6px 16px;
    text-align: center;
    font-size: 12px;
    min-width: 86px;
}
.page-head-stats span { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; }

.panel-card {
    border: 1px solid #dbe4f3;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(20, 40, 80, .05);
    overflow: hidden;
}
.panel-card > .card-header {
    background: #fff;
    border-bottom: 1px solid #e6ecf5;
    padding: 14px 20px;
}
.panel-card > .card-body { padding: 20px; }
.panel-title { font-size: 17px; font-weight: 600; color: var(--brand-dark); }
.panel-title i { color: var(--brand); margin-right: 6px; }

.panel-card .form-label { font-size: 13px; font-weight: 600; color: #3b4a60; margin-bottom: 4px; }
.panel-card .input-group-text { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.panel-card .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(31, 95, 191, .12); }
.reg-input { font-weight: 600; letter-spacing: 1px; }

.total-box {
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 6px;
    background: var(--brand-dark);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

/* UK number plate look */
.reg-plate {
    display: inline-block;
    background: #ffd400;
    color: #111;
    border: 1px solid #c9a800;
    border-radius: 4px;
    padding: 1px 8px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.search-form { min-width: 280px; }
.filter-pills .nav-link {
    font-size: 13px;
    padding: 5px 14px;
    color: #3b4a60;
    border-radius: 20px;
}
.filter-pills .nav-link.active { background: var(--brand); color: #fff; }
.filter-pills .badge { background: rgba(0, 0, 0, .1); color: inherit; font-weight: 600; }
.filter-pills .nav-link.active .badge { background: rgba(255, 255, 255, .25); }

.stock-table { font-size: 13.5px; }
.stock-table thead th {
    background: #eef3fb;
    color: var(--brand-dark);
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
    border-bottom: 2px solid #d3def0;
    padding-top: 10px;
    padding-bottom: 10px;
}
.stock-table td { white-space: nowrap; }
.status-badge { font-weight: 500; padding: 5px 10px; }
.stock-table .btn-sm { padding: 2px 8px; }
.totals-row td {
    background: var(--brand-dark) !important;
    color: #fff !important;
    font-weight: 700;
    border: 0;
    white-space: nowrap;
}
.totals-row .text-success { color: #6ef0a6 !important; }
.totals-row .text-danger  { color: #ff9b9b !important; }

.sell-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f3f6fb;
    border-radius: 10px;
    padding: 12px 16px;
}
.sell-summary small { display: block; color: #6c7a90; font-size: 12px; margin-bottom: 2px; }
.sell-summary strong { font-size: 18px; color: var(--brand-dark); }
.pl-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    padding: 12px 16px;
    background: #f3f6fb;
    font-weight: 600;
}
.pl-preview strong { font-size: 22px; }
.pl-preview.is-profit { background: #e3f7ec; color: #137a44; }
.pl-preview.is-loss   { background: #fde8e8; color: #c62828; }

@media (max-width: 575px) {
    .search-form { min-width: 0; width: 100%; }
    .page-head { padding: 16px 18px; }
}
.reg-input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ================= Sales page ================= */
.panel-green .panel-title i { color: var(--green); }
.sales-table thead th { background: #e8f6ee; border-bottom-color: #c8e8d5; color: #145c36; }
.sales-table tbody tr.row-active > td { background: #e3f7ec; }
.totals-green td { background: #145c36 !important; }
.btn-eye {
    width: 34px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #b7dcc6;
    color: var(--green);
    background: #fff;
    border-radius: 8px;
}
.btn-eye:hover, .btn-eye.active { background: var(--green); border-color: var(--green); color: #fff; }

.sale-details { border-color: #b7dcc6; scroll-margin-top: 90px; }
.detail-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    background: #f3faf6;
    border: 1px solid #d5eddf;
    border-radius: 12px;
    padding: 16px 20px;
}
.detail-car-icon {
    width: 72px; height: 72px;
    border-radius: 14px;
    background: linear-gradient(135deg, #16864b, #25b56a);
    color: #fff;
    font-size: 38px;
    display: flex; align-items: center; justify-content: center;
}
.reg-plate-lg { font-size: 20px; padding: 3px 14px; }
.detail-pl {
    text-align: right;
    border-radius: 12px;
    padding: 10px 18px;
    min-width: 160px;
}
.detail-pl small { display: block; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.detail-pl strong { display: block; font-size: 28px; line-height: 1.1; }
.detail-pl span { font-size: 12px; opacity: .8; }
.detail-pl.is-profit, .detail-total.is-profit { background: #e3f7ec; color: #137a44; }
.detail-pl.is-loss,   .detail-total.is-loss   { background: #fde8e8; color: #c62828; }

.detail-box {
    border: 1px solid #e3e9f2;
    border-radius: 12px;
    padding: 16px 18px;
    background: #fff;
}
.detail-box h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}
.detail-box h3 i { color: var(--green); margin-right: 6px; }
.detail-list {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 8px;
    margin: 0;
    font-size: 14px;
}
.detail-list dt { font-weight: 400; color: #6c7a90; }
.detail-list dd { margin: 0; text-align: right; color: #1d2a3d; }
.detail-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 14px;
    font-weight: 600;
}
.detail-total strong { font-size: 22px; }
.cost-bar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #eef2f7;
}
.cost-seg { height: 100%; }
.cost-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cost-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

.timeline { list-style: none; padding: 0 0 0 4px; margin: 0 0 14px; position: relative; }
.timeline::before {
    content: "";
    position: absolute;
    left: 9px; top: 8px; bottom: 8px;
    width: 2px;
    background: #dfe6f0;
}
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t-dot {
    position: absolute;
    left: 0; top: 3px;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dfe6f0;
}
.timeline strong { display: block; font-size: 14px; color: #1d2a3d; }
.timeline small { color: #6c7a90; }
.detail-days {
    background: #f3f6fb;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    color: #3b4a60;
}
.detail-days strong { font-size: 22px; color: var(--brand-dark); margin-right: 4px; }

@media (max-width: 575px) {
    .detail-pl { text-align: left; width: 100%; }
    .page-head-stats { flex-wrap: wrap; }
}

/* Print: sirf detail card */
@media print {
    .admin-nav, footer, .no-print, .alert { display: none !important; }
    .page-sales .page-head, .page-sales .panel-card:not(.sale-details) { display: none !important; }
    .admin-body { background: #fff; }
    .sale-details { border: 0; box-shadow: none; }
    .reg-plate, .detail-pl, .detail-total, .detail-car-icon, .cost-seg, .dot, .t-dot, .badge {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
}

/* ================= Expense pages (orange) ================= */
.btn-head {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .7);
    color: #fff;
    font-weight: 600;
}
.btn-head:hover { background: #fff; color: #c65a12; }
.btn-orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-orange:hover, .btn-orange:focus { background: #c65a12; border-color: #c65a12; color: #fff; }
.btn-outline-orange { border: 1px solid var(--orange); color: #c65a12; }
.btn-outline-orange:hover { background: var(--orange); color: #fff; }
.link-orange { color: #c65a12; text-decoration: none; }
.link-orange:hover { text-decoration: underline; }

.panel-orange { border-color: #f6d9c2; }
.panel-orange .panel-title i { color: var(--orange); }
.panel-orange .input-group-text { background: #fff1e6; color: #c65a12; }
.panel-orange .form-control:focus,
.panel-orange .form-select:focus { border-color: var(--orange); box-shadow: 0 0 0 .2rem rgba(234, 122, 28, .15); }

.month-label { font-weight: 600; color: var(--brand-dark); font-size: 16px; }
.month-label i { color: var(--orange); margin-right: 4px; }
.month-select { width: auto; min-width: 200px; }
.month-total { color: #6c7a90; }
.month-total strong { color: #c65a12; font-size: 18px; }

.summary-table { font-size: 14px; }
.summary-table thead th {
    background: #fff1e6; color: #8a3f0b; font-weight: 600; font-size: 13px;
    border-bottom: 2px solid #f6d9c2; padding: 10px 16px;
}
.summary-table td { padding: 8px 16px; }
.summary-table tr.is-zero td { color: #9aa5b5; }
.summary-total td {
    background: #fff1e6 !important;
    color: #c65a12 !important;
    font-weight: 700;
    font-size: 15px;
    border-top: 2px solid #f6d9c2;
    padding: 12px 16px !important;
}

.exp-table thead th { background: #fff4ec; color: #8a3f0b; border-bottom-color: #f6d9c2; }
.notes-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.totals-orange td { background: #b85510 !important; }
.row-hidden td { opacity: .6; }

.months-table thead th { background: #fff4ec; color: #8a3f0b; font-size: 13px; font-weight: 600; border-bottom: 2px solid #f6d9c2; }
.months-table td, .months-table th { padding-left: 16px; padding-right: 16px; }
.months-table tr.row-current td { background: #fff8f2; }

/* ================= Logout page ================= */
.logout-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 18px;
    padding: 40px 36px 28px;
}
.logout-icon {
    width: 76px; height: 76px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
    background: #fde8e8;
    color: #d32f2f;
}
.logout-icon.is-done { background: #e3f7ec; color: #16864b; }
.logout-info {
    background: #f3f6fb;
    border-radius: 12px;
    padding: 6px 16px;
    text-align: left;
    font-size: 14px;
}
.logout-info > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e3e9f2;
}
.logout-info > div:last-child { border-bottom: 0; }
.logout-info i { color: var(--brand); }
.logout-info span { color: #6c7a90; }
.logout-info strong { margin-left: auto; color: var(--brand-dark); }
.logout-brand {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-dark);
}

/* ================= Change password ================= */
.pw-rules { list-style: none; padding: 0; color: #6c7a90; columns: 2; }
.pw-rules li { padding: 2px 0; }
.pw-rules li.ok { color: #16864b; }
@media (max-width: 575px) { .pw-rules { columns: 1; } }

/* ================= History ================= */
.page-head-dark { background: linear-gradient(135deg, #16325c, #2b4f86); }
.page-head-stats > div.stat-warn { background: rgba(255, 90, 90, .35); border-color: rgba(255, 180, 180, .8); }
.history-table td { white-space: normal; }
.history-desc { min-width: 260px; }
.row-alert > td { background: #fff5f5; }
.mod-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 600;
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}
.mod-stock   { background: #e3edfb; color: #1f5fbf; }
.mod-sales   { background: #e3f7ec; color: #137a44; }
.mod-expense { background: #fff1e6; color: #c65a12; }
.mod-item    { background: #fdf0e0; color: #9c5a0f; }
.mod-auth    { background: #eef0f4; color: #4a5568; }
.mod-account { background: #e6f4f8; color: #117a8b; }

/* ================= Monthly reports ================= */
.month-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.month-chips span {
    background: #f3faf6; border: 1px solid #d5eddf;
    border-radius: 20px; padding: 3px 12px; font-size: 13px; color: #3b4a60;
}
.sales-table tr.is-empty td, .sheet-table tr.is-empty td { color: #9aa5b5; }
.sales-table tr.row-now > td:first-child { box-shadow: inset 4px 0 0 var(--green); }

.sheet-wrap { max-height: none; }
.sheet-table { font-size: 13px; margin: 0; }
.sheet-table th, .sheet-table td { white-space: nowrap; padding: 7px 10px; border-color: #f1e2d5; }
.sheet-table thead th { background: #fff1e6; color: #8a3f0b; font-weight: 600; }
.sheet-table thead th a { color: inherit; text-decoration: none; }
.sheet-table thead th a:hover { text-decoration: underline; }
.sheet-table .sheet-name {
    position: sticky; left: 0; z-index: 1;
    background: #fff; font-weight: 600; min-width: 200px;
    box-shadow: 1px 0 0 #f1e2d5;
}
.sheet-table thead .sheet-name { background: #fff1e6; }
.sheet-table .sheet-total { background: #fff8f2; font-weight: 700; color: #8a3f0b; }
.sheet-table .col-now { background: #fffaf3; }
.sheet-table thead .col-now { background: #ffe2c9; }
.sheet-table .dash { color: #d0d6de; }
.sheet-foot td {
    background: #b85510 !important; color: #fff !important;
    font-weight: 700; border-color: #b85510 !important;
}
.sheet-foot .sheet-name { background: #b85510 !important; }

@media print {
    .no-print, .btn-head { display: none !important; }
    .page-head { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .totals-row td, .sheet-foot td, .summary-total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sheet-table { font-size: 10px; }
    .sheet-table .sheet-name { position: static; min-width: 0; }
}
.stat-link { text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.stat-link:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 40, 80, .12); }

/* Dashboard: Real Profit card */
.stat-real.is-profit { background: #e9f8ef; border-color: #b7dcc6; }
.stat-real.is-profit .stat-icon, .stat-real.is-profit .stat-value { color: #137a44; }
.stat-real.is-loss { background: #fdeeee; border-color: #f3c2c2; }
.stat-real.is-loss .stat-icon, .stat-real.is-loss .stat-value { color: #c62828; }
.stat-real .stat-sub strong { color: #3b4a60; }
.perf-title-bar { padding: 12px 20px; }
.perf-title-bar i { font-size: 30px; }
.perf-title-bar h3 { font-size: 19px; }
.perf-title-bar p { font-size: 13px; }

/* ================= Sale details: 1-page A4 print ================= */
.print-only { display: none; }
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    html, body { font-size: 12px; }
    .page-sales main { padding: 0 !important; max-width: 100% !important; }
    .page-sales .sale-details { margin: 0 !important; border: 0 !important; }
    .page-sales .sale-details > .card-header { display: none !important; }
    .page-sales .sale-details > .card-body { padding: 0 !important; }

    .print-only { display: block; }
    .print-head {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-end;
        border-bottom: 2px solid #16864b;
        padding-bottom: 6px;
        margin-bottom: 12px;
    }
    .print-head strong { display: block; font-size: 16px; color: #16325c; }
    .print-head span { display: block; font-size: 11px; color: #6c7a90; }

    /* Hero ek line mein */
    .detail-hero { flex-wrap: nowrap !important; padding: 10px 14px !important; margin-bottom: 12px !important; gap: 12px !important; }
    .detail-car-icon { width: 48px; height: 48px; font-size: 26px; border-radius: 10px; }
    .reg-plate-lg { font-size: 16px; }
    .detail-pl { min-width: 0; padding: 6px 12px; text-align: right !important; width: auto !important; }
    .detail-pl strong { font-size: 22px; }

    /* Teeno boxes ek row mein */
    .sale-details .row { display: flex !important; flex-wrap: nowrap !important; margin: 0 -5px !important; }
    .sale-details .row > .col-md-4 { flex: 0 0 33.333% !important; max-width: 33.333% !important; padding: 0 5px !important; }
    .detail-box { padding: 10px 12px !important; break-inside: avoid; }
    .detail-box h3 { font-size: 13px; margin-bottom: 8px; padding-bottom: 6px; }
    .detail-list { font-size: 11.5px; row-gap: 5px; }
    .detail-total { padding: 6px 10px; margin-top: 10px; }
    .detail-total strong { font-size: 16px; }
    .cost-legend { font-size: 10px; }
    .timeline li { padding-bottom: 10px; }
    .timeline strong { font-size: 12px; }
    .detail-days { padding: 6px 10px; }
    .detail-days strong { font-size: 16px; }
    .sale-details, .detail-hero, .detail-box { break-inside: avoid; page-break-inside: avoid; }
    .print-head, .detail-days, .detail-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ================= Monthly reports: compact print ================= */
@page wide { size: A4 landscape; margin: 10mm; }
@media print {
    html:has(body.page-expense-monthly), body.page-expense-monthly { page: wide; }
    .page-sales-monthly main, .page-expense-monthly main { padding: 0 !important; max-width: 100% !important; }
    .page-sales-monthly .page-head, .page-expense-monthly .page-head { padding: 8px 14px; margin-bottom: 10px !important; border-radius: 8px; }
    .page-sales-monthly .page-head-icon, .page-expense-monthly .page-head-icon { font-size: 26px; }
    .page-sales-monthly .page-head h1, .page-expense-monthly .page-head h1 { font-size: 17px; }
    .page-sales-monthly .page-head p, .page-expense-monthly .page-head p { font-size: 11px; }

    /* Summary cards ek hi line mein */
    .page-sales-monthly .row.g-3, .page-expense-monthly .row.g-3 { flex-wrap: nowrap !important; margin-bottom: 10px !important; --bs-gutter-x: 8px; --bs-gutter-y: 0; }
    .page-sales-monthly .row.g-3 > *, .page-expense-monthly .row.g-3 > * { flex: 1 1 0 !important; max-width: none !important; width: auto !important; }
    .page-sales-monthly .stat-card, .page-expense-monthly .stat-card { padding: 6px 8px; gap: 6px; border-radius: 8px; }
    .page-sales-monthly .stat-icon, .page-expense-monthly .stat-icon { font-size: 18px; }
    .page-sales-monthly .stat-label, .page-expense-monthly .stat-label { font-size: 10px; }
    .page-sales-monthly .stat-value, .page-expense-monthly .stat-value { font-size: 15px; }
    .page-sales-monthly .stat-sub, .page-expense-monthly .stat-sub { font-size: 9px; }

    .page-sales-monthly .panel-card, .page-expense-monthly .panel-card { margin-bottom: 10px !important; border-radius: 8px; }
    .page-sales-monthly .panel-card > .card-header, .page-expense-monthly .panel-card > .card-header { padding: 6px 12px; }
    .page-sales-monthly .panel-title, .page-expense-monthly .panel-title { font-size: 13px; }
    .page-sales-monthly .card-footer { padding: 4px 12px; font-size: 9px; }
    .page-sales-monthly .stock-table { font-size: 10.5px; }
    .page-sales-monthly .stock-table th, .page-sales-monthly .stock-table td { padding-top: 3px !important; padding-bottom: 3px !important; }
    .page-sales-monthly .reg-plate { font-size: 10px; padding: 0 5px; }
    .month-chips span { font-size: 10px; padding: 1px 8px; }

    /* Tables kabhi na katein */
    .table-responsive { overflow: visible !important; }
    .page-expense-monthly .sheet-table { font-size: 9.5px; width: 100%; }
    .page-expense-monthly .sheet-table th, .page-expense-monthly .sheet-table td { padding: 3px 5px; }
    .page-expense-monthly .sheet-table .sheet-name { min-width: 0; white-space: normal; }
    .panel-card, .stat-card, .sheet-foot td, .totals-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print {
    .admin-body { min-height: 0 !important; display: block !important; }
    .page-expense-monthly .sheet-table th, .page-expense-monthly .sheet-table td { padding: 2px 5px; line-height: 1.25; }
    .page-expense-monthly .row.g-3 { margin-bottom: 6px !important; }
    .page-expense-monthly .stat-card { padding: 4px 8px; }
    .page-expense-monthly .stat-value { font-size: 13px; }
    .page-expense-monthly .panel-card > .card-header small { display: none; }
    .sheet-table { break-inside: auto; }
    .sheet-table tr { break-inside: avoid; }
}
@media print {
    /* Chrome tfoot ko alag page par na bheje */
    tfoot { display: table-row-group !important; }
}

@media print {
    /* Print mein sirf app ka content - browser extensions ke bars/popups nahi */
    body.admin-body > *:not(main) { display: none !important; }
    html, body { height: auto !important; overflow: visible !important; }
}
