html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
  --ink: #0b2146;
  --muted: #64748b;
  --primary: #2f66e8;
  --primary-dark: #1f4fc1;
  --line: #dbe2ea;
  --surface: #ffffff;
  --canvas: #f4f7fb;
}

.bill-entry-table { min-width: 1150px; }
.bill-entry-table td { position: relative; }
.bill-entry-table th:first-child { width: 25%; }
.bill-entry-table .form-control { min-width: 95px; }
.bill-entry-table .product-select { min-width: 210px; }
.domain-name { overflow-wrap: anywhere; }
.bill-entry-table .renewal-select { min-width: 85px; }
.bill-entry-table small { display: block; margin-top: .35rem; }
.bill-totals { border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.3rem; background: #f8fafc; }
.bill-totals > div { display: flex; justify-content: space-between; gap: 1.5rem; padding: .45rem 0; }
.bill-totals > [hidden] { display: none; }
.bill-totals .grand-total { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: 1rem; font-size: 1.3rem; }
.preserve-lines { white-space: pre-line; }
.payment-details { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; font-size: .9rem; }
.payment-details dd { margin: 0; overflow-wrap: anywhere; }
.invoice-qr { width: 130px; height: 130px; object-fit: contain; }
.pending-qr { width: 72px; height: 72px; }
@media print {
  body.app-body { background: white; font-size: 10pt; }
  header, .no-print, .alert { display: none !important; }
  .invoice.content-card { border: 0; box-shadow: none; padding: 0; }
  .invoice .table-responsive { overflow: visible; }
  .invoice .invoice-table { min-width: 0; width: 100%; font-size: 9pt; }
  .invoice .invoice-table > :not(caption) > * > * { padding: .5rem .3rem; }
  .invoice-table tr { break-inside: avoid; }
  .invoice-table thead { display: table-header-group; }
  .bill-totals, .payment-details { break-inside: avoid; }
}

html { font-size: 15px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", Arial, sans-serif; }
.app-navbar { background: #0c2043; box-shadow: 0 2px 12px rgba(10, 31, 68, .15); min-height: 66px; }
.navbar-brand { display: flex; align-items: center; gap: .55rem; margin-right: 2rem; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--primary); border-radius: 9px; font-weight: 800; }
.app-navbar .nav-link { color: rgba(255,255,255,.72); font-weight: 600; padding: .75rem .8rem !important; }
.app-navbar .nav-link:hover { color: white; }

/* Fixed desktop menu; Bootstrap offcanvas supplies mobile focus, backdrop and Escape handling. */
.app-sidebar { --bs-offcanvas-width: min(290px, 88vw); background: #0c2043 !important; color: #fff; display: flex; flex-direction: column; height: 100vh !important; height: 100dvh !important; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: 1.25rem 1.1rem; flex-shrink: 0; border-bottom: 1px solid #ffffff1a; }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; color: #fff; font-size: 1.1rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.sidebar-brand:hover { color: #fff; }
.brand-mark { flex-shrink: 0; }
.app-sidebar .offcanvas-body { display: flex; flex: 1 1 auto; flex-direction: column; overflow-y: auto; min-height: 0; padding: .85rem; scrollbar-width: thin; scrollbar-color: #64748b #0c2043; }
.sidebar-group + .sidebar-group { margin-top: 1rem; }
.sidebar-group-title { margin: 0 0 .3rem; padding: 0 .75rem; color: #99abc7; font-size: .7rem; letter-spacing: .1em; font-weight: 700; text-transform: uppercase; }
.sidebar-nav .nav-link { color: #d2dded; font-size: .93rem; font-weight: 600; padding: .6rem .75rem; border-radius: 7px; margin: .1rem 0; }
.sidebar-nav .nav-link:hover { background: #ffffff12; color: #fff; }
.sidebar-nav .nav-link.active { background: var(--primary); color: #fff; box-shadow: inset 3px 0 0 #9ab9ff; }
.admin-panel-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; margin-bottom: 1rem; padding: .22rem; border: 1px solid #ffffff26; border-radius: 9px; background: #061a36; }
.admin-panel-switch a { padding: .5rem .25rem; border-radius: 6px; color: #d2dded; font-size: .78rem; font-weight: 650; text-align: center; text-decoration: none; }
.admin-panel-switch a.active { color: #fff; background: var(--primary); }
.admin-panel-switch a:hover { color: #fff; background: #294b80; }
.app-sidebar a:focus-visible, .app-sidebar button:focus-visible { outline: 2px solid #b5d1ff; outline-offset: 2px; }
.sidebar-account { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem; border-top: 1px solid #ffffff1a; flex-shrink: 0; }
.sidebar-user { min-width: 0; }
.sidebar-user small { display: block; color: #99abc7; font-size: .72rem; }
.sidebar-user strong { display: block; overflow-wrap: anywhere; font-size: .9rem; }
.sidebar-account form { flex-shrink: 0; }
.mobile-header { background: #0c2043; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem 1rem; }
.mobile-header .btn { white-space: nowrap; }
.app-content { min-width: 0; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 1100; padding: .75rem 1rem; background: #fff; color: var(--ink); }
.skip-link:focus { top: .5rem; }
@media (min-width: 992px) {
  .app-sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 1030; border-right: 1px solid #142d52 !important; }
  .app-content { width: calc(100% - 260px); margin-left: 260px; }
}
@media print {
  .app-sidebar, .mobile-header, .offcanvas-backdrop, .skip-link { display: none !important; }
  .app-content { width: 100% !important; margin-left: 0 !important; }
  body.app-body { overflow: visible !important; padding-right: 0 !important; }
  .voucher-report .table-responsive { overflow: visible; }
  .voucher-report .table { min-width: 0; width: 100%; font-size: 9pt; table-layout: fixed; }
  .voucher-report th, .voucher-report td { padding: .5rem .3rem; overflow-wrap: anywhere; }
  .voucher-report tr { break-inside: avoid; }
  .voucher-report thead { display: table-header-group; }
  .voucher-report tfoot { display: table-row-group; }
}

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.page-heading h1 { font-size: clamp(2rem, 3vw, 2.65rem); font-weight: 750; letter-spacing: -.04em; margin: 0 0 .35rem; }
.page-heading p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.content-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 18px rgba(15, 35, 70, .04); }
.form-card { padding: clamp(1.4rem, 3vw, 2.2rem); }
.form-card h2 { font-size: 1.7rem; font-weight: 700; }
.form-label { font-weight: 650; color: #183054; }
.required::after { content: " *"; color: #dc3545; }
.form-control, .form-select { min-height: 50px; border-color: #cbd5e1; border-radius: 7px; padding: .7rem .9rem; }
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: #5b86ec; box-shadow: 0 0 0 .22rem rgba(47,102,232,.13); }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; border-top: 1px solid #edf1f5; margin-top: 2rem; padding-top: 1.5rem; }
.btn { font-weight: 650; border-radius: 7px; padding: .62rem 1rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.table { margin: 0; min-width: 780px; }
.table > :not(caption) > * > * { padding: 1rem 1.15rem; border-color: #edf1f5; }
.table thead th { color: #516177; background: #f8fafc; font-size: .78rem; letter-spacing: .045em; text-transform: uppercase; border-bottom-width: 1px; }
.table tbody tr:last-child td { border-bottom: 0; }
.customer-request-table { min-width: 0; width: 100%; table-layout: fixed; }
.customer-request-table th, .customer-request-table td { padding: .85rem .6rem; overflow-wrap: anywhere; }
.customer-request-table th:nth-child(1) { width: 17%; }
.customer-request-table th:nth-child(2) { width: 31%; }
.customer-request-table th:nth-child(3), .customer-request-table th:nth-child(4) { width: 16%; }
.customer-request-table th:nth-child(5) { width: 20%; }
@media (max-width: 700px) { .customer-request-table { min-width: 680px; } }
.items-table .item-row-overdue > td { --bs-table-bg: #fff1f2; background-color: #fff1f2; }
.items-table .item-row-inactive > td { --bs-table-bg: #fee2e2; background-color: #fee2e2; }
.items-table .item-row-due-soon > td { --bs-table-bg: #fef3c7; background-color: #fef3c7; }
.items-table .item-row-due-month > td { --bs-table-bg: #dcfce7; background-color: #dcfce7; }
.badge-soft { display: inline-block; padding: .3rem .65rem; color: #2454bf; background: #edf3ff; border-radius: 999px; font-weight: 700; font-size: .82rem; }
.empty-state { text-align: center; color: var(--muted) !important; padding: 3.5rem !important; }
.voucher-report .table { table-layout: fixed; }
.voucher-report th, .voucher-report td { overflow-wrap: anywhere; }
.voucher-report th:nth-child(1) { width: 10%; }
.voucher-report th:nth-child(2) { width: 12%; }
.voucher-report th:nth-child(3) { width: 17%; }
.voucher-report th:nth-child(4) { width: 15%; }
.voucher-report th:nth-child(5) { width: 15%; }
.voucher-report th:nth-child(6), .voucher-report th:nth-child(7) { width: 10%; }
.voucher-report th:nth-child(8) { width: 11%; }

.stat-card { display: flex; min-height: 185px; flex-direction: column; padding: 1.5rem; color: var(--ink); text-decoration: none; background: white; border: 1px solid var(--line); border-radius: 12px; transition: .2s ease; }
.stat-card:hover { color: var(--primary); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(31, 79, 193, .1); }
.stat-card span { color: var(--muted); font-weight: 650; }
.stat-card strong { margin: .4rem 0 auto; font-size: 3.2rem; line-height: 1; }
.stat-card small { color: var(--primary); font-weight: 700; }
.quick-start { padding: 1.75rem; }
.quick-start h2 { font-size: 1.35rem; font-weight: 700; }
.quick-start p { color: var(--muted); }
.flow-row { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; }
.flow-row span { padding: .55rem 1rem; background: #edf3ff; color: #2454bf; border-radius: 7px; font-weight: 700; }
.flow-row b { color: #8da0b8; }

.check-cell { display: flex; align-items: end; padding-bottom: .85rem; }
.form-check-input { width: 1.45rem; height: 1.45rem; margin-right: .55rem; }
.form-check-label { font-weight: 700; padding-top: .18rem; }
.bill-tabs { display: flex; gap: .75rem; margin-bottom: 1.7rem; }
.bill-tabs a { padding: .8rem 1.35rem; color: var(--ink); text-decoration: none; border: 1px solid #cbd5e1; border-radius: 7px; font-weight: 700; background: white; }
.bill-tabs a.active { color: white; background: var(--primary); border-color: var(--primary); }
.qr-preview { display: flex; align-items: center; gap: 1.25rem; padding: 1rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.qr-preview img { width: 110px; height: 110px; object-fit: contain; background: white; border: 1px solid var(--line); }

.login-body { min-height: 100vh; background: radial-gradient(circle at 15% 10%, #dce8ff 0, transparent 32%), linear-gradient(135deg, #f7f9fc, #e8eef8); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-shell main { width: 100%; max-width: 460px; }
.login-card { padding: 2.3rem; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 22px 60px rgba(13, 41, 86, .12); }
.login-card h1 { margin-top: 2rem; font-size: 2.1rem; font-weight: 750; letter-spacing: -.035em; }
.login-brand { display: flex; align-items: center; gap: .75rem; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 1.15rem; }
.login-brand small { color: var(--muted); }
.validation-summary ul { padding-left: 1.1rem; }

@media (max-width: 767px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .btn { width: 100%; }
  .form-card { padding: 1.1rem; }
  .form-actions .btn { flex: 1; }
  .login-card { padding: 1.5rem; }
}

/* Compact customer-only shell and dashboard. Admin screens keep their existing scale. */
.customer-body .app-content { padding: 1.1rem !important; }
.customer-body .sidebar-nav .nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; font-size: .88rem; }
.customer-body .sidebar-group-title { margin-bottom: .45rem; }
.customer-nav-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.customer-body .sidebar-account { flex-direction: column; align-items: stretch; gap: .7rem; }
.customer-body .sidebar-account form, .customer-body .sidebar-account button { width: 100%; }
.customer-body .sidebar-user strong { font-size: .84rem; line-height: 1.35; }
.customer-dashboard { font-size: .9rem; }
.customer-dashboard .page-heading { margin-bottom: .9rem; }
.customer-dashboard .page-heading h1 { font-size: clamp(1.65rem, 2.2vw, 2.15rem); margin-bottom: .12rem; }
.customer-dashboard .page-heading p { font-size: .86rem; overflow-wrap: anywhere; }
.customer-dashboard .page-heading .btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .48rem .75rem; font-size: .83rem; }
.customer-dashboard .page-heading .btn svg { width: 17px; height: 17px; }
.customer-dashboard .content-card { border-radius: 11px; }
.customer-total-card { display: flex; align-items: center; gap: .8rem; width: min(100%, 320px); padding: .85rem 1rem; margin-bottom: 1rem; }
.customer-total-card h2 { margin: 0 0 .22rem; font-size: .78rem; font-weight: 650; }
.customer-total-card p { font-size: 1.55rem; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; }
.customer-summary-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; color: #1764e8; background: #eaf2ff; }
.customer-summary-icon svg { width: 23px; height: 23px; }
.customer-dashboard-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.customer-dashboard-panel { min-width: 0; padding: .9rem; }
.customer-dashboard-panel > h2, .customer-panel-heading h2 { font-size: 1.08rem; font-weight: 720; margin: 0; }
.customer-panel-heading { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.customer-panel-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px; color: #1764e8; background: #eaf2ff; }
.customer-panel-icon svg { width: 20px; height: 20px; }
.customer-request-card { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.customer-request-card + .customer-request-card { margin-top: .75rem; }
.customer-request-card-heading { padding: .65rem .75rem; border-bottom: 1px solid var(--line); font-size: .86rem; }
.customer-request-card-heading a { text-underline-offset: 2px; }
.customer-request-table-wrap { min-width: 0; }
.customer-dashboard .customer-request-table { min-width: 0; width: 100%; table-layout: fixed; font-size: .82rem; }
.customer-dashboard .customer-request-table th, .customer-dashboard .customer-request-table td { padding: .55rem .45rem; overflow-wrap: anywhere; }
.customer-dashboard .customer-request-table th { font-size: .67rem; letter-spacing: .02em; }
.customer-dashboard .customer-request-table th:nth-child(1) { width: 18%; }
.customer-dashboard .customer-request-table th:nth-child(2) { width: 30%; }
.customer-dashboard .customer-request-table th:nth-child(3), .customer-dashboard .customer-request-table th:nth-child(4) { width: 16%; }
.customer-dashboard .customer-request-table th:nth-child(5) { width: 20%; }
.customer-dashboard .customer-request-table tfoot { background: #f8fafc; }
.customer-dashboard .customer-request-table tfoot td { font-weight: 700; }
.customer-request-balance { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .35rem 1.1rem; padding: .65rem .75rem; border-top: 1px solid var(--line); font-size: .8rem; }
.customer-qr-panel { display: flex; flex-direction: column; }
.customer-qr-help { color: var(--muted); font-size: .79rem; margin: 0 0 .6rem; }
.customer-qr-entry { margin-bottom: .75rem; }
.customer-qr-entry:last-child { margin-bottom: 0; }
.customer-qr-image { display: grid; place-items: center; padding: .8rem; border: 1px solid #e8eef5; border-radius: 9px; background: #f8fafc; }
.customer-dashboard .customer-qr-image .invoice-qr { display: block; width: min(100%, 188px); height: auto; aspect-ratio: 1; object-fit: contain; background: white; }
.customer-qr-download { display: block; width: 100%; margin-top: .65rem; padding: .5rem .65rem; font-size: .82rem; text-align: center; }
.customer-upcoming-panel, .customer-bills-panel { margin-bottom: 1rem; }
.customer-upcoming-panel > h2, .customer-bills-panel > h2 { margin-bottom: .35rem; }
.customer-upcoming-panel > p { font-size: .78rem; margin-bottom: .6rem; }
.customer-upcoming-table { min-width: 700px; font-size: .82rem; }
.customer-upcoming-table th, .customer-upcoming-table td, .customer-bills-table th, .customer-bills-table td { padding: .55rem .45rem !important; }
.customer-bills-table { min-width: 0; width: 100%; font-size: .84rem; }

/* Customer ledger: dense desktop report and readable transaction cards on phones. */
.customer-ledger-page { font-size: .86rem; }
.customer-ledger-page .page-heading { margin-bottom: .8rem; }
.customer-ledger-page .page-heading h1 { margin-bottom: .1rem; font-size: clamp(1.65rem, 2.2vw, 2.15rem); }
.customer-ledger-page .page-heading p { font-size: .82rem; overflow-wrap: anywhere; }
.customer-ledger-back { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .48rem .7rem; font-size: .79rem; white-space: nowrap; }
.customer-ledger-back svg { width: 16px; height: 16px; }
.customer-ledger-filter { padding: .8rem .9rem; margin-bottom: .8rem; }
.customer-ledger-filter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: .7rem; }
.customer-ledger-filter .form-label { margin-bottom: .3rem; font-size: .76rem; }
.customer-ledger-filter .form-control { width: 100%; min-height: 38px; padding: .4rem .6rem; font-size: .82rem; }
.customer-ledger-filter-actions { display: flex; align-items: center; gap: .45rem; }
.customer-ledger-filter-actions .btn { padding: .46rem .7rem; font-size: .77rem; white-space: nowrap; }
.customer-ledger-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: .45rem; }
.customer-ledger-stat { display: flex; align-items: center; gap: .7rem; min-width: 0; padding: .8rem .9rem; }
.customer-ledger-stat-icon { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 50%; }
.customer-ledger-stat-icon svg { width: 22px; height: 22px; }
.customer-ledger-stat h2 { margin: 0 0 .12rem; font-size: .73rem; font-weight: 600; }
.customer-ledger-stat p { margin: 0; font-size: 1.35rem; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; overflow-wrap: anywhere; }
.customer-ledger-stat p small { font-size: .67rem; font-weight: 650; }
.customer-ledger-stat-debit { color: #075ee9; }
.customer-ledger-stat-debit .customer-ledger-stat-icon { background: #dfedff; }
.customer-ledger-stat-credit { color: #087f55; }
.customer-ledger-stat-credit .customer-ledger-stat-icon { background: #defbea; }
.customer-ledger-stat-balance { color: #6934c7; }
.customer-ledger-stat-balance .customer-ledger-stat-icon { background: #eee4ff; }
.customer-ledger-explainer { margin: 0 0 .5rem; padding-left: .1rem; color: var(--muted); font-size: .72rem; }
.customer-ledger { overflow: hidden; }
.customer-ledger-period { padding: .55rem .9rem; font-size: .76rem; }
.customer-ledger-table { width: 100%; min-width: 780px; font-size: .77rem; }
.customer-ledger-table > :not(caption) > * > * { padding: .42rem .55rem; }
.customer-ledger-table thead th { white-space: nowrap; font-size: .65rem; letter-spacing: .025em; }
.customer-ledger-table tbody tr:nth-child(2n+1) { background: #f8fbff; }
.customer-ledger-table td, .customer-ledger-table th { overflow-wrap: anywhere; }
.customer-ledger-table td:nth-last-child(-n+3), .customer-ledger-table thead th:nth-last-child(-n+3) { white-space: nowrap; }
.customer-ledger-table .customer-ledger-document a { font-weight: 650; }
.customer-ledger-kind { display: inline-block; margin-left: .35rem; padding: .12rem .4rem; border-radius: 999px; font-size: .65rem; font-weight: 650; white-space: nowrap; }
.customer-ledger-kind-debit { color: #075ee9; background: #e5f0ff; }
.customer-ledger-kind-credit { color: #087f55; background: #ddf8e9; }
.customer-ledger-reference-id { display: inline-block; margin-left: .3rem; color: var(--muted); font-size: .66rem; }
.customer-ledger-credit { color: #087f55 !important; }
.customer-ledger-balance { font-weight: 650; }
.customer-ledger-opening, .customer-ledger-total { font-weight: 700; }
.customer-ledger-total { background: #f4f8ff; }

/* Home spending stays separate from company vouchers while sharing Account Master. */
.home-expense-heading { margin-bottom: 1rem; }
.home-expense-filter { padding: 1rem; margin-bottom: 1rem; }
.home-expense-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(115px, 1fr)) repeat(3, minmax(125px, 1fr)) auto; gap: .7rem; align-items: end; }
.home-expense-filter .form-label { margin-bottom: .3rem; font-size: .82rem; }
.home-expense-filter .form-control, .home-expense-filter .form-select { min-height: 40px; padding: .45rem .65rem; font-size: .84rem; }
.home-expense-filter .btn { min-height: 40px; font-size: .83rem; white-space: nowrap; }
.home-expense-period-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .75rem; font-size: .8rem; }
.home-expense-period-links span { color: var(--muted); }
.home-expense-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.home-expense-total { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.2rem; }
.home-expense-total > span { color: var(--muted); font-size: .83rem; }
.home-expense-total strong { color: #1764e8; font-size: 1.75rem; line-height: 1.2; }
.home-expense-total strong.home-expense-period { color: var(--ink); font-size: 1.15rem; }
.home-expense-total small { color: var(--muted); }
.home-expense-report-grid { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(0, 2fr); gap: .8rem; align-items: start; }
.home-expense-summary { padding: 1rem; }
.home-expense-summary h2, .home-expense-section-heading h2 { margin: 0; font-size: 1.1rem; }
.home-expense-summary h2 { margin-bottom: .65rem; }
.home-expense-category { padding: .55rem 0; border-top: 1px solid var(--line); }
.home-expense-category summary { display: flex; justify-content: space-between; gap: .5rem; cursor: pointer; font-weight: 700; }
.home-expense-category ul { list-style: none; margin: .4rem 0 0; padding: 0 0 0 .6rem; }
.home-expense-category li { display: flex; justify-content: space-between; gap: .5rem; padding: .22rem 0; color: var(--muted); font-size: .85rem; }
.home-expense-subcategory { margin: .4rem 0 0 .45rem; padding-left: .6rem; border-left: 2px solid #dbeafe; }
.home-expense-subcategory > div { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.home-expense-subcategory ul { margin-top: .25rem; }
.home-expense-history { overflow: hidden; }
.home-expense-section-heading { display: flex; justify-content: space-between; align-items: center; padding: 1rem; }
.home-expense-section-heading span { color: var(--muted); font-size: .8rem; }
.home-expense-table { min-width: 850px; font-size: .83rem; }
.home-expense-table > :not(caption) > * > * { padding: .65rem .6rem; }
.home-expense-row-actions { white-space: nowrap; }
.home-expense-row-actions a + a { margin-left: .5rem; }
.home-expense-form { max-width: 900px; }
.home-expense-form small { display: block; margin-top: .35rem; }
.home-expense-lines-heading { margin-bottom: .5rem; }
.home-expense-lines-heading h2 { margin: 0; font-size: 1.1rem; }
.home-expense-lines-heading h2 small { display: inline; font-size: .75rem; font-weight: 500; color: var(--muted); }
.home-expense-lines-heading p { margin: .2rem 0 0; color: var(--muted); font-size: .83rem; }
.home-expense-entry-table { min-width: 740px; }
.home-expense-entry-table > :not(caption) > * > * { padding: .45rem; }
.home-expense-entry-table th:nth-child(1) { width: 35%; }
.home-expense-entry-table th:nth-child(2) { width: 20%; }
.home-expense-entry-table th:nth-child(3) { width: 33%; }
.home-expense-entry-table th:nth-child(4) { width: 12%; }
.home-expense-entry-table .form-control { min-height: 42px; padding: .45rem .6rem; }
.home-expense-line-list { list-style: none; margin: 0; padding: 0; }
.home-expense-line-list li { display: flex; justify-content: space-between; gap: .7rem; padding: .12rem 0; }
.home-expense-line-list li span:last-child { white-space: nowrap; color: var(--muted); }
.home-expense-delete { max-width: 680px; }
@media (min-width: 992px) {
  .customer-body .app-sidebar { width: 228px; }
  .customer-body .app-content { width: calc(100% - 228px); margin-left: 228px; }
}
@media (min-width: 1180px) {
  .customer-dashboard-main { grid-template-columns: minmax(0, 1.8fr) minmax(250px, .78fr); }
}
@media (max-width: 700px) {
  .customer-body .app-content { padding: .75rem !important; }
  .customer-body .mobile-header { padding: .6rem .75rem; }
  .customer-body .mobile-header .sidebar-brand { font-size: .97rem; }
  .customer-ledger-page .page-heading { align-items: flex-start; gap: .55rem; }
  .customer-ledger-page .page-heading h1 { font-size: 1.55rem; }
  .customer-ledger-back { padding: .4rem .5rem; font-size: .72rem; }
  .customer-ledger-filter { padding: .7rem; }
  .customer-ledger-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .customer-ledger-filter-actions { grid-column: 1 / -1; }
  .customer-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .customer-ledger-stat { gap: .5rem; padding: .65rem; }
  .customer-ledger-stat-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .customer-ledger-stat-icon svg { width: 19px; height: 19px; }
  .customer-ledger-stat p { font-size: 1.1rem; }
  .customer-ledger-stat-balance { grid-column: 1 / -1; }
  .customer-ledger .table-responsive { overflow: visible; }
  .customer-ledger-table { display: block; min-width: 0; width: 100%; }
  .customer-ledger-table thead { display: none; }
  .customer-ledger-table tbody, .customer-ledger-table tfoot { display: block; }
  .customer-ledger-table tbody tr, .customer-ledger-table tfoot tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem .45rem; padding: .7rem .8rem; border-top: 1px solid var(--line); }
  .customer-ledger-table tbody td, .customer-ledger-table tbody th, .customer-ledger-table tfoot td, .customer-ledger-table tfoot th { display: block; min-width: 0; padding: 0; border: 0; white-space: normal !important; }
  .customer-ledger-table .customer-ledger-entry td:nth-child(-n+4) { grid-column: 1 / -1; }
  .customer-ledger-table .customer-ledger-entry td:nth-child(1) { color: var(--muted); font-size: .72rem; }
  .customer-ledger-table .customer-ledger-entry td:nth-child(2) { font-size: .83rem; }
  .customer-ledger-table .customer-ledger-entry td:nth-child(3), .customer-ledger-table .customer-ledger-entry td:nth-child(4) { font-size: .74rem; }
  .customer-ledger-table .customer-ledger-entry td:nth-child(4) { color: var(--muted); }
  .customer-ledger-table .customer-ledger-entry td:nth-child(5), .customer-ledger-table .customer-ledger-entry td:nth-child(6), .customer-ledger-table .customer-ledger-entry td:nth-child(7), .customer-ledger-table .customer-ledger-total td { text-align: left !important; font-size: .8rem; }
  .customer-ledger-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .08rem; color: var(--muted); font-size: .64rem; font-weight: 600; text-transform: uppercase; }
  .customer-ledger-table .customer-ledger-opening { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
  .customer-ledger-table .customer-ledger-opening td { text-align: right !important; }
  .customer-ledger-table .customer-ledger-opening td::before { display: none; }
  .customer-ledger-table .customer-ledger-total th { grid-column: 1 / -1; }
  .customer-ledger-table .empty-state { grid-column: 1 / -1; padding: 1rem !important; }
  .customer-dashboard .page-heading { gap: .65rem; }
  .customer-dashboard .page-heading h1 { font-size: 1.6rem; }
  .customer-dashboard .page-heading .btn { width: auto; align-self: flex-start; }
  .customer-total-card { width: 100%; padding: .75rem .85rem; }
  .customer-dashboard-panel { padding: .75rem; }
  .customer-dashboard .customer-request-table { display: block; min-width: 0; table-layout: auto; }
  .customer-dashboard .customer-request-table thead { display: none; }
  .customer-dashboard .customer-request-table tbody, .customer-dashboard .customer-request-table tfoot { display: block; }
  .customer-dashboard .customer-request-table tbody tr, .customer-dashboard .customer-request-table tfoot tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem .5rem; padding: .65rem .7rem; }
  .customer-dashboard .customer-request-table tbody tr + tr { border-top: 1px solid var(--line); }
  .customer-dashboard .customer-request-table td { display: block; border: 0; padding: 0; min-width: 0; }
  .customer-dashboard .customer-request-table tbody td:nth-child(1), .customer-dashboard .customer-request-table tbody td:nth-child(2), .customer-dashboard .customer-request-table tfoot td:first-child { grid-column: 1 / -1; }
  .customer-dashboard .customer-request-table tbody td:nth-child(1) { color: var(--muted); font-size: .73rem; }
  .customer-dashboard .customer-request-table tbody td:nth-child(2) { font-weight: 600; }
  .customer-dashboard .customer-request-table td.text-end { text-align: left !important; }
  .customer-dashboard .customer-request-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .12rem; color: var(--muted); font-size: .65rem; font-weight: 600; text-transform: uppercase; }
  .customer-dashboard .customer-request-table tfoot tr { border-top: 1px solid var(--line); }
  .customer-request-balance { justify-content: space-between; }
  .customer-dashboard .customer-upcoming-table { display: block; min-width: 0; }
  .customer-dashboard .customer-upcoming-table thead { display: none; }
  .customer-dashboard .customer-upcoming-table tbody, .customer-dashboard .customer-upcoming-table tfoot { display: block; }
  .customer-dashboard .customer-upcoming-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .6rem; padding: .6rem .2rem; }
  .customer-dashboard .customer-upcoming-table tbody tr + tr { border-top: 1px solid var(--line); }
  .customer-dashboard .customer-upcoming-table tbody td { display: block; min-width: 0; padding: 0 !important; border: 0; overflow-wrap: anywhere; }
  .customer-dashboard .customer-upcoming-table tbody td:nth-child(-n+3) { grid-column: 1 / -1; }
  .customer-dashboard .customer-upcoming-table tbody td:nth-child(2) { color: var(--muted); }
  .customer-dashboard .customer-upcoming-table tbody td.text-end { text-align: left !important; }
  .customer-dashboard .customer-upcoming-table tbody td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .65rem; font-weight: 600; text-transform: uppercase; }
  .customer-dashboard .customer-upcoming-table tfoot tr { display: flex; justify-content: space-between; gap: .5rem; padding: .65rem .2rem; border-top: 1px solid var(--line); }
  .customer-dashboard .customer-upcoming-table tfoot td { display: block; padding: 0 !important; border: 0; }
  .customer-dashboard .customer-bills-table { display: block; min-width: 0; }
  .customer-dashboard .customer-bills-table thead { display: none; }
  .customer-dashboard .customer-bills-table tbody { display: block; }
  .customer-dashboard .customer-bills-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; padding: .55rem .2rem; }
  .customer-dashboard .customer-bills-table tbody tr + tr { border-top: 1px solid var(--line); }
  .customer-dashboard .customer-bills-table tbody td { display: block; padding: 0 !important; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .customer-dashboard .customer-bills-table tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: .77rem; }
  .customer-dashboard .customer-bills-table tbody td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right !important; font-weight: 700; }
  .customer-dashboard .customer-bills-table tbody td:nth-child(3)::before { content: attr(data-label); display: block; color: var(--muted); font-size: .65rem; font-weight: 600; text-transform: uppercase; }
}
@media (max-width: 420px) {
  .customer-ledger-page .page-heading { flex-wrap: wrap; }
  .customer-ledger-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .customer-ledger-filter-actions { grid-column: 1; }
  .customer-ledger-summary { grid-template-columns: minmax(0, 1fr); }
  .customer-ledger-stat-balance { grid-column: 1; }
}
@media (max-width: 900px) {
  .home-expense-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-expense-report-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .home-expense-heading { align-items: flex-start; gap: .6rem; margin-bottom: .75rem; }
  .home-expense-heading h1 { font-size: 1.65rem; }
  .home-expense-heading p { font-size: .85rem; }
  .home-expense-heading .btn { font-size: .8rem; padding: .5rem .6rem; white-space: nowrap; }
  .home-expense-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .home-expense-overview { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .home-expense-total { padding: .8rem; }
  .home-expense-history .table-responsive { overflow: visible; }
  .home-expense-table { display: block; min-width: 0; }
  .home-expense-table thead { display: none; }
  .home-expense-table tbody { display: block; }
  .home-expense-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .6rem; padding: .75rem .85rem; border-top: 1px solid var(--line); }
  .home-expense-table tbody td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .home-expense-table tbody td:nth-child(4), .home-expense-table tbody td:nth-child(5), .home-expense-table tbody td:nth-child(7) { grid-column: 1 / -1; }
  .home-expense-table tbody td.text-end { text-align: left !important; }
  .home-expense-table tbody td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .66rem; font-weight: 650; text-transform: uppercase; }
  .home-expense-table .empty-state { grid-column: 1 / -1; padding: 1rem !important; }
}

/* Sign-in is shared by customers and admins; keep it compact on smaller screens. */
.login-card { padding: 1.7rem; }
.login-card h1 { margin-top: 1.2rem; font-size: 1.8rem; }
.login-card .form-control { min-height: 44px; padding: .55rem .75rem; }
@media (max-width: 767px) {
  .login-shell { padding: 1rem .75rem; }
  .login-card { padding: 1.25rem; }
  .login-card h1 { font-size: 1.55rem; }
}
