/* ==========================================================================
   Redqueen Distro OS — Design System
   Tema: charcoal gelap + aksen crimson Redqueen, kartu glassmorphic
   ========================================================================== */

:root {
  --bg: #0A0B10;
  --bg-2: #101218;
  --bg-3: #161923;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-solid: #171A24;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #F4F5F9;
  --muted: #969CB3;
  --muted-2: #6E748B;
  --red: #E11D2E;
  --red-bright: #FF4757;
  --red-deep: #8B0E1C;
  --grad: linear-gradient(135deg, #E11D2E 0%, #FF5A5F 100%);
  --grad-soft: linear-gradient(135deg, rgba(225, 29, 46, 0.22) 0%, rgba(255, 90, 95, 0.12) 100%);
  --ok: #22C55E;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --danger: #F04438;
  --danger-bg: rgba(240, 68, 56, 0.15);
  --info: #38BDF8;
  --info-bg: rgba(56, 189, 248, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --sidebar-w: 258px;
  --gap: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(920px 520px at 8% -8%, rgba(225, 29, 46, 0.22), transparent 62%),
    radial-gradient(760px 480px at 100% 0%, rgba(139, 14, 28, 0.24), transparent 58%),
    radial-gradient(700px 520px at 50% 112%, rgba(255, 90, 95, 0.10), transparent 60%);
  background-attachment: fixed;
}

a { color: var(--red-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 6px; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
small { font-size: 0.8rem; }
code, .mono { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; font-size: 0.86em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }

/* ---------------------------------- Layout --------------------------------- */

.rq-shell { display: flex; min-height: 100vh; }

.rq-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: rgba(10, 11, 16, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-right: 1px solid var(--border);
  padding: 20px 14px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.rq-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.rq-brand img, .rq-brand svg { width: 40px; height: 40px; flex: 0 0 40px; }
.rq-brand-name {
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.1;
}
.rq-brand-sub { font-size: 0.63rem; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; }

.rq-nav-group { margin-bottom: 18px; }
.rq-nav-title {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  padding: 0 10px 7px;
  font-weight: 700;
}
.rq-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.89rem;
  font-weight: 500;
  margin-bottom: 2px;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.rq-nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.rq-nav a.active {
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(225, 29, 46, 0.34);
}
.rq-nav a .ic { width: 18px; height: 18px; flex: 0 0 18px; opacity: .95; }
.rq-nav a .pill {
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  font-size: 0.68rem;
  padding: 1px 7px;
  font-weight: 700;
}
.rq-nav a.active .pill { background: rgba(0,0,0,0.24); }

.rq-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.rq-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 16, 0.6);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  position: sticky;
  top: 0;
  z-index: 30;
}
.rq-page-title { font-size: 1.06rem; font-weight: 700; margin: 0; }
.rq-page-sub { font-size: 0.78rem; color: var(--muted); margin: 0; }
.rq-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.rq-content { padding: 24px 26px 60px; flex: 1 1 auto; }
.rq-content-narrow { max-width: 1080px; }

.rq-burger { display: none; }

.rq-user {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 6px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
}
.rq-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.76rem; color: #fff; flex: 0 0 30px;
}
.rq-user-meta { line-height: 1.15; padding-right: 8px; }
.rq-user-name { font-size: 0.79rem; font-weight: 600; }
.rq-user-role { font-size: 0.66rem; color: var(--muted); }

/* ---------------------------------- Cards ---------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: var(--gap); }

.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { margin-left: auto; }
.card-sub { font-size: 0.79rem; color: var(--muted); margin-top: 2px; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

.split { display: flex; gap: var(--gap); flex-wrap: wrap; }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad); opacity: .8;
}
.stat.stat-ok::after { background: linear-gradient(135deg, #22C55E, #4ADE80); }
.stat.stat-warn::after { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.stat.stat-info::after { background: linear-gradient(135deg, #38BDF8, #818CF8); }
.stat-label { font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 1.62rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.stat-sub { font-size: 0.76rem; color: var(--muted); margin-top: 3px; }
.stat-ic {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad-soft); display: grid; place-items: center;
  color: var(--red-bright);
}
.stat-ic svg { width: 17px; height: 17px; }

/* --------------------------------- Buttons --------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .16s ease, box-shadow .16s ease, opacity .16s;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(225, 29, 46, 0.32);
}
.btn-primary:hover { background: linear-gradient(135deg, #F5202F, #FF6B70); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { background: var(--danger-bg); border-color: rgba(240,68,56,0.4); color: #FF8A80; }
.btn-danger:hover { background: rgba(240, 68, 56, 0.26); }
.btn-ok { background: var(--ok-bg); border-color: rgba(34,197,94,0.42); color: #7CE8A4; }
.btn-sm { padding: 6px 11px; font-size: 0.79rem; border-radius: 8px; }
.btn-lg { padding: 15px 24px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-icon { padding: 8px; border-radius: 10px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------- Forms ---------------------------------- */

.field { margin-bottom: 14px; }
.field label, .label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); margin-bottom: 6px; letter-spacing: 0.02em;
}
.field .hint { font-size: 0.73rem; color: var(--muted-2); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], input[type=url],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(8, 9, 14, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit; font-size: 0.9rem;
  transition: border-color .16s, box-shadow .16s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(255, 90, 95, 0.65);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.16);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23969CB3' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
}
select option { background: var(--surface-solid); color: var(--ink); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(0.75); cursor: pointer; }

