:root {
  --sidebar:   #0f172a;
  --bg:        #fafafa;
  --surface:   #ffffff;
  --card:      #ffffff;
  --border:    #e4e4e7;
  --pink:      #EC4899;
  --navy:      #214CA0;
  --primary:   #EC4899;
  --amber:     #f59e0b;
  --amber-fg:  #ca8a04;
  --green:     #16a34a;
  --green-bg:  #dcfce7;
  --red:       #dc2626;
  --red-bg:    #fee2e2;
  --text:      #09090b;
  --muted:     #71717a;
  --subtle:    #a1a1aa;
  --sans:      'Plus Jakarta Sans', sans-serif;
  --heading:   'Syne', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --radius:    10px;
  --sub:       #a1a1aa;    /* alias of --subtle, used in JS templates */
  --primary-hover: #db2777;
  --bg-subtle:     #f4f4f5;
  --pink-surface:  #fdf2f8;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,.10);
  --transition:    150ms ease;
  /* Legacy aliases — kept for backward compat with inline styles */
  --ocean:     #18181b;
  --wave:      #EC4899;
  --foam:      #fce7f3;
  --accent:    #f59e0b;
  --blue:      #6366f1;
  --blue-bg:   #ede9fe;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text)
}

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar)
}

.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2)
}

.login-logo {
  text-align: center;
  margin-bottom: 28px
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--heading);
  color: var(--text)
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px
}

.login-field {
  margin-bottom: 16px
}

.login-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: block
}

.login-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 11px 14px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .2s
}

.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(236,72,153,.1)
}

.login-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  margin-top: 8px
}

.login-btn:hover { background: var(--primary-hover) }

.login-btn:disabled {
  opacity: .6;
  cursor: not-allowed
}

.login-err {
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 12px;
  display: none
}

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 0
}

.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.sidebar-logo {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--heading);
  color: #fff;
  line-height: 1.2
}

.sidebar-sub {
  font-size: 10px;
  color: rgba(255,255,255,.3);
  margin-top: 1px;
  letter-spacing: .04em
}

.nav-item {
  padding: 8px 12px;
  margin: 2px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75)
}

.nav-item.active {
  background: rgba(236,72,153,.12);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary)
}

.nav-item svg {
  flex-shrink: 0
}

.nav-item.active svg {
  stroke: var(--primary)
}

.nav-item:not(.active) svg {
  stroke: rgba(255,255,255,.35)
}

.nav-icon {
  display: none
}

.sidebar-section {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.2);
  padding: 12px 20px 6px
}

.sidebar-spacer {
  flex: 1
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 8px 16px
}

.main {
  flex: 1;
  overflow-x: hidden
}

.topbar {
  background: var(--sidebar);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.topbar .page-title { color: #fff }
.topbar-title { font-size: 17px; font-weight: 700; font-family: var(--heading); color: #fff; line-height: 1.2 }
.topbar-sub   { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 1px }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px
}

.topbar .btn-action {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
  color: #fff
}

.topbar .btn-action:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.3);
  color: #fff
}

.topbar .btn-action.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff
}

.topbar .btn-action.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff
}

/* ── Page header (new pattern) ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 0
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--heading);
  color: var(--text);
  line-height: 1.2
}

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

.date-badge {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 5px 12px;
  border-radius: 99px
}

.topbar .date-badge {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.65)
}

.topbar #batchBadge {
  background: rgba(255,255,255,.1) !important;
  color: rgba(255,255,255,.8) !important
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 28px 0
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition)
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md)
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--heading);
  color: var(--text);
  line-height: 1
}

.stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px
}

/* ── Filters ── */
.filters {
  padding: 20px 28px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center
}

.filter-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary)
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600
}

.search-input {
  margin-left: auto;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  outline: none;
  background: var(--surface);
  transition: border-color .2s;
  min-width: 200px
}

.search-input:focus {
  border-color: var(--wave)
}

