/* ==========================================================================
   OPTIK DHORA — Medical Record & Optical Management System
   Gaya: bersih, medis-optik, profesional. Palet mengikuti logo resmi
   (biru #0a63ae → #2c9bdb, oranye #f7941e).
   ========================================================================== */

:root {
  --blue-900: #0a4d84;
  --blue-700: #0a63ae;
  --blue-500: #1a73c7;
  --blue-300: #7fbfe8;
  --blue-050: #eef5fb;
  --orange-600: #e07f12;
  --orange-500: #f7941e;
  --orange-050: #fff4e6;
  --ink: #1c2434;
  --ink-soft: #3d4a63;
  --muted: #66748f;
  --line: #dfe7f2;
  --bg: #f3f6fb;
  --white: #ffffff;
  --green: #17995f;
  --green-bg: #e8f7f0;
  --red: #d64545;
  --red-bg: #fdecec;
  --amber: #c98213;
  --amber-bg: #fdf5e5;
  --shadow-sm: 0 2px 6px rgba(20, 40, 80, .06);
  --shadow: 0 10px 26px rgba(20, 40, 80, .09);
  --shadow-lg: 0 20px 44px rgba(20, 40, 80, .14);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 254px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
p { margin: 0 0 10px; }
code { background: var(--blue-050); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; color: var(--blue-900); }

/* ------------------------------------------------------------- layout aplikasi */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #0a4d84 0%, #0a63ae 46%, #12588f 100%);
  color: #eaf2fa;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.sidebar-brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand-link { display: block; }
.brand-logo { width: 100%; max-width: 168px; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.brand-meta { margin-top: 10px; display: flex; flex-direction: column; gap: 1px; }
.brand-meta strong { font-size: 13px; letter-spacing: .4px; }
.brand-meta span { font-size: 11px; color: rgba(255,255,255,.72); }
.sidebar-nav { padding: 12px 10px 4px; display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,.55); padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px; color: #e8f1f9; font-size: 13.5px; font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.nav-item.active { background: #fff; color: var(--blue-700); font-weight: 700; box-shadow: var(--shadow-sm); }
.nav-ico { width: 16px; height: 16px; flex: 0 0 16px; background-repeat: no-repeat; background-size: contain; opacity: .95; }
.nav-item.active .nav-ico { opacity: 1; filter: none; }
.nav-badge {
  margin-left: auto; background: var(--orange-500); color: #fff; font-size: 11px;
  border-radius: 999px; padding: 1px 7px; font-weight: 700;
}
.sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,.14); }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(10px);
}
.topbar-title h1 { font-size: 17px; }
.topbar-date { font-size: 12px; color: var(--muted); }
.global-search { position: relative; margin-left: auto; flex: 0 1 420px; }
.global-search input {
  width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 999px;
  font: inherit; background: #f8fafd; color: var(--ink);
}
.global-search input:focus { outline: none; border-color: var(--blue-300); background: #fff; box-shadow: 0 0 0 3px rgba(26,115,199,.12); }
.ic-search {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%;
}
.ic-search::after { content: ""; position: absolute; right: -5px; bottom: -4px; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft);
}
.icon-btn:hover { background: var(--blue-050); }
.ic-bell { width: 16px; height: 16px; border: 2px solid var(--ink-soft); border-radius: 8px 8px 4px 4px; position: relative; }
.ic-bell::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); width: 5px; height: 3px; background: var(--ink-soft); border-radius: 0 0 3px 3px; }
.dot-badge {
  position: absolute; top: -5px; right: -5px; background: var(--orange-500); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center;
}
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 4px 12px 4px 5px; cursor: pointer; font: inherit; color: var(--ink);
}
.user-btn:hover { background: var(--blue-050); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-700), var(--blue-300));
  color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.user-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-info strong { font-size: 13px; }
.user-info small { font-size: 11px; color: var(--muted); }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: none; z-index: 50;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px;
  border: 0; background: transparent; font: inherit; color: var(--ink); cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--blue-050); text-decoration: none; }
.dropdown-danger { color: var(--red) !important; }

.app-content { padding: 22px; flex: 1 1 auto; }
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: #fff;
}
.sidebar-toggle { display: none; }
.bars, .bars::before, .bars::after { display: block; width: 16px; height: 2px; background: var(--ink-soft); content: ""; position: relative; }
.bars::before { top: -5px; } .bars::after { top: 3px; }