.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.88rem; }
.check input[type=checkbox], .check input[type=radio] {
  appearance: none; width: 20px; height: 20px; flex: 0 0 20px; margin: 1px 0 0;
  border: 1.5px solid var(--border-strong); border-radius: 6px;
  background: rgba(8,9,14,0.6); cursor: pointer; position: relative;
}
.check input[type=radio] { border-radius: 50%; }
.check input:checked { background: var(--grad); border-color: transparent; }
.check input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check input[type=radio]:checked::after {
  content: ''; position: absolute; left: 5.5px; top: 5.5px; width: 7px; height: 7px;
  border-radius: 50%; background: #fff;
}

.search-box { position: relative; min-width: 220px; flex: 1 1 220px; }
.search-box input { padding-left: 36px; }
.search-box svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted-2); pointer-events: none;
}

.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 16px;
}
.filter-bar .field { margin-bottom: 0; }
.filter-bar .field > * { min-width: 130px; }

/* ---------------------------------- Tables --------------------------------- */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(8, 9, 14, 0.35);
}
.table-scroll { overflow-x: auto; }
table.rq-table { width: 100%; border-collapse: collapse; font-size: 0.865rem; min-width: 560px; }
table.rq-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-weight: 700;
}
table.rq-table thead th.sortable { cursor: pointer; user-select: none; }
table.rq-table thead th.sortable:hover { color: var(--ink); }
table.rq-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  vertical-align: middle;
}
table.rq-table tbody tr:last-child td { border-bottom: 0; }
table.rq-table tbody tr:hover { background: rgba(255, 255, 255, 0.032); }
table.rq-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rq-table .actions { text-align: right; white-space: nowrap; }
table.rq-table td.strong { font-weight: 600; color: var(--ink); }
table.rq-table .sub { display: block; font-size: 0.75rem; color: var(--muted); }

.table-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted);
}
.table-foot .spacer { margin-left: auto; }
.pager { display: flex; gap: 6px; align-items: center; }
.pager button {
  min-width: 32px; height: 32px; padding: 0 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); border-radius: 8px; cursor: pointer; font-size: 0.8rem; font-weight: 600;
}
.pager button:hover:not(:disabled) { background: var(--surface-2); }
.pager button.active { background: var(--grad); border-color: transparent; color: #fff; }
.pager button:disabled { opacity: .35; cursor: default; }

.empty {
  text-align: center; padding: 44px 20px; color: var(--muted);
}
.empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 10px; }
.empty h3 { color: var(--ink); }
.empty p { font-size: 0.85rem; margin: 0 auto 14px; max-width: 380px; }

