/* ==========================================================================
   Klinik Sunat — design system (clean medical, putih–biru)
   ========================================================================== */
:root {
  --bg: #f2f6fc;
  --bg-2: #e8f0fa;
  --surface: #ffffff;
  --ink: #0e1c33;
  --ink-soft: #334a68;
  --muted: #6b7f99;
  --line: #e2eaf4;
  --line-strong: #cfdcec;
  --primary: #1b62d4;
  --primary-dark: #1450b4;
  --primary-soft: #e9f1fe;
  --teal: #0d9488;
  --teal-soft: #e4f6f4;
  --green: #0f8a5f;
  --green-soft: #e4f6ee;
  --amber: #b06000;
  --amber-soft: #fdf1df;
  --red: #d92d3f;
  --red-soft: #fdeaec;
  --violet: #6d4ad8;
  --violet-soft: #efeafe;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 39, 74, .05), 0 1px 3px rgba(15, 39, 74, .04);
  --shadow: 0 2px 4px rgba(15, 39, 74, .04), 0 12px 28px -14px rgba(15, 39, 74, .16);
  --shadow-lg: 0 24px 60px -24px rgba(11, 34, 66, .35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -8%, #dfeaff 0%, rgba(223, 234, 255, 0) 60%),
    radial-gradient(900px 480px at 100% 0%, #e6f5f2 0%, rgba(230, 245, 242, 0) 55%),
    var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
::selection { background: #cfe0ff; }

/* --------------------------------- icons --------------------------------- */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------- utils --------------------------------- */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- login page ------------------------------- */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-card {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
}
.login-hero {
  padding: 44px 40px;
  color: #fff;
  background:
    radial-gradient(600px 300px at 90% -10%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(160deg, #175fd4 0%, #1b62d4 45%, #0d7f9e 100%);
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: relative;
}
.login-hero::after {
  content: "";
  position: absolute; inset: auto -60px -80px auto;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255, 255, 255, .18);
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
}
.brand-mark .ic { width: 24px; height: 24px; stroke-width: 2; }
.login-hero h1 { font-size: 27px; line-height: 1.25; }
.login-hero p { color: rgba(255, 255, 255, .82); font-size: 13.5px; }
.hero-points { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.hero-point { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: rgba(255, 255, 255, .92); }
.hero-point .ic { color: #bff0e6; margin-top: 2px; }
.login-form { padding: 44px 40px; display: flex; flex-direction: column; gap: 18px; }
.login-form h2 { font-size: 21px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 11.5px; color: var(--muted); }

@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; }
  .login-hero { padding: 30px 26px; gap: 16px; }
  .hero-points { display: none; }
  .login-form { padding: 28px 24px 34px; }
}

/* -------------------------------- app shell ------------------------------- */
.shell { display: grid; grid-template-columns: 258px 1fr; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 0; }
.side-brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(150deg, #1b62d4, #0d7f9e);
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 8px 18px -8px rgba(27, 98, 212, .8);
}
.side-brand .logo .ic { width: 21px; height: 21px; stroke-width: 2; }
.side-brand b { font-size: 14.5px; display: block; line-height: 1.25; }
.side-brand span { font-size: 11.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #93a6bd; font-weight: 700; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9.5px 12px; border-radius: 11px;
  color: var(--ink-soft); font-size: 13.5px; font-weight: 550;
  position: relative; transition: background .15s, color .15s;
}
.nav a .ic { color: #7d93ad; }
.nav a:hover { background: #f1f6fd; color: var(--primary-dark); }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 650; }
.nav a.active .ic { color: var(--primary); }
.nav a.active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 7px;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--primary-soft); color: var(--primary-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(242, 246, 252, .84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 234, 244, .9);
}
.topbar h1 { font-size: 17px; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft); display: grid; place-items: center;
  cursor: pointer; transition: .15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--primary); }
.menu-toggle { display: none; }

.view { padding: 24px 28px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 268px;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .view { padding: 18px 16px 48px; }
  .topbar { padding: 12px 16px; }
}
.scrim { position: fixed; inset: 0; background: rgba(9, 24, 46, .38); z-index: 25; backdrop-filter: blur(2px); }

/* --------------------------------- cards --------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 12px 0; }

.grid { display: grid; gap: 18px; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1180px) {
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.main-side { grid-template-columns: minmax(0, 1fr); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat .chip {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat .chip.green { background: var(--green-soft); color: var(--green); }
.stat .chip.amber { background: var(--amber-soft); color: var(--amber); }
.stat .chip.teal { background: var(--teal-soft); color: var(--teal); }
.stat .chip.violet { background: var(--violet-soft); color: var(--violet); }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .foot { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat .foot b { color: var(--ink-soft); font-weight: 650; }

/* -------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: #f7fafe; border-color: #b9cbe1; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, #2269dd, #1b5fce);
  border-color: #1b5fce; color: #fff;
  box-shadow: 0 8px 18px -12px rgba(27, 95, 206, .95);
}
.btn-primary:hover { background: linear-gradient(180deg, #1c5fcc, #1450b4); border-color: #1450b4; color: #fff; }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: #0b7f75; border-color: #0b7f75; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary-dark); }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; }
.btn-soft { background: var(--primary-soft); border-color: #cfe0fb; color: var(--primary-dark); }
.btn-soft:hover { background: #dfeafd; border-color: #b9d2f8; }
.btn-danger { color: var(--red); border-color: #f3c8ce; background: #fff; }
.btn-danger:hover { background: var(--red-soft); border-color: #eeb2bb; color: #b71f31; }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.2px; border-radius: 8px; }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* --------------------------------- forms --------------------------------- */
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7f99' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 32px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: #8ab4f0; box-shadow: 0 0 0 3.5px rgba(27, 98, 212, .13);
}
.input::placeholder, .textarea::placeholder { color: #9bacbf; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 140px; }
.toolbar .search { min-width: 210px; }
.seg { display: inline-flex; background: #eef4fc; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg button.active { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* --------------------------------- tables -------------------------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: #7d92ab; font-weight: 700; padding: 11px 16px; background: #f8fbfe;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.table td { padding: 12px 16px; border-bottom: 1px solid #eef3f9; vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: #f9fbfe; }
table.table td .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
table.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.cell-main { font-weight: 600; color: var(--ink); }
.kept { min-width: 92px; }

/* --------------------------------- badges -------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
  background: #eef3f9; color: var(--ink-soft); white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.blue { background: var(--primary-soft); color: #1852b0; }
.badge.green { background: var(--green-soft); color: #0a6f4c; }
.badge.amber { background: var(--amber-soft); color: #92500a; }
.badge.red { background: var(--red-soft); color: #b02436; }
.badge.gray { background: #eef2f7; color: #62748c; }
.badge.teal { background: var(--teal-soft); color: #0a6f68; }
.badge.violet { background: var(--violet-soft); color: #5535b8; }
.badge.plain::before { display: none; }

/* ------------------------------- slot picker ------------------------------ */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot {
  height: 36px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft); font-size: 12.8px; font-weight: 600;
  display: grid; place-items: center; cursor: pointer; transition: .15s;
  font-variant-numeric: tabular-nums;
}
.slot:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(27, 98, 212, .9); }
.slot:disabled { cursor: not-allowed; color: #a9b8ca; background: #f4f7fb; text-decoration: line-through; }
.slot:disabled.filled { text-decoration: none; background: var(--amber-soft); color: #92500a; border-color: #f2ddbd; }
.slot-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.slot-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* ------------------------------- queue cards ------------------------------ */
.queue { display: flex; flex-direction: column; }
.queue-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px; align-items: center; padding: 13px 20px;
  border-bottom: 1px solid #eef3f9;
}
.queue-row:last-child { border-bottom: 0; }
.queue-no {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums;
}
.queue-no.done { background: var(--green-soft); color: var(--green); }
.queue-no.wait { background: #f1f5fa; color: #7a8ea5; }
.queue-time { font-size: 12px; color: var(--muted); }

/* --------------------------------- modal --------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 25, 46, .45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade .16s ease;
}
.modal {
  width: min(680px, 100%);
  max-height: min(90dvh, 900px);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: pop .18s ease;
  border: 1px solid rgba(255, 255, 255, .6);
}
.modal.wide { width: min(920px, 100%); }
.modal.slim { width: min(460px, 100%); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 20px 22px 14px;
}
.modal-head h3 { font-size: 17px; }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 4px 22px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 22px 18px; border-top: 1px solid var(--line);
  background: #fbfdff; border-radius: 0 0 18px 18px; flex-wrap: wrap;
}
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985) } to { opacity: 1; transform: none } }

/* --------------------------------- toasts -------------------------------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 13px; color: var(--ink-soft);
  animation: slide .18s ease;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast b { display: block; color: var(--ink); font-weight: 650; font-size: 13px; }
@keyframes slide { from { opacity: 0; transform: translateX(14px) } to { opacity: 1; transform: none } }

/* -------------------------------- misc bits ------------------------------- */
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 30px; height: 30px; color: #b6c6d9; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 550; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart .bar {
  width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #4f97f0, #1b62d4); min-height: 3px;
  transition: height .3s ease;
}
.chart .bar.empty-bar { background: #e3ecf6; }
.chart .bar-label { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-mini { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.stat-mini .v { font-size: 18px; font-weight: 700; }
.stat-mini .l { font-size: 11.5px; color: var(--muted); }
.list-row { display: flex; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid #eef3f9; font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.loading { display: grid; place-items: center; padding: 46px; color: var(--muted); font-size: 13px; gap: 10px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid #dbe7f5; border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.alert { padding: 12px 14px; border-radius: 11px; font-size: 13px; border: 1px solid; }
.alert.info { background: var(--primary-soft); border-color: #cfe0fb; color: #1a4f9e; }
.alert.warn { background: var(--amber-soft); border-color: #f2ddbd; color: #8a4c08; }
.alert.danger { background: var(--red-soft); border-color: #f6c9cf; color: #a8202f; }
.autocomplete { position: relative; }
.autocomplete-list {
  position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 11px;
  box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; padding: 4px;
}
.autocomplete-list button {
  display: flex; width: 100%; gap: 10px; align-items: center; text-align: left;
  background: transparent; border: 0; padding: 9px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--ink);
}
.autocomplete-list button:hover { background: var(--primary-soft); }
.autocomplete-list .sub { font-size: 11.5px; color: var(--muted); }
.picked {
  display: flex; gap: 12px; align-items: center; padding: 11px 13px;
  border: 1px solid #cfe0fb; background: #f5f9ff; border-radius: 11px;
}
.picked .avatar { background: #fff; }
.print-only { display: none; }


/* --- penyesuaian topbar di layar kecil --- */
@media (max-width: 760px) {
  #today-badge { display: none; }
  .topbar { gap: 10px; padding: 10px 14px; }
  .topbar h1 { font-size: 15.5px; }
  .topbar .sub { display: none; }
  #quick-register { padding: 0; width: 36px; height: 36px; border-radius: 10px; }
  #quick-register .ic { width: 17px; height: 17px; }
  #quick-register { font-size: 0; letter-spacing: 0; }
  .page-head h2 { font-size: 19px; }
  .stat .value { font-size: 23px; }
  .toolbar .input, .toolbar .select, .toolbar .search { width: 100%; min-width: 0; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .queue-row { grid-template-columns: 46px minmax(0, 1fr); padding: 12px 16px; }
  .queue-row > .row:last-child { grid-column: 1 / -1; justify-content: flex-end; }
  .modal-head { padding: 16px 16px 10px; }
  .modal-body { padding: 4px 16px 16px; }
  .modal-foot { padding: 12px 16px 16px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

@media print {
  .sidebar, .topbar, .toasts, .no-print { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .view { padding: 0; }
  body { background: #fff; }
}

/* ============================ kalender bulanan ============================ */
.kal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kal-month { display: flex; align-items: center; gap: 8px; }
.kal-month b { font-size: 14.5px; }
.kal-wrap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.kal-dow {
  text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #8ba0b8; padding: 2px 0 4px;
}
.kal-cell {
  min-height: 92px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 6px 7px; display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
  overflow: hidden; text-align: left;
}
.kal-cell:hover { border-color: #b9d2f8; background: #f8fbff; }
.kal-cell.blank { background: transparent; border-color: transparent; cursor: default; box-shadow: none; }
.kal-cell.past { background: #fbfcfe; }
.kal-cell.off { background: repeating-linear-gradient(135deg, #fbfcfe 0 6px, #f6f9fd 6px 12px); }
.kal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27, 98, 212, .1); background: #f6faff; }
.kal-num { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.kal-cell.today .kal-num { color: var(--primary-dark); }
.kal-cell.past .kal-num { color: #8fa3bb; }
.kal-count {
  font-size: 9.5px; font-weight: 700; border-radius: 999px; padding: 0 5px;
  background: var(--primary-soft); color: var(--primary-dark); line-height: 15px;
}
.kal-ev { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-soft); line-height: 1.25; min-width: 0; }
.kal-ev i { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.kal-ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-more { font-size: 9.8px; color: var(--muted); font-weight: 600; }
.kal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 12px; }
.kal-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: middle; }

/* ============================== whatsapp ================================= */
.btn-wa {
  background: #e9f9f0; border-color: #bfe8d3; color: #0a7a4f;
}
.btn-wa:hover { background: #d9f4e6; border-color: #a4ddc2; color: #075f3d; }
.btn-wa .ic { width: 16px; height: 16px; }
.badge.wa { background: #e9f9f0; color: #0a7a4f; }
.follow-line { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.follow-line .ic { width: 12px; height: 12px; }
.reminder-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px; align-items: center; padding: 11px 20px; border-bottom: 1px solid #eef3f9;
}
.reminder-row:last-child { border-bottom: 0; }
.reminder-row .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 11.5px; }
.tpl-preview {
  white-space: pre-wrap; font-size: 12.8px; line-height: 1.6; color: var(--ink-soft);
  background: #f8fbfe; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px;
  max-height: 220px; overflow-y: auto;
}
.chip-placeholder {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid #cfe0fb;
  background: #f5f9ff; color: var(--primary-dark); border-radius: 999px;
  padding: 2px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: ui-monospace, monospace;
}
.chip-placeholder:hover { background: #e8f1fe; }

@media (max-width: 860px) {
  .kal-wrap { gap: 5px; }
  .kal-cell { min-height: 62px; padding: 5px; }
  .kal-ev { display: none; }
  .kal-more { display: none; }
  .kal-num { font-size: 11.5px; flex-direction: column; gap: 1px; }
  .kal-dow { font-size: 9px; }
  .reminder-row { grid-template-columns: 32px minmax(0, 1fr); padding: 11px 16px; }
  .reminder-row > .row:last-child { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ======================== langganan (sisi klinik) ======================== */
.lock-screen {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(9, 24, 46, .55);
  backdrop-filter: blur(6px) saturate(140%);
  display: grid; place-items: center; padding: 22px;
}
.lock-card {
  width: min(470px, 100%);
  background: #fff; border-radius: 20px; padding: 30px 28px;
  box-shadow: var(--shadow-lg); text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.lock-icon {
  width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 4px;
  background: var(--amber-soft); color: var(--amber);
  display: grid; place-items: center;
}
.lock-icon svg { width: 28px; height: 28px; }
.lock-card h2 { font-size: 19px; }
.lock-detail {
  background: #f8fbfe; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 12.5px; color: var(--ink-soft); text-align: left;
}
.lock-detail .row { justify-content: space-between; }
.lg-banner {
  margin: 16px 28px 0;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(90deg, #fff7e8, #fffdf7);
  border: 1px solid #f2ddbd; color: #8a4c08; font-size: 13px;
}
.lg-banner.danger { background: linear-gradient(90deg, #fdeaec, #fff7f8); border-color: #f6c9cf; color: #a8202f; }
.lg-banner .grow { min-width: 200px; }
.lg-banner b { font-weight: 650; }
.lg-note { font-size: 12px; color: var(--muted); }
.paket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.paket-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px; background: #fff;
}
.paket-card.unggulan { border-color: #b9d2f8; box-shadow: 0 10px 26px -18px rgba(27, 98, 212, .7); background: #f9fcff; }
.paket-card h4 { font-size: 14.5px; }
.paket-harga { font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.paket-per { font-size: 11.5px; color: var(--muted); }
.paket-fitur { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.paket-fitur li { display: flex; gap: 7px; align-items: flex-start; color: var(--ink-soft); }
.paket-fitur .ic { width: 14px; height: 14px; color: var(--green); margin-top: 2px; flex: none; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.timeline-dot { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.timeline-dot i { width: 10px; height: 10px; border-radius: 50%; background: #cfe0fb; flex: none; margin-top: 5px; }
.timeline-dot span { width: 2px; flex: 1; background: var(--line); }
.timeline-item:last-child .timeline-dot span { display: none; }
.timeline-item.done .timeline-dot i { background: var(--primary); }
.timeline-body { padding-bottom: 16px; font-size: 12.5px; }
.timeline-body b { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .lg-banner { margin: 12px 16px 0; }
}

/* ============================ panduan pemakaian =========================== */
.guide-hero { padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.guide-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.guide-hero h3 { font-size: 16px; margin: 8px 0 4px; }
.guide-keys { display: flex; gap: 10px; flex-wrap: wrap; }
.guide-keys > div {
  border: 1px solid var(--line); border-radius: 10px; background: #f8fbfe;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 92px;
}
.guide-keys b { font-size: 12.5px; color: var(--primary-dark); }
.guide-keys span { font-size: 11px; color: var(--muted); }

.guide-flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.guide-flow-item {
  flex: 1 1 140px; min-width: 132px; border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 3px; background: #fbfdff;
}
.guide-flow-ico {
  width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 4px;
}
.guide-flow-item b { font-size: 12.5px; line-height: 1.35; }
.guide-flow-arrow { display: flex; align-items: center; color: #b6c6d9; }
.guide-flow-arrow .ic { width: 15px; height: 15px; }

.guide-card { overflow: hidden; }
.guide-head { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.guide-head h3 { font-size: 14.5px; }
.guide-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--primary-soft); color: var(--primary); display: grid; place-items: center;
}
.guide-ico.sm { width: 26px; height: 26px; border-radius: 8px; background: #f1f6fd; color: #6b8cb5; }
.guide-body { padding: 16px 18px 18px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.guide-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 11px; align-items: start; }
.guide-num {
  width: 24px; height: 24px; border-radius: 8px; background: #eef4fc; color: var(--primary-dark);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 750; flex: none; margin-top: 1px;
}
.guide-steps b { font-size: 13px; font-weight: 650; color: var(--ink); }
.guide-steps p { font-size: 12.7px; color: var(--ink-soft); margin-top: 2px; line-height: 1.55; }
.guide-tips { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; }
.guide-tip {
  display: flex; gap: 8px; font-size: 12.4px; color: #4a5f78;
  background: #f8fbfe; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
.guide-tip .ic { color: var(--primary); margin-top: 2px; flex: none; }
.guide-link { text-decoration: none; color: inherit; }
.guide-link:hover { background: #f7fafe; }
.guide-role td, .guide-role th { font-size: 12.3px; padding: 9px 12px; }
.guide-role .center { text-align: center; }
.ok-mark { color: var(--green); font-weight: 800; }
.no-mark { color: #b6c6d9; }

.guide-acc { border: 1px solid var(--line); border-radius: 11px; background: #fff; margin-bottom: 9px; overflow: hidden; }
.guide-acc summary {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink); list-style: none;
}
.guide-acc summary::-webkit-details-marker { display: none; }
.guide-acc summary > .ic:first-child { color: var(--primary); flex: none; }
.guide-acc summary > span { flex: 1; min-width: 0; }
.guide-acc summary > .ic:last-child { color: #b6c6d9; transition: transform .15s; flex: none; }
.guide-acc[open] summary > .ic:last-child { transform: rotate(90deg); }
.guide-acc[open] summary { background: #f8fbfe; border-bottom: 1px solid var(--line); }
.guide-acc-body { padding: 12px 14px; font-size: 12.8px; color: var(--ink-soft); line-height: 1.6; }

@media (max-width: 760px) {
  .guide-flow-arrow { display: none; }
  .guide-flow-item { flex: 1 1 46%; min-width: 0; }
  .guide-head { padding: 13px 14px; }
  .guide-body { padding: 14px; }
  .guide-hero { padding: 16px; }
  .guide-keys { display: none; }
}

.guide-jump { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.guide-jump-label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8ba0b8; margin-right: 2px;
}
.guide-chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: .15s;
}
.guide-chip:hover { border-color: #b9d2f8; background: var(--primary-soft); color: var(--primary-dark); }
.guide-card { scroll-margin-top: 84px; transition: box-shadow .25s, border-color .25s; }
.guide-card.guide-flash { border-color: #8ab4f0; box-shadow: 0 0 0 4px rgba(27, 98, 212, .12); }
@media (max-width: 760px) {
  .guide-jump { gap: 6px; }
  .guide-chip { padding: 5px 10px; font-size: 12px; }
  .guide-jump-label { width: 100%; }
}

@media print {
  .guide-card, .guide-acc, .card { break-inside: avoid; }
  .guide-jump, .guide-chip { display: none !important; }
  .guide-acc-body { display: block !important; }
  .guide-acc summary { background: #fff !important; }
  .guide-steps p { font-size: 11.5px; }
  .guide-tip { font-size: 11.5px; }
  .page-head .btn, .alert.info { display: none !important; }
}

/* ================== tampilan harian / bulanan / tahunan ================== */
.viewmode { flex: none; }
.kal-head .seg { flex: none; }

.tahun-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.tahun-card {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 12px 13px; cursor: pointer; font-family: inherit; transition: .15s;
}
.tahun-card:hover { border-color: #b9d2f8; background: #f8fbff; }
.tahun-card.now { border-color: var(--primary); background: #f6faff; box-shadow: 0 0 0 3px rgba(27, 98, 212, .1); }
.tahun-card.lewat { background: #fbfcfe; }
.tahun-card .b { font-size: 12px; font-weight: 700; color: var(--ink-soft); letter-spacing: .01em; }
.tahun-card .n { font-size: 21px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
.tahun-card.lewat .n { color: #7d93ad; }
.tahun-card .s { font-size: 10.8px; color: var(--muted); line-height: 1.35; }
.tahun-bar { display: block; height: 5px; border-radius: 3px; background: #e8eef7; overflow: hidden; margin: 2px 0; }
.tahun-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #4f97f0, #1b62d4); }
.tahun-mini-bar { display: block; width: 74px; height: 6px; border-radius: 3px; background: #eef3f9; overflow: hidden; flex: none; }
.tahun-mini-bar i { display: block; height: 100%; border-radius: 3px; }

.kal-cell.jkal { min-height: 74px; }
.kal-cell.jkal .kal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.kal-cell.jkal .kal-dots i { width: 7px; height: 7px; border-radius: 2px; }

.th-btn {
  border: 0; background: transparent; font-family: inherit; cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 2px 4px; border-radius: 5px;
  letter-spacing: .03em; text-transform: uppercase;
}
.th-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }
.th-btn.now { background: var(--primary); color: #fff; }
.jtable td, .jtable th { font-size: 12.5px; padding: 10px 12px; }
.jtable .center { text-align: center; }
.jtable tfoot .jtable-total td { border-top: 2px solid var(--line); background: #f8fbfe; font-weight: 700; }

@media (max-width: 860px) {
  .tahun-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; }
  .tahun-card { padding: 10px; }
  .tahun-card .n { font-size: 18px; }
  .kal-cell.jkal { min-height: 56px; }
  .kal-cell.jkal .kal-dots { display: none; }
  .tahun-mini-bar { width: 46px; }
}

/* =============================== unduh laporan ============================ */
.unduh-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  text-decoration: none; color: inherit; transition: .15s;
}
.unduh-item:hover { border-color: #b9d2f8; background: #f8fbff; }
.unduh-item b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; }
.unduh-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--primary-soft); color: var(--primary); display: grid; place-items: center;
}
/* grafik dengan banyak titik (laporan bulanan/tahunan) dapat digeser */
.chart.scrollable { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.chart.scrollable .bar-wrap { min-width: 18px; }
.chart.scrollable::-webkit-scrollbar { height: 6px; }
.chart.scrollable::-webkit-scrollbar-thumb { background: #cfdcec; border-radius: 3px; }

@media (max-width: 620px) {
  .page-head { align-items: flex-start; }
  .page-head > .row { width: 100%; max-width: 100%; }
  .page-head .seg[data-lap-periode] { width: 100%; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .page-head .seg[data-lap-periode] button { flex: 1 0 auto; }
  .card-pad .row.wrap { gap: 8px !important; }
  .card-pad .row.wrap .input { max-width: 100%; }
}
