/* ================= Mas Agra — Panel Admin =================
   Panel (sidebar/header) : merah
   Area pengolahan data   : cream
============================================================ */
:root {
  --red-950: #4E0E0E;
  --red-900: #6E1414;
  --red-800: #8B1A1A;
  --red-700: #A21F24;
  --red-600: #B8282E;
  --red-100: #F8DEDB;
  --red-50:  #FCEDEB;
  --cream-50:  #FFFDF8;
  --cream-100: #FBF5EA;
  --cream-200: #F4EAD7;
  --cream-300: #E8DAC0;
  --cream-400: #D8C4A0;
  --ink: #3A2A22;
  --ink-2: #6B5A4E;
  --muted: #8F7F72;
  --gold-700: #8A5A12;
  --gold-500: #C8912F;
  --gold-50: #FFF4DC;
  --green-700: #1D6F42;
  --green-600: #2F7A4A;
  --green-50: #E7F4EC;
  --blue-700: #1F5F8B;
  --blue-50: #E6F0F8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(58,42,34,.05), 0 6px 20px rgba(58,42,34,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--ink); background: var(--cream-100);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red-700); }
code { background: var(--cream-200); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ic { flex: none; }

/* ---------------- layout ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 258px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--red-800) 0%, var(--red-900) 70%, var(--red-950) 100%);
  color: #F8E6D2; display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; text-decoration: none; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; font-size: 17px; letter-spacing: .2px; }
.brand small { color: #F1CBB0; font-size: 12px; }
.sidebar nav { padding: 10px 12px; flex: 1; }
.nav-h { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #E7A99A; padding: 16px 12px 6px; }
.sidebar nav a, .logout {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0;
  color: #FBE9D8; text-decoration: none; border-radius: 10px; font-weight: 500; transition: background .15s;
}
.sidebar nav a span { flex: 1; }
.sidebar nav a:hover, .logout:hover { background: rgba(255,255,255,.09); }
.sidebar nav a.active { background: var(--cream-100); color: var(--red-800); font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: linear-gradient(90deg, var(--red-700), var(--red-800)); color: #fff;
  box-shadow: 0 2px 10px rgba(110,20,20,.18);
}
.tb-title { flex: 1; min-width: 0; }
.tb-title h1 { margin: 0; font-size: 19px; }
.tb-title p { margin: 2px 0 0; color: #F7D9C6; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user { display: flex; align-items: center; gap: 10px; }
.uav { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--cream-100); color: var(--red-700); font-weight: 800; }
.uinfo b { display: block; font-size: 13.5px; }
.uinfo small { color: #F7D9C6; font-size: 12px; }
.icon-btn { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.only-m { display: none; }
.content { padding: 24px 28px; flex: 1; }
.foot { padding: 14px 28px; color: var(--muted); font-size: 12px; }
.overlay { display: none; }

/* ---------------- panel & komponen ---------------- */
.panel { background: var(--cream-50); border: 1px solid var(--cream-300); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 15.5px; color: var(--ink); }
.lnk { color: var(--red-700); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.lnk:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s, background .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--red-700), var(--red-600)); color: #fff; box-shadow: 0 4px 12px rgba(162,31,36,.25); }
.btn-template { background: var(--gold-50); color: var(--gold-700); border-color: var(--gold-500); }
.btn-template:hover { background: #FFEBC2; }
.btn-import { background: var(--green-600); color: #fff; box-shadow: 0 4px 12px rgba(47,122,74,.22); }
.btn-export { background: var(--green-700); color: #fff; box-shadow: 0 4px 12px rgba(29,111,66,.25); }
.btn-light { background: #fff; color: var(--ink-2); border-color: var(--cream-300); }
.btn-light:hover { background: var(--cream-100); }
.btn-danger { background: #B3261E; color: #fff; }
.btn-danger-o { background: #fff; color: #B3261E; border-color: #E4B4AE; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }

.ibtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--cream-300); background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); text-decoration: none; }
.ibtn-edit:hover { background: var(--gold-50); color: var(--gold-700); border-color: var(--gold-500); }
.ibtn-del:hover { background: var(--red-50); color: #B3261E; border-color: #E4B4AE; }
.ibtn-view:hover { background: var(--blue-50); color: var(--blue-700); border-color: #A9C7DE; }

.alert { position: relative; padding: 12px 40px 12px 16px; border-radius: 11px; margin-bottom: 16px; border: 1px solid; line-height: 1.5; }
.alert-success { background: var(--green-50); border-color: #A8D5B9; color: #1B5E36; }
.alert-danger  { background: var(--red-50); border-color: #EBB8B2; color: #8B1A1A; }
.alert-warning { background: var(--gold-50); border-color: #EBCB8B; color: #7A4F0E; }
.alert-x { position: absolute; right: 10px; top: 8px; background: none; border: 0; font-size: 20px; cursor: pointer; color: inherit; opacity: .6; }
.err-list { margin: 6px 0 0; padding-left: 20px; }

/* ---------------- toolbar & tabel ---------------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.tb-left { display: flex; flex-wrap: wrap; gap: 8px; }
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 11px; color: var(--muted); }
.search input { padding: 9px 30px 9px 34px; width: 260px; border-radius: 10px; border: 1.5px solid var(--cream-300); background: #fff; font: inherit; color: var(--ink); }
.search input:focus { outline: none; border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(184,40,46,.12); }
.search .clear { position: absolute; right: 10px; text-decoration: none; color: var(--muted); font-size: 18px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--cream-300); border-radius: 12px; background: #fff; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  background: var(--cream-200); color: var(--red-900); text-align: left; font-weight: 700; font-size: 12.5px;
  padding: 11px 12px; border-bottom: 1px solid var(--cream-300); white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid #F1E7D6; vertical-align: top; line-height: 1.45; }
.tbl tbody tr:nth-child(even) td { background: #FFFCF6; }
.tbl tbody tr:hover td { background: #FFF6E8; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.w-chk { width: 36px; text-align: center; }
.w-no { width: 48px; color: var(--muted); }
.w-act { width: 90px; white-space: nowrap; text-align: center; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--red-700); cursor: pointer; }
.tbl td.num { text-align: center; font-weight: 700; }
.tbl.mini th { background: transparent; padding: 8px 6px; font-size: 11px; border-bottom: 1px solid var(--cream-300); text-align: center; }
.tbl.mini th:first-child { text-align: left; }
.tbl.mini td { padding: 10px 6px; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px !important; }
.empty .ic { color: var(--cream-400); margin-bottom: 6px; }
.empty.sm { padding: 18px 0 !important; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.tf-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.per { display: flex; align-items: center; gap: 6px; }
.per select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--cream-300); background: #fff; font: inherit; }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { min-width: 34px; height: 34px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; text-decoration: none; font-weight: 600; color: var(--ink-2); border: 1px solid var(--cream-300); background: #fff; }
.pager a:hover { border-color: var(--red-600); color: var(--red-700); }
.pager .cur { background: var(--red-700); color: #fff; border-color: var(--red-700); }
.pager .dis { opacity: .4; }
.pager .dots { border: 0; background: none; }

.st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid; }
.st-warn { background: var(--gold-50); color: var(--gold-700); border-color: #EBCB8B; }
.st-info { background: var(--blue-50); color: var(--blue-700); border-color: #A9C7DE; }
.st-ok   { background: var(--green-50); color: var(--green-700); border-color: #A8D5B9; }
.st-bad  { background: var(--red-50); color: #9A1C1C; border-color: #EBB8B2; }
.st-mute { background: #F1EDE7; color: #6B5A4E; border-color: #DDD3C6; }
.chip { display: inline-block; background: var(--red-50); color: var(--red-700); font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: capitalize; }

/* ---------------- filter laporan ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; padding: 14px; background: var(--cream-100); border: 1px dashed var(--cream-400); border-radius: 12px; }
.filters .fg { margin: 0; }
.filters .grow { flex: 1; min-width: 200px; }
.filters .act { display: flex; flex-direction: row; gap: 8px; flex-wrap: nowrap; }
.sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sum-i { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 11px; background: #fff; border: 1.5px solid var(--cream-300); text-decoration: none; color: var(--ink); }
.sum-i b { font-size: 15px; }
.sum-i.on { border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(184,40,46,.12); }

/* ---------------- form & modal ---------------- */
.fg { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.fg > label { font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.req { color: #B3261E; font-style: normal; }
.fg input, .fg select, .fg textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--cream-300); background: #fff;
  font: inherit; color: var(--ink);
}
.fg textarea { resize: vertical; }
.fg input:focus, .fg select:focus, .fg textarea:focus { outline: none; border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(184,40,46,.12); }
.hint { color: var(--muted); font-size: 12px; }
.radio { display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; border: 1.5px solid var(--cream-300); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 400 !important; color: var(--ink) !important; font-size: 13.5px !important; }
.radio input { width: auto; margin-top: 3px; accent-color: var(--red-700); }
.radio:has(input:checked) { border-color: var(--red-600); background: var(--red-50); }

.modal { position: fixed; inset: 0; background: rgba(46,16,12,.55); display: grid; place-items: center; z-index: 100; padding: 16px; backdrop-filter: blur(2px); }
.modal[hidden] { display: none; }
.modal-box { width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--cream-50); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; animation: mIn .18s ease-out; }
.modal-box.sm { width: min(420px, 100%); }
@keyframes mIn { from { transform: translateY(10px); opacity: 0; } }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: linear-gradient(90deg, var(--red-700), var(--red-800)); color: #fff; }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-x { background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; line-height: 1; opacity: .85; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--cream-300); background: var(--cream-100); }
.edit-only { display: none; }
.is-edit .edit-only { display: block; }
.steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.7; color: var(--ink-2); }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; margin-bottom: 14px; border: 2px dashed var(--cream-400); border-radius: 14px; background: #fff; text-align: center; cursor: pointer; color: var(--green-700); }
.drop:hover, .drop.over { border-color: var(--green-600); background: var(--green-50); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-t { font-weight: 700; color: var(--ink); }
.drop.has .drop-f { color: var(--green-700); font-weight: 700; }

/* ---------------- dashboard ---------------- */
.dash-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hello { font-size: 16px; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--cream-300); border-radius: 11px; padding: 3px; }
.seg a { padding: 7px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--red-700); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--cream-50); border: 1px solid var(--cream-300); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .15s; }
a.kpi:hover { transform: translateY(-2px); border-color: var(--red-100); }
.kpi-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--red-50); color: var(--red-700); }
.kpi span { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi b { display: block; font-size: 26px; line-height: 1.2; margin: 2px 0; color: var(--ink); }
.kpi small { color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid-2 .panel { margin-bottom: 20px; }
.chart-card { min-height: 290px; }
.vbars { height: 190px; display: flex; align-items: flex-end; gap: 3px; padding: 0 2px; border-bottom: 1px solid var(--cream-400);
  background: repeating-linear-gradient(to top, transparent 0 47px, #F1E7D6 47px 48px); }
.vb { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.vb i { display: block; width: 100%; min-height: 2px; background: var(--red-600); border-radius: 4px 4px 0 0; transition: background .15s; }
.vb:hover i { background: var(--red-800); }
.vbars.dense { gap: 1px; }
.vbars.dense .vb i { border-radius: 2px 2px 0 0; }
.vaxis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hb { display: grid; grid-template-columns: 170px 1fr 34px; gap: 10px; align-items: center; position: relative; }
.hb-l { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 14px; background: var(--cream-200); border-radius: 4px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--red-600); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb:hover .hb-t i { background: var(--red-800); }
.hb b { text-align: right; font-size: 13px; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; white-space: nowrap; z-index: 5; pointer-events: none;
}
.hb[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.master { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.master a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--cream-100); border: 1px solid var(--cream-300); text-decoration: none; color: var(--ink-2); }
.master a:hover { border-color: var(--red-600); color: var(--red-700); }

/* ---------------- transkrip chat ---------------- */
.transcript { background: var(--cream-100); border-radius: 12px; padding: 18px; max-height: 70vh; overflow-y: auto; border: 1px solid var(--cream-300); }
.tr-row { display: flex; margin-bottom: 10px; }
.tr-row.user { justify-content: flex-end; }
.tr-b { max-width: 72%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; font-size: 13.5px; }
.tr-row.bot .tr-b { background: #fff; border: 1px solid var(--cream-300); border-bottom-left-radius: 4px; }
.tr-row.user .tr-b { background: var(--red-700); color: #fff; border-bottom-right-radius: 4px; }
.tr-meta { font-size: 11.5px; opacity: .7; margin-bottom: 4px; }

/* ---------------- login ---------------- */
.auth-body { min-height: 100vh; background: linear-gradient(135deg, var(--red-900), var(--red-700) 55%, var(--red-600)); display: grid; place-items: center; padding: 20px; }
.auth { width: min(940px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.auth-left { padding: 48px 42px; color: #FDEBD8; background: rgba(0,0,0,.14); border-right: 1px solid rgba(255,255,255,.08); }
.auth-left h1 { font-size: 30px; line-height: 1.2; color: #fff; margin: 20px 0 12px; }
.auth-left p { color: #F4D2BD; line-height: 1.6; margin: 0 0 22px; }
.auth-left ul { list-style: none; padding: 0; margin: 0; }
.auth-left li { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.auth-left li .ic { color: #FFD58A; }
.auth-right { background: var(--cream-50); padding: 48px 42px; display: flex; align-items: center; }
.auth-form { width: 100%; }
.auth-form h2 { margin: 0 0 4px; color: var(--red-800); font-size: 24px; }
.auth-form > p { margin: 0 0 22px; }
.lbl { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.inp-ic { position: relative; margin-bottom: 16px; }
.inp-ic > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.inp-ic input { width: 100%; padding: 12px 42px 12px 40px; border-radius: 11px; border: 1.5px solid var(--cream-300); background: #fff; font: inherit; font-size: 14.5px; color: var(--ink); }
.inp-ic input:focus { outline: none; border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(184,40,46,.13); }
.peek { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.to-chat { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; text-decoration: none; font-weight: 600; font-size: 13px; }

.install-card { width: min(640px, 100%); background: var(--cream-50); border-radius: 18px; padding: 28px; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.install-head h1 { margin: 0; font-size: 21px; color: var(--red-800); }
.install-head p { margin: 2px 0 0; color: var(--muted); }
.install-log { background: #fff; border: 1px solid var(--cream-300); border-radius: 12px; padding: 12px 12px 12px 32px; line-height: 1.8; }
.install-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- responsif ---------------- */
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 10px 0 30px rgba(0,0,0,.3); }
  .overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .only-m { display: grid; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .uinfo { display: none; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .auth { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 24px; }
  .hb { grid-template-columns: 120px 1fr 30px; }
}
.mini-wrap { overflow-x: auto; }
.tbl td .long { display: block; min-width: 230px; }
.is-edit .add-only { display: none; }

/* ---------------- foto kelas & rute ---------------- */
.small { font-size: 12px; }
.chip.lg { font-size: 13px; padding: 4px 12px; }
.thumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--cream-300); background: var(--cream-200); }
.thumbs.big img { width: 160px; height: 90px; border-radius: 10px; }
.route-link { color: var(--red-800); font-weight: 700; text-decoration: none; font-size: 14.5px; }
.route-link:hover { text-decoration: underline; }
.kelas-cell { display: flex; align-items: center; gap: 10px; }
.kelas-cell img { width: 72px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--cream-300); }
.route-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; padding: 14px 16px; background: var(--cream-100); border: 1px solid var(--cream-300); border-radius: 12px; }
.kv { border-collapse: collapse; font-size: 14px; }
.kv th { text-align: left; color: var(--ink-2); font-weight: 600; padding: 5px 18px 5px 0; white-space: nowrap; }
.kv td { padding: 5px 0; font-size: 15px; }
.img-up { border: 1.5px dashed var(--cream-400); border-radius: 12px; padding: 12px; background: #fff; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.img-grid:empty { display: none; }
.img-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--cream-300); background: var(--cream-200); }
.img-item img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.img-item .sz { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.img-item .sz.new { background: var(--green-600); }
.img-item .rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(179,38,30,.92); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.img-add { position: relative; display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 14px; border-radius: 10px; background: var(--green-50); color: var(--green-700); font-weight: 700 !important; font-size: 13px !important; border: 1.5px solid #A8D5B9; cursor: pointer; }
.img-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-status { font-size: 12px; margin-top: 6px; }
.img-status.err { color: #B3261E; }

/* =====================================================================
   RESPONSIVE WEB DESIGN
   ≥1280 desktop lebar · 1024–1279 desktop/laptop · 721–1023 tablet · ≤720 HP
   ===================================================================== */
img { max-width: 100%; }
.content { max-width: 1600px; width: 100%; }
.table-wrap { -webkit-overflow-scrolling: touch; }

/* ---------- Tablet & laptop kecil: sidebar menjadi menu geser ---------- */
@media (max-width: 1023px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 10px 0 30px rgba(0,0,0,.3); }
  .overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .only-m { display: grid; }
  .content { padding: 18px; }
  .topbar { padding: 12px 18px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .filters .grow { flex-basis: 100%; }
  .filters .act { width: 100%; }
}

/* ---------- HP ---------- */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .content { padding: 12px; }
  .foot { padding: 12px; text-align: center; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .tb-title h1 { font-size: 16.5px; line-height: 1.25; }
  .tb-title p { font-size: 11.5px; }
  .uav { width: 34px; height: 34px; }
  .panel { padding: 12px; border-radius: 12px; }
  .card-h { flex-wrap: wrap; }
  .alert { font-size: 13px; }

  /* tombol toolbar: grid 2 kolom yang rapi */
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .tb-left { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tb-left .btn { width: 100%; padding: 10px 8px; font-size: 13px; white-space: normal; text-align: center; line-height: 1.2; }
  .tb-left .btn:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .search { width: 100%; }
  .search input { width: 100%; }

  /* filter laporan */
  .filters { padding: 12px; gap: 10px; }
  .filters .fg { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .filters .fg.grow { flex-basis: 100%; }
  .filters .act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters .act .btn { width: 100%; padding: 10px 6px; }
  .sum { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .sum-i { flex: none; }

  /* tabel menjadi kartu */
  .table-wrap { border: 0; background: transparent; overflow: visible; border-radius: 0; }
  .tbl:not(.mini) thead { display: none; }
  .tbl:not(.mini), .tbl:not(.mini) tbody { display: block; width: 100%; }
  .tbl:not(.mini) tbody tr { display: block; position: relative; background: #fff; border: 1px solid var(--cream-300); border-radius: 12px; margin-bottom: 10px; padding: 6px 14px; box-shadow: var(--shadow); }
  .tbl:not(.mini) tbody tr:hover td, .tbl:not(.mini) tbody tr:nth-child(even) td { background: transparent; }
  .tbl:not(.mini) tbody td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #EFE3CE; text-align: right; word-break: break-word; }
  .tbl:not(.mini) tbody td > .cv { flex: 1; min-width: 0; }
  .tbl:not(.mini) tbody td:last-child { border-bottom: 0; }
  .tbl:not(.mini) tbody td::before { content: attr(data-label); flex: 0 0 36%; text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-2); line-height: 1.35; padding-top: 2px; }
  .tbl:not(.mini) tbody td:not([data-label])::before { display: none; }
  .tbl:not(.mini) td.w-no { display: none; }
  .tbl:not(.mini) td.w-chk { position: absolute; top: 10px; right: 12px; padding: 0; border: 0; width: auto; }
  .tbl:not(.mini) td.w-chk::before { display: none; }
  .tbl:not(.mini) tbody tr:has(td.w-chk) td:nth-child(3) { padding-right: 34px; }
  .tbl:not(.mini) td.w-act { justify-content: flex-end; gap: 8px; width: auto; padding: 10px 0 4px; }
  .tbl:not(.mini) td.w-act::before { display: none; }
  .tbl:not(.mini) td.empty { display: block; text-align: center; border: 0; padding: 24px 0 !important; }
  .tbl:not(.mini) td.empty::before { display: none; }
  .tbl:not(.mini) tbody tr:has(td.empty) { box-shadow: none; }
  .tbl td > .long, .tbl td .long { min-width: 0; }
  .tbl td .thumbs, .tbl td .kelas-cell { justify-content: flex-end; }
  .tbl td > .cv > div { display: block; }
  .tbl td .st, .tbl td .chip { white-space: normal; }
  .ibtn { width: 38px; height: 38px; }
  .route-link { font-size: 15px; }

  .tbl-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .tf-left { justify-content: space-between; gap: 10px; }
  .pager { flex-wrap: wrap; justify-content: center; }

  /* dashboard */
  .dash-top { flex-direction: column; align-items: stretch; }
  .seg { display: grid; grid-template-columns: repeat(3, 1fr); }
  .seg a { text-align: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { flex-direction: column; gap: 8px; padding: 12px; }
  .kpi-ic { width: 34px; height: 34px; border-radius: 10px; }
  .kpi b { font-size: 22px; }
  .chart-card { min-height: 0; }
  .vbars { height: 150px; }
  .hb { grid-template-columns: minmax(0, 42%) 1fr 26px; gap: 8px; }
  .master a { flex: 1 1 calc(50% - 8px); justify-content: center; }

  /* detail rute */
  .route-head { flex-direction: column; padding: 12px; }
  .thumbs.big { flex-wrap: nowrap; overflow-x: auto; width: 100%; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .thumbs.big img { flex: 0 0 78%; width: 78%; height: auto; aspect-ratio: 16 / 9; scroll-snap-align: start; }

  /* modal menjadi lembar bawah (bottom sheet) */
  .modal { padding: 0; place-items: end center; }
  .modal-box, .modal-box.sm { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; animation: sheetIn .22s ease-out; }
  .modal-b { padding: 14px; }
  .modal-f { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; }
  .img-grid { grid-template-columns: repeat(2, 1fr); }
  .transcript { padding: 10px; max-height: none; }
  .tr-b { max-width: 88%; }

  /* login */
  .auth-body { padding: 0; place-items: stretch; }
  .auth { border-radius: 0; min-height: 100vh; box-shadow: none; }
  .auth-right { padding: 28px 20px; }
  .install-card { border-radius: 14px; padding: 18px; }
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: .4; } }

@media (max-width: 340px) {
  .tb-left { grid-template-columns: 1fr; }
  .filters .fg { flex-basis: 100%; }
  .kpis { grid-template-columns: 1fr; }
}

/* perangkat sentuh: target sentuh lebih besar */
@media (hover: none) {
  .sidebar nav a { padding: 12px; }
  .pager a, .pager span { min-width: 38px; height: 38px; }
}

/* login: header merek ringkas di HP */
.auth-mbrand { display: none; }
@media (max-width: 860px) {
  .auth-mbrand { display: flex; align-items: center; gap: 12px; margin: -28px -20px 22px; padding: 22px 20px; padding-top: calc(22px + env(safe-area-inset-top)); background: linear-gradient(135deg, var(--red-900), var(--red-700)); color: #fff; }
  .auth-mbrand img { width: 46px; height: 46px; }
  .auth-mbrand b { display: block; font-size: 18px; }
  .auth-mbrand small { color: #F7D9C6; font-size: 12.5px; }
  .auth-right { align-items: flex-start; }
}

/* ================= LIVE CHAT ================= */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #FFD58A; color: var(--red-900); font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; animation: pulseB 1.6s infinite; }
.sidebar nav a.active .nav-badge { background: var(--red-700); color: #fff; }
@keyframes pulseB { 50% { box-shadow: 0 0 0 5px rgba(255,213,138,.25); } }
.bell { position: relative; display: grid; }
.bell.need { box-shadow: 0 0 0 2px #FFD58A inset; }
.bell.muted { opacity: .6; }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: #FFD58A; box-shadow: 0 0 0 2px var(--red-700); }
#toastBox { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { position: relative; display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--cream-300); border-left: 5px solid var(--red-700); border-radius: 12px; padding: 12px 34px 12px 14px; box-shadow: 0 14px 34px rgba(58,42,34,.2); animation: toastIn .25s ease-out; transition: opacity .5s, transform .5s; font-size: 13px; }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast-t { flex: 1; line-height: 1.45; }
.toast-t span { color: var(--ink-2); }
.toast-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 18px; color: var(--muted); cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

.live { display: grid; grid-template-columns: 340px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.live-list, .live-conv { background: var(--cream-50); border: 1px solid var(--cream-300); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.live-tools { padding: 12px; border-bottom: 1px solid var(--cream-300); display: grid; gap: 10px; }
.live-seg { display: grid; grid-template-columns: repeat(4, 1fr); }
.live-seg a { padding: 7px 4px; text-align: center; font-size: 12.5px; }
.live-seg .cnt { background: #FFD58A; color: var(--red-900); border-radius: 999px; padding: 0 6px; font-size: 11px; }
.live-seg .cnt:empty { display: none; }
.live-search input { width: 100%; }
.live-items { overflow-y: auto; flex: 1; padding: 8px; }
.live-hint { padding: 24px 12px; text-align: center; }
.live-item { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--cream-300); border-left: 4px solid var(--cream-400); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.live-item:hover { border-color: var(--red-100); }
.live-item.on { border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(184,40,46,.12); }
.live-item.m-menunggu { border-left-color: var(--gold-500); background: #FFFBF0; }
.live-item.m-cs { border-left-color: var(--green-600); }
.li-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.li-unread { background: var(--red-700); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; }
.li-msg { font-size: 13px; color: var(--ink-2); margin: 4px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-bot { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.li-bot .st { font-size: 11px; padding: 2px 8px; }
.li-time { margin-left: auto; font-size: 11.5px; }
.live-empty { margin: auto; text-align: center; padding: 30px; max-width: 420px; color: var(--ink-2); }
.live-empty .ic { color: var(--red-600); }
.live-empty h3 { margin: 10px 0 6px; color: var(--ink); }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--cream-300); background: #fff; flex-wrap: wrap; }
.lc-back { display: none; background: var(--cream-200); color: var(--red-800); font-size: 22px; }
.lc-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.lc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lc-note { padding: 8px 14px; font-size: 12.5px; border-bottom: 1px solid var(--cream-300); background: var(--cream-100); color: var(--ink-2); }
.lc-note.n-menunggu { background: var(--gold-50); color: var(--gold-700); }
.lc-note.mine { background: var(--green-50); color: var(--green-700); }
.lc-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--cream-100); }
.lc-row { display: flex; margin-bottom: 10px; }
.lc-row.cs { justify-content: flex-end; }
.lc-b { max-width: 74%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; background: #fff; border: 1px solid var(--cream-300); word-break: break-word; }
.lc-row.cust .lc-b { border-bottom-left-radius: 4px; border-left: 3px solid var(--red-600); }
.lc-row.bot .lc-b { background: #FBF8F2; color: var(--ink-2); border-bottom-left-radius: 4px; font-size: 12.5px; }
.lc-row.cs .lc-b { background: var(--green-700); color: #fff; border-color: var(--green-700); border-bottom-right-radius: 4px; }
.lc-meta { font-size: 11px; opacity: .72; margin-bottom: 3px; }
.lc-sys { text-align: center; font-size: 12px; color: var(--ink-2); margin: 10px auto; padding: 5px 12px; background: #fff; border: 1px dashed var(--cream-400); border-radius: 999px; width: fit-content; max-width: 90%; }
.lc-sys.internal { background: var(--gold-50); border-color: var(--gold-500); color: var(--gold-700); }
.lc-sys span { opacity: .6; margin-left: 4px; }
.lc-form { border-top: 1px solid var(--cream-300); background: #fff; padding: 10px 12px; }
.lc-tpl { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.lc-tpl button { flex: none; font: inherit; font-size: 12px; border: 1px solid var(--cream-400); background: var(--cream-100); color: var(--ink-2); padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.lc-tpl button:hover { border-color: var(--green-600); color: var(--green-700); }
.lc-input { display: flex; gap: 8px; align-items: flex-end; }
.lc-input textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--cream-300); font: inherit; background: var(--cream-50); }
.lc-input textarea:focus { outline: none; border-color: var(--green-600); background: #fff; }
.lc-input .btn { height: 44px; background: linear-gradient(135deg, var(--green-700), var(--green-600)); box-shadow: 0 4px 12px rgba(47,122,74,.25); }

@media (max-width: 1023px) { .live { grid-template-columns: 290px 1fr; height: calc(100vh - 120px); } }
@media (max-width: 760px) {
  .live { grid-template-columns: 1fr; height: calc(100dvh - 100px); gap: 0; }
  .live .live-conv { display: none; }
  .live.show-conv .live-list { display: none; }
  .live.show-conv .live-conv { display: flex; }
  .lc-back { display: grid; }
  .lc-actions { width: 100%; }
  .lc-actions .btn { flex: 1; }
  .lc-b { max-width: 86%; }
  .lc-input .btn span { display: none; }
  .lc-input textarea { font-size: 16px; }
  #toastBox { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
.nav-badge[hidden] { display: none; }

/* ================= Data Rute: titik naik & titik turun terpisah ================= */
.rute-note { display: block; margin: 0 0 14px; line-height: 1.5; font-size: 13.5px; color: var(--ink-2); background: var(--gold-50); border: 1px dashed #EBCB8B; border-radius: 10px; padding: 9px 12px; }
.rute-note .ic { vertical-align: -3px; margin-right: 4px; color: var(--gold-700); }
.titik-box .w-act { white-space: nowrap; width: 1%; }
.titik-box .tbl th, .titik-box .tbl td { padding-left: 10px; padding-right: 10px; }
.rute-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.titik-box { background: var(--cream-50); border: 1px solid var(--cream-300); border-radius: 12px; overflow: hidden; }
.titik-box.t-naik { border-top: 4px solid var(--green-600); }
.titik-box.t-turun { border-top: 4px solid var(--red-700); }
.titik-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--cream-300); background: var(--cream-100); }
.titik-h h3 { margin: 0; font-size: 15.5px; color: var(--red-900); display: flex; align-items: center; gap: 8px; }
.titik-h .cnt { background: var(--red-700); color: #fff; font-size: 11.5px; border-radius: 999px; padding: 1px 8px; }
.titik-box .table-wrap { border: 0; border-radius: 0; }
.titik-box .tbl th:first-child, .titik-box .tbl td:first-child { padding-left: 14px; }
.kota-tag { display: inline-block; background: var(--blue-50); color: var(--blue-700); border: 1px solid #BCD6EA; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.combo { margin-top: 16px; border: 1px solid var(--cream-300); border-radius: 12px; background: var(--cream-50); }
.combo > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; color: var(--red-800); list-style: none; }
.combo > summary::-webkit-details-marker { display: none; }
.combo > summary::before { content: '▸ '; }
.combo[open] > summary::before { content: '▾ '; }
.combo .table-wrap { border: 0; border-top: 1px solid var(--cream-300); border-radius: 0 0 12px 12px; }
.rute-sum { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; }
@media (max-width: 1100px) { .rute-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .titik-h { padding: 10px 12px; }
  .titik-h .btn { width: 100%; justify-content: center; }
  .rute-sum { flex-direction: column; }
  .titik-box .tbl td:first-child { padding-left: 12px; }
}

/* ================= Versi Cloudflare: PDF, foto lampiran, transkrip ================= */
.boot { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }
.ibtn-pdf:hover { background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }
.ibtn-pdf { color: var(--red-700); }
button.lnk { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; }
.modal-box.lg { width: min(760px, 100%); }
.foto-view { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.foto-view img { max-width: 100%; max-height: 70vh; border-radius: 10px; border: 1px solid var(--cream-300); background: var(--cream-100); }
.tr-foto { display: block; margin-top: 8px; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tr-foto img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid var(--cream-300); }
.tr-row.user .tr-foto img { border-color: rgba(255,255,255,.4); }
.lc-row.cust .tr-foto img { border-color: rgba(255,255,255,.4); }
.tr-sys { text-align: center; font-size: 12.5px; color: var(--ink-2); background: var(--cream-100); border: 1px dashed var(--cream-400); border-radius: 999px; padding: 5px 14px; margin: 8px auto; width: fit-content; max-width: 90%; }
.tr-sys.internal { background: var(--gold-50); border-color: #EBCB8B; color: var(--gold-700); }
.tr-sys span { color: var(--muted); font-size: 11px; margin-left: 4px; }

/* ---------- Analisis AI komplain & emosi pelanggan ---------- */
.ai-box { min-width: 220px; max-width: 360px; font-size: 12.5px; line-height: 1.45; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.ai-tags span { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ai-urg.u-rendah { background: #E7F4EC; color: #1B5E36; }
.ai-urg.u-sedang { background: #FFF4DC; color: #7A4F0E; }
.ai-urg.u-tinggi { background: #FDE3E1; color: #A1221B; }
.ai-emo { background: #F1ECF9; color: #4B2E83; }
.ai-esk { background: #A1221B; color: #fff; }
.ai-sum { color: var(--ink, #3A2A22); }
.ai-saran { color: #5b4a3e; margin-top: 2px; }
.emo-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: #F1ECF9; color: #4B2E83; margin-left: 4px; white-space: nowrap; }
.emo-tag.neg { background: #FDE3E1; color: #A1221B; }

.btn-call { background: #2E9E5B; color: #fff; border-color: #2E9E5B; }
.btn-call:hover { filter: brightness(1.07); }
/* titik naik belum terhubung ke agen */
.lepas-box { padding-right: 16px; }
.lepas-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.t-naik .st-warn { display: inline-block; margin-top: 4px; white-space: normal; font-size: 11px; line-height: 1.3; }
/* ---- judul kolom yang bisa diurutkan (klik: naik ⇄ turun) ---- */
.tbl th.th-sort { cursor: pointer; user-select: none; transition: background .15s, color .15s; }
.tbl th.th-sort:hover { background: var(--gold-50); color: var(--red-800); }
.tbl th.th-sort:focus { outline: none; }
.tbl th.th-sort:focus-visible { outline: 2px solid var(--red-700); outline-offset: -3px; }
.tbl th.th-sort.on { color: var(--red-800); background: #FBE9D6; }
.th-in { display: inline-flex; align-items: center; gap: 6px; }
.th-ic { display: inline-flex; flex-direction: column; gap: 2px; flex: none; }
.th-ic i { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: .28; transition: opacity .15s; }
.th-ic .u { border-bottom: 5px solid currentColor; }
.th-ic .d { border-top: 5px solid currentColor; }
.tbl th.th-sort:hover .th-ic i { opacity: .5; }
.tbl th.th-sort.asc .th-ic .u, .tbl th.th-sort.desc .th-ic .d { opacity: 1; color: var(--red-700); }
.tbl th.th-sort.asc .th-ic .d, .tbl th.th-sort.desc .th-ic .u { opacity: .15; }
.tbl.mini th.th-sort .th-in { justify-content: center; }
/* status koordinat agen (fitur agen terdekat) */
.lok { font-size: 11.5px; margin-top: 3px; white-space: nowrap; }
.lok.ok { color: #2F7A4A; }
.lok.warn { color: var(--gold-700); }
.cnt-warn { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold-50); color: var(--gold-700); font-size: 11.5px; margin-left: 2px; }

/* ---------------- sidebar: menu & submenu (geser / lipat) ---------------- */
.brand-row { display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-row .brand { flex: 1; min-width: 0; border-bottom: 0; }
.side-toggle { flex: none; width: 34px; height: 34px; margin-right: 12px; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); color: #F8E6D2; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.side-toggle:hover { background: rgba(255,255,255,.16); }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 4px; }
.nav-grp { margin: 2px 0; }
.nav-grp-h { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: #FBE9D8; font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s; }
.nav-grp-h span { flex: 1; }
.nav-grp-h:hover { background: rgba(255,255,255,.09); }
.nav-grp.has-active > .nav-grp-h { color: #fff; }
.nav-cnt { font-size: 11px; font-weight: 700; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.12); color: #F1CBB0; display: inline-grid; place-items: center; }
.nav-chev { display: grid; transition: transform .25s ease; opacity: .8; }
.nav-grp.open .nav-chev { transform: rotate(90deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.nav-grp.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-in { overflow: hidden; margin-left: 20px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.14); }
.sidebar nav .nav-sub a { padding: 8px 10px; font-size: 14px; }
.sidebar nav .nav-sub a .ic { width: 16px; height: 16px; opacity: .9; }

/* mode ringkas (desktop): hanya ikon; klik kelompok untuk membuka kembali menu lengkap */
@media (min-width: 1024px) {
  .sidebar { transition: width .25s ease; }
  .sidebar.mini { width: 76px; overflow-x: hidden; }
  .sidebar.mini .brand div, .sidebar.mini nav a span, .sidebar.mini .nav-grp-h span,
  .sidebar.mini .nav-cnt, .sidebar.mini .nav-chev, .sidebar.mini .logout span,
  .sidebar.mini nav a > .ic + span + .ic, .sidebar.mini .nav-badge { display: none; }
  .sidebar.mini .brand-row { flex-direction: column; gap: 8px; padding-bottom: 10px; }
  .sidebar.mini .brand { padding: 16px 0 4px; justify-content: center; }
  .sidebar.mini .side-toggle { margin: 0; }
  .sidebar.mini nav a, .sidebar.mini .nav-grp-h, .sidebar.mini .logout { justify-content: center; padding: 11px 0; }
  .sidebar.mini .nav-sub { grid-template-rows: 0fr; }
  .sidebar.mini nav a.active { box-shadow: none; }
  .sidebar.mini .nav-grp.has-active > .nav-grp-h { background: rgba(255,255,255,.14); }
}
@media (max-width: 1023px) { .side-toggle { display: none; } }

.akses-tolak { text-align: center; padding: 48px 20px; color: var(--red-800); }
.akses-tolak h2 { margin: 14px 0 6px; color: var(--ink, #2A2320); font-size: 20px; }
.akses-tolak .btn { margin-top: 14px; }

/* ---------------- form User: hak akses menu ---------------- */
.akses-box { border: 1px solid var(--cream-300); border-radius: 12px; padding: 12px 14px; background: #fff; }
.akses-top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; }
.akses-top .muted { font-size: 12.5px; }
.akses-grp { border-top: 1px dashed var(--cream-300); padding: 8px 0 4px; }
.akses-grp:first-of-type { border-top: 0; }
.akses-grp-h { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--red-800); font-size: 13.5px; margin-bottom: 4px; }
.akses-grp-h label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.akses-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; padding-left: 24px; }
.akses-items label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; padding: 3px 0; }
.akses-box input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--red-700); }
.akses-box.terkunci { opacity: .6; pointer-events: none; }
.akses-chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--cream-200); color: var(--red-800); margin: 1px 3px 1px 0; white-space: nowrap; }
.akses-chip.semua { background: #E2F2E7; color: #1E7146; }
.brand-row .brand { padding-right: 8px; }
.brand-row .brand small { white-space: nowrap; }