/* ── Table ── */
.table-wrap {
  padding: 16px 28px 40px;
  overflow-x: auto
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border)
}

.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--subtle);
  background: var(--bg);
  border-bottom: 1px solid var(--bg-subtle)
}
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable::after { content: ' ⇅'; font-size: 9px; opacity: 0.3; }
.table th.sort-asc::after { content: ' ▲'; opacity: 1; color: var(--wave); }
.table th.sort-desc::after { content: ' ▼'; opacity: 1; color: var(--wave); }

.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--bg-subtle);
  font-size: 13px;
  vertical-align: middle
}

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

.table tr:hover td {
  background: var(--bg)
}

.resi-mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--primary);
  font-weight: 500
}

.nama-bold {
  font-weight: 600
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap
}

.b-gudang_jkt { background: #ede9fe; color: #6366f1 }
.b-kapal      { background: #fef9c3; color: #ca8a04 }
.b-tual       { background: #fce7f3; color: #EC4899 }
.b-selesai    { background: #dcfce7; color: #16a34a }

.bayar-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: .03em;
  text-transform: uppercase
}

.bayar-lunas { background: #dcfce7; color: #16a34a }
.bayar-belum { background: #fee2e2; color: #dc2626 }
.bayar-dp    { background: #fef9c3; color: #ca8a04 }

/* Generic badge color variants — used in pesawat item table */
.badge-green  { background: #dcfce7; color: #16a34a }
.badge-red    { background: #fee2e2; color: #dc2626 }
.badge-blue   { background: #ede9fe; color: #6366f1 }
.badge-gray   { background: var(--bg-subtle); color: #71717a }
.badge-orange { background: #fef9c3; color: #ca8a04 }

.btn-action {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all .15s
}

.btn-action:hover { border-color: var(--primary); color: var(--primary) }

.btn-action.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary)
}

.btn-action.primary:hover { background: var(--primary-hover) }

.btn-action.pink {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink)
}

/* ── Import modal ── */
.import-drop {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg)
}
.import-drop:hover, .import-drop.drag { border-color: var(--wave); background: var(--foam) }
.import-drop input[type=file] { opacity: 0; position: absolute; z-index: -1; }
.import-preview { margin-top:16px; overflow-x:auto; max-height:300px; overflow-y:auto }
.import-preview table { width:100%; border-collapse:collapse; font-size:12px }
.import-preview th { background:var(--bg); padding:7px 10px; text-align:left; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); position:sticky; top:0 }
.import-preview td { padding:7px 10px; border-bottom:1px solid var(--border) }
.import-preview tr.row-error td { background:var(--red-bg); color:var(--red) }
.import-result { font-size:13px; margin-top:12px; padding:10px 14px; border-radius:8px }
.import-result.ok  { background:var(--green-bg); color:var(--green) }
.import-result.err { background:var(--red-bg); color:var(--red) }

/* ── Checkbox ── */
.cb-wrap { display:flex; align-items:center; justify-content:center }
.row-cb  { width:16px; height:16px; cursor:pointer; accent-color:var(--primary) }
tr.selected td { background:#f0f9fb }

/* ── Bulk bar ── */
.bulk-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  background: var(--sidebar);
  color: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 900;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease
}
.bulk-bar.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto }
body.bulk-active .modal-overlay { padding-bottom: 90px }
.bulk-count { font-size: 13px; font-weight: 600 }
.bulk-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity .15s
}
.bulk-btn:hover { opacity: .85 }
.bulk-btn.edit   { background: var(--wave);  color: #fff }
.bulk-btn.danger { background: var(--red);   color: #fff }
.bulk-btn.clear  { background: rgba(255,255,255,.15); color: #fff }
.btn-delete { font-family:var(--sans); font-size:12px; font-weight:500; padding:5px 10px; border-radius:8px; border:1.5px solid var(--red); background:transparent; color:var(--red); cursor:pointer; transition:all .15s }
.btn-delete:hover { background:var(--red); color:#fff }
.dropdown-item { display:block; width:100%; font-family:var(--sans); font-size:13px; font-weight:500; padding:8px 12px; border-radius:6px; border:none; background:transparent; color:var(--text); text-align:left; cursor:pointer; transition:background .15s }
.dropdown-item:hover { background:var(--bg) }

/* ── Pagination ── */
.pagination-bar { display:flex;align-items:center;justify-content:space-between;padding:12px 24px;border-top:1px solid var(--border);font-size:13px;color:var(--muted);flex-wrap:wrap;gap:8px }
.pg-btns { display:flex;gap:4px }
.pg-btn { font-family:var(--sans);font-size:12px;font-weight:500;padding:5px 10px;border-radius:8px;border:1.5px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;transition:all .15s }
.pg-btn:hover:not(:disabled) { border-color:var(--wave);color:var(--wave) }
.pg-btn.active { background:var(--wave);color:#fff;border-color:var(--wave) }
.pg-btn:disabled { opacity:.4;cursor:default }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  align-items: center;
  justify-content: center
}

.modal-overlay.open {
  display: flex
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  border-top: 3px solid var(--primary);
  overflow: hidden;
  width: 100%;
  max-width: 500px;
  margin: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
  max-height: 90vh;
  overflow-y: auto
}

/* Alias for modals that use .modal-box instead of .modal */
.modal-box {
  background: var(--surface);
  border-radius: 16px;
  border-top: 3px solid var(--primary);
  overflow: hidden;
  width: 100%;
  max-width: 500px;
  margin: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
  max-height: 90vh;
  overflow-y: auto
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.modal-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.modal-header-info { flex: 1; min-width: 0 }

.modal-title {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--heading);
  color: var(--text);
  margin-bottom: 1px
}

.modal-resi {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--primary)
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0
}

.modal-body {
  padding: 16px 20px
}

.field-group {
  margin-bottom: 14px
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  display: block
}

.field-label .field-hint {
  font-size: 10px;
  color: var(--subtle);
  font-weight: 400;
  margin-left: 4px
}

.field-select,
.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  outline: none;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition)
}

.field-select:focus,
.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(236,72,153,.1)
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px
}

.btn-cancel {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  background: var(--bg-subtle);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s
}

.btn-cancel:hover { background: #e4e4e7 }

.btn-save {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background .15s
}

.btn-save:hover { background: var(--primary-hover) }

.btn-primary {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background .15s
}
.btn-primary:hover { background: var(--primary-hover) }
.btn-primary:disabled { opacity: .6; cursor: not-allowed }

.btn-secondary {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all .15s
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary) }

/* ── Harga preview box ── */
.harga-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px
}

.harga-preview-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 2px
}

.harga-preview-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text)
}

