/* ========== komponen — gaya minimal & lapang ========== */

/* ---------- panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
}
.panel + .panel { margin-top: var(--s4); }

/* Judul panel sengaja huruf biasa, bukan KAPITAL RENGGANG — lebih tenang dibaca. */
.panel-title { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: var(--s4); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.panel-head .panel-title { margin: 0; }
.hint { font-size: 13px; color: var(--muted); margin: calc(var(--s3) * -1) 0 var(--s4); line-height: 1.55; }
.empty { color: var(--muted); text-align: center; padding: var(--s7) var(--s4); font-size: 13.5px; }

/* nomor kecil di sebelah judul panel */
.pill-count {
  font-size: 12px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: var(--r-full);
  font-variant-numeric: tabular-nums;
}

/* ---------- tombol ---------- */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--r-sm);
  padding: 8px 13px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); }

.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-ghost:not(:disabled):hover { background: var(--surface-2); border-color: var(--muted); }

.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:not(:disabled):hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--surface); border-color: var(--bad-line); color: var(--bad); }
.btn-danger:not(:disabled):hover { background: var(--bad-soft); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; gap: 5px; }
.btn-block { width: 100%; }

.icon-btn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; padding: 6px; border-radius: var(--r-sm); line-height: 0;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }

.linkbtn {
  background: none; border: none; padding: 0; font: inherit; font-size: 13px;
  color: var(--accent); cursor: pointer; font-weight: 500;
}
.linkbtn:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- form ---------- */
label.lbl {
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  display: block; margin-bottom: 6px; letter-spacing: -0.005em;
}
input[type="text"], input[type="url"], input[type="date"], input[type="time"],
input[type="number"], textarea, select {
  /* 16px wajib: di bawah itu Safari iOS auto-zoom tiap field difokus */
  width: 100%; font: inherit; font-size: 16px;
  padding: 8px 11px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  resize: vertical;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
input[type="checkbox"] { accent-color: var(--accent); }

.field { margin-bottom: var(--s4); }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; gap: var(--s4); }
@media (min-width: 640px) {
  .field-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.count { display: block; text-align: right; font-size: 11.5px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.count-warn { color: var(--warn); }
.count-bad { color: var(--bad); font-weight: 600; }

/* ---------- pesan ---------- */
.alert {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--r);
  font-size: 13.5px; line-height: 1.55;
  border: 1px solid;
}
.alert .ico { margin-top: 2px; }
.alert-bad  { background: var(--bad-soft);  border-color: var(--bad-line);  color: var(--bad); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.alert-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hover); }
.alert + .alert { margin-top: var(--s2); }
.alert ul { margin: var(--s2) 0 0; padding-left: 17px; }
.alert li + li { margin-top: 3px; }
.alert b { font-weight: 600; }

