/* Cliqodoc web panel – साधं, स्वच्छ, मोबाईल + डेस्कटॉप */
:root {
  --bg: #f4f7f8;
  --card: #fff;
  --ink: #1b2a2f;
  --muted: #5d6f75;
  --line: #dde5e8;
  --brand: #0f766e;
  --brand-2: #115e59;
  --brand-soft: #e6f4f2;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --info: #175cd3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  font-family: 'Noto Sans Devanagari', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0 0 0.6em; line-height: 1.25; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; color: var(--muted); }
.boot { padding: 2rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); }
.empty { color: var(--muted); padding: 1rem 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 0.8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

/* buttons & inputs */
button, .btn {
  font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer; min-height: 38px;
}
button:hover { border-color: #b9c7cc; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--brand-2); }
button.danger { background: #fff; border-color: #f4b8b2; color: var(--danger); }
button.small { padding: 0.25rem 0.55rem; min-height: 30px; font-size: 0.85rem; }
button.big { font-size: 1.15rem; padding: 0.8rem 1.4rem; }
button.wide { width: 100%; }
button.icon { border: none; background: transparent; font-size: 1.2rem; padding: 0.3rem 0.5rem; }
input, select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.6rem;
  background: #fff; color: var(--ink); width: 100%; min-height: 38px;
}
input[type='checkbox'], input[type='radio'] { width: auto; min-height: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid #5eead4; outline-offset: 1px; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.7rem 0.9rem; }
.form-grid .full, .form-grid h4 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.field > span { color: var(--muted); }
.field.check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 0.5rem; }

/* layout */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #e6f4f2, #f4f7f8 60%); }
.login-card { background: #fff; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); width: min(420px, 100%); display: flex; flex-direction: column; gap: 0.9rem; }
.login-card .form-grid { grid-template-columns: 1fr; }
.brand-big { width: 56px; height: 56px; border-radius: 14px; background: var(--brand); color: #fff; font-size: 2rem; display: grid; place-items: center; }
.shell { display: grid; grid-template-columns: 230px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 1rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .brand { font-weight: 700; color: var(--brand); }
.top .who { color: var(--muted); font-size: 0.9rem; }
.top select.lang { width: auto; }
.menu-btn { display: none; }
.net { font-size: 0.85rem; color: var(--warn); }
.net.off { background: #fef0c7; padding: 0.2rem 0.5rem; border-radius: 6px; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 0.6rem; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; gap: 0.6rem; align-items: center; padding: 0.55rem 0.7rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.side a:hover { background: var(--bg); }
.side a.active { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.side .ic { width: 1.4rem; text-align: center; }
.content { padding: 1.2rem; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card h3 { display: flex; align-items: center; gap: 0.5rem; }
.page-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h2 { margin: 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; }
.stat b { display: block; font-size: 1.6rem; color: var(--brand-2); }
.stat span { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-block; }
  .side { display: none; position: fixed; top: 52px; left: 0; bottom: 0; width: 250px; z-index: 30; box-shadow: var(--shadow); overflow: auto; }
  .shell.nav-open .side { display: flex; }
  .top .who { display: none; }
  .content { padding: 0.8rem; }
}

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.82rem; color: var(--muted); font-weight: 600; background: #fafcfc; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7fbfb; }
@media (max-width: 640px) {
  table thead { display: none; }
  table tr { display: block; border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
  table td { display: flex; gap: 0.6rem; border: none; padding: 0.2rem 0.4rem; }
  table td::before { content: attr(data-label); color: var(--muted); min-width: 40%; font-size: 0.82rem; }
}

/* badges */
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; background: #eef2f3; color: var(--muted); white-space: nowrap; }
.badge.ok, .st-done, .st-approved, .st-final, .st-paid, .st-available, .st-completed, .st-settled, .st-sent, .st-delivered, .st-read { background: #dcfae6; color: var(--ok); }
.badge.warn, .st-waiting, .st-ordered, .st-partial, .st-discharge_advised, .st-break, .st-late, .st-scheduled, .st-submitted, .st-query, .st-queued, .st-reserved, .st-cleaning { background: #fef0c7; color: var(--warn); }
.badge.danger, .st-cancelled, .st-skipped, .st-unpaid, .st-leave, .st-occupied, .st-rejected, .st-failed, .st-maintenance { background: #fee4e2; color: var(--danger); }
.badge.info, .st-in_consult, .st-collected, .st-resulted, .st-performed, .st-reported, .st-admitted, .st-in_progress, .st-approved_partial, .st-partially_approved { background: #d1e9ff; color: var(--info); }
.badge.ojas { background: #0f766e; color: #fff; }

/* tabs */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; white-space: nowrap; }
.tabs button.active { border-bottom-color: var(--brand); color: var(--brand-2); font-weight: 600; }

/* toast & modal */
#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 100; max-width: min(460px, 92vw); }
.toast { background: #1b2a2f; color: #fff; padding: 0.7rem 1rem; border-radius: 8px; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warn); }
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: grid; place-items: center; z-index: 90; padding: 1rem; }
.modal { background: #fff; border-radius: 14px; width: min(760px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1rem 0.3rem; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 0.5rem 1rem; overflow: auto; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0.8rem 1rem; border-top: 1px solid var(--line); }

/* patient picker / autocomplete */
.picker { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 40; max-height: 360px; overflow: auto; }
.suggest:empty { display: none; }
.suggest-item { display: block; width: 100%; text-align: left; border: none; border-bottom: 1px solid var(--line); border-radius: 0; }
.suggest-item:hover, .suggest-item.hl { background: var(--brand-soft); }
.suggest-empty { padding: 0.6rem; color: var(--muted); }

/* queue */
.now-serving { display: flex; align-items: center; gap: 1rem; background: var(--brand-soft); border: 1px solid #b5e0da; border-radius: 12px; padding: 1rem; }
.now-serving .num { font-size: 2.6rem; font-weight: 800; color: var(--brand-2); min-width: 4rem; text-align: center; }
.token-list { display: flex; flex-direction: column; gap: 0.4rem; }
.token-row { display: flex; align-items: center; gap: 0.7rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem; }
.token-row .num { font-weight: 700; font-size: 1.2rem; min-width: 2.5rem; }
.token-row.emergency { border-color: #f4b8b2; background: #fff6f5; }

/* prescription */
.rx-lines { display: flex; flex-direction: column; gap: 0.5rem; }
.rx-line { display: grid; grid-template-columns: 2.2fr 0.8fr 1fr 1.1fr 0.7fr 1.4fr auto; gap: 0.4rem; align-items: center; background: #fafcfc; border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem; }
.rx-line .name { font-weight: 600; }
@media (max-width: 900px) { .rx-line { grid-template-columns: 1fr 1fr; } .rx-line .name { grid-column: 1 / -1; } }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; background: #fff; font-size: 0.85rem; cursor: pointer; min-height: 0; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.alert { border-radius: 8px; padding: 0.6rem 0.8rem; background: #fef0c7; color: #7a2e0e; }
.alert.danger { background: #fee4e2; color: var(--danger); }
.alert.info { background: #d1e9ff; color: #194185; }

/* bed board */
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.bed { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem; background: #fff; cursor: pointer; min-height: 88px; }
.bed.available { border-left: 5px solid var(--ok); }
.bed.occupied { border-left: 5px solid var(--danger); }
.bed.cleaning, .bed.reserved { border-left: 5px solid var(--warn); }
.bed.maintenance { border-left: 5px solid #98a2b3; opacity: 0.8; }
.bed b { display: block; }

/* ads banner (डॉक्टर पॅनल) */
.ads { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #fff; margin-bottom: 1rem; height: 92px; }
.ads .slide { position: absolute; inset: 0; display: flex; align-items: center; gap: 1rem; padding: 0.5rem 1rem; transition: transform 0.6s ease; text-decoration: none; color: var(--ink); }
.ads img { height: 76px; width: auto; max-width: 40%; object-fit: contain; border-radius: 6px; }
.ads .tag { position: absolute; top: 4px; right: 8px; font-size: 0.7rem; color: var(--muted); }

/* misc */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.pill-tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.report-box { white-space: pre-wrap; font-family: inherit; }
.thumbs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.thumbs img { height: 90px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
.flag-H, .flag-HH, .flag-CRIT_H { color: var(--danger); font-weight: 700; }
.flag-L, .flag-LL, .flag-CRIT_L { color: var(--info); font-weight: 700; }
.video-frame { width: 100%; height: 70vh; border: 0; border-radius: 10px; background: #000; }
@media print { .top, .side, .no-print { display: none !important; } .shell { display: block; } }

/* screens भाग २ */
a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: 0.3rem; }
a.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
a.btn.big { font-size: 1.1rem; padding: 0.7rem 1.2rem; }
.row > input, .row > select { width: auto; max-width: 100%; }
.row.end { justify-content: flex-end; }
details > summary { cursor: pointer; padding: 0.25rem 0; }
.card .card { box-shadow: none; }
.thumbs img { cursor: zoom-in; }
.page-head > input, .page-head > select { width: auto; }
.page-head { flex-wrap: wrap; }
.row > .picker, .page-head > div { min-width: 0; }