.harga-preview-total .harga-preview-val {
  color: var(--green)
}

.harga-preview-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0
}

.harga-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 12px
}

.harga-row:last-child {
  margin-bottom: 0;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px
}

.harga-row span:first-child { color: var(--muted) }
.harga-row span:last-child  { color: var(--text); font-family: var(--mono) }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: var(--sidebar);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(8px);
  transition: all .2s;
  pointer-events: none
}

.toast.show {
  opacity: 1;
  transform: none
}
.toast.toast-success { background: #16a34a; }
.toast.toast-error   { background: #dc2626; }

.loading-row td {
  text-align: center;
  padding: 32px;
  color: var(--muted)
}

/* ── Batch page cards ── */
.batch-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:16px;margin-top:4px }
.batch-card { background:var(--surface);border-radius:var(--radius);border:1px solid var(--border);padding:20px;transition:box-shadow .15s }
.batch-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.08) }
.batch-card-header { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px }
.batch-card-title { font-size:15px;font-weight:600;color:var(--text) }
.batch-card-meta { font-size:11px;color:var(--muted);margin-top:3px }
.batch-card-actions { display:flex;gap:8px;margin-top:14px;flex-wrap:wrap }

/* ── Batch detail ── */
.detail-header { display:flex;align-items:center;gap:12px;padding:16px 24px;background:var(--surface);border-bottom:1px solid var(--border) }
.detail-back { background:none;border:none;font-size:20px;cursor:pointer;color:var(--muted);padding:4px 8px;border-radius:6px;line-height:1 }
.detail-back:hover { background:var(--bg);color:var(--text) }
.detail-title { font-size:17px;font-weight:600 }
.detail-meta { font-size:12px;color:var(--muted);margin-top:2px }
.stat6 { display:grid;grid-template-columns:repeat(6,1fr);gap:12px;padding:16px 24px }
.stat6 .stat-card { padding:14px 16px; min-width: 0; }
.stat6 .stat-card .stat-label { font-size:10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat6 .stat-card .stat-value { font-size:18px; white-space: nowrap; }
.detail-filter-bar { display:flex;gap:8px;padding:0 24px 12px;flex-wrap:wrap;align-items:center }
.detail-content { padding:0 24px 40px }
.detail-bulk-bar { display:flex;align-items:center;gap:12px;padding:0 24px;background:var(--ocean);color:#fff;font-size:13px;max-height:0;overflow:hidden;opacity:0;transition:max-height .2s ease,opacity .2s ease,padding .2s ease }
.detail-bulk-bar.visible { max-height:50px;opacity:1;padding:8px 24px }

/* ── Income / Expense ── */
.ie-section { margin-top:24px;display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start }
.ie-card { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px }
.ie-card-title { font-size:13px;font-weight:600;color:var(--text);margin-bottom:14px;padding-bottom:10px;border-bottom:1px solid var(--border) }
.ie-row { display:flex;justify-content:space-between;align-items:center;font-size:12px;margin-bottom:8px }
.ie-row .label { color:var(--muted) }
.ie-row .value { font-weight:600;font-family:var(--mono) }
.progress-income { display:flex;height:8px;border-radius:4px;overflow:hidden;margin:10px 0 }
.pi-lunas { background:var(--green) }
.pi-dp    { background:var(--accent) }
.pi-belum { background:var(--border) }
.profit-box { margin-top:14px;padding:16px;background:var(--surface);border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,0.05);border:1px solid var(--border) }
.profit-row { display:flex;justify-content:space-between;font-size:12px;margin-bottom:6px }
.profit-row.total { font-weight:700;font-size:14px;padding-top:10px;border-top:1px solid var(--border);margin-top:10px }
.profit-positive { color:var(--green) }
.profit-negative { color:var(--red) }

/* ── Form inputs (finance page) ── */
.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  display: block;
}
.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  outline: none;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(236,72,153,.1);
}