/* ---------- badge & chip ---------- */
.badge {
  font-size: 11.5px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-stock  { background: var(--surface-2); color: var(--text-2); }
.badge-scheduled { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-sent, .badge-done { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-error { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge-draft { background: var(--surface-2); color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--r-full); padding: 4px 11px;
  font-size: 12.5px; color: var(--text-2);
  cursor: pointer; user-select: none;
  transition: border-color .12s, background .12s, color .12s;
}
.chip:hover { border-color: var(--muted); }
.chip input { margin: 0; }
.chip.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* monogram platform: kotak membulat, warna brand dilembutkan */
.pdot {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  font-size: 10px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent;
}

/* ---------- dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: var(--s7) var(--s4);
  text-align: center; cursor: pointer;
  background: var(--surface-2);
  color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag, .dropzone:focus-visible {
  border-color: var(--accent); background: var(--accent-soft); outline: none;
}
.dropzone .ico { margin: 0 auto var(--s3); color: var(--muted); }
.dropzone.drag .ico, .dropzone:hover .ico { color: var(--accent); }
.dz-main { font-weight: 500; font-size: 14px; color: var(--text); }
.dz-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- baris video ---------- */
.vlist { display: flex; flex-direction: column; gap: var(--s2); }
.vrow {
  display: grid;
  grid-template-columns: auto 52px 1fr auto;
  gap: var(--s3); align-items: center;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s3);
  background: var(--surface);
  transition: border-color .12s, background .12s;
}
.vrow:hover { border-color: var(--line-2); }
.vrow-num { grid-template-columns: auto auto 52px 1fr auto; }
.vrow.dragging { opacity: .35; }
.vrow.drop-target { border-color: var(--accent); background: var(--accent-soft); }

.vhandle {
  cursor: grab; color: var(--line-2); padding: 2px;
  touch-action: none; line-height: 0;
  transition: color .12s;
}
.vrow:hover .vhandle { color: var(--muted); }
.vhandle:active { cursor: grabbing; }

.vthumb {
  width: 52px; height: 52px; flex: none;
  border-radius: var(--r-xs);
  object-fit: cover;
  background: var(--surface-3);
  /* Sebelum ada frame yang ter-decode, <video> dirender hitam di sebagian
     browser. Ditipiskan supaya tidak terlihat seperti kotak rusak. */
  color-scheme: light;
}
.thumb-fallback {
  display: grid; place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
}
.vbody { min-width: 0; }
.vtitle { font-weight: 500; font-size: 14px; letter-spacing: -0.008em; }
.vtitle-input { font-weight: 500; border-color: transparent; background: transparent; padding-left: 0; }
.vtitle-input:hover { border-color: var(--line-2); background: var(--surface); padding-left: 11px; }
.vtitle-input:focus { padding-left: 11px; }
.vmeta {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center;
}
.vmeta a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.vmeta a:hover { color: var(--accent); }
.vmeta .sep { color: var(--line-2); }
.vactions { display: flex; gap: 2px; align-items: center; align-self: flex-start; }

/* panel rincian di dalam baris video */
.vdetail { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }

/* penanda "Tersimpan" — autosave tanpa umpan balik bikin ragu */
.save-state { font-size: 11.5px; color: var(--muted); transition: color .2s; }
.save-state.ok { color: var(--ok); }
.save-state.bad { color: var(--bad); }
.vnum {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  min-width: 24px; text-align: center; font-variant-numeric: tabular-nums;
}

.progress { height: 3px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; margin-top: var(--s2); }
.progress .bar { height: 100%; width: 0; background: var(--accent); border-radius: var(--r-full); transition: width .2s; }

/* ---------- tabel jadwal ---------- */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--s5) * -1); padding: 0 var(--s5);
}
table.grid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 100%; }
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line);
  padding: 8px 11px; text-align: left; white-space: nowrap;
}
table.grid thead th {
  background: var(--surface); font-size: 11.5px; font-weight: 500; color: var(--muted);
  position: sticky; top: 0; z-index: 2;
}
table.grid tbody th {
  position: sticky; left: 0; background: var(--surface); z-index: 1;
  border-right: 1px solid var(--line); font-weight: 500;
  max-width: 160px;
}
table.grid tbody th .row { flex-wrap: nowrap; gap: 7px; }
table.grid td.cell { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
table.grid tbody tr:hover td { background: var(--surface-2); }
table.grid tbody tr:last-child th, table.grid tbody tr:last-child td { border-bottom: none; }
.cell-time { color: var(--muted); font-size: 11px; display: block; font-variant-numeric: tabular-nums; }

/* ---------- daftar pengiriman ---------- */
.sendlist { display: flex; flex-direction: column; gap: 5px; max-height: 440px; overflow-y: auto; }
.senditem {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: var(--s3); align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px var(--s3); font-size: 13px;
  background: var(--surface);
}
.senditem .state { line-height: 0; color: var(--muted); }
.senditem.ok  { background: var(--ok-soft);  border-color: var(--ok-line); }
.senditem.ok .state { color: var(--ok); }
.senditem.err { background: var(--bad-soft); border-color: var(--bad-line); }
.senditem.err .state { color: var(--bad); }
.senditem .err-msg { font-size: 11.5px; color: var(--bad); word-break: break-word; }
.senditem .sub { font-size: 11.5px; color: var(--muted); }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed; z-index: 60;
  left: var(--s3); right: var(--s3); bottom: calc(var(--bottomnav-h) + var(--s3));
  display: flex; flex-direction: column; gap: var(--s2); align-items: center;
  pointer-events: none;
}
@media (min-width: 900px) {
  .toast-wrap { left: auto; right: var(--s6); bottom: var(--s6); align-items: flex-end; }
}
.toast {
  display: flex; align-items: center; gap: var(--s2);
  background: var(--text); color: #fff;
  padding: 10px 14px; border-radius: var(--r);
  font-size: 13px; max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .16s ease-out;
}
.toast.bad { background: var(--bad); }
.toast.ok  { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- spinner ---------- */
.spin {
  display: inline-block; width: 13px; height: 13px; flex: none;
  border: 1.75px solid currentColor; border-top-color: transparent;
  border-radius: 50%; opacity: .7;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- preview platform ---------- */
.preview-wrap { margin-top: var(--s3); display: flex; justify-content: center; }
.pv { width: 100%; max-width: 290px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; font-size: 13px; }
.pv-head { display: flex; align-items: center; gap: 7px; padding: 9px 11px; }
.pv-body { padding: 0 11px 11px; word-break: break-word; }
.pv-media { background: var(--surface-3); color: var(--muted); display: grid; place-items: center; font-size: 10.5px; letter-spacing: .07em; }
.pv-avatar { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 8.5px; font-weight: 700; flex: none; }
.pv-tag { color: var(--info); }
.pv-muted { color: var(--muted); font-size: 11.5px; }
.pv-actions { padding: 6px 11px; font-size: 14px; color: var(--text-2); }
.pv-title { font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.pv-desc { font-size: 12.5px; color: var(--text-2); word-break: break-word; }
.pv-instagram .pv-media { aspect-ratio: 9/16; max-height: 270px; }
.pv-tiktok { position: relative; background: #000; color: #fff; border-color: #000; }
.pv-tiktok .pv-media { aspect-ratio: 9/16; max-height: 330px; background: #111; }
.pv-tiktok .pv-overlay { position: absolute; left: 0; right: 38px; bottom: 0; padding: 11px; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.pv-tiktok .pv-head, .pv-tiktok .pv-body { padding: 2px 0; }
.pv-clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
.pv-youtube .pv-media { aspect-ratio: 16/9; }
.pv-youtube .pv-body { padding: 11px; }
.pv-facebook .pv-media { aspect-ratio: 4/5; max-height: 230px; }
.pv-fb-actions { display: flex; justify-content: space-around; border-top: 1px solid var(--line); font-size: 12px; }
.pv-threads .pv-thread-row { display: flex; gap: 9px; padding: 11px; }
.pv-threads .pv-thread-col { min-width: 0; flex: 1; }
.pv-threads .pv-head, .pv-threads .pv-body { padding: 0; }
.pv-threads .pv-media { aspect-ratio: 4/5; max-height: 170px; border-radius: var(--r-sm); margin-top: 7px; }
.pv-pinterest .pv-media { aspect-ratio: 2/3; max-height: 270px; }
.pv-pinterest .pv-body { padding: 11px; }
.pv-link { font-size: 11.5px; color: var(--accent); margin: 5px 0; word-break: break-all; }

/* ---------- insight ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); background: var(--surface); }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.bar-row { display: grid; grid-template-columns: 116px 1fr auto; gap: var(--s3); align-items: center; margin-bottom: var(--s2); font-size: 13px; }
.bar-track { height: 7px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: var(--r-full); }
.bar-row .val { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12.5px; }

/* ---------- blok kode ---------- */
code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
}
code { background: var(--surface-3); padding: 1px 5px; border-radius: var(--r-xs); }
pre { background: var(--surface-2); border: 1px solid var(--line); padding: var(--s3); border-radius: var(--r-sm); overflow-x: auto; }
pre code { background: none; padding: 0; }

/* ---------- kartu bersarang (di dalam panel) ---------- */
.subcard { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); background: var(--surface); }
.subcard + .subcard { margin-top: var(--s3); }

/* ========== kepala halaman ========== */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap;
}
.page-title { font-size: 20px; font-weight: 600; letter-spacing: -0.025em; margin: 0; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.backlink {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--muted); text-decoration: none; margin-bottom: 2px;
}
.backlink::before { content: '←'; }
.backlink:hover { color: var(--accent); }

/* langkah bernomor di wizard */
.step { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s4); }
.step .panel-title, .step .hint { margin: 0; }
.step .hint { margin-top: 3px; }
.step-num {
  width: 22px; height: 22px; flex: none; margin-top: 1px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.warn-text { color: var(--warn); }

/* Keterangan kecil yang berdiri sendiri. Beda dari .hint, yang sengaja
   punya margin atas negatif karena posisinya selalu tepat di bawah judul panel. */
.note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

/* ========== kartu jadwal (daftar) ========== */
.plancard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  transition: border-color .12s, box-shadow .12s;
}
.plancard:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.plancard.done { background: var(--surface-2); }
.plancard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.plancard-title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; min-width: 0; }

/* Seluruh kartu jadi area klik — tombol kecil di ujung kanan itu yang
   dulu membuat halaman ini terasa jauh dan repot dipakai. */
.plancard .stretch { color: inherit; text-decoration: none; }
.plancard .stretch::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.plancard .stretch:focus-visible::after { box-shadow: var(--ring); }
.icon-btn.above { position: relative; z-index: 1; }

.plancard-meta { font-size: 12.5px; color: var(--muted); margin: 2px 0 var(--s3); }
.plancard-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap; margin-top: var(--s2);
  font-size: 12.5px; color: var(--text-2);
}
.plancard-next { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.plancard-next.bad { color: var(--bad); }

/* ========== board Pinterest (ringkas) ========== */
.boardrow {
  margin: 2px 0 2px 34px;
  border-left: 2px solid var(--line);
  padding: 6px 0 6px var(--s3);
}
.boardrow-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 12.5px; }
.boardrow-label { color: var(--muted); }
.boardrow-value { font-weight: 500; }
.boardrow-value.bad { color: var(--bad); font-weight: 400; }
.boardrow-edit { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: 6px; }
.boardrow-edit select { max-width: 280px; }
.boardrow-edit .muted { flex-basis: 100%; }

