:root {
  /* Palet tosca Kemenkes — selaras dengan perawatku.app */
  --bg: #f2f8f6;
  --card: #ffffff;
  --ink: #0e2e2b;
  --muted: #5e7a76;
  --line: #e7efec;
  --brand: #047d78;         /* tosca-deep (utama) */
  --brand-2: #0db0a9;       /* tosca */
  --brand-dark: #035c58;
  --mint: #2fa96f;          /* hijau aksen */
  --mint-deep: #1b8c57;
  --accent: #047d78;        /* CTA tosca */
  --accent-dark: #035c58;
  --tile-1: #edf8f1;        /* petak ikon: gradasi mint lembut */
  --tile-2: #cae9d6;
  --ok: #16a34a;
  --ok-bg: #e4f6ea;
  --busy: #dc2626;
  --busy-bg: #fbe7e7;
  --warn: #d97706;
  --radius: 20px;
  --radius-sm: 14px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(15,42,58,.05), 0 12px 30px -18px rgba(15,42,58,.28);
  --shadow-lg: 0 18px 44px -22px rgba(4,125,120,.42);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
a { color: var(--brand); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header (app bar) ---------- */
header.topbar {
  background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 12px rgba(7,112,205,.25);
}
.topbar .container { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; }
@media (max-width: 560px) { .nav-name { display: none; } }
.brand { font-weight: 800; font-size: 21px; letter-spacing: -.4px; display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: #fff; color: var(--brand);
  display: grid; place-items: center; font-size: 15px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav .badge.role { background: rgba(255,255,255,.2); color: #fff; }
.nav > span { color: #fff; }
.topbar .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.topbar .btn:hover { background: rgba(255,255,255,.25); }
.topbar .btn.primary { background: #fff; color: var(--brand); border-color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  padding: 11px 18px; border-radius: var(--pill); font-weight: 700; font-size: 14px;
  text-decoration: none; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c6d2e4; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.cta { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 18px -6px rgba(4,125,120,.5); }
.btn.cta:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.danger { color: var(--busy); border-color: #f2c9c6; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero + search ---------- */
.hero {
  background: linear-gradient(150deg, #0db0a9 0%, #047d78 100%);
  color: #fff; padding: 34px 0 92px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -40px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); border-radius: 50%;
}
.hero h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.6px; }
.hero p { margin: 0; opacity: .92; max-width: 640px; }

/* segmented control (jenis) */
.segment { display: inline-flex; background: rgba(255,255,255,.18); border-radius: var(--pill); padding: 4px; margin: 18px 0 0; gap: 4px; }
.segment button { border: none; background: none; color: #fff; font: inherit; font-weight: 700; padding: 9px 20px; border-radius: var(--pill); cursor: pointer; display: flex; align-items: center; gap: 7px; }
.segment button.active { background: #fff; color: var(--brand); }

/* search card floating */
.search-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 16px; margin-top: -66px; position: relative; z-index: 5;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 12px; align-items: end;
}
.search-card .field { min-width: 0; }
.search-card label { margin: 0 0 5px; color: var(--muted); }
.search-card .btn { height: 46px; }
@media (max-width: 760px) { .search-card { grid-template-columns: 1fr 1fr; } .search-card .field.full, .search-card .btn { grid-column: 1 / -1; } }

/* ---------- Cards / layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 26px 0 12px; font-weight: 800; }

/* ---------- Grid layanan (ala "Layanan Kami" perawatku) ---------- */
.services-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 0 14px; flex-wrap: wrap; }
.services-head h2 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.services-head .count { color: var(--muted); font-weight: 600; font-size: 14px; }

.services-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 620px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }

.svc {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 8px 12px; text-align: center; cursor: pointer; transition: .15s;
}
.svc:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #cfe4dd; }
.svc[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.svc[aria-disabled="true"]:hover { box-shadow: none; transform: none; border-color: var(--line); }
.svc .tile {
  width: 60px; height: 60px; margin: 4px auto 10px; border-radius: 16px;
  background: linear-gradient(160deg, var(--tile-1), var(--tile-2));
  display: grid; place-items: center; color: var(--brand);
  box-shadow: inset 0 -3px 6px rgba(4,125,120,.08);
}
.svc .tile svg { width: 26px; height: 26px; }
.svc h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.svc .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.badge-top {
  position: absolute; top: 8px; left: 8px; color: #fff; background: var(--mint-deep);
  font-size: 9px; font-weight: 800; letter-spacing: .3px; padding: 3px 7px;
  border-radius: var(--pill); text-transform: uppercase; box-shadow: 0 2px 6px rgba(27,140,87,.3);
}
.badge-top.busy { background: #9aa4b2; box-shadow: none; }
.stock-bar { height: 5px; background: #eef3f1; border-radius: 6px; overflow: hidden; margin: 8px auto 0; max-width: 90px; }
.stock-bar > span { display: block; height: 100%; background: var(--ok); }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(7,112,205,.15); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Chips / badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: var(--pill); font-size: 12px; font-weight: 800; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.busy { background: var(--busy-bg); color: var(--busy); }
.badge.pending { background: #fff4e0; color: var(--warn); }
.badge.muted { background: #eef1f6; color: var(--muted); }
.badge.role { background: #e6f1fd; color: var(--brand-dark); text-transform: capitalize; }
.badge.solid { background: rgba(255,255,255,.92); color: var(--ok); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.badge.solid.busy { color: var(--busy); }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); font-size: 14px; }
.slot.free { background: var(--ok-bg); border-color: #cfeada; }
.slot.taken { background: var(--busy-bg); border-color: #f4d2ce; }
.slot .time { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 108px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
code { background: #eef2f8; padding: 2px 6px; border-radius: 6px; font-size: 12px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(12,25,45,.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); max-width: 480px; width: 100%; padding: 24px; box-shadow: var(--shadow-lg); max-height: 92vh; overflow: auto; }
.modal h2 { margin: 0 0 4px; font-size: 20px; }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: 90vw; }
.toast { background: #12253f; color: #fff; padding: 13px 20px; border-radius: var(--pill); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(10px); transition: .25s; text-align: center; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--busy); }
.toast.ok { background: var(--ok); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 11px 18px; cursor: pointer; border: none; background: none; font: inherit; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 44px 0; }
.auth-hero { background: linear-gradient(150deg, #0db0a9, #047d78); padding: 40px 0 80px; color: #fff; }
.auth-wrap { max-width: 420px; margin: -60px auto 40px; }
/* Area cetak (hanya tampil saat print) */
#printArea { display: none; }
#printArea h1 { font-size: 18px; margin: 0 0 2px; }
#printArea .print-sub { color: #555; font-size: 12px; margin-bottom: 14px; }
#printArea table { width: 100%; border-collapse: collapse; font-size: 11px; }
#printArea th, #printArea td { border: 1px solid #999; padding: 5px 7px; text-align: left; }
#printArea th { background: #e7f5ed; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  @page { margin: 14mm; }
}

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pill { padding: 5px 12px; border-radius: var(--pill); background: #eef4f1; font-size: 12px; font-weight: 700; color: #3f5b56; }

/* Kartu terpilih (masuk keranjang) */
.svc.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-2) inset, var(--shadow); }
.svc .check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(4,125,120,.35); }

/* Ruang untuk bilah keranjang */
main.container { padding-bottom: 92px; }

/* Bilah keranjang mengambang */
#cartBar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 24px -12px rgba(15,42,58,.3); padding: 12px 0; }
.cart-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-info { font-weight: 700; font-size: 14px; }
.cart-info #cartCount { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--pill); background: var(--brand); color: #fff; margin-right: 4px; }
.cart-when { color: var(--muted); font-weight: 600; font-size: 13px; }

/* Checkout */
.co-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.co-line b { font-size: 14px; }
.co-line .meta { color: var(--muted); font-size: 12px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty > span { min-width: 20px; text-align: center; font-weight: 800; }

/* ---------- OSCE ---------- */
.needs-box { background: var(--tile-1); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; margin: 14px 0; }
.si-meta { font-weight: 700; margin-bottom: 6px; }
.si-block { margin-top: 6px; line-height: 1.5; }
.si-more { margin-top: 8px; }
.si-more summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); }

/* Rubrik kompetensi berbobot */
.rubric-comp { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 15px; }
.rc-nilai { color: var(--brand); font-weight: 700; font-size: 13px; }
.rc-levels { display: grid; gap: 6px; }
.rc-level { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; font: inherit; }
.rc-level:hover { border-color: var(--brand-2); background: var(--tile-1); }
.rc-level.sel { border-color: var(--brand); background: var(--tile-1); box-shadow: 0 0 0 1px var(--brand) inset; }
.rc-score { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--tile-2); color: var(--brand-dark); font-weight: 800; display: grid; place-items: center; }
.rc-level.sel .rc-score { background: var(--brand); color: #fff; }
.rc-desc { font-size: 13px; line-height: 1.45; padding-top: 3px; }
.rc-maxinfo { margin-top: 12px; font-size: 13px; color: var(--muted); }
.rc-maxinfo b { color: var(--ink); }

/* Global performance */
.global-rating { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.global-rating button { flex: 1; min-width: 120px; padding: 9px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.global-rating button:hover { border-color: var(--brand-2); }
.global-rating button.sel { background: var(--brand); border-color: var(--brand); color: #fff; }

.score-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 15px; }
.score-summary b { color: var(--brand); }

/* Editor rubrik (admin) */
.rb-form { margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--line); }
.rb-form-title { font-weight: 800; margin-bottom: 8px; }
.desc-field { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.desc-field .desc-lvl { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; background: var(--tile-2); color: var(--brand-dark); font-weight: 800; display: grid; place-items: center; margin-top: 4px; }

/* Filter & statistik rekap absensi */
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.filter-row > div { flex: 1; min-width: 140px; }
.filter-row label { margin-top: 0; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 90px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--brand); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.ok b { color: var(--ok); }
.stat.bad b { color: var(--busy); }

/* Kartu absensi */
#absenBox { margin-top: 20px; }
.absen-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-left: 4px solid var(--brand); }
.absen-title { font-weight: 800; font-size: 16px; }
.absen-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Kartu order (Peminjaman saya) */
.order-card { margin-bottom: 12px; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-when { color: var(--muted); font-size: 13px; margin: 6px 0 8px; }
.order-items { display: flex; flex-wrap: wrap; gap: 6px; }
