@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #1F2420;
  --paper: #F6F4EE;
  --surface: #FFFFFF;
  --copper: #5B7A68;
  --copper-dark: #46604F;
  --rust: #B5652D;
  --rust-soft: #F3E3D6;
  --stone: #8B8D85;
  --stone-line: #DEDBD1;
  --danger: #A83B3B;
  --font-ui: 'Inter', -apple-system, sans-serif;
  --font-num: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- App shell ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow: hidden;
}

.sidebar__brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(246,244,238,0.12);
  margin-bottom: 16px;
}

.sidebar__brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
}

.sidebar__brand-sub {
  font-size: 12px;
  color: var(--stone);
  margin-top: 2px;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: rgba(246,244,238,0.75);
  transition: background 0.15s ease, color 0.15s ease;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: rgba(246,244,238,0.07);
  color: var(--paper);
}

.nav-item.active {
  background: var(--copper);
  color: #fff;
}

.sidebar__footer {
  padding: 12px 20px 0;
  border-top: 1px solid rgba(246,244,238,0.12);
  margin-top: 12px;
  font-size: 13px;
  color: var(--stone);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 12px;
}

.sidebar__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--copper);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}

.sidebar__role {
  font-size: 11px;
  color: var(--stone);
}

/* ---------- Main content ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: none;
}

.content {
  padding: 28px 32px 90px;
  max-width: 1180px;
  width: 100%;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 21px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-help-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--stone-line);
  background: var(--surface);
  color: var(--stone);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.page-help-icon:hover {
  background: var(--copper);
  border-color: var(--copper);
  color: #fff;
}

.page-head__hint {
  font-size: 13.5px;
  color: var(--stone);
  margin-top: 4px;
  max-width: 60ch;
}

.page-head__actions { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: var(--copper-dark); }

.btn-ghost { background: transparent; border-color: var(--stone-line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--stone); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.tab-filter { display: none; } /* digantikan .segmented di bawah */

.segmented {
  display: inline-flex;
  background: #EFEDE5;
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
}

.segmented button {
  border: none;
  background: transparent;
  padding: 7px 15px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--stone);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.segmented button:hover:not(.active) {
  color: var(--ink);
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

/* ---------- Cards / summary strip ---------- */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--stone-line);
  border: 1px solid var(--stone-line);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0 26px;
}

.summary-cell {
  background: var(--surface);
  padding: 16px 18px;
}

.summary-cell__label {
  font-size: 12px;
  color: var(--stone);
  margin-bottom: 6px;
}

.summary-cell__value {
  font-family: var(--font-num);
  font-size: 21px;
  font-weight: 600;
}

.summary-cell__value.accent { color: var(--copper); }
.summary-cell__value.warn { color: var(--rust); }

/* ---------- Section ---------- */
.section {
  background: var(--surface);
  border: 1px solid var(--stone-line);
  border-radius: 8px;
  margin-bottom: 22px;
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--stone-line);
}

.section__head h2 {
  font-size: 14.5px;
  font-weight: 600;
}

.section__hint {
  font-size: 12px;
  color: var(--stone);
  margin-top: 1px;
}

/* ---------- Pagination ---------- */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--stone-line);
}
.pagination-info {
  font-size: 12.5px;
  color: var(--stone);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}
.pagination-page, .pagination-nav {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--stone-line);
  background: var(--surface);
  border-radius: 6px;
  font-size: 12.5px;
  font-family: var(--font-num);
  color: var(--ink);
  cursor: pointer;
}
.pagination-page:hover, .pagination-nav:hover:not(:disabled) {
  border-color: var(--copper);
  color: var(--copper-dark);
}
.pagination-page.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.pagination-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pagination-ellipsis {
  color: var(--stone);
  padding: 0 4px;
  font-size: 12.5px;
}

@media (max-width: 860px) {
  .pagination-bar { flex-direction: column; align-items: flex-start; }
  .pagination-controls { flex-wrap: wrap; }
}