/* ========== bar ringkasan yang menempel ========== */
.stickybar {
  position: sticky;
  bottom: calc(var(--bottomnav-h) + var(--s2));
  z-index: 20;
  margin-top: var(--s4);
}
@media (min-width: 900px) { .stickybar { bottom: var(--s4); } }
.stickybar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
  box-shadow: var(--shadow-lg);
}
.stickybar-info { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; min-width: 0; }
.stickybar-info strong { font-size: 15px; letter-spacing: -0.015em; }
.stickybar-info .muted, .stickybar-info .warn-text { font-size: 12.5px; }

/* ========== saringan ========== */
.filterbar { display: flex; gap: 6px; flex-wrap: wrap; }
.filterchip {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  border-radius: var(--r-full); padding: 5px 11px; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.filterchip:hover { border-color: var(--muted); }
.filterchip:focus-visible { outline: none; box-shadow: var(--ring); }
.filterchip.on { background: var(--text); border-color: var(--text); color: #fff; }
.filterchip-num {
  font-variant-numeric: tabular-nums; font-size: 11px;
  background: var(--surface-3); color: var(--text-2);
  border-radius: var(--r-full); padding: 0 6px;
}
.filterchip.on .filterchip-num { background: rgba(255, 255, 255, .2); color: #fff; }

/* ========== kelompok per hari ========== */
.daygroup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.daygroup-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  padding: 10px var(--s4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.daygroup-date { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.daygroup-count { font-size: 11.5px; color: var(--muted); }

/* ========== satu item jadwal ========== */
.item { border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item.open { background: var(--surface-2); }

.item-head {
  width: 100%; font: inherit; text-align: left; cursor: pointer;
  background: none; border: none;
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: var(--s3); align-items: center;
  padding: 10px var(--s4);
  transition: background .12s;
}
.item-head:hover { background: var(--surface-2); }
.item-head:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

.item-chev { color: var(--muted); transition: transform .15s; }
.item.open .item-chev { transform: rotate(180deg); }

.item-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item-title { font-size: 13.5px; font-weight: 500; letter-spacing: -0.008em; }
.item-sub { font-size: 12px; color: var(--muted); }
.item-channel { color: var(--text-2); }
.item-lack { color: var(--bad); }
.item-quote { font-style: italic; }

.item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.item-time { font-size: 12.5px; color: var(--text-2); }

.item-body { padding: 0 var(--s4) var(--s4); }
.item-body > * + * { margin-top: var(--s3); }

/* garis warna tipis di kiri sebagai penanda status — lebih tenang daripada
   mewarnai seluruh baris */
.item-siap       { box-shadow: inset 3px 0 0 var(--accent-line); }
.item-kurang     { box-shadow: inset 3px 0 0 var(--warn-line); }
.item-kedaluwarsa{ box-shadow: inset 3px 0 0 var(--bad-line); }
.item-error      { box-shadow: inset 3px 0 0 var(--bad); }
.item-sent       { box-shadow: inset 3px 0 0 var(--ok-line); }

.badge-siap { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent-line); }
.badge-kurang { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-kedaluwarsa { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }

/* teks final yang benar-benar dikirim */
.finalbox { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.finalbox-head {
  font-size: 11.5px; color: var(--muted);
  padding: 6px var(--s3); background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.finaltext {
  margin: 0; border: none; border-radius: 0; background: var(--surface);
  white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.55;
  max-height: 220px; overflow-y: auto;
}
.finalbox-foot {
  font-size: 11px; color: var(--muted);
  padding: 5px var(--s3); border-top: 1px solid var(--line); background: var(--surface-2);
}

/* sel pratinjau yang bahannya belum lengkap */
td.cell-bad { background: var(--warn-soft); box-shadow: inset 0 -2px 0 var(--warn-line); }
td.cell-past { color: var(--bad); }

/* ========== pengaturan ========== */
.srv-value {
  font-size: 12.5px; color: var(--text-2); text-align: right;
  word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ========== insight ========== */
.filterbar-label { font-size: 12px; color: var(--muted); align-self: center; margin-right: 2px; }
.bad-text { color: var(--bad); }

/* diagnosa per channel */
.diagrow {
  display: flex; align-items: center; gap: var(--s3);
  padding: 10px 0; border-top: 1px solid var(--line);
}
.diagrow:first-child { border-top: none; }
.diagrow-label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; }
.diagrow-detail { font-size: 12px; color: var(--text-2); margin-top: 1px; }

/* kartu metrik per platform */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s3); }
.mcard { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); background: var(--surface); }
.mcard-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); font-size: 13.5px; font-weight: 600; }
.mcard-head .muted { font-weight: 400; }

.mrow {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  padding: 5px 0; border-top: 1px solid var(--line);
}
.mrow:first-of-type { border-top: none; }
.mlabel { font-size: 12.5px; color: var(--text-2); }
.mvalue { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.mvalue b { font-size: 15px; letter-spacing: -0.02em; }
.msub { font-size: 11px; color: var(--muted); }
.mempty { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* metrik sebagai chip kecil */
.chipset { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mchip {
  display: inline-flex; align-items: baseline; gap: 5px;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: var(--r-full); padding: 2px 9px;
  font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mchip.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-hover); }
.mchip-label { color: var(--muted); }
.mchip.on .mchip-label { color: var(--accent-hover); }

/* satu video di beberapa platform */
.vidrow {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  padding: 7px 0; border-top: 1px solid var(--line); margin-top: var(--s2);
}
.vidrow-name { font-size: 12.5px; color: var(--text-2); min-width: 110px; }

/* ---------- panel diagnosa ---------- */
.diag-row {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) 0; border-top: 1px solid var(--line);
}
.diag-icon { line-height: 0; margin-top: 2px; }
.diag-label { font-weight: 500; font-size: 13.5px; }
.diag-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.diag-fix {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 12.5px; color: var(--accent-hover);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 6px 9px; border-radius: var(--r-sm); margin-top: 6px;
}
.diag-fix .ico { margin-top: 2px; }

/* ========== jejak platform pada video ========== */
/* Penanda kecil di baris video: sudah sampai ke platform mana saja.
   Cincin warna dipakai, bukan warna isian, supaya monogram platformnya
   tetap terbaca dan barisnya tidak jadi ramai. */
.jejak { display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; }

.pdot-xs { width: 18px; height: 18px; font-size: 8px; border-radius: 5px; }

.pdot-terkirim { box-shadow: 0 0 0 1.5px var(--ok); }
.pdot-gagal    { box-shadow: 0 0 0 1.5px var(--bad); }
.pdot-antre    { opacity: .45; }

/* nomor rotasi untuk video yang tidak ikut dipilih */
.vnum-off { color: var(--line-2); font-weight: 400; }

/* keterangan arti penanda */
.jejak-legend { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); }
.jejak-legend span { display: inline-flex; align-items: center; gap: 5px; }
.jejak-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--surface-3); display: inline-block; }
.jejak-legend i.ok  { box-shadow: 0 0 0 1.5px var(--ok); }
.jejak-legend i.bad { box-shadow: 0 0 0 1.5px var(--bad); }
.jejak-legend i.antre { opacity: .45; }