/* ── Biaya table ── */
.biaya-table { width:100%; border-collapse:collapse; font-size:12px; margin-top:10px }
.biaya-table th { text-align:left; padding:8px; border-bottom:1px solid var(--border); color:var(--muted); font-weight:600 }
.biaya-table td { padding:8px; border-bottom:1px solid var(--border) }
.biaya-form { display:grid; grid-template-columns:2fr 3fr 2fr 2fr auto; gap:10px; align-items:end; margin-top:16px; padding-top:16px; border-top:1px solid var(--border) }
.biaya-form-ops { display:grid; grid-template-columns:1fr 2fr 3fr 2fr auto; gap:10px; align-items:end; margin-top:16px; padding-top:16px; border-top:1px solid var(--border) }
.btn-hapus-biaya { background:none; border:none; color:var(--red); font-size:14px; cursor:pointer; padding:4px; opacity:.7; transition:opacity .15s }
.btn-hapus-biaya:hover { opacity:1 }

/* Mobile Table to Card */
@media (max-width: 768px) {
  .biaya-form, .biaya-form-ops { grid-template-columns: 1fr; gap: 12px; }
  .table, .table tbody, .table tr, .table td {
    display: block;
    width: 100%;
  }
  .table thead {
    display: none;
  }
  .table tr {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface);
  }
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--foam);
  }
  .table td:last-child {
    border-bottom: none;
  }
  .table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .cb-wrap {
    justify-content: flex-end;
  }
  .table-wrap {
    background: transparent;
    border: none;
    padding: 16px;
  }
}


