/* =========================================================
   CATAT — Catat Aduan, dan Tangani
   Stylesheet utama. Design tokens & komponen diadaptasi dari
   prototipe desain (Plus Jakarta Sans, aksen teal, sidebar gelap).
   ========================================================= */

:root {
  --bg: #F4F6F8;
  --ink: #0F172A;
  --ink-2: #1E293B;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --line: #E6EAEE;
  --line-2: #EEF2F5;
  --line-3: #F1F5F9;
  --card: #ffffff;

  --sidebar: #0C2A33;
  --sidebar-ink: #B5C9CE;
  --sidebar-muted: #7FA6AE;
  --sidebar-label: #5C7C84;

  --accent: #0d9488;
  --accent-ink: #0b7a72;
  --accent-soft: #F0FDFA;
  --accent-border: #CCFBF1;

  --danger: #DC2626;
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
input, textarea, select, button { font-family: inherit; }

::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: content-box; }

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: 400; font-style: normal; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block;
  white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* ---------------- App shell ---------------- */
.app { display: flex; height: 100vh; width: 100%; overflow: hidden; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--sidebar);
  display: flex; flex-direction: column; color: var(--sidebar-ink);
}
/* Area menu yang dapat di-scroll; brand di atas & tombol foot tetap ter-pin. */
.sidebar-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sidebar-scroll::-webkit-scrollbar { width: 7px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }
.sidebar-brand { padding: 20px 20px 16px; display: flex; align-items: center; gap: 11px; }
.sidebar-brand .logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(13,148,136,.35); color: #fff; font-size: 22px;
}
.sidebar-brand .name { color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.2px; line-height: 1.1; }
.sidebar-brand .sub { color: var(--sidebar-muted); font-size: 11px; font-weight: 600; letter-spacing: .3px; }