/* ---------------------------------- Badges --------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: #7CE8A4; border-color: rgba(34,197,94,0.32); }
.badge-warn { background: var(--warn-bg); color: #FCD34D; border-color: rgba(245,158,11,0.32); }
.badge-danger { background: var(--danger-bg); color: #FF9B93; border-color: rgba(240,68,56,0.34); }
.badge-info { background: var(--info-bg); color: #8BD8FB; border-color: rgba(56,189,248,0.32); }
.badge-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge-red { background: rgba(225,29,46,0.16); color: #FF8A8A; border-color: rgba(225,29,46,0.36); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 99px; font-size: 0.78rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.chip strong { color: var(--ink); font-weight: 700; }

.kv { display: grid; grid-template-columns: 118px 1fr; gap: 7px 14px; font-size: 0.87rem; }
.kv dt { color: var(--muted); font-size: 0.8rem; }
.kv dd { margin: 0; font-weight: 500; }

/* ---------------------------------- Alerts --------------------------------- */

.alert {
  padding: 12px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 0.86rem; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 2px; }
.alert-ok { background: var(--ok-bg); border-color: rgba(34,197,94,0.34); color: #A7F3C4; }
.alert-danger { background: var(--danger-bg); border-color: rgba(240,68,56,0.36); color: #FFB4AF; }
.alert-warn { background: var(--warn-bg); border-color: rgba(245,158,11,0.34); color: #FDE68A; }
.alert-info { background: var(--info-bg); border-color: rgba(56,189,248,0.3); color: #BAE6FD; }

/* ---------------------------------- Modals --------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center;
  padding: 20px; z-index: 100; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 620px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: auto;
  max-height: 92vh; overflow-y: auto;
  animation: rqPop .18s ease;
}
.modal.modal-lg { max-width: 860px; }
.modal.modal-sm { max-width: 430px; }
@keyframes rqPop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; }
.modal-head .close {
  margin-left: auto; background: var(--surface); border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 9px; color: var(--muted);
  cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; line-height: 1;
}
.modal-head .close:hover { color: var(--ink); background: var(--surface-2); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* ---------------------------------- Toasts --------------------------------- */

#rq-toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.toast {
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 12px 15px; font-size: 0.85rem;
  box-shadow: var(--shadow);
  animation: rqSlide .2s ease;
}
.toast.t-ok { border-left-color: var(--ok); }
.toast.t-err { border-left-color: var(--danger); }
.toast.t-warn { border-left-color: var(--warn); }
@keyframes rqSlide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ------------------------------- Login page -------------------------------- */

.rq-login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 430px;
  background: rgba(20, 22, 30, 0.78);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand svg, .login-brand img { width: 116px; height: auto; margin-bottom: 12px; }
.login-brand h1 { font-size: 1.05rem; letter-spacing: 0.2em; text-transform: uppercase; }
.login-brand p { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; margin: 0; }
.demo-accounts { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.demo-accounts h3 { font-size: 0.74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.demo-list { display: grid; gap: 7px; margin-top: 10px; }
.demo-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 11px;
  color: var(--ink); font: inherit; font-size: 0.79rem; cursor: pointer; text-align: left;
}
.demo-item:hover { background: var(--surface-2); }
.demo-item .role { font-weight: 700; color: var(--red-bright); min-width: 96px; }
.demo-item .em { color: var(--muted); margin-left: auto; font-size: 0.74rem; }

/* ------------------------------ Sales mobile UI ---------------------------- */

.rq-mobile {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 14px 96px;
  min-height: 100vh;
}
.m-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px 12px;
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(10,11,16,0.96) 70%, rgba(10,11,16,0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 0 -14px 6px;
  padding-left: 18px; padding-right: 18px;
}
.m-topbar .ttl { font-size: 1rem; font-weight: 700; margin: 0; }
.m-topbar .sub { font-size: 0.73rem; color: var(--muted); margin: 0; }
.m-topbar .back {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
}
.m-hero {
  background: var(--grad);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: var(--gap);
  box-shadow: 0 14px 32px rgba(225, 29, 46, 0.28);
}
.m-hero h2 { margin: 0 0 2px; font-size: 1.16rem; }
.m-hero p { margin: 0; font-size: 0.82rem; opacity: .92; }
.m-hero-stats { display: flex; gap: 10px; margin-top: 16px; }
.m-hero-stats div {
  flex: 1; background: rgba(0, 0, 0, 0.2); border-radius: 12px;
  padding: 9px 11px; text-align: center;
}
.m-hero-stats .v { font-size: 1.26rem; font-weight: 800; line-height: 1.1; }
.m-hero-stats .l { font-size: 0.66rem; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }

.task-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--ink); text-decoration: none;
  position: relative;
}
.task-card:hover { text-decoration: none; background: var(--surface-2); }
.task-card.done { opacity: .72; }
.task-card .tname { font-weight: 700; font-size: 0.97rem; margin-bottom: 2px; padding-right: 74px; }
.task-card .taddr { font-size: 0.78rem; color: var(--muted); }
.task-card .tmeta { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.task-card .tst { position: absolute; top: 15px; right: 15px; }
.task-card .go {
  position: absolute; right: 14px; bottom: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center; color: #fff;
}

.m-actions { display: grid; gap: 12px; }
.m-action {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 18px;
  color: var(--ink); font-weight: 600; text-decoration: none; font-size: 0.96rem;
  min-height: 64px;
}
.m-action:hover { text-decoration: none; background: var(--surface-2); }
.m-action .mic {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
  background: var(--grad-soft); display: grid; place-items: center; color: var(--red-bright);
}
.m-action .mic svg { width: 21px; height: 21px; }
.m-action .arrow { margin-left: auto; color: var(--muted-2); }
.m-action .sub { display: block; font-weight: 400; font-size: 0.76rem; color: var(--muted); }

.m-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center;
  background: rgba(10, 11, 16, 0.9);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border-top: 1px solid var(--border);
  padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));
}
.m-nav-inner { display: flex; width: 100%; max-width: 540px; }
.m-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; border-radius: 12px; color: var(--muted);
  font-size: 0.66rem; font-weight: 600; text-decoration: none;
}
.m-nav a svg { width: 21px; height: 21px; }
.m-nav a.active { color: #fff; background: var(--grad); }
.m-nav a:hover { text-decoration: none; }
.m-nav a .dot {
  position: absolute; transform: translate(13px, -3px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--red-bright);
  box-shadow: 0 0 0 2px var(--bg);
}
/* Tombol keluar di bottom-nav sales: dipisah garis agar tidak tertekan tanpa sengaja */
.m-nav a.m-nav-exit {
  color: #FF8A8A;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.m-nav a.m-nav-exit:active { background: var(--danger-bg); }

/* Tombol keluar ringkas di topbar sales */
.m-logout {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; color: var(--muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.m-logout:hover { color: #FF8A8A; background: var(--danger-bg); border-color: rgba(240,68,56,.34); }
.m-logout:active { transform: scale(.96); }

.step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.76rem; font-weight: 700;
  color: var(--muted); flex: 0 0 26px;
}
.step-dot.on { background: var(--grad); border-color: transparent; color: #fff; }
.step-dot.done { background: var(--ok-bg); border-color: rgba(34,197,94,.4); color: #7CE8A4; }
.step-line { flex: 1; height: 2px; background: var(--border); border-radius: 2px; }

.cam-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #05060a;
  border: 1px solid var(--border);
  aspect-ratio: 3 / 4;
  max-height: 60vh;
  display: grid; place-items: center;
}
.cam-frame video, .cam-frame img.preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-frame .cam-guide {
  position: absolute; inset: 12%; border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 14px; pointer-events: none;
}
.cam-frame .cam-hint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); padding: 6px 14px; border-radius: 99px;
  font-size: 0.78rem; white-space: nowrap;
}
.scan-status { text-align: center; font-size: 0.84rem; color: var(--muted); margin-top: 12px; }

.gps-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); font-size: 0.85rem;
}
.gps-pill .gdot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--muted-2); flex: 0 0 10px;
}
.gps-pill.ok .gdot { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.gps-pill.warn .gdot { background: var(--warn); box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.gps-pill.err .gdot { background: var(--danger); box-shadow: 0 0 0 4px rgba(240,68,56,.18); }
.gps-pill .gval { margin-left: auto; font-size: 0.78rem; color: var(--muted); text-align: right; }

.summary-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px;
  font-size: 0.87rem;
}
.summary-row .val { margin-left: auto; font-weight: 700; }

.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-row .qname { flex: 1; min-width: 0; font-size: 0.87rem; }
.qty-row .qname b { display: block; font-weight: 600; }
.qty-row .qname span { font-size: 0.74rem; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.stepper button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; line-height: 1; display: grid; place-items: center;
}
.stepper button:hover { background: rgba(255,255,255,0.14); }
.stepper input {
  width: 62px; text-align: center; padding: 8px 4px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sync-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 99px; font-size: 0.72rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.sync-pill.online { color: #7CE8A4; border-color: rgba(34,197,94,.34); background: var(--ok-bg); }
.sync-pill.offline { color: #FCD34D; border-color: rgba(245,158,11,.34); background: var(--warn-bg); }
.sync-pill .sdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync-pill.busy .sdot { animation: rqBlink .8s infinite; }
@keyframes rqBlink { 50% { opacity: .25; } }

.progress-bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; }
.progress-bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .3s ease; }

.thumb {
  width: 44px; height: 44px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in;
}
.thumb-ph { display: grid; place-items: center; color: var(--muted-2); }

.logo-lg { width: 54px; height: 54px; }

/* ---------------------------------- Print ---------------------------------- */

.print-only { display: none; }

@media print {
  :root { --ink: #000; --muted: #444; }
  body { background: #fff !important; background-image: none !important; color: #000 !important; }
  .rq-sidebar, .rq-topbar, .m-nav, .no-print, #rq-toasts, .modal-backdrop { display: none !important; }
  .rq-content, .rq-mobile { padding: 0 !important; max-width: none !important; }
  .card, .table-wrap, .stat { background: #fff !important; border-color: #ccc !important; box-shadow: none !important; backdrop-filter: none !important; }
  .print-only { display: block !important; }
  table.rq-table { font-size: 11pt; min-width: 0; }
  table.rq-table thead th { background: #f2f2f2 !important; color: #000 !important; }
  table.rq-table tbody td { border-color: #ddd !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .badge { border-color: #999 !important; color: #000 !important; background: #f4f4f4 !important; }
  .qr-label-sheet { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 12mm; }
  .qr-label {
    border: 1px dashed #999 !important; border-radius: 4mm; padding: 6mm;
    text-align: center; background: #fff !important; page-break-inside: avoid;
  }
  .invoice-print { max-width: none !important; }
  .page-break { page-break-after: always; }
}

/* ------------------------------- Responsive -------------------------------- */

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rq-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  .rq-sidebar.open { transform: none; }
  .rq-burger {
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 11px; flex: 0 0 38px;
    background: var(--surface); border: 1px solid var(--border); color: var(--ink); cursor: pointer;
  }
  .rq-burger svg { width: 19px; height: 19px; }
  .rq-scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 35; display: none;
  }
  .rq-scrim.open { display: block; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .rq-content { padding: 18px 14px 60px; }
  .rq-topbar { padding: 11px 14px; }
  .rq-page-sub { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .rq-user-meta { display: none; }
  .card { padding: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .stat-value { font-size: 1.42rem; }
  #rq-toasts { left: 14px; right: 14px; bottom: 82px; max-width: none; }
  .modal { padding: 18px; border-radius: 16px; }
  .filter-bar .field, .filter-bar .search-box { flex: 1 1 100%; min-width: 0; }
  .filter-bar .field > * { min-width: 0; }
}
