:root {
  --pri: #0f766e; --pri-2: #14b8a6; --pri-bg: #e6f4f2; --side-bg: #0b3b37;
  --bg: #f3f5f7; --card: #fff; --text: #1f2937; --muted: #6b7280; --line: #e5e7eb;
  --red: #b91c1c; --red-bg: #fee2e2; --amber: #92400e; --amber-bg: #fef3c7;
  --green: #166534; --green-bg: #dcfce7; --blue: #1e40af; --blue-bg: #dbeafe; --gray-bg: #f1f5f9;
  --radius: 12px; --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
h2 small { font-weight: 400; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.red-t { color: var(--red); }
.nowrap { white-space: nowrap; }
.req { color: var(--red); }

/* ---------- Layout ---------- */
#sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); background: var(--side-bg); color: #ccfbf1; padding: 16px 12px; overflow-y: auto; z-index: 30; transition: transform .2s; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px; }
.logo { font-size: 30px; }
.brand-name { font-weight: 700; color: #fff; font-size: 15px; line-height: 1.3; }
.brand-sub { font-size: 11px; opacity: .7; }
#nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 9px; color: #ccfbf1; margin-bottom: 2px; font-weight: 500; }
#nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
#nav a.active { background: var(--pri-2); color: #042f2c; font-weight: 700; }
.nav-ico { width: 22px; text-align: center; }
.main { margin-inline-start: var(--side); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center; padding: 10px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.gsearch { position: relative; flex: 1; max-width: 520px; }
#gresults { position: absolute; top: calc(100% + 4px); inset-inline: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.12); overflow: hidden; }
#gresults a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; color: var(--text); }
#gresults a:hover { background: var(--pri-bg); text-decoration: none; }
.pad { padding: 12px; }
#langBtn { margin-inline-start: auto; }
.menu-btn { display: none; }
#view { padding: 22px 24px 40px; max-width: 1320px; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.date-line { color: var(--muted); margin: -8px 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 0; min-width: 0; }
.span-2 { grid-column: 1 / -1; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ---------- Controls ---------- */
input, select, textarea { font: inherit; color: inherit; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pri-2); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn.primary { background: var(--pri); color: #fff; }
.btn.primary:hover { background: #0d5f59; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--gray-bg); }
.btn.danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.wa { background: #e7f8ee; color: #128c4b; border-color: #bfe9d0; }
.icon-btn { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 15px; color: var(--muted); }
.icon-btn:hover { background: var(--gray-bg); color: var(--text); }
.link-btn { background: none; border: none; color: var(--pri); cursor: pointer; font: inherit; font-size: 12px; padding: 0 4px; text-decoration: underline; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { font: inherit; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.chip-btn.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.filter { max-width: 320px; margin-bottom: 10px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-bg); color: var(--muted); white-space: nowrap; }
.badge.red, .st-unpaid { background: var(--red-bg); color: var(--red); }
.badge.amber, .st-partial { background: var(--amber-bg); color: var(--amber); }
.badge.green, .st-paid { background: var(--green-bg); color: var(--green); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
a.stat:hover { border-color: var(--pri-2); text-decoration: none; }
.stat-icon { font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--pri-bg); border-radius: 12px; }
.stat-val { font-size: 21px; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 12.5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: #f7fbfa; }
.empty { padding: 22px; text-align: center; color: var(--muted); background: #fafbfc; border: 1px dashed var(--line); border-radius: 10px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.list li:last-child { border-bottom: none; }
.li-end { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.alert { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }

/* ---------- Appointments ---------- */
.appt-list { display: flex; flex-direction: column; gap: 8px; }
.appt { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: 10px; background: #fff; }
.appt-time { display: flex; flex-direction: column; min-width: 78px; line-height: 1.3; }
.appt-time small { color: var(--muted); font-size: 11.5px; }
.appt-main { flex: 1; min-width: 0; }
.status-sel { width: auto; padding: 4px 8px; font-size: 12.5px; font-weight: 600; border-radius: 99px; }
.st-border-checkedin { border-inline-start-color: #d97706; }
.st-border-completed { border-inline-start-color: #16a34a; opacity: .85; }
.st-border-cancelled, .st-border-noshow { border-inline-start-color: #9ca3af; opacity: .6; }
.status-sel.st-scheduled { background: var(--blue-bg); color: var(--blue); }
.status-sel.st-checkedin { background: var(--amber-bg); color: var(--amber); }
.status-sel.st-completed { background: var(--green-bg); color: var(--green); }
.status-sel.st-cancelled, .status-sel.st-noshow { background: var(--gray-bg); color: var(--muted); }
.day-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.day-nav input[type=date] { width: auto; }
.day-nav label { display: flex; gap: 6px; align-items: center; }
.day-title { margin-inline-start: auto; }

/* ---------- Pets & visits ---------- */
.pet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pet-card { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.pet-card:hover { border-color: var(--pri-2); text-decoration: none; background: #f7fbfa; }
.pet-ico { font-size: 28px; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.visit { border: 1px solid var(--line); border-inline-start: 4px solid var(--pri-2); border-radius: 10px; padding: 12px 14px; }
.visit-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.chips { display: flex; gap: 6px; }
.chip { background: var(--gray-bg); border-radius: 99px; padding: 1px 8px; font-size: 12px; }
.dx { margin: 8px 0 4px; font-weight: 700; color: var(--pri); }
.v-sec { margin-top: 6px; }
.v-k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.v-sec p { margin: 0; white-space: pre-wrap; }

/* ---------- Bars ---------- */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--pri), var(--pri-2)); border-radius: 99px; }
[dir=rtl] .bar-fill { background: linear-gradient(270deg, var(--pri), var(--pri-2)); }
.bar-val { font-weight: 600; font-size: 12.5px; }

/* ---------- Modal ---------- */
#modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
#modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-box.wide { max-width: 900px; }
.modal-box header, .modal-box footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px; }
.modal-box header { border-bottom: 1px solid var(--line); }
.modal-box header h3 { margin: 0; font-size: 17px; }
.modal-box footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { padding: 16px 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12.5px; font-weight: 600; color: #374151; }
.field.full { grid-column: 1 / -1; }
.form-actions { margin-top: 14px; }
.ie-table { margin: 14px 0 8px; }
.ie-table td { padding: 6px 4px; vertical-align: top; }
.ie-table td:first-child { min-width: 260px; }
.ie-table td:first-child > * + * { margin-top: 4px; }
.ie-table .ie-qty { width: 80px; }
.ie-table .ie-price { width: 110px; }
.ie-lt { white-space: nowrap; font-weight: 600; padding-top: 14px !important; }
.ie-bottom { margin-top: 14px; }
.ie-totals { display: flex; gap: 20px; justify-content: flex-end; margin-top: 14px; padding: 12px; background: var(--pri-bg); border-radius: 10px; flex-wrap: wrap; }
.ie-totals .grand { font-size: 16px; }

/* ---------- Invoice document ---------- */
.invoice-doc { max-width: 820px; padding: 28px 32px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--pri); padding-bottom: 16px; }
.inv-clinic { font-size: 20px; font-weight: 800; color: var(--pri); }
.inv-meta { text-align: end; }
.inv-title { font-size: 22px; font-weight: 800; }
.inv-bill { display: flex; gap: 48px; margin: 18px 0; }
.inv-table th { background: var(--pri-bg); color: var(--pri); }
.inv-totals { margin-inline-start: auto; max-width: 320px; margin-top: 14px; }
.tot-row { display: flex; justify-content: space-between; padding: 5px 0; }
.tot-row.grand { border-top: 2px solid var(--text); margin-top: 4px; padding-top: 8px; font-size: 17px; font-weight: 800; }
.inv-pays { margin-top: 16px; }
.inv-thanks { text-align: center; color: var(--muted); margin-top: 28px; border-top: 1px dashed var(--line); padding-top: 14px; }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; }
[dir=rtl] #toast { transform: translateX(50%) translateY(20px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
[dir=rtl] #toast.show { transform: translateX(50%); }

/* ---------- Sign-in / setup ---------- */
#auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--side-bg), #115e57 60%, var(--pri-2)); }
.auth-card { background: #fff; width: 100%; max-width: 420px; border-radius: 16px; padding: 24px 28px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.auth-top .logo { font-size: 40px; }
.auth-card h1 { font-size: 21px; margin-bottom: 2px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-err { color: var(--red); font-weight: 600; min-height: 1.2em; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: auto; }
[hidden] { display: none !important; }

/* ---------- Reports ---------- */
.rep-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.rep-tab { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; }
.rep-tab:hover { text-decoration: none; background: var(--gray-bg); }
.rep-tab.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.filters .chips-row { margin-inline-start: auto; }
.print-only { display: none; }
.card h3 { font-size: 14px; margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.stat-sub { color: var(--muted); margin-top: 2px; }
.rep-table td, .rep-table th { white-space: nowrap; }
.rep-table tbody tr[data-act] { cursor: pointer; }
.rep-table tbody tr[data-act]:hover td { background: #f7fbfa; }
.rep-table tr.sel td { background: var(--pri-bg); }
.rep-table tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--pri); }
[dir=rtl] .rep-table tr.sel td:first-child { box-shadow: inset -3px 0 0 var(--pri); }
.rep-table tr.unassigned td { color: var(--amber); }
.rep-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfc; }
.share-cell { min-width: 120px; }
.share-track { display: inline-block; width: 64px; height: 6px; background: var(--gray-bg); border-radius: 99px; vertical-align: middle; overflow: hidden; }
.share-fill { display: block; height: 100%; background: var(--pri); border-radius: 99px; }
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }
.vet-pick { width: auto; margin-inline-start: auto; font-weight: 400; }
/* single-series column chart: one hue, thin rounded columns, recessive baseline */
.cols-wrap { position: relative; }
.cols-peak { margin-bottom: 6px; }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--line); direction: ltr; }
[dir=rtl] .cols { flex-direction: row-reverse; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 3px; cursor: default; }
.col:focus { outline: 2px solid var(--pri-2); outline-offset: 1px; }
.col-bar { display: block; width: 100%; max-width: 22px; margin: 0 auto; background: var(--pri); border-radius: 4px 4px 0 0; }
.col:hover .col-bar { background: var(--pri-2); }
.cols-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.bar-row:hover .bar-fill, .bar-row:focus .bar-fill { filter: brightness(1.15); }
.bar-row:focus { outline: 2px solid var(--pri-2); outline-offset: 2px; border-radius: 4px; }
#tip { position: fixed; z-index: 70; background: #111827; color: #fff; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; pointer-events: none; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.2); }

/* ---------- Logo ---------- */
.logo img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 2px; display: block; }
.auth-top .logo img { width: 64px; height: 64px; }
.clinic-block { display: flex; gap: 14px; align-items: center; }
.clinic-logo { max-height: 72px; max-width: 150px; object-fit: contain; }
.logo-box { height: 120px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 12px; background: #fafbfc; margin-bottom: 8px; }
.logo-box img { max-height: 100px; max-width: 80%; object-fit: contain; }
.logo-empty { font-size: 48px; opacity: .4; }

/* ---------- Lab & imaging ---------- */
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.alert.amber { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.inbox { border-color: #fde68a; background: #fffdf5; }
.file-no { font-size: 16px; background: var(--pri-bg); color: var(--pri); padding: 1px 8px; border-radius: 6px; }
.res-table tr.flag-H td { color: var(--red); background: #fff5f5; }
.res-table tr.flag-L td { color: var(--blue); background: #f5f8ff; }
.findings { margin-top: 16px; }
.res-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 16px; }
.res-imgs img { width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #000; }
.res-files { margin-top: 14px; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; background: #fafbfc; font-size: 12.5px; }
.file-chip .icon-btn { padding: 0 4px; font-size: 12px; }
.btn.drop { align-self: flex-start; }
#re-vals h4 { margin: 14px 0 0; }
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.howto > div { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.howto p { margin: 6px 0 10px; color: #374151; font-size: 13px; }
code { background: var(--gray-bg); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
code.path { display: block; word-break: break-all; padding: 6px 8px; }

/* ---------- WhatsApp settings ---------- */
.wa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.wa-grid h4 { margin: 14px 0 6px; }
.wa-help { background: #f6fbf8; border: 1px solid #d6efe0; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.wa-help ol { padding-inline-start: 18px; margin: 6px 0; }
.wa-help li { margin-bottom: 4px; }
.tpl { border-top: 1px dashed #cfe7d8; padding-top: 6px; margin-top: 6px; }
.tpl p { margin: 4px 0 0; }
.inline-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.inline-row .check { margin: 0; }
input.mini { width: 70px; }
@media (max-width: 1000px) { .wa-grid { grid-template-columns: 1fr; } }

/* ---------- Password boxes & form errors ---------- */
.pw-wrap { position: relative; display: block; direction: ltr; } /* passwords are typed left-to-right; keeps the eye clear of the text */
.pw-wrap input { padding-inline-end: 42px; }
.pw-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 17px; padding: 4px 8px; border-radius: 6px; line-height: 1; }
.pw-eye:hover { background: var(--gray-bg); }
.pw-live { font-size: 12px; min-height: 0; }
.pw-live .warn { color: var(--amber); font-weight: 600; }
.pw-live .ok { color: var(--green); font-weight: 600; }
.form-err { color: var(--red); background: var(--red-bg); border-radius: 8px; font-weight: 600; margin-top: 12px; padding: 8px 12px; }
.form-err:empty { display: none; }

/* ---------- User box & connection banner ---------- */
#userbox { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
#userbox + #langBtn { margin-inline-start: 0; }
.who { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
#netbar { background: var(--amber-bg); color: var(--amber); padding: 8px 24px; font-weight: 600; text-align: center; border-bottom: 1px solid #fde68a; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #sidebar { transform: translateX(-100%); }
  [dir=rtl] #sidebar { transform: translateX(100%); }
  body.nav-open #sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .main { margin-inline-start: 0; }
  .menu-btn { display: inline-block; }
  .topbar { padding: 10px 12px; flex-wrap: wrap; }
  .who .badge { display: none; }
  #view { padding: 16px 12px 40px; }
  .appt { flex-wrap: wrap; }
  .inv-head, .inv-bill { flex-direction: column; gap: 12px; }
  .inv-meta { text-align: start; }
  .invoice-doc { padding: 18px; }
}

/* ---------- Print ---------- */
@media print {
  #sidebar, .topbar, .no-print, #toast { display: none !important; }
  .main { margin: 0; }
  #view { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
  .invoice-doc { max-width: none; padding: 0; }
  .badge { border: 1px solid currentColor; }
  .print-only { display: inline; }
  .filters { border: none; padding: 0; }
  .filters label, .rep-tabs { display: none; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .card { break-inside: avoid; }
  .col-bar, .share-fill, .bar-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