/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    overflow: hidden;
    padding: 0;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 500;
    transition: width .25s ease
  }
  .sidebar.open {
    width: 240px;
    padding: 0
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 499
  }
  .sidebar-overlay.open { display: block }
  .hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.2);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    color: #fff
  }
  /* Detail header actions — wrap ke baris penuh, compact */
  .det-actions {
    flex: 0 0 100%;
    gap: 6px !important;
    padding-left: 36px; /* indent sejajar title (skip back btn width) */
  }
  .det-actions .btn-action,
  .det-actions .btn-delete { font-size: 11px; padding: 5px 10px; }

  .stats { grid-template-columns: repeat(2, 1fr); padding: 16px 16px 0 }
  .filters { padding: 12px 16px 0 }
  .table-wrap { padding: 12px 8px 40px }
  .table thead { display: none }
  .table tr { display: block; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface) }
  .table td { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding: 10px 14px; font-size: 12px }
  .table td:last-child { border-bottom: none }
  .table td::before { content: attr(data-label); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 8px; flex-shrink: 0 }
  .table tr:hover td { background: var(--surface) }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px }
  .topbar-right { gap: 6px; flex-wrap: wrap }
  .topbar-right .date-badge { display: none }
  .topbar-right #batchBadge { display: none }
  .topbar-right .btn-action:not(.primary):not([onclick*="openAddModal"]) { display: none }
  .stat6 { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px 16px; }
  .stat6 .stat-card { padding: 10px; }
  .detail-header { padding: 12px 16px; flex-wrap: wrap; }
  .detail-header .hamburger { display: inline-flex !important; }
  .detail-back { padding: 4px; }
  .detail-title { font-size: 15px; }
  .detail-meta { font-size: 11px; }
  .detail-filter-bar { padding: 0 16px 8px; }
  .detail-content { padding: 0 16px 40px; }
  .ie-section { grid-template-columns: 1fr }
  .biaya-form { grid-template-columns: 1fr 1fr }
  .modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 85vh
  }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none
  }
  .filters::-webkit-scrollbar { display: none }
  .page-header {
    flex-direction: column;
    gap: 10px;
    padding: 16px 16px 0
  }
  .page-header .btn-action { align-self: flex-start }
}
@media (max-width: 1100px) {
  .stat6 { grid-template-columns: repeat(3, 1fr) }
  .ie-section { grid-template-columns: 1fr }
  .biaya-form { grid-template-columns: 1fr 1fr }
}

.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.2s;
  opacity: 0.6;
}
.btn-copy:hover {
  background: var(--foam);
  opacity: 1;
}
.btn-copy.copied {
  opacity: 1;
  color: var(--green);
}

/* ── Dashboard ──────────────────────────────────────────── */
.dash-hero {
  background: linear-gradient(160deg, var(--sidebar) 0%, #27272a 100%);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-hero-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.dash-hero-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}
.dash-hero .btn-action {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(4px);
}
.dash-hero .btn-action:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}

/* KPI grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  padding: 20px 24px 0;
}
.dash-kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px
}

.dkpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px
}

.dkpi-body { flex: 1; min-width: 0 }

.dkpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.dkpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1
}

.dkpi-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px
}

.dash-kpi-profit {
  background: linear-gradient(135deg, var(--sidebar) 0%, #27272a 100%);
  border-color: transparent
}

.dash-kpi-profit .dkpi-label { color: rgba(255,255,255,.55) }
.dash-kpi-profit .dkpi-value { color: #fff }
.dash-kpi-profit .dkpi-sub   { color: rgba(255,255,255,.4) }

/* Mid grid: status + payment */
.dash-mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 24px 0;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.dash-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-card-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 99px;
}

