:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface2: #f8fafc; --line: #e3e8ef; --text: #1d2733; --muted: #66758a;
  --primary: #1f5f8b; --primary-2: #2a78ad; --primary-soft: #e7f0f8;
  --ok: #1e7d4f; --ok-soft: #e4f4ec; --warn: #9a6400; --warn-soft: #fff4dc; --danger: #b3261e; --danger-soft: #fdeceb;
  --info-soft: #eaf2fb; --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --side: 260px; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Heebo', 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; -webkit-tap-highlight-color: transparent; }
body.noscroll { overflow: hidden; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0; line-height: 1.25; }
h2 { font-size: 1.12rem; margin: 0; }
h3 { font-size: 1rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.pre { white-space: pre-wrap; word-break: break-word; }
.ltr { direction: ltr; text-align: end; }
.danger-text { color: var(--danger); } .ok-text { color: var(--ok); } .warn-text { color: var(--warn); }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); font-size: 1.1rem; }

/* ---------- buttons & inputs ---------- */
.btn { font: inherit; display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .95rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface2); border-color: #cfd7e2; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: .3rem .65rem; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.google { width: 100%; justify-content: center; padding: .8rem; font-size: 1.05rem; background: #fff; border-color: #c9d2de; }
.icon-btn { font: inherit; background: none; border: 0; cursor: pointer; padding: .35rem .5rem; border-radius: 8px; color: var(--muted); font-size: 1.05rem; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-decoration: underline; }
input, select, textarea { font: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid #cfd7e2; border-radius: 9px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 1px; border-color: var(--primary-2); }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
input[type=date], input[type=time], input[type=datetime-local], input[type=email], input[type=tel] { direction: rtl; }
.search { max-width: 380px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #e7f0f8, #f4f6f9 60%); }
.login-card { background: var(--surface); padding: 2rem 1.7rem; border-radius: 18px; box-shadow: 0 10px 40px rgba(31,95,139,.13); width: 100%; max-width: 420px; text-align: center; display: grid; gap: 1rem; justify-items: center; }
.dev-login { display: grid; gap: .5rem; width: 100%; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: #12344d; color: #dfe9f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: .7rem; align-items: center; padding: 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; color: #fff; font-size: 1.05rem; } .brand small { color: #9fb6ca; }
.side nav { display: flex; flex-direction: column; padding: .6rem; gap: 2px; flex: 1; }
.side nav a { color: #cddbe7; padding: .55rem .7rem; border-radius: 9px; display: flex; gap: .6rem; align-items: center; text-decoration: none; font-size: .97rem; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.active { background: #1f5f8b; color: #fff; font-weight: 500; }
.ni { width: 1.5rem; text-align: center; }
.side-foot { padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: end; gap: .5rem; }
.side-foot .me { min-width: 0; } .side-foot b { display: block; color: #fff; } .side-foot small { display: block; color: #9fb6ca; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; }
.side-foot .link { color: #9fd0f5; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.4rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; min-height: 50px; }
.menu-btn { display: none; font-size: 1.35rem; } .top-title { display: none; }
.sync { margin-inline-start: auto; font-size: .82rem; padding: .2rem .6rem; border-radius: 99px; }
.sync.on { color: var(--ok); background: var(--ok-soft); } .sync.off { color: var(--warn); background: var(--warn-soft); }
.content { padding: 1.4rem; max-width: 1280px; width: 100%; margin: 0 auto; display: grid; gap: 1rem; align-content: start; }
.scrim { display: none; }

/* ---------- page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.page-head p { margin: .25rem 0 0; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.hello h1 { font-size: 1.4rem; } .hello p { margin: .1rem 0 0; }
.back { font-size: .92rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: .6rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.card.item { cursor: pointer; display: grid; gap: .3rem; align-content: start; transition: border-color .15s, box-shadow .15s; }
.card.item:hover { border-color: #b9c8d8; box-shadow: 0 3px 10px rgba(16,24,40,.08); }
.card.item p { margin: 0; } .card.item .card-head { margin: 0; }
.card.dim { opacity: .62; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.span2 { grid-column: 1 / -1; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; display: grid; gap: .1rem; box-shadow: var(--shadow); }
.stat small { color: var(--muted); font-size: .84rem; } .stat b { font-size: 1.55rem; color: var(--primary); line-height: 1.3; } .stat span { font-size: .85rem; color: var(--muted); }
.sub { font-size: .95rem; margin: .8rem 0 .35rem; color: #34465a; }
.note { padding: .7rem .9rem; border-radius: 10px; border: 1px solid transparent; }
.note.info { background: var(--info-soft); border-color: #cfe0f2; } .note.warn { background: var(--warn-soft); border-color: #f2dca8; } .note.err { background: var(--danger-soft); border-color: #f3c3bf; color: var(--danger); }
.empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); background: var(--surface2); border: 1px dashed #d5dde7; border-radius: var(--radius); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters select { width: auto; max-width: 220px; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { font: inherit; background: none; border: 0; padding: .55rem .9rem; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 .5rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1.2rem; margin: 0; }
.details dt { font-size: .83rem; color: var(--muted); } .details dd { margin: .1rem 0 0; }
.meta { font-size: .8rem; color: var(--muted); margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.chips li { background: var(--primary-soft); color: #174a6c; padding: .15rem .6rem; border-radius: 99px; font-size: .9rem; }
.chips-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; }

/* badges */
.badge { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: #edf1f5; color: #475569; white-space: nowrap; font-weight: 500; vertical-align: middle; margin-inline-start: .25rem; }
.v-verified { background: var(--ok-soft); color: var(--ok); }
.v-pending { background: var(--info-soft); color: #1d5b91; }
.v-uncertain, .v-missing { background: var(--warn-soft); color: var(--warn); }
.v-conflicting { background: var(--danger-soft); color: var(--danger); }
.s-document { background: #e8eefc; color: #2b4aa0; } .s-doctor { background: #e9f6f2; color: #1b6a55; } .s-family { background: #f6eefc; color: #6c3a95; } .s-ai { background: #fff0e6; color: #a44b0b; }
.l-active { background: var(--ok-soft); color: var(--ok); } .l-completed { background: #edf1f5; } .l-stopped { background: var(--danger-soft); color: var(--danger); }
.r-admin { background: #12344d; color: #fff; } .r-member { background: var(--primary-soft); color: var(--primary); }
.age { font-size: .75rem; border-radius: 99px; padding: 0 .45rem; }
.age.new { background: var(--ok-soft); color: var(--ok); } .age.mid { background: #edf1f5; color: var(--muted); } .age.old { background: var(--warn-soft); color: var(--warn); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.row-item { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .55rem; border-radius: 9px; cursor: pointer; }
.row-item:hover { background: var(--surface2); }
.row-item.col { flex-direction: column; align-items: stretch; }
.ri-line { display: flex; gap: .6rem; }
.ri-icon { width: 1.6rem; text-align: center; flex: none; font-size: 1.05rem; }
.ri-main { flex: 1; min-width: 0; display: grid; }
.ri-main small { color: var(--muted); font-size: .85rem; }
.list.compact .row-item { padding: .35rem .5rem; }
.audit-detail { margin-top: .5rem; display: grid; gap: .5rem; cursor: default; }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { background: var(--surface2); text-align: start; font-weight: 500; color: #475569; padding: .55rem .65rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .5rem .65rem; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.tbl tbody tr { cursor: pointer; } .tbl tbody tr:hover { background: #fafcfe; }
.tbl tr.st-postponed td, .tbl tr.st-cancelled td { color: var(--muted); text-decoration: line-through; text-decoration-color: #c0c8d2; }
.tbl tr.st-planned td { color: #1d5b91; }
.tbl tr.expand { cursor: default; background: var(--surface2); } .tbl tr.expand td { padding: 1rem; text-decoration: none !important; color: var(--text) !important; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 19px; top: 0; bottom: 0; width: 2px; background: #d8e1eb; }
.tl-month { position: relative; font-weight: 700; color: #34465a; padding: .9rem 0 .4rem 0; padding-inline-start: 50px; }
.tl-item { position: relative; display: flex; gap: .8rem; padding: .3rem 0; cursor: pointer; }
.tl-dot { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); border: 2px solid #c6d4e2; display: grid; place-items: center; z-index: 1; font-size: 1.05rem; }
.tl-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .9rem; display: grid; gap: .1rem; box-shadow: var(--shadow); }
.tl-item:hover .tl-body { border-color: #b9c8d8; }
.tl-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.tl-date { font-weight: 700; color: var(--primary); } .tl-type { color: var(--muted); }
.tl-snip { margin: .25rem 0 0; font-size: .92rem; color: #3c4b5c; }
.t-diagnosis .tl-dot { border-color: #b3261e; background: #fdeceb; }
.t-chemo .tl-dot, .t-immuno .tl-dot, .t-other_treatment .tl-dot { border-color: #6c3a95; background: #f6eefc; }
.t-pet_ct .tl-dot, .t-ct .tl-dot, .t-imaging .tl-dot, .t-blood_test .tl-dot { border-color: #1b6a55; background: #e9f6f2; }
.t-hospitalization .tl-dot, .t-er .tl-dot { border-color: #9a6400; background: #fff4dc; }
.t-decision .tl-dot { border-color: #12344d; background: #e7f0f8; }

/* documents */
.dropzone { border: 2px dashed #b9c8d8; border-radius: 14px; padding: 1.3rem; text-align: center; background: var(--surface2); transition: .15s; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone p { margin: .3rem 0; }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.up-item { border: 1px solid var(--line); border-radius: 10px; padding: .6rem; display: grid; gap: .45rem; }
.up-item.s-done { background: var(--ok-soft); } .up-item.s-error { background: var(--danger-soft); }
.up-name { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; word-break: break-all; }
.up-fields { display: grid; grid-template-columns: 2fr 1fr 1fr auto auto; gap: .4rem; align-items: center; }
.doc-group h2 { display: flex; gap: .6rem; align-items: baseline; }
.doc-list { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.doc-row { display: flex; gap: .65rem; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid #eef1f5; }
.doc-row:last-child { border-bottom: 0; }
.doc-row.sel { background: var(--primary-soft); }
.doc-ic { font-size: 1.45rem; }
.doc-main { flex: 1; min-width: 0; display: grid; cursor: pointer; } .doc-main small { font-size: .84rem; }
.doc-actions { display: flex; flex: none; }
.doc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.doc-chip { font: inherit; font-size: .88rem; background: #e8eefc; color: #233f8a; border: 0; border-radius: 8px; padding: .3rem .6rem; cursor: pointer; text-align: start; }
.doc-chip:hover { background: #d9e3fb; } .doc-chip.small { font-size: .8rem; padding: .15rem .45rem; margin: 1px; }
.selbar { position: sticky; top: 56px; z-index: 5; display: flex; gap: .6rem; align-items: center; background: #12344d; color: #fff; padding: .5rem .8rem; border-radius: 10px; }

/* review */
.nav-count { margin-inline-start: auto; background: #e8a33d; color: #1d2733; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 0 .45rem; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.review-item { display: flex; gap: .7rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid #8aa4bd; border-radius: 10px; padding: .7rem .8rem; }
.review-item.v-conflicting { border-inline-start-color: var(--danger); } .review-item.v-uncertain, .review-item.v-missing { border-inline-start-color: var(--warn); }
.review-item.sel { background: var(--primary-soft); }
.review-item p { margin: .2rem 0; }
.review-actions { display: flex; flex-direction: column; gap: .35rem; flex: none; }
@media (max-width: 760px) { .review-item { flex-wrap: wrap; } .review-actions { flex-direction: row; width: 100%; } }

/* calendar */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.task { display: flex; gap: .6rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--primary); border-radius: 10px; padding: .55rem .7rem; }
.task .ri-main { cursor: pointer; } .task.late { border-inline-start-color: var(--danger); }
.task.st-done { border-inline-start-color: var(--ok); opacity: .7; } .task.st-cancelled { border-inline-start-color: #a8b3c0; opacity: .6; }
.task.st-postponed { border-inline-start-color: var(--warn); } .task.st-pending { border-inline-start-color: #8aa4bd; }
.who { margin-inline-end: .6rem; }
.status-sel { width: auto; font-size: .85rem; padding: .3rem .4rem; flex: none; }
.day-group h3 { margin: .8rem 0 .4rem; color: #34465a; } .day-group h3.today { color: var(--primary); }
.nav-arrows { display: flex; gap: .4rem; align-items: center; margin-inline-start: auto; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mh { background: var(--surface2); text-align: center; font-size: .85rem; padding: .35rem; color: var(--muted); }
.mc { background: var(--surface); min-height: 96px; padding: .3rem; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.mc:hover { background: #fafcfe; } .mc.out { background: #f8f9fb; color: #a7b1bd; } .mc.today .mn { background: var(--primary); color: #fff; }
.mn { font-size: .82rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; }
.mt { font-size: .74rem; background: var(--primary-soft); color: #174a6c; border-radius: 4px; padding: 0 .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt.st-done { background: var(--ok-soft); color: var(--ok); } .mt.st-cancelled { text-decoration: line-through; opacity: .6; }
.more { font-size: .72rem; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.day-col { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .5rem; min-width: 0; }
.day-col.today { border-color: var(--primary); } .day-col h3 { font-size: .9rem; margin-bottom: .4rem; display: flex; justify-content: space-between; }
.week .task { flex-direction: column; align-items: stretch; padding: .4rem; }

/* forms & modal */
.modal-back { position: fixed; inset: 0; background: rgba(15,30,45,.45); display: grid; place-items: center; padding: 1rem; z-index: 100; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.modal-body { padding: 1rem 1.2rem; overflow-y: auto; display: grid; gap: .8rem; }
.record-form { display: grid; gap: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; }
.field { display: grid; gap: .25rem; } .field > span { font-size: .88rem; color: #3c4b5c; font-weight: 500; }
.req { color: var(--danger); }
.check { display: flex; gap: .5rem; align-items: center; cursor: pointer; padding: .3rem 0; }
.check.inline { display: inline-flex; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.form-actions.center { justify-content: center; }
.form-actions.sticky { position: sticky; bottom: -1rem; background: var(--surface); padding: .7rem 0; border-top: 1px solid var(--line); margin-bottom: -1rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: 0; }
legend { font-weight: 500; padding: 0 .3rem; }
.drugs { display: grid; gap: .45rem; }
.drug-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: .4rem; }
.summary { background: var(--surface2); padding: .8rem; border-radius: 8px; margin: 0; font-family: inherit; max-height: 260px; overflow: auto; }

/* toasts */
.toasts { position: fixed; bottom: 1rem; inset-inline-start: 50%; transform: translateX(50%); z-index: 200; display: grid; gap: .5rem; width: min(92vw, 460px); }
.toast { background: #12344d; color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: pop .2s ease-out; }
.toast.err { background: var(--danger); } .toast.warn { background: #7a5200; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { position: fixed; inset-inline-start: 0; top: 0; z-index: 60; transform: translateX(100%); transition: transform .2s ease; box-shadow: -10px 0 30px rgba(0,0,0,.25); }
  .menu-open .side { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,30,45,.4); z-index: 50; }
  .menu-btn, .top-title { display: inline-block; }
  .topbar { padding: .45rem .8rem; }
  .content { padding: 1rem .8rem 4rem; }
  h1 { font-size: 1.3rem; }
  .form-grid, .details { grid-template-columns: 1fr; }
  .up-fields { grid-template-columns: 1fr 1fr; }
  .drug-row { grid-template-columns: 1fr 1fr; }
  .filters > * { flex: 1 1 140px; max-width: none !important; }
  .search { max-width: none; }
  .mc { min-height: 60px; } .mt { font-size: 0; height: 6px; padding: 0; } .mt::first-letter { font-size: 0; }
  .modal-back { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 16px 16px 0 0; }
  .doc-actions .icon-btn { padding: .3rem; }
  .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .45rem; }
  .task { flex-wrap: wrap; } .status-sel { margin-inline-start: auto; }
}
@media print {
  .side, .topbar, .actions, .filters, .tabs, .form-actions, .doc-actions, .toasts { display: none !important; }
  body { background: #fff; } .card, .tl-body, .stat { box-shadow: none; }
}
