:root {
    --brand-primary: #0f5132;
    --brand-primary-dark: #0a3622;
    --brand-accent: #d4a017;
    --brand-bg: #f4f6f8;
}

body {
    background-color: var(--brand-bg);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: .3px;
}

.app-navbar {
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
}

.app-navbar .nav-link {
    color: rgba(255,255,255,.85) !important;
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:hover {
    color: #fff !important;
}

.card {
    border: none;
    border-radius: .6rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eef0f2;
    font-weight: 600;
}

.stat-card {
    border-left: 4px solid var(--brand-primary);
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ---------- Billing screen ---------- */
#itemsTable input, #itemsTable select {
    min-width: 70px;
}

#itemsTable td {
    vertical-align: middle;
}

.summary-box {
    background: #fff;
    border-radius: .6rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 1rem;
}

.summary-box .row > div {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.summary-total {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.balance-due {
    color: #b02a37;
    font-weight: 700;
}

.balance-paid {
    color: #0f5132;
    font-weight: 700;
}

.shortcut-hint {
    font-size: .75rem;
    color: #8a8f98;
}

/* ---------- Compact UI (billing screen: fit without scrolling) ---------- */
body.compact-ui {
    font-size: .85rem;
}

body.compact-ui h4 {
    font-size: 1.05rem;
}

body.compact-ui .row {
    --bs-gutter-y: .25rem;
}

body.compact-ui .card {
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 0 !important;
}

body.compact-ui .card-header {
    padding: .25rem .65rem;
    font-size: .8rem;
}

body.compact-ui .card-body {
    padding: .4rem .6rem;
}

body.compact-ui .form-label {
    margin-bottom: 0;
    font-size: .72rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.2;
}

body.compact-ui .form-control,
body.compact-ui .form-select {
    padding: .2rem .5rem;
    font-size: .8rem;
    line-height: 1.2;
    min-height: calc(1.2em + .4rem + 2px);
}

body.compact-ui textarea.form-control {
    min-height: auto;
    padding-top: .2rem;
    padding-bottom: .2rem;
}

body.compact-ui #remarks {
    min-height: 32px;
}

body.compact-ui .mb-2 {
    margin-bottom: .25rem !important;
}

body.compact-ui .btn {
    padding: .3rem .6rem;
    font-size: .82rem;
}

body.compact-ui .btn-sm {
    padding: .2rem .45rem;
    font-size: .75rem;
}

body.compact-ui #itemsTable th,
body.compact-ui #itemsTable td,
body.compact-ui #paymentsTable th,
body.compact-ui #paymentsTable td {
    padding: .25rem .35rem;
}

body.compact-ui .summary-box {
    padding: .5rem .75rem !important;
}

body.compact-ui .summary-box .row > div {
    padding-top: .05rem;
    padding-bottom: .05rem;
}

body.compact-ui .summary-box hr {
    margin: .35rem 0;
}

body.compact-ui .summary-total {
    font-size: 1.1rem;
}

body.compact-ui #lastBillBar {
    padding: .25rem .75rem !important;
    font-size: .8rem;
}

body.compact-ui .mb-3 {
    margin-bottom: .5rem !important;
}

/* ---------- Print ---------- */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; }
    .print-only { display: block !important; }
}

.print-only { display: none; }

#invoicePrint {
    background: #fff;
    max-width: 210mm;
    margin: 0 auto;
    padding: 12mm;
    font-size: 13px;
    color: #1b1b1b;
}

#invoicePrint table {
    width: 100%;
    border-collapse: collapse;
}

#invoicePrint th, #invoicePrint td {
    padding: 6px 8px;
}

#invoicePrint .items-table th, #invoicePrint .items-table td {
    border: 1px solid #ccc;
}

#invoicePrint .items-table th {
    background: #f1f3f5;
}

#invoicePrint .totals-table td {
    border: none;
}

.badge-status-Paid { background-color: #198754; }
.badge-status-Partial { background-color: #d4a017; }
.badge-status-Unpaid { background-color: #b02a37; }
.badge-status-Cancelled { background-color: #6c757d; }