/* Segmented bar */
.dash-segbar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border);
  gap: 2px;
}

/* Legend rows */
.dlg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.dlg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dlg-label { flex: 1; color: var(--text); font-weight: 500; }
.dlg-count { font-family: var(--mono); font-weight: 600; min-width: 36px; text-align: right; }
.dlg-pct {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  min-width: 38px;
  text-align: center;
}

/* Payment rows */
.dpay-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.dpay-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.dpay-info { flex: 1; min-width: 0; }
.dpay-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.dpay-amount { font-family: var(--mono); font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.dpay-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.dpay-bar-fill { height: 100%; border-radius: 2px; transition: width .4s ease; }
.dpay-count {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
  text-align: right;
  flex-shrink: 0;
  min-width: 52px;
  line-height: 1;
}
.dpay-count span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--sans);
  margin-top: 2px;
}

/* Batch summary mini bar */
.dash-batch-row { cursor: pointer; }
.dash-batch-row:hover td { background: var(--bg) !important; }
.db-mini-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 5px;
  width: 80px;
}

/* Responsive */
@media (max-width: 1200px) {
  .dash-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .dash-mid-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dash-hero { padding: 14px 16px; }
  .dash-hero-title { font-size: 17px; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px 14px 0; }
  .dash-mid-grid { padding: 12px 14px 0; gap: 12px; }
  .dash-card { padding: 16px; }
  #dashboardPage .dash-card ~ div { padding: 12px 14px 0; }
  #dashboardPage > div:last-child { padding: 12px 14px 32px; }
}

/* ── Kasir Pesawat ──────────────────────────────────────── */
.kasir-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}
.kasir-search-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky;
  top: 16px;
}
.kasir-search-panel label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sub);
  margin-bottom: 8px;
}
.kasir-customer-list {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}
.kasir-result-panel {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  min-height: 300px;
  overflow: hidden;
}
.kasir-result-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.kasir-result-body {
  padding: 0 18px;
  overflow-y: auto;
  max-height: calc(100vh - 360px);
  min-height: 60px;
}
.kasir-result-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.kasir-customer-row {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  margin-bottom: 7px;
  transition: all .15s;
  background: var(--card);
}
.kasir-customer-row:hover { background: var(--bg); }
.kasir-customer-row.active { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 3px rgba(236,72,153,.12); }
.kasir-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.kasir-item-row:last-child { border-bottom: none; }
.kasir-metode-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all .15s;
}
.kasir-metode-btn:hover { border-color: var(--primary); color: var(--primary); }
.kasir-metode-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.kasir-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.kasir-lunas-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
  letter-spacing: .3px;
}

