/* Home Visit Report — form (phone first), office views and print. */

.hv-page { max-width: 760px; margin: 0 auto; }
.hv-page-wide { max-width: none; }
.hv-page h1 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.hv-lead { color: var(--ink-light, #6b6b6b); margin-bottom: 1.25rem; }
.hv-back { display: inline-block; margin-bottom: 1rem; color: var(--primary, #e0530e); font-weight: 600; text-decoration: none; }

/* Buttons (the portal styles every <button>; reset for ours) */
.hv-btn, a.hv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    width: auto; min-height: 48px; padding: 0 1.25rem; border: 0; border-radius: 0.6rem;
    background: linear-gradient(135deg, #e0530e 0%, #f4761f 100%); color: #fff;
    font: 600 1rem/1.2 Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.hv-btn:hover { transform: none; box-shadow: 0 4px 12px rgba(224, 83, 14, 0.25); }
.hv-btn:disabled { background: #d9d4ce; color: #fff; cursor: not-allowed; box-shadow: none; }
.hv-btn-ghost, a.hv-btn-ghost { background: #fff; color: #3a3a3a; border: 1px solid #d6cfc6; }
.hv-btn-ghost:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
.hv-btn-sm { min-height: 36px; padding: 0 0.8rem; font-size: 0.85rem; }
.hv-btn-danger { color: #b91c1c; }
.hv-link { width: auto; padding: 0.35rem 0; background: none; color: inherit; text-align: left; font: inherit; text-decoration: underline; text-underline-offset: 2px; border-radius: 0; }
.hv-link:hover { transform: none; box-shadow: none; }

/* Notes */
.hv-note { margin: 1rem 0; padding: 0.85rem 1rem; border-radius: 0.6rem; background: #f6f4f1; color: #3a3a3a; font-size: 0.95rem; }
.hv-note-warn { background: #fff4e5; border-left: 4px solid #d97706; }
.hv-conf { font-size: 0.85rem; color: #6b6b6b; margin-bottom: 1rem; }

/* ── Full-screen form ────────────────────────────────────────────────────
   The portal's own header and page padding are hidden while the form is open. */
body:has(.hv-app) > header { display: none; }
body:has(.hv-app) > .container { padding: 0; }
body:has(.hv-app) { background: #f6f3ef; }
.hv-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.hv-appbar {
    position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem;
    padding: 0.6rem 1rem; background: #fff; border-bottom: 1px solid #eee4d8; box-shadow: 0 1px 6px rgba(58, 42, 30, 0.05);
}
.hv-appbar-back {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    color: #3a3a3a; font-size: 1.35rem; text-decoration: none;
}
.hv-appbar-back:hover { background: #f6f1eb; }
.hv-appbar-title { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.hv-appbar-title strong { font: 700 1.1rem/1.3 Merriweather, Georgia, serif; color: #2f2a26; }
.hv-appbar-title span { font-size: 0.85rem; color: #6b6b6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-appbar .hv-progress { flex: 0 1 340px; }
.hv-appbar .hv-save { flex: none; }

.hv-layout { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 1rem; }
.hv-side { margin-bottom: 0.8rem; }
.hv-side .hv-conf { margin: 0.4rem 0.2rem 0; }
.hv-nav { display: none; }
.hv-main { min-width: 0; }

@media (min-width: 1024px) {
    .hv-appbar { padding: 0.7rem 2rem; }
    .hv-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 2rem; padding: 1.5rem 2rem; align-items: start; }
    .hv-side { position: sticky; top: 88px; max-height: calc(100vh - 170px); overflow-y: auto; margin: 0; }
    .hv-nav { display: grid; gap: 0.2rem; margin-bottom: 1rem; padding: 0.5rem; background: #fff; border: 1px solid #eee4d8; border-radius: 0.9rem; }
    .hv-nav-item {
        display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 44px; padding: 0.4rem 0.6rem;
        background: none; color: #3a3a3a; border-radius: 0.6rem; text-align: left; font-weight: 500; font-size: 0.9rem;
    }
    .hv-nav-item:hover { transform: none; box-shadow: none; background: #faf6f1; }
    .hv-nav-item.is-current { background: #fff1e6; color: #c2410c; }
    .hv-nav-item .hv-sec-no { width: 26px; height: 26px; font-size: 0.78rem; }
    .hv-nav-title { flex: 1; line-height: 1.3; }
    .hv-nav-state { flex: none; white-space: nowrap; min-width: 24px; padding: 0 0.4rem; border-radius: 99px; font-size: 0.72rem; font-weight: 700; text-align: center; line-height: 1.6; }
    .hv-nav-state.is-todo { background: #fff4e5; color: #b45309; }
    .hv-nav-state.is-done { background: #ecfdf5; color: #047857; }
    .hv-side .hvr-head { grid-template-columns: 1fr; }

    /* Wide screen: short fields sit side by side, long ones take the full row */
    .hv-main .hv-sec > summary { min-height: 60px; padding: 0.7rem 1.4rem; font-size: 1.05rem; }
    .hv-main .hv-sec-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.4rem; padding: 0 1.4rem 1.4rem; }
    .hv-main .hv-sec-body > .hv-sec-foot,
    .hv-main .hv-sec-body > .hv-help, .hv-main .hv-sec-body > .hv-t-area, .hv-main .hv-sec-body > .hv-t-radio,
    .hv-main .hv-sec-body > .hv-t-check, .hv-main .hv-sec-body > .hv-rowsfield, .hv-main .hv-sec-body > .hv-t-photos, .hv-main .hv-sec-body > .hv-group { grid-column: 1 / -1; }
    .hv-row-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 1rem; }
    .hv-row-grid > .hv-t-area { grid-column: 1 / -1; }
    .hv-add { width: auto; padding: 0 1.5rem; }
}
@media (min-width: 1400px) {
    .hv-main .hv-sec-body { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Smooth feel: soft cards, gentle motion, calm focus ─────────────────── */
html:has(.hv-app) { scroll-behavior: smooth; scroll-padding-top: 96px; scroll-padding-bottom: 96px; }
.hv-app .hv-sec { box-shadow: 0 1px 2px rgba(58, 42, 30, 0.04); transition: box-shadow 0.25s ease, border-color 0.25s ease; }
.hv-app .hv-sec:hover { box-shadow: 0 4px 16px rgba(58, 42, 30, 0.07); }
.hv-app .hv-sec[open] { border-color: #f0dcc7; }
.hv-app .hv-sec > summary { border-radius: 0.8rem; transition: background-color 0.2s ease; }
.hv-app .hv-sec > summary:hover { background: #fdf9f5; }
.hv-app .hv-sec > summary::after { transition: transform 0.25s ease; }
/* Opening a section fades its content in */
.hv-app .hv-sec[open] > .hv-sec-body { animation: hv-reveal 0.28s ease both; }
@keyframes hv-reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.hv-app input[type="text"], .hv-app input[type="date"], .hv-app input[type="time"], .hv-app select, .hv-app textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.hv-app input:hover, .hv-app select:hover, .hv-app textarea:hover { border-color: #c9bdb0; }
.hv-app .hv-choice, .hv-app .hv-check { transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease; }
.hv-app .hv-choice:hover, .hv-app .hv-check:hover { border-color: #e9b48f; box-shadow: 0 2px 8px rgba(224, 83, 14, 0.08); }
.hv-app .hv-row { transition: box-shadow 0.2s ease; animation: hv-reveal 0.25s ease both; }
.hv-app .hv-row:focus-within { box-shadow: 0 0 0 3px rgba(244, 118, 31, 0.12); }
.hv-app .hv-btn { transition: box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease; }
.hv-app .hv-btn:active:not(:disabled) { opacity: 0.85; }
.hv-app .hv-nav-item { transition: background-color 0.2s ease, color 0.2s ease; }
.hv-app .hv-nav-state, .hv-app .hv-sec-state { transition: background-color 0.3s ease, color 0.3s ease; }
.hv-progress-bar span { transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.hv-app .hv-note:not([hidden]), .hv-app .hv-other:not([hidden]) { animation: hv-reveal 0.22s ease both; }
.hv-app .hv-appbar, .hv-app .hv-bar { backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); background: rgba(255, 255, 255, 0.9); }
.hv-app .hv-side { scrollbar-width: thin; }

@media (prefers-reduced-motion: reduce) {
    html:has(.hv-app) { scroll-behavior: auto; }
    .hv-app *, .hv-app *::after { animation: none !important; transition: none !important; }
}

.hv-progress { flex: 1 1 220px; display: flex; align-items: center; gap: 0.6rem; }
.hv-progress-bar { flex: 1; height: 8px; background: #eee4d8; border-radius: 99px; overflow: hidden; }
.hv-progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f4761f, #e0530e); transition: width 0.3s; }
.hv-progress-text { font-size: 0.8rem; font-weight: 600; color: #3a3a3a; white-space: nowrap; }
.hv-save { font-size: 0.8rem; color: #047857; }
.hv-save.is-warn { color: #b45309; }
.hv-h1 { font-size: 1.45rem; margin-bottom: 0.25rem; }

/* Missing list */
.hv-missing > * { margin-bottom: 1rem; }
.hv-todo, .hv-problems, .hv-ready { border-radius: 0.6rem; padding: 0.8rem 1rem; font-size: 0.92rem; }
.hv-todo { background: #fff; border: 1px solid #f0d9c2; }
.hv-todo summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.hv-todo-list strong { display: block; margin-top: 0.6rem; font-size: 0.8rem; color: #6b6b6b; font-weight: 500; }
.hv-todo ul, .hv-problems ul { margin: 0.3rem 0 0 1.1rem; }
.hv-problems { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.hv-ready { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-weight: 600; }

/* Sections */
.hv-sec { background: #fff; border: 1px solid #eee4d8; border-radius: 0.8rem; margin-bottom: 0.8rem; }
.hv-sec > summary {
    display: flex; align-items: center; gap: 0.7rem; min-height: 56px; padding: 0.6rem 1rem;
    cursor: pointer; list-style: none; font-weight: 600; font-size: 1rem;
}
.hv-sec > summary::-webkit-details-marker { display: none; }
.hv-sec > summary::after { content: '▾'; margin-left: 0.25rem; color: #9a8f84; transition: transform 0.2s; }
.hv-sec[open] > summary::after { transform: rotate(180deg); }
.hv-sec-no {
    flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: #fff1e6; color: #e0530e; font-size: 0.85rem;
}
.hv-sec-title { flex: 1; }
.hv-sec-state { font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 99px; white-space: nowrap; }
.hv-sec-state.is-todo { background: #fff4e5; color: #b45309; }
.hv-sec-state.is-done { background: #ecfdf5; color: #047857; }
.hv-sec-body { padding: 0 1rem 1.1rem; }

/* One section at a time */
.hv-sec.is-step-hidden { display: none; }
.hv-step .hv-sec > summary { cursor: default; }
.hv-step .hv-sec > summary::after { display: none; }
.hv-step .hv-sec > summary:hover { background: none; }
.hv-sec-foot {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem;
    margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #f0e6da;
}
.hv-sec-foot .hv-btn { min-height: 46px; }
.hv-sec-left { flex: 1 1 200px; font-size: 0.85rem; font-weight: 600; text-align: center; }
.hv-sec-left.is-todo { color: #b45309; }
.hv-sec-left.is-done { color: #047857; }
.hv-next { margin-left: auto; }
@media (max-width: 640px) {
    .hv-sec-foot .hv-sec-left { order: -1; flex-basis: 100%; }
    .hv-sec-foot .hv-btn { flex: 1 1 0; padding: 0 0.8rem; font-size: 0.92rem; }
}
.hv-viewbar { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; }
.hv-viewtoggle {
    width: auto; padding: 0.3rem 0; background: none; color: #c2410c; border-radius: 0;
    font: 600 0.85rem/1.3 Inter, system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.hv-viewtoggle:hover { transform: none; box-shadow: none; color: #9a3412; }
.hv-help { margin-bottom: 0.9rem; padding: 0.7rem 0.9rem; background: #faf7f2; border-radius: 0.5rem; font-size: 0.92rem; color: #4b4540; }

/* Fields */
.hv-field { margin-top: 1rem; }
.hv-field[hidden], .hv-other[hidden], .hv-note[hidden] { display: none; }
.hv-label, .hv legend { display: block; margin: 0 0 0.35rem; font-weight: 600; font-size: 0.95rem; color: #2f2a26; line-height: 1.4; }
.hv-req { color: #c2410c; }
.hv-hint { margin-top: 0.3rem; font-size: 0.82rem; color: #6b6b6b; }
.hv input[type="text"], .hv input[type="date"], .hv input[type="time"], .hv select, .hv textarea {
    width: 100%; min-height: 48px; padding: 0.65rem 0.8rem; border: 1px solid #d6cfc6; border-radius: 0.55rem;
    background: #fff; color: #1f1b18; font: 16px/1.45 Inter, 'Noto Sans Tamil', 'Noto Sans Malayalam', system-ui, sans-serif;
}
.hv textarea { resize: vertical; min-height: 96px; }
.hv input:focus, .hv select:focus, .hv textarea:focus { outline: none; border-color: #f4761f; box-shadow: 0 0 0 3px rgba(244, 118, 31, 0.18); }
.hv-money { display: flex; align-items: stretch; }
.hv-rupee { display: grid; place-items: center; padding: 0 0.9rem; background: #f6f1eb; border: 1px solid #d6cfc6; border-right: 0; border-radius: 0.55rem 0 0 0.55rem; font-weight: 600; }
.hv-money input[type="text"] { border-radius: 0 0.55rem 0.55rem 0; }
.hv-other { margin-top: 0.6rem; }

/* Date / time with a one-tap "Today" / "Now" */
.hv-inline { display: flex; gap: 0.5rem; }
.hv-inline input { flex: 1; min-width: 0; }
.hv-quick {
    flex: none; width: auto; min-height: 48px; padding: 0 0.9rem; background: #fff; color: #c2410c;
    border: 1px solid #f0c9a8; border-radius: 0.55rem; font-weight: 600; font-size: 0.88rem;
}
.hv-quick:hover { transform: none; box-shadow: none; background: #fff4ec; }

/* Still empty, in a section the officer has already moved on from */
.hv-needs input[type="text"], .hv-needs input[type="date"], .hv-needs input[type="time"],
.hv-needs select, .hv-needs textarea, .hv-needs .hv-choice, .hv-needs .hv-check { border-color: #f59e0b; background: #fffbeb; }
.hv-needs > .hv-label, .hv-needs .hv-radios > legend { color: #b45309; }

.hv-radios { border: 0; padding: 0; margin: 0; min-width: 0; }
.hv-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hv-choice, .hv-check {
    display: flex; align-items: center; gap: 0.6rem; margin: 0; min-height: 48px; padding: 0.55rem 0.9rem;
    border: 1px solid #d6cfc6; border-radius: 0.6rem; background: #fff; cursor: pointer; font-weight: 500; font-size: 0.95rem;
}
.hv-choice { flex: 1 1 auto; }
.hv-choice input, .hv-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: #e0530e; }
.hv-choice:has(input:checked), .hv-check:has(input:checked) { border-color: #e0530e; background: #fff4ec; }
.hv-check { align-items: flex-start; line-height: 1.45; }
.hv-check.is-right { align-items: center; flex-direction: row-reverse; justify-content: space-between; }
.hv-check input { margin-top: 0.1rem; }

/* Repeating rows */
.hv-rows { display: grid; gap: 0.8rem; }
.hv-row { border: 1px solid #eee4d8; border-radius: 0.7rem; padding: 0.2rem 0.9rem 0.9rem; background: #fdfbf8; }
.hv-row .hv-field { margin-top: 0.75rem; }
.hv-row-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 0.4rem; }
.hv-remove {
    width: auto; min-height: 40px; padding: 0 0.9rem; background: #fff; color: #b91c1c; border: 1px solid #fecaca;
    border-radius: 0.5rem; font-size: 0.85rem; font-weight: 600;
}
.hv-remove:hover { transform: none; box-shadow: none; background: #fef2f2; }
.hv-add { margin-top: 0.8rem; width: 100%; border-style: dashed; }
.hv-add[hidden] { display: none; }

/* Not applicable right now (for example income for a student) */
.hv-field.is-off { opacity: 0.5; }
.hv-field.is-off .hv-req { display: none; }
.hv-field.is-off input, .hv-field.is-off select { background: #f3efe9; cursor: not-allowed; }

/* Several short fields in one row under a shared heading */
.hv-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.hv-group > legend { padding: 0; margin-bottom: 0.2rem; }
.hv-group-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 1rem; }

/* Photos */
.hv-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; margin: 0.5rem 0; }
.hv-photos:empty { display: none; }
.hv-photo { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid #eee4d8; border-radius: 0.7rem; background: #fdfbf8; display: grid; place-items: center; padding: 0.4rem; text-align: center; font-size: 0.82rem; }
.hv-photo a { position: absolute; inset: 0; display: block; }
.hv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hv-photo .hv-remove { position: absolute; top: 0.35rem; right: 0.35rem; min-height: 32px; padding: 0 0.6rem; font-size: 0.78rem; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.hv-photo-busy { color: #6b6b6b; }
.hv-photo-error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

/* Bottom action bar */
.hv-bar {
    position: sticky; bottom: 0; z-index: 40; padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97); border-top: 1px solid #eee4d8; box-shadow: 0 -1px 6px rgba(58, 42, 30, 0.05);
}
.hv-bar-inner { max-width: 1440px; margin: 0 auto; }
.hv-bar-btns { display: flex; gap: 0.6rem; }
.hv-bar-btns .hv-btn { flex: 1; }
@media (min-width: 1024px) {
    .hv-bar { padding: 0.8rem 2rem; }
    .hv-bar-inner { display: flex; align-items: center; gap: 1rem; }
    .hv-bar-msg { flex: 1; margin: 0; }
    .hv-bar-btns { margin-left: auto; }
    .hv-bar-btns .hv-btn { flex: none; min-width: 170px; }
}
.hv-bar-msg { margin-bottom: 0.6rem; padding: 0.55rem 0.8rem; border-radius: 0.5rem; font-size: 0.88rem; font-weight: 600; }
.hv-bar-msg[hidden] { display: none; }
.hv-bar-msg.is-error { background: #fef2f2; color: #b91c1c; }
.hv-bar-msg.is-ok { background: #ecfdf5; color: #065f46; }

/* Submitted confirmation */
.hv-done { background: #fff; border: 1px solid #eee4d8; border-radius: 1rem; padding: 2rem 1.25rem; text-align: center; }
.hv-done-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #ecfdf5; color: #047857; font-size: 2rem; margin-bottom: 0.8rem; }
.hv-done dl { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 0.3rem 1rem; margin: 1rem 0; text-align: left; }
.hv-done dt { color: #6b6b6b; }
.hv-done dd { font-weight: 700; }
.hv-done p { margin: 0.8rem auto; max-width: 460px; }

/* Officer's case list */
.hv-search { width: 100%; min-height: 48px; padding: 0.65rem 0.9rem; margin-bottom: 1rem; border: 1px solid #d6cfc6; border-radius: 0.6rem; font-size: 16px; }
.hv-cases { list-style: none; display: grid; gap: 0.6rem; }
.hv-cases li[hidden] { display: none; }
.hv-cases a { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.6rem; padding: 0.9rem 1rem; background: #fff; border: 1px solid #eee4d8; border-radius: 0.8rem; color: inherit; text-decoration: none; }
.hv-cases a:hover { border-color: #f4761f; }
.hv-case-name { font-weight: 700; }
.hv-case-meta { grid-column: 1 / -1; font-size: 0.85rem; color: #6b6b6b; }
.hv-local { color: #b45309; font-weight: 600; }

/* Badges */
.hv-badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 99px; font-size: 0.75rem; font-weight: 700; background: #f1ede8; color: #5b534c; white-space: nowrap; }
.hv-badge-draft { background: #fff4e5; color: #b45309; }
.hv-badge-done { background: #ecfdf5; color: #047857; }
.hv-badge-new { background: #eff6ff; color: #1d4ed8; }
.hv-badge-urgent { background: #b91c1c; color: #fff; }

/* Home Visit tab on the application page */
.hv-case { display: grid; gap: 0.8rem; margin-bottom: 1rem; }
.hv-case-row label { display: block; font-size: 0.82rem; font-weight: 600; color: #6b6b6b; margin-bottom: 0.3rem; }
.hv-case-assign { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.hv-case-assign select { min-height: 44px; min-width: 260px; max-width: 100%; padding: 0 0.7rem; border: 1px solid #d6cfc6; border-radius: 0.5rem; font-size: 0.95rem; background: #fff; }
.hv-case-saved { font-size: 0.85rem; color: #047857; }
.hv-case-state { font-size: 0.95rem; }
.hv-case-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* Settings: people */
.hv-users h3 { font-size: 1rem; margin: 1.4rem 0 0.6rem; }
.hv-users-act { white-space: nowrap; }
.hv-users-act .hv-btn { margin-right: 0.3rem; }
.hv-user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.hv-user-grid label { font-size: 0.85rem; font-weight: 600; margin: 0; }
.hv-user-grid input, .hv-user-grid select { display: block; width: 100%; min-height: 44px; margin-top: 0.3rem; padding: 0 0.7rem; border: 1px solid #d6cfc6; border-radius: 0.5rem; font-size: 0.95rem; background: #fff; }
.hv-user-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.hv-user-foot [hidden] { display: none; }
#huMsg { font-size: 0.88rem; color: #b91c1c; margin-right: auto; }

/* ── Report (read-only, office + print) ─────────────────────────────────── */
.hvr { background: #fff; border: 1px solid #eee4d8; border-radius: 0.8rem; padding: 1.25rem; color: #1f1b18; }
.hvr-conf { font-size: 0.82rem; color: #6b6b6b; margin-bottom: 0.8rem; }
.hvr-urgent { margin-bottom: 1rem; padding: 0.8rem 1rem; background: #b91c1c; color: #fff; border-radius: 0.5rem; font-weight: 700; }
.hvr-title { font-size: 1.3rem; margin-bottom: 0.8rem; }
.hvr-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.2rem 1rem; }
.hvr-sec { margin-top: 1.4rem; break-inside: auto; }
.hvr-sec h3 { font-size: 1.02rem; padding-bottom: 0.35rem; margin-bottom: 0.4rem; border-bottom: 2px solid #f0e6da; break-after: avoid; }
.hvr-f { padding: 0.45rem 0; border-bottom: 1px solid #f5efe8; break-inside: avoid; }
.hvr-l { font-size: 0.8rem; font-weight: 600; color: #6b6b6b; }
.hvr-v { white-space: normal; word-break: break-word; }
.hvr-v select { width: 100%; }
.hvr-empty { color: #a39a91; }
.hvr-yes { color: #047857; font-weight: 600; }
.hvr-sign { margin-top: 0.6rem; font-size: 0.9rem; }
.hvr-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; margin-top: 0.3rem; }
.hvr-photos a { display: block; break-inside: avoid; }
.hvr-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #eee4d8; border-radius: 0.4rem; }
.hvr-table { overflow-x: auto; margin: 0.5rem 0; }
.hvr-table table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.hvr-table th, .hvr-table td { padding: 0.45rem 0.55rem; border: 1px solid #eee4d8; text-align: left; vertical-align: top; }
.hvr-table thead th { background: #faf7f2; font-size: 0.78rem; }
.hvr-table tbody th { background: #fdfbf8; white-space: nowrap; }
.hv-list a { color: #e0530e; font-weight: 600; text-decoration: none; }

@media (max-width: 640px) {
    /* Tables become stacked cards on a phone */
    .hvr-table table, .hvr-table tbody, .hvr-table tr, .hvr-table td, .hvr-table tbody th { display: block; }
    .hvr-table thead { display: none; }
    .hvr-table tr { border: 1px solid #eee4d8; border-radius: 0.6rem; margin-bottom: 0.6rem; overflow: hidden; }
    .hvr-table th, .hvr-table td { border: 0; border-bottom: 1px solid #f5efe8; }
    .hvr-table td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 600; color: #6b6b6b; }
    .hvr { padding: 1rem; }
    .hv-case-assign select { min-width: 0; width: 100%; }
}

/* ── Print page ─────────────────────────────────────────────────────────── */
.hvr-print { margin: 0; padding: 1.5rem; background: #fff; font: 14px/1.5 Inter, 'Noto Sans Tamil', 'Noto Sans Malayalam', system-ui, sans-serif; color: #1f1b18; }
.hvr-print .hvr { max-width: 820px; margin: 0 auto; border: 0; padding: 0; }
.hvr-print-bar { max-width: 820px; margin: 0 auto 1rem; text-align: right; }
.hvr-logo { display: block; height: 56px; width: auto; margin: 0 auto 1rem; }
.hvr-foot { max-width: 820px; margin: 1.5rem auto 0; font-size: 0.75rem; color: #6b6b6b; }
@page { size: A4; margin: 14mm; }
@media print {
    .hvr-print { padding: 0; font-size: 11pt; }
    .hvr-print-bar { display: none; }
    .hvr-print .hvr-table { overflow: visible; }
    .hvr-print .hvr-table table { display: table; }
    .hvr-print .hvr-table thead { display: table-header-group; }
    .hvr-print .hvr-table tbody { display: table-row-group; }
    .hvr-print .hvr-table tr { display: table-row; }
    .hvr-print .hvr-table td, .hvr-print .hvr-table tbody th { display: table-cell; }
    .hvr-print .hvr-table td::before { content: none; }
    .hvr-table tr { break-inside: avoid; }
    .hvr-urgent { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.hvr-pdf { display: inline-block; padding: 0.6rem 0.8rem; border: 1px solid #eee4d8; border-radius: 0.6rem; background: #fdfbf8; font-size: 0.85rem; }