/* ---------- Ledger table ---------- */
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.ledger th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--stone);
  padding: 10px 18px;
  border-bottom: 1px solid var(--stone-line);
}

table.ledger td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--stone-line);
  vertical-align: middle;
}

table.ledger tr:last-child td { border-bottom: none; }

table.ledger .num {
  font-family: var(--font-num);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.ledger th.num { text-align: right; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.tag-paid { background: #E4EEE8; color: var(--copper-dark); }
.tag-partial { background: var(--rust-soft); color: var(--rust); }
.tag-unpaid { background: #F3E0E0; color: var(--danger); }
.tag-scheduled { background: #E9E7DD; color: var(--stone); }
.tag-done { background: #E4EEE8; color: var(--copper-dark); }

.row-name { font-weight: 600; }
.row-sub { font-size: 12px; color: var(--stone); margin-top: 1px; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.help-dot {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--stone-line);
  color: var(--stone);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: help;
  position: relative;
}

.help-dot .tip {
  display: none;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-weight: 400;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  width: 220px;
  line-height: 1.4;
  z-index: 10;
}

.help-dot:hover .tip { display: block; }

.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--stone-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
  border-color: var(--copper);
}

.field.num input { font-family: var(--font-num); text-align: right; }

.field-note { font-size: 11.5px; color: var(--stone); }

.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 10px;
  padding: 10px 18px;
  align-items: start;
  border-bottom: 1px solid var(--stone-line);
  min-width: 0;
}

.item-row > div {
  min-width: 0;
}

.item-row input,
.item-row select {
  width: 100%;
  min-width: 0;
}

/* Matikan spinner bawaan browser di angka supaya lebar kolom lebih terkontrol */
.item-row input[type="number"] {
  -moz-appearance: textfield;
}
.item-row input[type="number"]::-webkit-outer-spin-button,
.item-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.item-row-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 10px;
  padding: 0 18px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--stone);
  min-width: 0;
}

.item-row-head > div { min-width: 0; }

/* Varian 6 kolom: dipakai di form Pembelian (ada berat lokasi + gudang + selisih) */
.item-row.cols-6,
.item-row-head.cols-6 {
  grid-template-columns: 1.7fr 0.9fr 0.9fr 0.8fr 0.9fr auto;
}

.item-row-head span.help-dot {
  vertical-align: middle;
  margin-left: 2px;
}

.field-mobile-label {
  display: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--stone);
  margin-bottom: 3px;
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1px solid var(--stone-line);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--stone);
}
.icon-btn:hover { border-color: var(--danger); color: var(--danger); }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #FAFAF6;
  border-top: 1px solid var(--stone-line);
  border-radius: 0 0 8px 8px;
}

.form-total {
  font-size: 13px;
  color: var(--stone);
}
.form-total strong {
  font-family: var(--font-num);
  font-size: 18px;
  color: var(--ink);
  margin-left: 8px;
}

/* ---------- Empty state ---------- */
.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--stone);
}
.empty p { font-size: 13.5px; margin-top: 6px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 20px;
}

.login-card {
  background: var(--paper);
  border-radius: 10px;
  padding: 38px 34px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0 auto 22px;
}

.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card p { font-size: 13px; color: var(--stone); margin-bottom: 24px; }

.login-card .field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; justify-content: center; margin-top: 6px; padding: 11px; }

/* ---------- Mobile bottom nav ---------- */
.mobile-nav {
  display: none;
}

/* Panel "Lainnya" - default tersembunyi total di desktop;
   perilaku buka/tutup dan tata letaknya diatur khusus di
   media query mobile (max-width: 860px) di bawah. */
.more-sheet-overlay {
  display: none;
}