/* ── Kasir responsive (mobile) ──────────────────────────── */
@media (max-width: 768px) {
  .kasir-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .kasir-search-panel {
    position: static;
  }
  .kasir-customer-list {
    max-height: 240px;
  }
  .kasir-result-body {
    max-height: 45vh;
  }
  .kasir-result-header {
    flex-wrap: wrap;
    gap: 4px;
  }
  .kasir-metode-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

/* ── Print ──────────────────────────────────────────────── */
/* Default print: show struk. Invoice print: JS adds .printing-invoice to body */
@media print {
  body > * { display: none !important; }
  body:not(.printing-invoice) #struk-print { display: block !important; }
  body.printing-invoice #invoicePrintTarget { display: block !important; }
  body.printing-invoice #invoicePrintTarget .invoice-paper {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }
  .inv-header-bar, .inv-table, .inv-bottom-bar, .inv-total-btn, .inv-badge,
  .inv-divider, .inv-date, .inv-catatan {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #struk-print { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#struk-print {
  display: none;
  font-family: var(--mono);
  font-size: 13px;
  padding: 20px;
  max-width: 300px;
  margin: 0 auto;
}
.struk-header { text-align: center; margin-bottom: 12px; }
.struk-header h2 { font-size: 15px; margin: 0 0 2px; }
.struk-divider { border-top: 1px dashed #000; margin: 8px 0; }
.struk-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.struk-total { font-weight: 700; font-size: 14px; }
.struk-lunas { text-align: center; font-size: 15px; font-weight: 700; margin-top: 10px; }

/* ── Invoice Manual — Form ── */
.invoice-form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: none;
}
.invoice-form-panel.open { display: block; }
.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.invoice-items-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.invoice-items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.invoice-items-table .td-auto {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.invoice-items-table input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--sans);
  font-size: 13px;
  width: 100%;
  outline: none;
  background: var(--bg);
}
.invoice-items-table input:focus { border-color: var(--primary); }
.invoice-preview-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.invoice-print-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.invoice-history-section { margin-top: 32px; }

/* ── Invoice Manual responsive ── */
@media (max-width: 768px) {
  .inv-form-grid-3,
  .inv-form-grid-2 { display: flex !important; flex-direction: column; gap: 12px; }
  .inv-layout-grid  { display: flex !important; flex-direction: column; gap: 20px; }
  .invoice-form-panel { padding: 16px; }
  .invoice-print-actions { flex-wrap: wrap; }
}

/* ── Invoice Paper — Reference Style ── */
.invoice-paper {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  max-width: 540px;
  margin: 0 auto;
  font-family: var(--sans);
  font-size: 13px;
  color: #1a1a2e;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  overflow: hidden;
}

/* Header */
.inv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 0;
}
.inv-title-block { flex: 1; }
.inv-title {
  font-size: 52px;
  font-weight: 800;
  font-style: italic;
  color: #EC4899;
  line-height: 1;
  letter-spacing: -1px;
}
.inv-title-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.inv-no-label { font-size: 11px; color: #9ca3af; }
.inv-no-val   { font-size: 13px; font-weight: 700; color: #374151; }
.inv-badge {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid #EC4899;
  object-fit: contain;
  padding: 4px;
  background: #fff8fc;
  flex-shrink: 0;
}

/* Divider & date */
.inv-divider {
  height: 2px;
  background: #EC4899;
  margin: 16px 32px 0;
}
.inv-date {
  text-align: right;
  padding: 8px 32px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #EC4899;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Customer */
.inv-to-label {
  padding: 0 32px 4px;
  font-size: 11px;
  color: #9ca3af;
}
.inv-customer-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 0 32px 20px;
}
.inv-customer-name {
  font-size: 14px;
  font-weight: 800;
  color: #EC4899;
  text-transform: uppercase;
  flex: 1;
  line-height: 1.3;
}
.inv-customer-hp {
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
}
.inv-customer-alamat {
  font-size: 11px;
  color: #6b7280;
  text-align: right;
  flex: 1;
}

/* Items table */
.inv-table-wrap { padding: 0 32px; }
.inv-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #EC4899;
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}
.inv-table th {
  background: #fff;
  padding: 9px 11px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: #374151;
  border-bottom: 1.5px solid #EC4899;
  border-right: 1px solid #fce7f3;
}
.inv-table th:last-child { border-right: none; text-align: right; }
.inv-table td {
  padding: 9px 11px;
  border-bottom: 1px solid #fce7f3;
  border-right: 1px solid #fce7f3;
  vertical-align: middle;
  min-height: 36px;
  height: 36px;
}
.inv-table td:last-child { border-right: none; text-align: right; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-table td.pink { color: #EC4899; font-weight: 600; }

/* Total */
.inv-total-wrap {
  display: flex;
  justify-content: flex-end;
  padding: 16px 32px;
}
.inv-total-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  background: #EC4899;
  color: #fff;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  min-width: 260px;
}

/* Footer */
.inv-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 4px 32px 20px;
  gap: 16px;
}
.inv-pembayaran-title {
  font-size: 11px;
  font-weight: 700;
  color: #EC4899;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.inv-pembayaran-detail {
  font-size: 11px;
  color: #374151;
  line-height: 1.7;
}
.inv-ttd {
  text-align: center;
  min-width: 130px;
}
.inv-ttd-label {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 28px;
}
.inv-ttd-line {
  height: 1px;
  background: #EC4899;
  margin-bottom: 5px;
}
.inv-ttd-name {
  font-size: 12px;
  font-weight: 700;
  color: #EC4899;
}
.inv-ttd-sub {
  font-size: 10px;
  color: #9ca3af;
}
.inv-catatan {
  margin: 0 32px 16px;
  font-size: 11px;
  color: #9ca3af;
  background: var(--pink-surface);
  border-radius: 6px;
  padding: 7px 10px;
}
.inv-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-top: 1.5px solid #EC4899;
  padding: 10px 32px;
}
.inv-bottom-brand   { font-size: 12px; font-weight: 800; color: #EC4899; letter-spacing: .06em; }
.inv-bottom-address { font-size: 10px; color: #9ca3af; }
.inv-bottom-social  { font-size: 10px; color: #EC4899; }

#invoicePrintTarget { display: none; }

/* ── Pesawat date picker container ── */
#pesawatDateList {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#pesawatDateList::-webkit-scrollbar { width: 5px; }
#pesawatDateList::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Month group + grid */
.date-month-group { display: flex; flex-direction: column; gap: 6px; }
.date-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  background: var(--bg, #f5f5f5);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s, color .15s;
}
.date-month-header:hover {
  background: var(--border);
  color: var(--text);
}
.month-toggle-icon { transition: transform .2s; flex-shrink: 0; }
.date-month-group.collapsed .month-toggle-icon { transform: rotate(-90deg); }
.date-month-group.collapsed .date-month-grid { display: none; }
.date-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 960px) { .date-month-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .date-month-grid { grid-template-columns: 1fr; } }

/* ── Date card ── */
.date-card {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
  user-select: none;
}
.date-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(236,72,153,.08);
}
.date-card.selected {
  border-color: var(--primary);
  background: var(--foam, rgba(236,72,153,.06));
  box-shadow: 0 0 0 3px rgba(236,72,153,.1);
}

/* Custom checkbox square */
.date-card-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.date-card-check svg { width: 10px; height: 10px; }
.date-card.selected .date-card-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Info: day name + date string stacked */
.date-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.date-card-day {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.date-card-full {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.date-card.selected .date-card-day  { color: var(--primary); }
.date-card.selected .date-card-full { color: var(--primary); opacity: .75; }

/* Count: stacked number + "item" label */
.date-card-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}
.date-card-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.date-card-unit {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}
.date-card.selected .date-card-num  { color: var(--primary); }
.date-card.selected .date-card-unit { color: var(--primary); opacity: .7; }

/* ── Tables that keep desktop layout on mobile (horizontal scroll) ── */
/* Applies to: Batch Pesawat Detail, Pesawat item list */
@media (max-width: 768px) {
  #batchPesawatDetailPage .table,
  #pesawatPage .table              { display: table; width: 100%; }
  #batchPesawatDetailPage .table thead,
  #pesawatPage .table thead        { display: table-header-group; }
  #batchPesawatDetailPage .table tbody,
  #pesawatPage .table tbody        { display: table-row-group; }
  #batchPesawatDetailPage .table tr,
  #pesawatPage .table tr           { display: table-row; margin-bottom: 0; border: none; border-radius: 0; padding: 0; background: transparent; }
  #batchPesawatDetailPage .table tr:hover td,
  #pesawatPage .table tr:hover td  { background: var(--bg); }
  #batchPesawatDetailPage .table td,
  #pesawatPage .table td           { display: table-cell; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
  #batchPesawatDetailPage .table th,
  #pesawatPage .table th           { display: table-cell; }
  #batchPesawatDetailPage .table td::before,
  #pesawatPage .table td::before   { display: none; }
  #batchPesawatDetailPage .table-wrap,
  #pesawatPage .table-wrap         { overflow-x: auto; padding: 0; background: transparent; border: none; }
}
