/* =====================================================================
   "Rose & Ink" — screen design of the site.
   Printed forms (MDFNew.docx, blood-print.html) do not use this file.
   The prescription table (.cf) keeps its original look on purpose.
   ===================================================================== */

/* Noto Sans Georgian, bundled (SIL Open Font License: fonts/NotoSansGeorgian-OFL.txt) */
@font-face { font-family: 'Noto Sans Georgian'; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-sans-georgian-georgian-400-normal.woff2") format('woff2');
  unicode-range: U+0589,U+10A0-10FF,U+1C90-1CBA,U+1CBD-1CBF,U+205A,U+2D00-2D2F,U+2E31; }
@font-face { font-family: 'Noto Sans Georgian'; font-weight: 600; font-display: swap;
  src: url("../fonts/noto-sans-georgian-georgian-600-normal.woff2") format('woff2');
  unicode-range: U+0589,U+10A0-10FF,U+1C90-1CBA,U+1CBD-1CBF,U+205A,U+2D00-2D2F,U+2E31; }
@font-face { font-family: 'Noto Sans Georgian'; font-weight: 700; font-display: swap;
  src: url("../fonts/noto-sans-georgian-georgian-700-normal.woff2") format('woff2');
  unicode-range: U+0589,U+10A0-10FF,U+1C90-1CBA,U+1CBD-1CBF,U+205A,U+2D00-2D2F,U+2E31; }