.sidebar-label {
  padding: 6px 14px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .8px;
  color: var(--sidebar-label); text-transform: uppercase;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; padding: 2px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; color: var(--sidebar-ink); font-size: 13.5px; font-weight: 600; transition: background .12s;
}
.nav-item .ms { font-size: 20px; }
.nav-item span.txt { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { color: #fff; background: rgba(13,148,136,.28); box-shadow: inset 3px 0 0 var(--accent); }
.nav-badge { background: #EF4444; color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 20px; padding: 1px 7px; }

.app-nav { display: flex; flex-direction: column; gap: 2px; padding: 2px 12px; }
.app-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 9px;
  cursor: pointer; color: var(--sidebar-ink); font-size: 12.5px; font-weight: 600;
}
.app-nav-item:hover, .app-nav-item.active { background: rgba(255,255,255,.06); color: #fff; }
.app-nav-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.app-nav-item .count { color: var(--sidebar-label); font-size: 11px; font-weight: 600; }

.sidebar-foot { margin-top: auto; padding: 14px; }
.btn-cta {
  width: 100%; border: none; border-radius: 11px; background: var(--accent); color: #fff;
  font-size: 13.5px; font-weight: 700; padding: 12px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 16px rgba(13,148,136,.3);
}
.btn-cta:hover { background: var(--accent-ink); }
.user-card {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-card .av { width: 34px; height: 34px; border-radius: 50%; background: #0891B2; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.user-card .nm { color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .rl { color: var(--sidebar-muted); font-size: 11px; }
.user-card a.logout { color: var(--sidebar-label); display: flex; }
.user-card a.logout:hover { color: #fff; }

/* ---------------- Main ---------------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 66px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 24px;
}
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--line-3); color: var(--muted); cursor: pointer; transition: background .12s, color .12s;
}
.sidebar-toggle:hover { background: #e2e8f0; color: var(--ink); }
.sidebar-toggle .ms { font-size: 22px; }

/* Sidebar sembunyi (collapse desktop) */
.sidebar-overlay { display: none; }
@media (min-width: 901px) {
  .app.sidebar-hidden .sidebar { display: none; }
}
.topbar .title { font-size: 16.5px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); line-height: 1.15; }
.topbar .subtitle { font-size: 12px; color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.search-box {
  display: flex; align-items: center; gap: 9px; background: var(--line-3); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px; height: 40px; width: 260px;
}
.search-box input { border: none; background: transparent; outline: none; font-size: 13px; width: 100%; color: var(--ink); }
.search-box .ms { font-size: 19px; color: var(--muted-2); }
.role-chip {
  display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px; height: 40px; font-size: 12.5px; font-weight: 600; color: #334155;
}
.role-chip .ms { font-size: 18px; color: var(--accent); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center;
}
.icon-btn .ms { font-size: 20px; color: #475569; }
.icon-btn .dot-notif { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #EF4444; border: 2px solid #fff; }

/* Identitas pengguna (nama + logout) di sudut kanan-atas topbar. */
.topbar-user { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.topbar-user .tu-id { display: flex; align-items: center; gap: 9px; color: inherit; padding: 3px 5px 3px 3px; border-radius: 10px; }
.topbar-user .tu-id:hover { background: var(--line-3); }
.topbar-user .tu-nm { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.topbar-user .tu-logout { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted); }
.topbar-user .tu-logout:hover { background: #FEF2F2; color: #DC2626; }
.topbar-user .tu-logout .ms { font-size: 20px; }

/* ---------------- Notifikasi (bell dropdown) ---------------- */
.notif-wrap { position: relative; }
.notif-badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 20px; background: #EF4444; color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.notif-panel { position: absolute; top: 48px; right: 0; width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.18); z-index: 40; display: none; overflow: hidden; }
.notif-panel.open { display: block; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; font-weight: 800; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line-3); color: inherit; }
.notif-item:hover { background: #F8FAFC; }
.notif-ico { font-size: 20px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.notif-judul { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.notif-pesan { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-waktu { font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.notif-foot { display: block; text-align: center; padding: 11px; font-size: 12.5px; font-weight: 700; border-top: 1px solid var(--line-2); }

.content { flex: 1; overflow: auto; }
.page { padding: 24px; max-width: 1400px; margin: 0 auto; }

/* ---------------- Cards & grid ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }

.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.stat-icon .ms { font-size: 22px; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 14px; color: var(--ink); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat-trend { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }

.section-title { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.section-sub { font-size: 12px; color: var(--muted); }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge .ms { font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.app-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--line-3); color: #334155; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.ticket-chip { display: inline-flex; align-items: center; gap: 3px; background: var(--accent-soft); color: #0F766E; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--accent-border); }
.ticket-chip .ms { font-size: 13px; }

.av { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }

/* ---------------- Buttons ---------------- */
.btn { border: none; border-radius: 10px; font-size: 13px; font-weight: 700; padding: 10px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn .ms { font-size: 18px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(13,148,136,.25); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: #475569; }
.btn-ghost:hover { border-color: #CBD5E1; }
.btn-sm { padding: 8px 13px; font-size: 12.5px; }

/* ---------------- Forms ---------------- */
.field-label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 7px; }
.field { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 13.5px; color: var(--ink); background: #fff; outline: none; }
.field:focus { border-color: var(--accent); }
textarea.field { resize: vertical; min-height: 100px; }
.select-sm { border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; height: 38px; font-size: 12.5px; font-weight: 600; color: #334155; background: #fff; cursor: pointer; outline: none; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 5px; }
.help { font-size: 11.5px; color: var(--muted-2); }

.pri-option { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--line); background: #fff; color: var(--muted); }
.pri-option.active { border-width: 1.5px; }

/* ---------------- Table (daftar tiket) ---------------- */
.table-toolbar { padding: 16px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.table-wrap { overflow-x: auto; }
.status-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.status-tab {
  padding: 12px 14px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s;
}
.status-tab:hover { color: var(--ink); }
.status-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
  display: inline-block; margin-left: 6px; min-width: 18px; padding: 1px 6px; border-radius: 20px;
  background: var(--line-3); color: var(--muted-2); font-size: 11px; font-weight: 800; text-align: center; line-height: 1.5;
}
.status-tab.active .tab-count { background: var(--accent-soft); color: var(--accent); }
.table-head, .table-row { display: grid; gap: 0; align-items: center; }
.table-head { padding: 12px 18px; background: #FAFBFC; border-bottom: 1px solid var(--line-2); font-size: 11px; font-weight: 700; color: var(--muted-2); letter-spacing: .4px; text-transform: uppercase; }
.table-row { padding: 14px 18px; border-bottom: 1px solid var(--line-3); cursor: pointer; }
.table-row:hover { background: #F8FAFC; }
.cell-strong { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-muted { font-size: 11.5px; color: var(--muted-2); }
.no-tiket { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { padding: 48px; text-align: center; color: var(--muted-2); font-size: 13px; }

/* ---------------- Kanban ---------------- */
.kanban-bar { padding: 16px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: #fff; }
.board-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: #fff; color: #475569; }
.board-chip.active { border-color: transparent; background: var(--sidebar); color: #fff; }
.kanban-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 18px 24px; }
.kanban-cols { display: flex; gap: 16px; height: 100%; min-width: min-content; }
.kanban-col { width: 290px; flex-shrink: 0; display: flex; flex-direction: column; background: #EFF2F5; border: 1.5px solid transparent; border-radius: 14px; padding: 12px 10px; max-height: 100%; transition: background .12s, border-color .12s; }
.kanban-col.drag-over { background: #ECFDF5; border-color: var(--accent); }
.kanban-col-head { display: flex; align-items: center; gap: 9px; padding: 2px 4px 12px; }
.kanban-col-head .nm { font-size: 13px; font-weight: 800; color: #334155; letter-spacing: -.2px; }
.kanban-col-head .cnt { font-size: 11.5px; font-weight: 700; color: var(--muted-2); background: #EEF2F5; border-radius: 20px; padding: 2px 8px; }
.kanban-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; padding: 2px; min-height: 40px; }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px; cursor: pointer; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: border-color .12s, box-shadow .12s; }
.task-card:hover { border-color: #CBD5E1; box-shadow: 0 6px 16px rgba(15,23,42,.08); }
.task-card.dragging { opacity: .5; }
.task-card .row { display: flex; align-items: center; gap: 6px; }
.task-card .judul { font-size: 13.5px; font-weight: 700; color: var(--ink-2); line-height: 1.35; margin: 9px 0 11px; }
.task-card .grip { font-size: 16px; color: #CBD5E1; cursor: grab; }
.task-meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); font-weight: 600; }
.col-empty { border: 2px dashed #E2E8F0; border-radius: 12px; padding: 20px; text-align: center; font-size: 12px; color: var(--muted-2); font-weight: 600; }

/* ---------------- Detail tiket ---------------- */
.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; margin-bottom: 14px; }
.back-link .ms { font-size: 17px; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.timeline-item { display: flex; gap: 12px; }
.timeline-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.timeline-icon .ms { font-size: 15px; }
.timeline-line { flex: 1; width: 2px; background: var(--line-2); min-height: 8px; margin: 4px auto; }
.reply-box { margin-top: 6px; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #134E4A; line-height: 1.5; }

/* ---------------- Modal ---------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; overflow: auto; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 760px; box-shadow: 0 24px 60px rgba(15,23,42,.3); overflow: hidden; }

/* ---------------- Toast / alert ---------------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--sidebar); color: #fff; border-radius: 12px; padding: 12px 18px; display: flex; align-items: center; gap: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.35); font-size: 13px; font-weight: 600; }
.toast .ms { font-size: 19px; color: #34D399; }
.alert { border-radius: 10px; padding: 11px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.alert-success { background: #DCFCE7; color: #15803D; }
.alert-danger { background: #FEE2E2; color: #B91C1C; }
.alert-info { background: var(--accent-soft); color: #0F766E; }

/* ---------------- Utility ---------------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }
.mb-4 { margin-top: 0; margin-bottom: 16px; }
.grow { flex: 1; }
.text-muted { color: var(--muted); }
.progress { height: 8px; border-radius: 6px; background: var(--line-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 6px; }

/* ---------------- Laporan ---------------- */
.report-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 2px solid var(--sidebar); }
.report-head .logo { width: 46px; height: 46px; border-radius: 11px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; }
.report-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.report-sub { font-size: 12.5px; color: var(--muted); }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); background: #FAFBFC; }
.report-table td { font-size: 13px; padding: 11px 12px; border-bottom: 1px solid var(--line-3); }
.report-table tr:last-child td { border-bottom: none; }
.report-table .num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.dist-row .nm { font-size: 12.5px; color: #334155; width: 130px; flex-shrink: 0; }
.dist-row .bar { flex: 1; height: 8px; border-radius: 6px; background: var(--line-3); overflow: hidden; }
.dist-row .bar > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.dist-row .val { font-size: 12.5px; font-weight: 700; width: 28px; text-align: right; }

/* ---------------- Basis Pengetahuan ---------------- */
.kb-isi h2 { font-size: 18px; font-weight: 800; margin: 18px 0 8px; color: var(--ink); }
.kb-isi h3 { font-size: 15.5px; font-weight: 700; margin: 16px 0 6px; color: var(--ink); }
.kb-isi p { margin: 0 0 10px; }
.kb-isi ul, .kb-isi ol { margin: 0 0 12px; padding-left: 22px; }
.kb-isi li { margin-bottom: 4px; }
.kb-isi a { color: var(--accent); text-decoration: underline; }
.kb-isi blockquote { margin: 0 0 12px; padding: 6px 14px; border-left: 3px solid var(--accent); background: var(--line-3); border-radius: 0 8px 8px 0; color: #475569; }
.kb-isi pre { background: #0F172A; color: #E2E8F0; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; margin: 0 0 12px; }
.kb-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 11px; color: inherit; background: #fff; transition: border-color .12s, background .12s;
}
.kb-link:hover { border-color: var(--accent); background: var(--line-3); }
.kb-link > .ms { font-size: 22px; color: var(--accent); flex-shrink: 0; }
.kb-link .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kb-link-judul { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-link-meta { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Sidebar drawer (mobile) ---------------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease; will-change: transform;
  }
  .app.sidebar-open .sidebar {
    transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  .app.sidebar-open .sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.5);
  }
}

/* ---------------- Responsif (tablet & mobile) ---------------- */
@media (max-width: 900px) {
  .page { padding: 18px 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  /* Grid dua/tiga kolom inline (dashboard, laporan, proyek) → satu kolom */
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 720px) {
  /* Topbar lebih ringkas agar muat di layar sempit */
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar .subtitle { display: none; }
  .topbar .search-box { width: 148px; }
  .role-chip { display: none; }
  .topbar-user .tu-nm { display: none; }
  .notif-panel { width: 300px; max-width: calc(100vw - 24px); }
  /* Tabel-grid (tiket, pengguna, dll): tumpuk tiap baris jadi kartu */
  .table-head { display: none; }
  .table-row { grid-template-columns: 1fr !important; min-width: 0 !important; row-gap: 7px; padding: 14px 16px; }
  .table-row > div { min-width: 0; }
  /* Tabel-native laporan: gulir horizontal agar tetap terbaca */
  .table-wrap > .report-table { min-width: 520px; }
  .modal-grid { grid-template-columns: 1fr !important; }
  .modal-grid > div:first-child { border-right: none !important; border-bottom: 1px solid var(--line-2); }
  .modal-overlay { padding: 20px 12px; }
}
@media (max-width: 560px) {
  .page { padding: 14px 12px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .topbar .search-box { display: none; }
  /* Filter dalam-halaman: penuh selebar layar */
  .table-toolbar .search-box { width: 100% !important; }
}

/* ---------------- Cetak (print-friendly) ---------------- */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app, .main, .content { display: block !important; height: auto !important; overflow: visible !important; }
  body { background: #fff !important; }
  .page { max-width: none !important; padding: 0 !important; }
  .card { border: 1px solid #D8DEE4 !important; box-shadow: none !important; break-inside: avoid; }
  .report-head { border-bottom-color: #0C2A33 !important; }
  @page { margin: 14mm; }
}