/* ------------------------------------------------------------------- kartu */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header h2 { font-size: 20px; }
.page-header p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 22px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 3px; color: inherit;
}
a.stat-card:hover { text-decoration: none; border-color: var(--blue-300); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat-value { font-size: 25px; font-weight: 700; color: var(--blue-900); line-height: 1.2; }
.stat-hint { font-size: 11.5px; color: var(--muted); }
.tone-primary { border-left: 4px solid var(--blue-500); }
.tone-success { border-left: 4px solid var(--green); }
.tone-warning { border-left: 4px solid var(--orange-500); }
.tone-danger { border-left: 4px solid var(--red); }

/* ------------------------------------------------------------------- tabel */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: #f7fafd; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.data tbody tr:hover { background: #fafcff; }
table.data td.right, table.data th.right { text-align: right; }
table.data td.center, table.data th.center { text-align: center; }
table.data td.nowrap { white-space: nowrap; }
table.data td.actions { white-space: nowrap; text-align: right; }
table.data tfoot td { font-weight: 700; background: #f7fafd; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
.subtext { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------------- badge */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.badge-danger { background: var(--red-bg); color: var(--red); }
.badge-info { background: #e9f2fb; color: var(--blue-700); }
.badge-primary { background: #e6f0fa; color: var(--blue-900); }
.badge-muted { background: #f1f3f7; color: var(--muted); }

/* ------------------------------------------------------------------ tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--blue-050); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); border-color: var(--blue-700); color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, var(--blue-700), var(--blue-900)); color: #fff; }
.btn-orange { background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); border-color: var(--orange-600); color: #fff; }
.btn-orange:hover { color: #fff; filter: brightness(1.05); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { color: #fff; filter: brightness(1.06); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-ghost-danger { background: transparent; color: var(--red); border-color: #f2c9c9; }
.btn-ghost-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.inline-form { display: inline; }

/* ------------------------------------------------------------------ form */
.form-grid { display: grid; gap: 16px 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit;
  background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue-300); box-shadow: 0 0 0 3px rgba(26,115,199,.12);
}
.field textarea { resize: vertical; min-height: 74px; }
.field-hint { font-size: 11.5px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--red); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.checkbox-row input[type="checkbox"] { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 18px; margin: 0 0 18px; }
legend { font-weight: 700; font-size: 13px; color: var(--blue-700); padding: 0 8px; text-transform: uppercase; letter-spacing: .6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { min-width: 160px; }
.toolbar .field.grow { flex: 1 1 240px; }
.toolbar-search { flex: 1 1 260px; position: relative; }
.toolbar-search input { width: 100%; }

/* ------------------------------------------------------------- flash & empty */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.flash {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: 13.5px; border: 1px solid transparent; box-shadow: var(--shadow-sm);
}
.flash-success { background: var(--green-bg); color: #106b43; border-color: #bfe6d4; }
.flash-error { background: var(--red-bg); color: #8f2b2b; border-color: #f2c9c9; }
.flash-warning { background: var(--amber-bg); color: #7d5a10; border-color: #f0dcae; }
.flash-info { background: var(--blue-050); color: var(--blue-900); border-color: #cfe2f5; }
.flash-icon { font-weight: 700; }

.empty-state { text-align: center; padding: 34px 18px; }
.empty-ico {
  display: inline-block; width: 44px; height: 44px; border-radius: 50%; background: var(--blue-050);
  border: 1px dashed var(--blue-300); margin-bottom: 12px;
}
.empty-title { font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; }
.empty-hint { color: var(--muted); font-size: 13px; margin: 0; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.page-info { font-size: 12.5px; color: var(--muted); }
.page-links { display: flex; gap: 6px; }
.page-link {
  min-width: 34px; text-align: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--ink-soft); background: #fff;
}
.page-link:hover { background: var(--blue-050); text-decoration: none; }
.page-link.active { background: var(--blue-700); border-color: var(--blue-700); color: #fff; font-weight: 700; }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* -------------------------------------------------------------- detail & tabs */
.detail-grid { display: grid; gap: 14px 20px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.detail-item .value { font-size: 14px; font-weight: 600; word-break: break-word; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 10px 14px; border-radius: 10px 10px 0 0; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border: 1px solid transparent; border-bottom: 0;
}
.tab.active { background: #fff; color: var(--blue-700); border-color: var(--line); margin-bottom: -1px; }
.tab:hover { text-decoration: none; color: var(--blue-700); }

.timeline { list-style: none; margin: 0; padding: 4px 0 0 0; }
.timeline li { position: relative; padding: 0 0 18px 30px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline .dot {
  position: absolute; left: -9px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue-500);
}
.timeline .t-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.timeline .t-title { font-weight: 700; font-size: 13.5px; }
.timeline .t-date { font-size: 12px; color: var(--muted); }
.timeline .t-desc { font-size: 13px; color: var(--ink-soft); }

.kv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kv-table th { text-align: left; width: 40%; padding: 8px 12px 8px 0; color: var(--muted); font-weight: 600; vertical-align: top; }
.kv-table td { padding: 8px 0; vertical-align: top; }

.note { background: var(--blue-050); border: 1px solid #cfe2f5; border-radius: var(--radius-sm); padding: 13px 15px; font-size: 13px; color: var(--blue-900); }
.note-warning { background: var(--amber-bg); border-color: #f0dcae; color: #7d5a10; }
.note-danger { background: var(--red-bg); border-color: #f2c9c9; color: #8f2b2b; }
.note ul { margin: 8px 0 0; padding-left: 20px; }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 28, 48, .48); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 80;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 460px; width: 100%;
  padding: 24px; border: 1px solid var(--line);
}
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal p { color: var(--ink-soft); }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ------------------------------------------------------------------ antrian */
.queue-board { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.queue-col { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.queue-col-head { padding: 12px 16px; font-weight: 700; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.queue-col-head.bpjs { background: linear-gradient(135deg, var(--blue-700), var(--blue-500)); }
.queue-col-head.umum { background: linear-gradient(135deg, var(--orange-600), var(--orange-500)); }
.queue-current { font-size: 40px; font-weight: 800; letter-spacing: 1px; padding: 14px 16px 4px; color: var(--blue-900); }
.queue-meta { padding: 0 16px 12px; font-size: 12.5px; color: var(--muted); }
.queue-next-list { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.queue-chip { background: #f1f5fa; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-weight: 600; font-size: 12.5px; }
.queue-actions { display: flex; gap: 7px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafcff; }

/* ---------------------------------------------------------------- layar TV */
body.tv { background: radial-gradient(circle at 20% 0%, #104a7d 0%, #072b4c 55%, #041a30 100%); color: #fff; overflow: hidden; }
.tv-wrap { min-height: 100vh; display: flex; flex-direction: column; padding: 22px 26px; gap: 18px; }
.tv-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.tv-head img { height: 74px; }
.tv-clock { text-align: right; }
.tv-clock .time { font-size: 42px; font-weight: 800; letter-spacing: 2px; line-height: 1; }
.tv-clock .date { font-size: 15px; color: rgba(255,255,255,.78); }
.tv-body { flex: 1 1 auto; display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
.tv-panel { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); border-radius: 20px; padding: 20px 24px; display: flex; flex-direction: column; }
.tv-panel .p-label { font-size: 17px; letter-spacing: 3px; font-weight: 700; color: #a8d4f7; }
.tv-panel.umum .p-label { color: #ffcf95; }
.tv-panel .p-number { font-size: 112px; font-weight: 800; line-height: 1; letter-spacing: 3px; margin: 10px 0 4px; }
.tv-panel .p-place { font-size: 24px; font-weight: 600; color: #f4f9ff; }
.tv-panel .p-status { font-size: 15px; color: rgba(255,255,255,.7); margin-top: 6px; }
.tv-panel .p-next { margin-top: auto; }
.tv-panel .p-next .lbl { font-size: 13px; letter-spacing: 2px; color: rgba(255,255,255,.6); text-transform: uppercase; }
.tv-panel .p-next .list { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.tv-panel .p-next .chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 8px 16px; font-size: 26px; font-weight: 700; }
.tv-foot { display: flex; gap: 20px; align-items: center; justify-content: space-between; font-size: 14px; color: rgba(255,255,255,.7); }
.tv-recent { display: flex; gap: 12px; flex-wrap: wrap; }
.tv-recent .r { background: rgba(255,255,255,.1); border-radius: 12px; padding: 7px 14px; font-size: 15px; }
.tv-recent .r b { font-size: 19px; }
.tv-sim { position: fixed; top: 16px; right: 16px; background: var(--orange-500); color: #062033; font-weight: 800; padding: 7px 14px; border-radius: 999px; font-size: 13px; letter-spacing: 1px; z-index: 60; }
.tv-idle { text-align: center; margin: auto; opacity: .85; }

/* -------------------------------------------------------------- halaman publik */
.layout-public { background: linear-gradient(160deg, #eef5fb 0%, #f7fbff 45%, #fff6ea 100%); min-height: 100vh; }
.public-shell { max-width: 1020px; margin: 0 auto; padding: 26px 18px 46px; }
.public-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.public-head img { height: 58px; }
.public-head .ph-name { font-size: 19px; font-weight: 800; color: var(--blue-900); letter-spacing: .5px; }
.public-head .ph-legal { font-size: 12px; color: var(--muted); }
.public-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 26px; }
.public-card h2 { font-size: 21px; margin-bottom: 6px; }
.public-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.stepper { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: #f4f7fb; }
.step.active { background: var(--blue-700); color: #fff; font-weight: 600; }
.step.done { background: var(--green-bg); color: var(--green); font-weight: 600; }
.step .n { width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.option-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.option {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; background: #fff;
  display: flex; flex-direction: column; gap: 4px; text-align: left;
}
.option:hover { border-color: var(--blue-300); background: #fafcff; }
.option.selected { border-color: var(--blue-500); background: var(--blue-050); box-shadow: 0 0 0 3px rgba(26,115,199,.10); }
.option strong { font-size: 14px; }
.option span { font-size: 12.5px; color: var(--muted); }
.slot-grid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.slot {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; background: #fff;
  font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.slot.available:hover { border-color: var(--blue-500); background: var(--blue-050); }
.slot.selected { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.slot.full, .slot.past, .slot.closed { background: #f4f6f9; color: #9aa6bb; cursor: not-allowed; text-decoration: line-through; }
.slot small { display: block; font-size: 10.5px; font-weight: 500; }
.public-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }
.booking-result { text-align: center; }
.booking-result .code { font-size: 30px; font-weight: 800; color: var(--blue-900); letter-spacing: 2px; margin: 6px 0; }
.booking-result .qr { margin: 16px 0; }
.booking-result .qr img { width: 190px; height: 190px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 16px 0; }
.detail-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.detail-table td:last-child { text-align: right; font-weight: 600; }

/* ------------------------------------------------------------------ scanner */
.scanner-box { border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
#od-scanner-reader video, #od-scanner-reader canvas { width: 100% !important; border-radius: 12px; }
.scanner-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* ------------------------------------------------------------------- misc */
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.small { font-size: 12.5px; }
.flex { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.money { font-variant-numeric: tabular-nums; }
.section-gap { margin-bottom: 26px; }
.spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--blue-500);
  border-radius: 50%; animation: od-spin .8s linear infinite; display: inline-block;
}
@keyframes od-spin { to { transform: rotate(360deg); } }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------------ responsif */
@media (max-width: 1180px) {
  .tv-panel .p-number { font-size: 84px; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .global-search { flex: 1 1 100%; order: 3; }
  .app-content { padding: 16px 14px; }
  .user-info { display: none; }
  .tv-body { grid-template-columns: 1fr; }
  .tv-panel .p-number { font-size: 66px; }
  .tv-head img { height: 52px; }
  .tv-clock .time { font-size: 30px; }
}
@media (max-width: 620px) {
  .public-card { padding: 18px; }
  .card-body { padding: 14px; }
  .grid { gap: 14px; }
  .stat-value { font-size: 21px; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* ------------------------------------------------------------ ikon sidebar */
.ic-dash { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Crect x='1' y='1' width='6' height='6' rx='1'/%3E%3Crect x='9' y='1' width='6' height='6' rx='1'/%3E%3Crect x='1' y='9' width='6' height='6' rx='1'/%3E%3Crect x='9' y='9' width='6' height='6' rx='1'/%3E%3C/svg%3E"); }
.ic-user { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Ccircle cx='8' cy='5' r='3'/%3E%3Cpath d='M2 15c0-3.3 2.7-6 6-6s6 2.7 6 6z'/%3E%3C/svg%3E"); }
.ic-visit { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Crect x='2' y='2' width='12' height='12' rx='2'/%3E%3Cpath d='M5 8h6M8 5v6' stroke='%230a63ae' stroke-width='1.5'/%3E%3C/svg%3E"); }
.ic-eye { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M8 4C4.5 4 1.8 6.6 1 8c.8 1.4 3.5 4 7 4s6.2-2.6 7-4c-.8-1.4-3.5-4-7-4zm0 6.4A2.4 2.4 0 1 1 8 5.6a2.4 2.4 0 0 1 0 4.8z'/%3E%3C/svg%3E"); }
.ic-rx { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M3 2h7l3 3v9H3z'/%3E%3Cpath d='M5 7h6M5 10h6' stroke='%230a63ae' stroke-width='1.4'/%3E%3C/svg%3E"); }
.ic-cal { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5'/%3E%3Crect x='2' y='3' width='12' height='3' fill='%230a4d84'/%3E%3C/svg%3E"); }
.ic-queue { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Crect x='2' y='3' width='12' height='3' rx='1'/%3E%3Crect x='2' y='8' width='9' height='3' rx='1'/%3E%3Crect x='2' y='13' width='6' height='2' rx='1'/%3E%3C/svg%3E"); }
.ic-tv { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Crect x='1' y='3' width='14' height='9' rx='1.5'/%3E%3Crect x='6' y='13' width='4' height='2'/%3E%3C/svg%3E"); }
.ic-frame { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='1.8'%3E%3Ccircle cx='4.5' cy='9' r='3'/%3E%3Ccircle cx='11.5' cy='9' r='3'/%3E%3Cpath d='M7.5 9h1M1.5 8 4 5m10.5 3L12 5'/%3E%3C/svg%3E"); }
.ic-lens { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='1.8'%3E%3Cellipse cx='9' cy='8' rx='5' ry='3.4'/%3E%3Cpath d='M9 4.6 7 11.4'/%3E%3C/svg%3E"); }
.ic-box { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M8 1 15 5v6l-7 4-7-4V5z'/%3E%3Cpath d='M8 8 15 5M8 8v7M8 8 1 5' stroke='%230a4d84' stroke-width='1.2' fill='none'/%3E%3C/svg%3E"); }
.ic-cart { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M1 2h2l2 8h8l1.5-5H4' stroke='%23ffffff' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='6' cy='13' r='1.4'/%3E%3Ccircle cx='12' cy='13' r='1.4'/%3E%3C/svg%3E"); }
.ic-cash { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Crect x='1' y='4' width='14' height='8' rx='1.5'/%3E%3Ccircle cx='8' cy='8' r='2' fill='%230a63ae'/%3E%3C/svg%3E"); }
.ic-invoice { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M3 1h10v14l-2-1.2L9 15l-2-1.2L5 15l-2-1.2z'/%3E%3Cpath d='M6 5h4M6 8h4' stroke='%230a63ae' stroke-width='1.3'/%3E%3C/svg%3E"); }
.ic-report { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Crect x='2' y='8' width='3' height='6'/%3E%3Crect x='7' y='4' width='3' height='10'/%3E%3Crect x='12' y='6' width='3' height='8'/%3E%3C/svg%3E"); }
.ic-users { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Ccircle cx='5.5' cy='5' r='2.4'/%3E%3Ccircle cx='11' cy='6' r='1.9'/%3E%3Cpath d='M1 14c0-2.6 2-4.6 4.5-4.6S10 11.4 10 14z'/%3E%3Cpath d='M11 13.6c0-1.6.7-2.8 2-3.2 1.6.3 2.5 1.5 2.5 3.2z'/%3E%3C/svg%3E"); }
.ic-shield { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M8 1l6 2v5c0 3.4-2.4 6.2-6 7-3.6-.8-6-3.6-6-7V3z'/%3E%3Cpath d='M5.5 8l1.8 1.8L11 6' stroke='%230a63ae' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); }
.ic-cog { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M8 1l1 1.6 1.9-.3.6 1.8 1.6 1-.8 1.7.8 1.7-1.6 1-.6 1.8-1.9-.3L8 15l-1-1.6-1.9.3-.6-1.8-1.6-1 .8-1.7-.8-1.7 1.6-1 .6-1.8 1.9.3z'/%3E%3Ccircle cx='8' cy='8' r='2.2' fill='%230a63ae'/%3E%3C/svg%3E"); }
.ic-broom { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M9.5 1l1.5 1.5-2 4.5-1.5-1.5z'/%3E%3Cpath d='M6.2 6.8 3 13.5 2 14l.5-1.2 5.2-6.2z'/%3E%3Crect x='2' y='12.6' width='7' height='2.4' rx='1'/%3E%3C/svg%3E"); }
.ic-empty { background-image: none; }

/* ------------------------------------------------------- hasil pencarian */
.picker-results {
  margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; padding: 5px;
}
.picker-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 11px; border-radius: 8px; cursor: pointer; font: inherit;
}
.picker-item:hover { background: var(--blue-050); }
.picker-item strong { font-size: 13.5px; }
.picker-item span { font-size: 12px; color: var(--muted); }
.picker-empty { padding: 12px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------- Kode QR pasien */
.qr-patient { line-height: 0; }
.qr-patient img { width: 150px; height: 150px; display: block; }

/* --------------------------------------------------- layar TV: catatan idle */
.tv-panel .p-idle-note { font-size: 14px; color: rgba(255, 255, 255, .62); margin-top: 10px; }