/* ---------- Calendar mini (visit page) ---------- */
.visit-list { display: flex; flex-direction: column; }
.visit-item {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--stone-line);
  align-items: center;
}
.visit-item:last-child { border-bottom: none; }
.visit-date {
  width: 52px;
  text-align: center;
  flex-shrink: 0;
}
.visit-date .d { font-family: var(--font-num); font-size: 19px; font-weight: 600; }
.visit-date .m { font-size: 11px; color: var(--stone); text-transform: uppercase; }
.visit-info { flex: 1; min-width: 0; }
.visit-info .t { font-weight: 600; font-size: 13.5px; }
.visit-info .s { font-size: 12px; color: var(--stone); margin-top: 2px; }
.visit-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Loading overlay (proses krusial) ---------- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31,36,32,0.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
.loading-overlay.open { display: flex; }

.loading-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(246,244,238,0.25);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}
.loading-message {
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- Konten Panduan (User Guide dalam modal) ---------- */
.guide-content { padding: 4px 20px 12px; }

.guide-section {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--stone-line);
}
.guide-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.guide-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-section h3::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--copper);
  border-radius: 2px;
  display: inline-block;
}

.guide-section p {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 8px;
}
.guide-section p:last-child { margin-bottom: 0; }

.guide-section code {
  background: #F0EEE6;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-num);
  font-size: 12px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0;
}
.guide-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--stone-line);
  vertical-align: top;
  line-height: 1.5;
}
.guide-table tr:last-child td { border-bottom: none; }
.guide-table td:first-child { width: 38%; color: var(--stone-dark, var(--ink)); }
.guide-table .num { font-family: var(--font-num); text-align: right; }

.guide-table--example {
  background: #FAFAF6;
  border: 1px solid var(--stone-line);
  border-radius: 8px;
  overflow: hidden;
}
.guide-table--example td { padding: 10px 14px; }

.guide-formula {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-num);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 14px 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  margin: 10px 0;
  overflow-x: auto;
}

.guide-formula-line {
  font-family: var(--font-num);
  font-size: 12.5px;
  color: var(--copper-dark);
  text-align: center !important;
  line-height: 1.8;
  padding: 10px !important;
}

.guide-note {
  font-size: 12.5px;
  color: var(--stone);
  background: #FAFAF6;
  border-left: 3px solid var(--copper);
  padding: 9px 12px;
  border-radius: 0 6px 6px 0;
  margin-top: 8px;
}

.guide-list {
  font-size: 13px;
  line-height: 1.7;
  padding-left: 18px;
  color: var(--ink);
}
.guide-list li { margin-bottom: 6px; }
.guide-list li:last-child { margin-bottom: 0; }

/* ---------- Modal / Pop-up ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31,36,32,0.55);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.15s ease;
}

.modal.modal-lg { max-width: 760px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stone-line);
}

.modal__head h2 { font-size: 16px; font-weight: 700; }
.modal__head p { font-size: 12.5px; color: var(--stone); margin-top: 3px; max-width: 46ch; }

.modal__close {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--stone);
  font-size: 16px;
  flex-shrink: 0;
}
.modal__close:hover { background: #F0EEE6; color: var(--ink); }

.modal__body { padding: 4px 0; overflow-y: auto; }

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--stone-line);
  background: #FAFAF6;
  border-radius: 0 0 10px 10px;
}

/* ---------- Mini chart (SVG line) ---------- */
.chart-wrap { padding: 18px 20px; }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--stone); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--copper); display: inline-block; }