@font-face { font-family: 'Noto Sans Georgian'; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-sans-georgian-latin-400-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Sans Georgian'; font-weight: 600; font-display: swap;
  src: url("../fonts/noto-sans-georgian-latin-600-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Sans Georgian'; font-weight: 700; font-display: swap;
  src: url("../fonts/noto-sans-georgian-latin-700-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
    --ink: #1B2437;
    --ink-2: #33405A;
    --muted: #5A6478;
    --line: #D5D9E3;
    --line-soft: #ECEEF3;
    --page: #F3F4F8;
    --accent: #B42B5E;
    --accent-dark: #8E1F49;
    --accent-soft: #FCEEF3;
    --accent-line: #F0C4D2;
    --blood: #A61E4D;
    --ok: #1F8A5B;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(27, 36, 55, .06);
}

body {
    font-family: 'Noto Sans Georgian', var(--bs-font-sans-serif);
    color: var(--ink);
    background: var(--page);
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* the prescription table keeps its original font and look */
.cf, .cf input, .cf .ac-menu { font-family: var(--bs-font-sans-serif); }

/* ---------- top navigation ---------- */
.app-nav { background: var(--ink); }
.app-nav .inner {
    max-width: 1360px; margin: 0 auto; padding: 10px 24px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.app-nav .brand { background: #fff; border-radius: 10px; padding: 4px 8px; margin-right: 10px; display: inline-flex; }
.app-nav .brand img { height: 30px; display: block; }
.app-nav .links { display: flex; flex-wrap: wrap; gap: 4px; }
.app-nav .links a {
    color: #C9CFDC; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 14.5px; white-space: nowrap;
}
@media (max-width: 1599px) { .app-nav .user .uname { display: none; } }
/* eight menu links on one line (the menu is at most 1360px wide); full names on hover */
.app-nav .links a { padding: 8px 9px; font-size: 14px; }
.app-nav .nav-long { display: none; }
.app-nav .links a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.app-nav .links a.active { background: var(--accent); color: #fff; }
.app-nav .user {
    margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
    color: #fff; text-decoration: none; font-size: 15px; padding: 4px 10px 4px 4px; border-radius: 999px;
}
.app-nav .user:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.app-nav .user .avatar { border: 2px solid #fff; }
.app-nav .dropdown-menu { border-radius: 12px; border-color: var(--line); box-shadow: 0 12px 30px rgba(27, 36, 55, .15); }

/* ---------- page shell ---------- */
.app-main { max-width: 1360px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-head h1 { margin: 0 auto 0 0; font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-head h1 .count { font-size: 16px; font-weight: 500; color: var(--muted); }
.lead-muted { margin: 0; color: var(--muted); font-size: 15px; }

.x-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px;
}
.x-card > h2 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.x-card > h2 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.x-card > h2 .num {
    width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; color: #fff; background: var(--accent);
}

/* ---------- buttons ---------- */
.x-btn {
    height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
    color: var(--ink); font: inherit; font-size: 15px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.x-btn:hover { border-color: #9AA3B8; color: var(--ink); }
.x-btn svg { flex: none; }
.x-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.x-btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.x-btn.blood { color: var(--blood); border-color: var(--accent-line); }
.x-btn.blood:hover { background: var(--accent-soft); color: var(--blood); }
.x-btn.danger { color: #B42318; }
.x-btn.sm { height: 38px; padding: 0 12px; font-size: 14px; }
.x-btn.lg { height: 50px; padding: 0 24px; font-size: 17px; }
.x-icon { width: 40px; padding: 0; justify-content: center; }

/* ---------- form fields ---------- */
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); min-width: 0; margin: 0; }
.fld .form-control, .fld .form-select, .x-input {
    height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
    font: inherit; font-size: 15px; color: var(--ink); background-color: #fff; min-width: 0; box-shadow: none;
}
.fld .form-control:focus, .fld .form-select:focus, .x-input:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 43, 94, .15); outline: none;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.chip-check {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; color: var(--ink);
    cursor: pointer; user-select: none; margin: 0;
}
.chip-check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.search-box {
    display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; margin: 0;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 43, 94, .12); }
.search-box input { flex: 1 1 auto; border: 0; outline: none; font: inherit; font-size: 17px; color: var(--ink); background: transparent; min-width: 0; }

kbd {
    font-family: inherit; font-size: 12px; background: #EEF0F5; color: var(--ink);
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; box-shadow: none;
}
.hints { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); padding: 0 4px; }

/* ---------- prescription page ---------- */
.toolbar {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.toolbar { gap: 8px; }
.toolbar .x-btn { padding: 0 13px; }
.toolbar .x-btn.x-icon { padding: 0; }
.toolbar .sep { width: 1px; height: 28px; background: #E3E6EE; margin: 0 4px; }
.toolbar .grow { flex: 1 1 auto; }
.toolbar .form-select { height: 42px; border-radius: 10px; border-color: var(--line); width: 210px; font-size: 15px; }
.rx-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 4px; }
.rx-head img { height: 80px; }
.rx-head h1 { margin: 0; font-size: 24px; font-weight: 700; text-align: center; flex: 1 1 auto; }
.rx-head .legal { max-width: 380px; text-align: right; font-size: 13px; line-height: 1.5; color: var(--muted); }
.rx-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .rx-cards { grid-template-columns: minmax(0, 1fr); } }
.rx-table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; margin: 0 12px 24px; }
.rx-table-card .table { margin-bottom: 0; }

/* ---------- lists ---------- */
.x-list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.x-list .row-grid {
    display: grid; grid-template-columns: 40px minmax(160px, 1.2fr) minmax(160px, 1.5fr) 100px 530px;
    gap: 12px; padding: 12px 20px; align-items: center; border-bottom: 1px solid #F0F2F6; min-width: 980px;
}
.x-list .row-grid.head { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom-color: var(--line-soft); }
.x-list .row-grid:last-child { border-bottom: 0; }
.x-list .row-grid:not(.head):hover { background: #FAFBFD; }
.x-list .num { color: #8A93A6; font-size: 14px; }
.x-list .title { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; }
.x-list .title small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.x-list .dx { font-size: 14px; color: var(--ink-2); }
.x-list .date { font-size: 14px; color: var(--muted); }
.x-list .acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; }

.pagination { gap: 6px; justify-content: center; }
.pagination .page-link {
    min-width: 40px; height: 40px; border-radius: 10px !important; border: 1px solid var(--line);
    color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
}
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- analysis ---------- */
.an-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.an-side { flex: 1 1 340px; max-width: 420px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.an-main { flex: 999 1 560px; min-width: 0; }
.seg { display: flex; gap: 4px; background: var(--page); border-radius: 10px; padding: 4px; }
.seg a { flex: 1 1 0; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: var(--muted); text-decoration: none; }
.seg a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(27, 36, 55, .1); }
.an-group { display: flex; flex-direction: column; gap: 6px; text-decoration: none; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.an-group:hover { background: #FAFBFD; color: var(--ink); }
.an-group.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.an-group .top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 600; }
.an-group .sub { font-size: 12px; color: var(--muted); }
.bar { display: block; height: 6px; border-radius: 3px; background: #EEF0F5; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #9AA3B8; }
.an-group.on .bar > span { background: var(--accent); }
.an-scroll { max-height: 640px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.med-row { display: grid; grid-template-columns: 32px minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #F3F4F8; margin: 0; }
.med-row.head { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom-color: var(--line-soft); }
.med-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.freq { display: flex; align-items: center; gap: 10px; }
.freq .bar { flex: 1 1 auto; height: 10px; border-radius: 5px; }
.freq .bar > span.hi { background: var(--ok); }
.freq b { font-size: 14px; min-width: 70px; text-align: right; }
.tpl-make { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }
.tpl-make .x-input { flex: 1 1 220px; border-color: #E7B3C3; height: 42px; }

/* ---------- blood order ---------- */
.bo-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.bo-form { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bo-side { flex: 1 1 380px; max-width: 460px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.bo-preview {
    background: #fff; border-radius: 6px; box-shadow: 0 8px 28px rgba(27, 36, 55, .16);
    aspect-ratio: 210 / 148.5; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.bo-preview .ph { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid var(--ink); padding-bottom: 5px; margin-bottom: 2px; }
.bo-preview .ph img { height: 26px; }
.bo-preview .ph span { font-size: 7px; text-align: right; color: #444; line-height: 1.4; }
.bo-preview .r { display: flex; gap: 10px; }
.bo-preview .pv { display: flex; align-items: flex-end; gap: 4px; font-size: 8.5px; color: #222; min-width: 0; flex: 1 1 0; }
.bo-preview .pv b { flex: 1 1 auto; border-bottom: 1px solid #111; font-weight: 600; font-size: 9.5px; padding: 0 3px; min-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-info { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 14px; border-radius: 999px; background: #E7F1FF; color: #1F4FB5; font-size: 14px; }

/* ---------- messages ---------- */
#flash-messages .alert { border-radius: 12px; border: 0; box-shadow: var(--shadow); }

/* ---------- modals ---------- */
.modal-content { border-radius: 16px; border: 0; }
.modal-header, .modal-footer { border-color: var(--line-soft); }
.modal .btn-primary { background: var(--accent); border-color: var(--accent); }
.modal .btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ---------- login ---------- */
body.login-page { background: var(--page); }
.lg-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; }
.lg-brand {
    flex: 0 1 520px; background: var(--ink); color: #fff; padding: 56px 52px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.lg-logo { background: #fff; border-radius: 16px; padding: 14px 18px; align-self: flex-start; }
.lg-logo img { height: 64px; display: block; }
.lg-claim { display: flex; flex-direction: column; gap: 14px; }
.lg-kicker { font-size: 14px; font-weight: 600; letter-spacing: .06em; color: #F2B8C9; }
.lg-claim h1 { margin: 0; font-size: 38px; line-height: 1.25; font-weight: 700; }
.lg-claim p { margin: 0; font-size: 16px; line-height: 1.6; color: #C9CFDC; max-width: 380px; }
.lg-foot { font-size: 13px; color: #9AA3B8; }
.lg-panel { flex: 1 1 560px; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.lg-box { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 24px; }
.lg-box h2 { margin: 0 0 4px; font-size: 28px; font-weight: 700; }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.person {
    border: 2px solid transparent; background: #fff; border-radius: 20px; padding: 22px 10px 18px;
    display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; font: inherit; color: var(--ink);
    box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.person:hover, .person:focus-visible { transform: translateY(-3px); border-color: #E7B3C3; box-shadow: 0 10px 26px rgba(27, 36, 55, .10); outline: none; }
.person .avatar { border: 4px solid #fff; box-shadow: 0 6px 16px rgba(27, 36, 55, .14); }
.person-name { font-size: 18px; font-weight: 600; }
.lg-pass { max-width: 380px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.chosen-person { text-align: center; }
.chosen-person .avatar { border: 5px solid #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .15); }
.chosen-name { font-size: 24px; font-weight: 700; margin-top: 10px; }
@media (max-width: 700px) {
    .lg-brand { flex-basis: 100%; padding: 28px 24px; }
    .lg-claim h1 { font-size: 26px; }
    .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* print button while the document is being prepared */
.is-busy { cursor: progress !important; opacity: .65; pointer-events: none; }

/* ---------- on-duty doctor's notes ---------- */
.duty-now {
    display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "label label count" "date date count" "hint hint hint";
    gap: 2px 16px; align-items: center; text-decoration: none; color: #fff;
    background: var(--ink); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow);
}
.duty-now:hover { color: #fff; background: #222D44; }
.duty-now-label { grid-area: label; font-size: 13px; font-weight: 600; letter-spacing: .05em; color: #F2B8C9; }
.duty-now-date { grid-area: date; font-size: 28px; font-weight: 700; }
.duty-now-date span { font-size: 16px; font-weight: 500; color: #C9CFDC; margin-left: 6px; }
.duty-now-count { grid-area: count; font-size: 15px; font-weight: 600; background: rgba(255, 255, 255, .1); padding: 8px 14px; border-radius: 999px; }
.duty-now-hint { grid-area: hint; font-size: 13px; color: #9AA3B8; margin-top: 4px; }
.duty-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.duty-tools .seg { flex: 0 0 auto; }
.duty-tools .seg a { white-space: nowrap; padding: 0 14px; }
.duty-search { display: flex; gap: 8px; align-items: center; flex: 1 1 280px; margin: 0; }
.duty-search .search-box { flex: 1 1 auto; }
.duty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.duty-card {
    display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--radius);
    background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
    border: 2px solid transparent; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.duty-card:hover { transform: translateY(-2px); border-color: #E7B3C3; box-shadow: 0 10px 24px rgba(27, 36, 55, .10); color: var(--ink); }
.duty-card.current { border-color: var(--accent); background: var(--accent-soft); }
.dc-day { font-size: 34px; font-weight: 700; line-height: 1.1; }
.dc-month { font-size: 15px; font-weight: 600; }
.dc-week { font-size: 13px; color: var(--muted); }
.dc-count { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.duty-hit { display: flex; gap: 16px; text-decoration: none; color: var(--ink); padding: 10px 8px; border-top: 1px solid #F0F2F6; }
.duty-hit:hover { background: #FAFBFD; color: var(--ink); }
.duty-hit-date { font-weight: 600; white-space: nowrap; color: var(--accent); }
.duty-hit-main { display: flex; flex-direction: column; min-width: 0; }
.duty-hit-main span { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty-badge { font-size: 13px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 999px; padding: 3px 10px; vertical-align: middle; }
.duty-note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.duty-note-title { font-size: 18px; font-weight: 700; color: var(--ink); text-decoration: none; }
.duty-note-title:hover { color: var(--accent); }
.duty-note-meta { font-size: 13px; color: var(--muted); }
.duty-note-preview { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-height: 7.8em; overflow: hidden; overflow-wrap: anywhere; }

.duty-editor-wrap { display: flex; flex-direction: column; gap: 14px; }
.duty-status { font-size: 13px; color: var(--muted); }
.duty-status.unsaved { color: #B54708; font-weight: 600; }
.duty-draft-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #FFF6E5; border: 1px solid #F5D08A; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.duty-draft-alert[hidden] { display: none; }
.duty-paper {
    width: 100%; max-width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff;
    box-shadow: 0 6px 26px rgba(27, 36, 55, .12); border-radius: 4px; padding: 18mm 18mm 22mm;
    display: flex; flex-direction: column;
}
.duty-paper-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 14px; }
.duty-paper-kicker { font-size: 19px; font-weight: 700; }
.duty-paper-date { font-size: 15px; color: var(--ink-2); }
.duty-paper-date span { color: var(--muted); }
.duty-paper-meta { font-size: 12px; color: var(--muted); text-align: right; max-width: 260px; }
.duty-patient {
    width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 8px 2px; font: inherit; font-size: 18px;
    font-weight: 600; color: var(--ink); background: transparent; outline: none; margin-bottom: 8px;
}
.duty-patient:focus { border-bottom-color: var(--accent); }
.duty-patient::placeholder { font-weight: 400; color: #9AA3B8; }
.duty-format { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 0 10px; position: sticky; top: 0; background: #fff; z-index: 2; }
.duty-format button {
    min-width: 36px; height: 34px; border: 1px solid transparent; border-radius: 8px; background: transparent;
    color: var(--ink); font: inherit; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.duty-format button:hover { background: var(--page); border-color: var(--line); }
.duty-format .sep { width: 1px; background: var(--line-soft); margin: 4px 4px; }
.duty-body {
    flex: 1 1 auto; min-height: 180mm; outline: none; font-size: 16px; line-height: 1.65; color: #111;
    overflow-wrap: anywhere; white-space: pre-wrap; cursor: text;
}
.duty-body p, .duty-body div { margin: 0 0 8px; }
.duty-body ul, .duty-body ol { margin: 0 0 8px; padding-left: 26px; }
.duty-body:empty::before { content: attr(data-placeholder); color: #9AA3B8; }
@media (max-width: 700px) { .duty-paper { padding: 20px 16px; min-height: 70vh; } .duty-body { min-height: 50vh; } }

/* =====================================================================
   Patients board ("პაციენტების დაფა") and the duty report
   ===================================================================== */
:root { --icu: #B42B5E; --icu-soft: #FCEEF3; --ward: #2F5DA8; --ward-soft: #EAF1FB; --task: #B54708; --task-soft: #FFF4E5; }
.x-btn.ok { color: var(--ok); border-color: #A9D8C1; }
.x-btn.ok:hover { background: #EAF7F0; color: var(--ok); }

.bd-head h1 { margin-right: 4px; }
.bd-duty { font-size: 14px; color: var(--muted); background: #fff; border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow); }
.bd-duty b { color: var(--ink); }
.bd-filter a { padding: 0 14px; white-space: nowrap; }
.bd-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; flex: 1 1 100%; }

.bd-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .bd-columns { grid-template-columns: minmax(0, 1fr); } }
.bd-col { background: #E9ECF3; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 12px; min-height: 200px; }
.bd-col-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 6px 2px; }
.bd-col-head h2 { margin: 0; font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.bd-col-head h2::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--ward); }
.bd-icu .bd-col-head h2::before { background: var(--icu); }
.bd-n { font-size: 15px; font-weight: 700; color: var(--muted); }
.bd-pill { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.bd-pill.task { background: var(--task-soft); color: var(--task); }
.bd-pill.wait { background: #fff; color: var(--muted); }
.bd-col-add {
    margin-left: auto; width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; text-decoration: none; box-shadow: var(--shadow);
}
.bd-col-add:hover { background: var(--accent); color: #fff; }
.bd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.bd-empty { color: var(--muted); font-size: 15px; padding: 26px 10px; text-align: center; border: 2px dashed #CDD3E0; border-radius: 14px; grid-column: 1 / -1; }

.bd-card {
    background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(27, 36, 55, .08); display: flex; flex-direction: column;
    border-top: 4px solid var(--ward); overflow: hidden; transition: box-shadow .15s ease, transform .15s ease;
}
.bd-icu .bd-card { border-top-color: var(--icu); }
.bd-card:hover { box-shadow: 0 10px 24px rgba(27, 36, 55, .10); }
.bd-card-top { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 8px; text-decoration: none; color: var(--ink); flex-wrap: wrap; }
.bd-card-top:hover { color: var(--ink); background: #FAFBFD; }
.bd-bed {
    flex: none; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 12px; background: var(--ward-soft); color: var(--ward);
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
}
.bd-icu .bd-bed, .unit-icu .bd-bed { background: var(--icu-soft); color: var(--icu); }
.bd-bed.lg { min-width: 60px; height: 60px; font-size: 24px; border-radius: 16px; }
.bd-who { display: flex; flex-direction: column; min-width: 0; flex: 1 1 140px; }
.bd-who b { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.bd-who small { font-size: 13.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.bd-doc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; margin-top: 6px; }
.bd-doc .avatar { border: 0; }
.bd-state { padding: 4px 14px 10px; }
.bd-state p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.bd-state.stale p { color: var(--muted); }
.bd-state-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bd-wait { color: var(--task); font-weight: 600; background: var(--task-soft); border-radius: 6px; padding: 1px 6px; }
.bd-none { color: #8A93A6 !important; font-style: italic; }
.bd-tasks { list-style: none; margin: 0; padding: 8px 12px 8px 10px; background: var(--task-soft); display: flex; flex-direction: column; gap: 6px; }
.bd-tasks li, .side-task { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.bd-tasks li form, .side-task form { flex: none; }
.bd-tasks small, .side-task small { display: block; font-size: 12px; color: var(--muted); }
.bd-check {
    width: 22px; height: 22px; border-radius: 7px; border: 2px solid #D9A36B; background: #fff; padding: 0; cursor: pointer; flex: none;
    display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.bd-check:hover, .bd-check.on { background: var(--ok); border-color: var(--ok); }
.bd-check:hover::after, .bd-check.on::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.bd-card-foot { display: flex; gap: 2px; border-top: 1px solid var(--line-soft); margin-top: auto; }
.bd-card-foot a { flex: 1 1 0; text-align: center; font-size: 13px; padding: 9px 4px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.bd-card-foot a:hover { background: var(--accent-soft); color: var(--accent); }
.bd-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; align-items: center; padding: 0 4px; }
.bd-refresh { margin-left: auto; color: #8A93A6; font-size: 12.5px; }

/* patient page */
.bd-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: #FFF6E5; border: 1px solid #F5D08A; border-radius: 12px; padding: 10px 14px; }
.pt-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 28px; border-left: 6px solid var(--ward); }
.pt-head.unit-icu { border-left-color: var(--icu); }
.pt-id { display: flex; align-items: center; gap: 16px; flex: 1 1 340px; min-width: 0; }
.pt-title h1 { margin: 0; font-size: 26px; font-weight: 700; overflow-wrap: anywhere; }
.pt-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.unit-pill { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--ward-soft); color: var(--ward); white-space: nowrap; }
.unit-pill.icu { background: var(--icu-soft); color: var(--icu); }
.pt-facts { display: flex; gap: 24px; flex-wrap: wrap; }
.pt-facts > div { display: flex; flex-direction: column; gap: 3px; }
.pt-facts span { font-size: 12.5px; color: var(--muted); }
.pt-facts b { font-size: 15px; }
.pt-doc { display: inline-flex; align-items: center; gap: 8px; }
.pt-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.pt-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pt-side { flex: 1 1 300px; max-width: 420px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
@media (max-width: 900px) { .pt-side { max-width: none; position: static; } }

.pt-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 600px) { .pt-kinds { grid-template-columns: minmax(0, 1fr); } }
.kind-opt { position: relative; margin: 0; cursor: pointer; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt > span {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 10px 40px; border: 2px solid var(--line); border-radius: 12px;
    background: #fff; transition: border-color .15s, background .15s; position: relative;
}
.kind-opt > span::before {
    content: ""; position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%;
    border: 2px solid #9AA3B8; background: #fff;
}
.kind-opt b { font-size: 15px; }
.kind-opt small { font-size: 12px; color: var(--muted); }
.kind-opt:hover > span { border-color: #9AA3B8; }
.kind-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(180, 43, 94, .2); }
.kind-opt.k-status input:checked + span { border-color: var(--ward); background: var(--ward-soft); }
.kind-opt.k-status input:checked + span::before { border-color: var(--ward); box-shadow: inset 0 0 0 3px #fff; background: var(--ward); }
.kind-opt.k-task input:checked + span { border-color: var(--task); background: var(--task-soft); }
.kind-opt.k-task input:checked + span::before { border-color: var(--task); box-shadow: inset 0 0 0 3px #fff; background: var(--task); }
.kind-opt.k-comment input:checked + span { border-color: #6B4FA8; background: #F2EEFA; }
.kind-opt.k-comment input:checked + span::before { border-color: #6B4FA8; box-shadow: inset 0 0 0 3px #fff; background: #6B4FA8; }
.pt-write textarea, .tl-edit textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.55;
    color: var(--ink); resize: vertical; min-height: 110px;
}
.pt-write textarea:focus, .tl-edit textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 43, 94, .15); outline: none; }
.pt-write-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.pt-write-foot .hints { padding: 0; }

.tl-day { font-size: 13px; color: var(--muted); padding: 6px 0 0; border-top: 1px solid var(--line-soft); }
.tl-day:first-of-type { border-top: 0; padding-top: 0; }
.tl-day b { color: var(--ink); }
.tl-item { border-left: 4px solid var(--ward); padding: 4px 0 4px 14px; display: flex; flex-direction: column; gap: 4px; scroll-margin-top: 80px; }
.tl-item.k-task { border-left-color: var(--task); }
.tl-item.k-comment { border-left-color: #6B4FA8; }
.tl-item.k-event { border-left-color: #C4CAD6; }
.tl-item.k-event .tl-text { color: var(--muted); font-size: 14px; }
.tl-item:target { background: #FFFBEA; border-radius: 0 8px 8px 0; }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.tl-meta b { color: var(--ink); font-weight: 600; }
.k-badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--ward-soft); color: var(--ward); }
.k-task .k-badge { background: var(--task-soft); color: var(--task); }
.k-comment .k-badge { background: #F2EEFA; color: #6B4FA8; }
.k-event .k-badge { background: #EEF0F5; color: var(--muted); }
.tl-upd { font-style: italic; }
.tl-text { font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.tl-item.done .tl-text { color: var(--muted); }
.tl-task { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tl-ok { color: var(--ok); font-size: 14px; font-weight: 600; }
.tl-link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; cursor: pointer; }
.tl-edit summary { font-size: 13px; color: var(--muted); cursor: pointer; width: max-content; }
.tl-edit summary:hover { color: var(--accent); }
.tl-edit form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 6px; }
.side-task { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.side-task:last-child { border-bottom: 0; }
.side-task.done span:last-child { color: var(--muted); }

/* add / edit patient */
.pf-wrap { max-width: 760px; }
.pf-units { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.unit-opt { margin: 0; cursor: pointer; }
.unit-opt input { position: absolute; opacity: 0; pointer-events: none; }
.unit-opt span { display: flex; align-items: center; justify-content: center; height: 54px; border: 2px solid var(--line); border-radius: 12px; font-size: 17px; font-weight: 600; color: var(--muted); background: #fff; }
.unit-opt:hover span { border-color: #9AA3B8; }
.unit-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(180, 43, 94, .2); }
.unit-opt.icu input:checked + span { border-color: var(--icu); background: var(--icu-soft); color: var(--icu); }
.unit-opt.ward input:checked + span { border-color: var(--ward); background: var(--ward-soft); color: var(--ward); }
.pf-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 14px; }
@media (max-width: 600px) { .pf-row { grid-template-columns: minmax(0, 1fr); } }

/* discharged */
.dc-list { gap: 0; overflow: hidden; }
.dc-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid #F0F2F6; text-decoration: none; color: var(--ink); flex-wrap: wrap; }
.dc-row:last-child { border-bottom: 0; }
.dc-row:hover { background: #FAFBFD; color: var(--ink); }
.dc-main { display: flex; flex-direction: column; flex: 1 1 260px; min-width: 0; }
.dc-main small, .dc-meta small { color: var(--muted); font-size: 13px; display: block; }
.dc-meta { font-size: 14px; text-align: right; }

/* report (screen + print) */
.rp-daylabel { font-size: 15px; padding: 0 6px; }
.rp-paper { background: #fff; border-radius: 6px; box-shadow: 0 8px 28px rgba(27, 36, 55, .14); padding: 34px 40px; max-width: 900px; width: 100%; margin: 0 auto; }
@media (max-width: 700px) { .rp-paper { padding: 20px 16px; } }
.rp { color: #111; font-size: 14px; line-height: 1.5; }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 2px solid #1f2a44; padding-bottom: 10px; margin-bottom: 10px; }
.rp-head img { height: 52px; width: auto; }
.rp-t { text-align: right; }
.rp-t h1 { margin: 0; font-size: 20px; font-weight: 700; }
.rp-t div { font-size: 13.5px; color: #333; }
.rp-sum { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13.5px; color: #333; padding: 6px 0 4px; }
.rp-warn { color: #9A3412; }
.rp-unit { font-size: 16px; font-weight: 700; margin: 18px 0 6px; padding: 5px 10px; border-radius: 6px; background: #EAF1FB; color: #1F3F78; display: flex; gap: 10px; align-items: baseline; break-after: avoid; page-break-after: avoid; }
.rp-unit.icu { background: #FCEEF3; color: #8E1F49; }
.rp-unit span { font-size: 13px; font-weight: 600; opacity: .8; }
.rp-pt { border-bottom: 1px solid #D5D9E3; padding: 8px 2px 10px; break-inside: avoid; page-break-inside: avoid; }
.rp-pt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 15px; margin-bottom: 4px; }
.rp-bed { font-weight: 700; min-width: 30px; padding: 0 6px; border: 1.5px solid #1f2a44; border-radius: 6px; text-align: center; font-size: 13.5px; }
.rp-dx { color: #333; }
.rp-doc { margin-left: auto; font-size: 12.5px; color: #555; }
.rp-ev { font-size: 12.5px; color: #555; font-style: italic; padding-left: 2px; }
.rp-block { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; margin-top: 4px; }
.rp-label { font-size: 12px; font-weight: 700; color: #555; text-transform: none; padding-top: 2px; }
.rp-item { margin: 0 0 3px; overflow-wrap: anywhere; }
.rp-time { font-weight: 600; margin-right: 8px; font-size: 12.5px; color: #333; white-space: nowrap; }
.rp-by { color: #555; font-size: 12.5px; }
.rp-none { color: #777; font-style: italic; }
.rp-task { display: block; }
.rp-box { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border: 1.5px solid #333; border-radius: 3px; margin-right: 7px; font-size: 11px; line-height: 1; vertical-align: -2px; }
.rp-task.done .rp-box { background: #E8F5EE; }
.rp-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-top: 22px; font-size: 13px; color: #333; break-inside: avoid; }
.rp-sign { display: flex; align-items: flex-end; gap: 6px; }
.rp-sign i { display: inline-block; width: 60mm; border-bottom: 1px solid #111; height: 16px; }
.rp-print .rp { font-size: 10.5pt; }
.rp-print .rp-head img { height: 14mm; }
.rp-list { display: flex; flex-direction: column; gap: 10px; }
.rp-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 18px; }
.rp-card-date { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); min-width: 130px; }
.rp-card-date b { font-size: 20px; }
.rp-card-date span { font-size: 13px; color: var(--muted); }
.rp-card-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; flex: 1 1 300px; font-size: 14px; }
.bd-new { display: inline-block; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: 2px; white-space: nowrap; }
.tl-item.is-new { background: #FFF7FA; border-radius: 0 8px 8px 0; }
.rm-wrap { padding-bottom: 0; gap: 8px; }
.rm-wrap:empty { display: none; }
.rm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 10px 8px 16px; border-radius: 12px; font-size: 14.5px; background: #EAF1FB; color: #1F3F78; }
.rm.warn { background: #FFF4E5; color: #8A3B06; font-weight: 600; }
.rm > span { flex: 1 1 300px; }
.rm-x { border: 0; background: none; color: inherit; opacity: .6; font-size: 16px; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.rm-x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.md-group { gap: 4px; padding: 10px 14px; }
.md-opt { display: grid; grid-template-columns: 24px minmax(0, 1.2fr) minmax(0, 1fr) 140px; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 8px; margin: 0; cursor: pointer; }
.md-opt:hover { background: #FAFBFD; }
.md-opt input { width: 18px; height: 18px; accent-color: var(--accent); }
.md-opt:has(input:checked) { background: var(--accent-soft); }
.md-name { font-weight: 600; overflow-wrap: anywhere; }
.md-note, .md-used { font-size: 13.5px; color: var(--muted); }
@media (max-width: 700px) { .md-opt { grid-template-columns: 24px minmax(0, 1fr); } .md-note, .md-used { grid-column: 2; } }
.st-month { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.st-month b { min-width: 150px; text-align: center; }
.st-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .st-tiles { grid-template-columns: minmax(0, 1fr); } }
.st-tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.st-tile span { font-size: 13.5px; color: var(--muted); }
.st-tile b { font-size: 30px; line-height: 1.15; font-weight: 700; }
.st-tile small { font-size: 12.5px; color: var(--muted); }
.st-table th { font-size: 13px; color: var(--muted); font-weight: 600; vertical-align: bottom; }
.st-table th small { font-weight: 400; }
.st-table td { font-size: 15px; }
.st-table td:not(:first-child), .st-table th:not(:first-child) { text-align: right; }

/* =====================================================================
   Informed consent sheets (NIV-300-12/a): list + the sheet itself
   ===================================================================== */
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cs-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; text-decoration: none; color: var(--ink);
    display: flex; flex-direction: column; gap: 6px; border-left: 5px solid var(--accent); transition: transform .15s, box-shadow .15s;
}
.cs-card[hidden] { display: none; }
.cs-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(27, 36, 55, .10); }
.cs-card-name { font-size: 18px; font-weight: 700; line-height: 1.35; }
.cs-card-sub { font-size: 13.5px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-card-meta { font-size: 12.5px; color: #8A93A6; margin-top: auto; }

.cs-tools-wrap { padding-bottom: 0; gap: 8px; }
.cs-name { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1 1 360px; min-width: 0; }
.cs-name span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cs-name .x-input { flex: 1 1 auto; height: 42px; font-weight: 600; }
.cs-mark { background: #FFF6C7; border-radius: 4px; padding: 0 4px; }
.cs-foot { flex-direction: row; flex-wrap: wrap; gap: 10px; padding-top: 0; }

/* the sheet: A4, the same margins as the Word form */
.cs-sheet { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 12px 30px; }
.cs-page {
    width: 210mm; min-height: 297mm; padding: 12.7mm 12.7mm 12.7mm 25.4mm; background: #fff; color: #000;
    box-shadow: 0 6px 24px rgba(27, 36, 55, .14); font-family: Sylfaen, 'Noto Sans Georgian', sans-serif; font-size: 11pt; line-height: 1.16;
}
.cs-page p { margin: 0; }
.cs-page p.j { text-align: justify; }
.cs-empty { height: 1.16em; }
.cs-head { display: flex; justify-content: space-between; gap: 6mm; font-size: 9pt; line-height: 12.8pt; }
.cs-head .r { text-align: right; }
.cs-title { font-size: 11pt; font-weight: 700; text-align: center; margin: 0; line-height: 1.16; }
.cs-page p.cs-sig { margin-bottom: 1.05em; }
.cs-fill { display: inline-block; position: relative; vertical-align: baseline; }
.cs-fill small { position: absolute; left: 0; right: 0; top: 100%; font-size: 8pt; text-align: center; line-height: 1.1; white-space: nowrap; }
.cs-line { display: inline-block; border-bottom: 1px solid #000; height: 1em; vertical-align: baseline; }
.cs-fill .cs-line { width: 100%; }
.cs-input {
    font: inherit; color: #000; border: 0; border-bottom: 1px solid #000; background: #FFF6C7; padding: 0 2mm; width: 100%;
    height: 1.3em; outline: none; border-radius: 0; vertical-align: baseline;
}
.cs-input:focus { background: #FFEB99; }
.cs-date { font-size: 12pt; font-weight: 700; display: flex; align-items: baseline; gap: 1mm; }
.cs-date .cs-input { width: 23mm; padding: 0; font-weight: 700; text-align: left; border-bottom: 0; }
.cs-edit { background: #FFF6C7; outline: none; border-radius: 2px; min-height: 1.16em; cursor: text; }
.cs-edit:focus { background: #FFEB99; box-shadow: 0 0 0 2px #F5D08A; }
.cs-btitle { font-weight: 700; }
.cs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8mm; margin-top: 1.16em; }
.cs-col { white-space: pre-wrap; text-decoration: underline; text-underline-offset: 2px; min-height: 2.4em; }
.cs-block { position: relative; }
.cs-del { position: absolute; right: -2mm; top: -2px; transform: translateX(100%); border: 0; background: none; color: #B42318; font-size: 12px; cursor: pointer; white-space: nowrap; padding: 2px 6px; }
.cs-add { margin-top: 10px; border: 1px dashed #C9A227; background: #FFFBEA; color: #7A5B00; border-radius: 8px; padding: 6px 12px; font: 13px 'Noto Sans Georgian', sans-serif; cursor: pointer; }
@media (max-width: 900px) {
    .cs-page { width: 100%; min-height: 0; padding: 16px; }
    .cs-del { position: static; transform: none; }
}

@media print {
    body.cs-body { background: #fff; }
    body.cs-body #flash-messages, body.cs-body .cs-tools-wrap, body.cs-body .cs-foot { display: none !important; }
    .cs-sheet { display: block; padding: 0; }
    .cs-page { width: auto; min-height: 0; padding: 0; box-shadow: none; }
    .cs-page + .cs-page { break-before: page; page-break-before: always; }
    .cs-input, .cs-edit, .cs-edit:focus, .cs-input:focus { background: none !important; box-shadow: none !important; }
    .cs-input::placeholder { color: transparent; }
    .cs-del, .cs-add { display: none !important; }
    .cs-col:empty { display: none; }
}

/* =====================================================================
   Duty roster ("მორიგეობის განრიგი")
   ===================================================================== */
.rs-month { display: flex; align-items: center; gap: 8px; }
.rs-pick { display: flex; gap: 6px; }
.rs-pick .form-select { height: 42px; border-radius: 10px; border-color: var(--line); font-size: 15px; font-weight: 600; }
.rs-pick select[name=m] { width: 150px; }
.rs-pick select[name=y] { width: 100px; }
.rs-view a { padding: 0 14px; white-space: nowrap; }
.rs-status { border-radius: 12px; padding: 10px 16px; font-size: 14.5px; }
.rs-status.ok { background: #EAF7F0; color: #14603F; }
.rs-status.warn { background: #FFF4E5; color: #8A3B06; }
.rs-warn { color: #B42318; font-weight: 600; }

.rs-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.rs-wd { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.rs-wd.we { color: var(--accent); }
.rs-day {
    position: relative; min-height: 96px; background: #fff; border: 1px solid transparent; border-radius: 12px; box-shadow: var(--shadow);
    padding: 8px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
}
.rs-day:hover { border-color: #9AA3B8; }
.rs-day:focus-visible { outline: 3px solid rgba(180, 43, 94, .35); }
.rs-day.we { background: #FBF6F8; }
.rs-day.hol { background: #FCEEF3; }
.rs-day.today { border: 2px solid var(--accent); }
.rs-day.gap { border: 1.5px dashed #E39A9A; }
.rs-pad { min-height: 96px; }
.rs-wdm { display: none; font-size: 12.5px; color: var(--muted); min-width: 72px; }
.rs-num { font-size: 18px; font-weight: 700; line-height: 1; }
.rs-day.we .rs-num, .rs-day.hol .rs-num { color: var(--accent); }
.rs-hol { font-size: 11px; color: var(--accent); line-height: 1.2; }
.rs-who { font-size: 15px; font-weight: 600; padding: 3px 9px; border-radius: 8px; max-width: 100%; overflow-wrap: anywhere; }
.rs-none { font-size: 12.5px; color: #B42318; font-weight: 600; }
.rs-flags { position: absolute; top: 7px; right: 9px; display: flex; gap: 4px; font-size: 11px; color: var(--muted); }
/* one soft color per doctor */
.c0 { background: #E4EEFB; color: #1F4FB5; } .c1 { background: #FCE7EF; color: #A61E4D; }
.c2 { background: #E6F5EC; color: #1F7A4D; } .c3 { background: #FFF0DB; color: #9A5B00; }
.c4 { background: #EFE8FA; color: #5B3BA8; } .c5 { background: #E3F4F7; color: #146C7A; }
.c6 { background: #F6E9E1; color: #8A4B1F; } .c7 { background: #ECEEF3; color: #33405A; }
.rs-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

.rs-table-wrap { overflow-x: auto; }
.rs-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rs-table th { font-size: 13px; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.rs-table td { padding: 6px 14px; border-bottom: 1px solid #F0F2F6; vertical-align: middle; }
.rs-table td small { display: block; font-size: 12px; color: var(--accent); }
.rs-table tr.we td:first-child, .rs-table tr.we td:nth-child(2) { color: var(--accent); font-weight: 600; }
.rs-table tr.gap td { background: #FFF6F6; }
.rs-table tr.changed td { background: #FFFBEA; }
.rs-table .form-select { height: 38px; max-width: 260px; border-radius: 8px; }
.rs-quick.saved { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(31, 138, 91, .2); }
.rs-flags-cell { color: var(--muted); font-size: 13px; white-space: nowrap; }
.rs-people .form-control, .rs-people .form-select { height: 38px; }
.rs-people .rs-order { width: 70px; } .rs-people .rs-weeks { width: 90px; }
.rs-people input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.rs-people tr.off td { opacity: .55; }

.rs-bottom { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rs-stats { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rs-stats th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line-soft); }
.rs-stats td { padding: 5px 6px; border-bottom: 1px solid #F3F4F8; }
.rs-stats td:not(:first-child), .rs-stats th:not(:first-child) { text-align: right; }
.rs-log { display: flex; flex-direction: column; font-size: 14px; padding: 4px 0; border-bottom: 1px solid #F3F4F8; }
.rs-log small { color: var(--muted); font-size: 12px; }
.rs-gen { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.rs-gen-side { position: sticky; top: 16px; }
@media (max-width: 900px) {
    .rs-bottom, .rs-gen { grid-template-columns: minmax(0, 1fr); }
    .rs-gen-side { position: static; }
}
@media (max-width: 700px) {
    /* phone: the month as a list of days */
    .rs-cal { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .rs-wd, .rs-pad { display: none; }
    .rs-day { min-height: 0; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; }
    .rs-num { min-width: 28px; }
    .rs-wdm { display: inline; }
    .rs-flags { position: static; margin-left: auto; }
    .rs-pick select[name=m] { width: 120px; }
}

/* =====================================================================
   Quote of the day + today panel (prescription page)
   ===================================================================== */
.rx-cards { position: relative; }
.rx-quote {
    grid-column: 1 / -1; order: -1; position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px 28px 18px 70px; display: flex; flex-direction: column; gap: 4px; border-left: 5px solid var(--accent);
}
.rx-quote-mark { position: absolute; left: 18px; top: 2px; font-size: 72px; line-height: 1; color: var(--accent-line); font-family: Georgia, serif; }
.rx-quote-text { margin: 0; font-size: 19px; line-height: 1.55; color: var(--ink); font-style: italic; }
.rx-quote-author { margin: 0; font-size: 15px; font-weight: 600; color: var(--accent); }
.rx-quote-kicker { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
.rx-today { display: none; }

/* wide screens: the side spaces next to the patient data (never taller than it) */
@media (min-width: 1900px) {
    .rx-quote:not(.q-xl), .rx-today {
        position: absolute; top: 0; width: min(320px, calc((100vw - 1360px) / 2 - 16px));
        box-shadow: 0 6px 24px rgba(27, 36, 55, .08);
    }
    .rx-quote:not(.q-xl) {
        right: calc(100% + 16px); bottom: 0; overflow: hidden;
        padding: 22px 22px 18px; border-left: 0; border-top: 5px solid var(--accent); gap: 10px;
    }
    .rx-quote:not(.q-xl) .rx-quote-mark { position: static; font-size: 64px; height: 30px; margin: 0 0 4px; }
    .rx-quote:not(.q-xl) .rx-quote-text { font-size: 19px; line-height: 1.55; }
    .rx-quote.q-m .rx-quote-text { font-size: 17px; line-height: 1.5; }
    .rx-quote.q-l .rx-quote-text { font-size: 15.5px; line-height: 1.5; }
    .rx-quote.q-l .rx-quote-mark { display: none; }
    .rx-quote:not(.q-xl) .rx-quote-author { font-size: 15.5px; }
    .rx-quote:not(.q-xl) .rx-quote-kicker { order: -2; }
    .rx-today {
        display: flex; flex-direction: column; align-items: flex-start; gap: 2px; left: calc(100% + 16px);
        background: #fff; border-radius: var(--radius); padding: 22px 24px; border-top: 5px solid var(--ink);
    }
    .rx-today-kicker { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
    .rx-today-day { font-size: 64px; font-weight: 700; line-height: 1; color: var(--ink); }
    .rx-today-month { font-size: 16px; color: var(--ink-2); }
    .rx-today-sep { width: 40px; height: 2px; background: var(--line); margin: 14px 0 10px; }
    .rx-today-duty { font-size: 22px; font-weight: 700; color: var(--accent); text-decoration: none; }
    .rx-today-duty:hover { color: var(--accent-dark); }
}
@media (max-width: 700px) {
    .rx-quote { padding: 16px 18px 16px 52px; }
    .rx-quote-mark { left: 12px; font-size: 56px; }
    .rx-quote-text { font-size: 17px; }
}
.qt-row { border-bottom: 1px solid #F0F2F6; }
.qt-row:last-child { border-bottom: 0; }
.qt-row summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) 200px; gap: 12px; padding: 10px 18px; cursor: pointer; list-style: none; align-items: baseline; }
.qt-row summary::-webkit-details-marker { display: none; }
.qt-row summary:hover { background: #FAFBFD; }
.qt-row.off summary { opacity: .5; }
.qt-row.now summary { background: var(--accent-soft); }
.qt-n { color: #8A93A6; font-size: 13px; }
.qt-text { font-size: 15px; }
.qt-author { font-size: 13.5px; color: var(--muted); text-align: right; }
.qt-edit { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 14px 70px; }
@media (max-width: 700px) { .qt-row summary { grid-template-columns: 28px minmax(0, 1fr); } .qt-author { grid-column: 2; text-align: left; } .qt-edit { padding-left: 18px; } }