/* ---------- Print sheet ---------- */
.print-sheet {
  max-width: 720px;
  margin: 30px auto;
  background: #fff;
  padding: 40px;
  border: 1px solid var(--stone-line);
}
.print-actions {
  max-width: 720px;
  margin: 16px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
@media print {
  .print-actions { display: none; }
  body { background: #fff; }
  .print-sheet { border: none; margin: 0; max-width: 100%; }
}

/* =================================================
   RESPONSIVE — mobile friendly
   ================================================= */
@media (max-width: 860px) {
  .sidebar { display: none; }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .form-footer .btn { width: 100%; justify-content: center; }
  .form-footer .form-total { text-align: center; margin-bottom: 4px; }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--ink);
    color: var(--paper);
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .topbar__brand { font-weight: 700; font-size: 15px; }

  .content { padding: 18px 16px 84px; }

  .summary-strip { grid-template-columns: repeat(2, 1fr); }

  .form-grid { grid-template-columns: 1fr; padding: 14px; }

  .item-row, .item-row-head,
  .item-row.cols-6, .item-row-head.cols-6 {
    grid-template-columns: 1fr !important;
    gap: 6px;
  }
  .item-row { padding: 12px 14px; border: 1px solid var(--stone-line); border-radius: 8px; margin: 0 14px 10px; }
  .item-row-head { display: none; }
  .field-mobile-label { display: block; }

  table.ledger thead { display: none; }
  table.ledger, table.ledger tbody, table.ledger tr, table.ledger td {
    display: block;
    width: 100%;
  }
  table.ledger tr {
    padding: 12px 18px;
    border-bottom: 1px solid var(--stone-line);
  }
  table.ledger td {
    border: none;
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    text-align: right;
  }
  table.ledger td.num { justify-content: space-between; }
  table.ledger td::before {
    content: attr(data-label);
    font-size: 11.5px;
    color: var(--stone);
    font-weight: 600;
    text-align: left;
  }
  table.ledger td[data-label=""]::before { display: none; }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--ink);
    padding: 6px 4px 8px;
    justify-content: space-around;
    z-index: 20;
    border-top: 1px solid rgba(246,244,238,0.1);
  }

  .mobile-nav a, .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: rgba(246,244,238,0.6);
    font-size: 10.5px;
    padding: 4px 8px;
    border-radius: 8px;
    background: none;
    border: none;
    font-family: inherit;
  }
  .mobile-nav a svg, .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav a.active, .mobile-nav button.active { color: #fff; }

  /* ---------- Panel "Lainnya" (bottom sheet) ---------- */
  .more-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31,36,32,0.55);
    z-index: 90;
    align-items: flex-end;
    justify-content: center;
  }
  .more-sheet-overlay.open { display: flex; }

  .more-sheet {
    background: var(--ink);
    color: var(--paper);
    width: 100%;
    max-width: 480px;
    border-radius: 18px 18px 0 0;
    padding: 10px 20px 24px;
    animation: sheet-up 0.2s ease;
  }
  @keyframes sheet-up {
    from { transform: translateY(16px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
  }

  .more-sheet__handle {
    width: 40px; height: 4px;
    background: rgba(246,244,238,0.25);
    border-radius: 4px;
    margin: 4px auto 14px;
  }
  .more-sheet__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--stone);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    padding: 0 4px;
  }
  .more-sheet__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .more-sheet__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 6px;
    border-radius: 12px;
    color: rgba(246,244,238,0.8);
    font-size: 11.5px;
    text-align: center;
  }
  .more-sheet__item svg { width: 22px; height: 22px; }
  .more-sheet__item.active { background: var(--copper); color: #fff; }
  .more-sheet__item:active { background: rgba(246,244,238,0.08); }

  .more-sheet__logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(246,244,238,0.2);
    background: rgba(246,244,238,0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
  }
  .more-sheet__logout svg { width: 17px; height: 17px; }

  .page-head__actions .btn span { display: none; }
  .page-head__actions .btn { padding: 9px; }

  .segmented { width: 100%; }
  .segmented button { flex: 1; }

  .section__head input[type="text"] { width: 100% !important; }
  .section__head { flex-wrap: wrap; }
  .section__head > div:not(:first-child) { width: 100%; }

  .visit-item {
    flex-wrap: wrap;
  }
  .visit-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 66px; /* sejajar dengan teks info, bukan ikut lebar kolom tanggal */
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  /* Di HP sangat sempit, 2 kolom masih terlalu sempit untuk kartu
     berisi label+tooltip+angka+tombol (Ambang Transaksi Besar, dst) */
  .summary-strip { grid-template-columns: 1fr; }
}
