/* Hero Invoicing - tema korporat biru-putih (formal, rapi) */
:root {
  --blue: #1D4ED8;
  --blue-dark: #173FAE;
  --blue-soft: #EEF3FF;
  --navy: #0E1F42;
  --navy-2: #16325F;
  --ink: #0F172A;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --line: #E4E9F2;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --green: #15803D;
  --green-soft: #E7F6EC;
  --red: #DC2626;
  --red-soft: #FDECEC;
  --amber: #B45309;
  --amber-soft: #FDF3E2;
  --cyan: #0E7490;
  --cyan-soft: #E4F5F9;
  --violet: #6D28D9;
  --violet-soft: #F1EBFD;
  --grey-soft: #EEF1F6;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 42, 84, .06), 0 8px 24px rgba(16, 42, 84, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.app {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
}

a { color: var(--blue); }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace; }
.sub { font-size: 12.5px; color: var(--muted); }
.ta-r { text-align: right; }
.nowrap { white-space: nowrap; }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.link { color: var(--blue); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

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

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #E8EEF9;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 4px 6px 14px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 11.5px; color: #A9BADC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: #C8D6EE; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item .ic { width: 18px; height: 18px; opacity: .9; flex: 0 0 18px; }
.nav-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 3px 0 0 #6D9DFF; }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; }
.nav-logout { color: #F4C7C7; }
.sched-pill {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: #A9BADC;
  background: rgba(255, 255, 255, .07); padding: 8px 11px; border-radius: 99px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
.mobile-only { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding: 24px 32px 18px;
}
.page-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.content { padding: 0 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.content-wide { max-width: 1600px; width: 100%; }

/* -------------------------------------------------------------------- tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 16px; min-height: 40px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--grey-soft); color: var(--ink);
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(29, 78, 216, .22); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--blue-soft); border-color: #C7D2FE; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-sm { padding: 8px 13px; min-height: 36px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; min-height: 36px; width: 36px; }
.btn.is-busy { opacity: .65; pointer-events: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ------------------------------------------------------------------- kartu */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15.5px; font-weight: 700; }
.card-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.card-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 20px 22px; }
.card-body-flush { padding: 0; }
.card-flush .card-body { padding: 0; }
/* JANGAN memakai sticky pada SATU kartu saja bila kartu lain menyusul di bawahnya:
   kartu sticky menimpa (menutupi) kartu berikutnya saat halaman digulir — tombol
   Simpan/Kirim di editor invoice pernah benar-benar tidak bisa diklik karena ini.
   Kolom samping kini di-sticky sebagai SATU kesatuan (lihat .split-side di bawah). */
.card-sticky { position: static; }.sub-title { font-size: 14px; margin: 22px 0 10px; }

/* ------------------------------------------------------------------- grid */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; }

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; display: flex; gap: 16px; align-items: flex-start; box-shadow: var(--shadow); }
.stat-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: 0 0 42px; }
.stat-ic .ic { width: 21px; height: 21px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted-2); }
.stat.danger .stat-ic { background: var(--red-soft); color: var(--red); }
.stat.success .stat-ic { background: var(--green-soft); color: var(--green); }

/* ------------------------------------------------------------------- tabel */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); font-weight: 700; padding: 13px 16px; background: #F8FAFD;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid #EFF2F8; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FBFCFE; }
.table-items td { padding: 8px 10px; }
.table-items th { padding: 10px 12px; }
.w-qty { width: 92px; } .w-unit { width: 110px; } .w-price { width: 140px; } .w-amt { width: 140px; } .w-del { width: 54px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager > div { display: flex; gap: 10px; }

/* -------------------------------------------------------------------- tab */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 9px 15px; border-radius: 99px; text-decoration: none; font-size: 13.5px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(29, 78, 216, .2); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; }
.toolbar .input { max-width: 420px; }

/* ------------------------------------------------------------------ lencana */
.badge { display: inline-block; padding: 4px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.b-grey { background: var(--grey-soft); color: #475569; }
.b-blue { background: var(--blue-soft); color: var(--blue-dark); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-cyan { background: var(--cyan-soft); color: var(--cyan); }
.b-violet { background: var(--violet-soft); color: var(--violet); }

/* --------------------------------------------------------------- formulir */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; flex: 1; }
.field > span, .lbl { font-size: 12.5px; font-weight: 600; color: #3F4A5C; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row-3 > .field { min-width: 180px; }
.field-btn { flex: 0 0 auto; justify-content: flex-end; }
.input {
  width: 100%; padding: 10px 13px; min-height: 42px;
  border: 1px solid #D8DFEA; border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font-family: inherit; font-size: 14px;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.input-sm { min-height: 38px; padding: 8px 11px; font-size: 13px; }
.input-plain { border-color: transparent; background: transparent; padding: 7px 9px; min-height: 36px; }
.input-plain:hover { background: #F7F9FC; }
.input-plain:focus { background: #fff; border-color: var(--blue); }
textarea.input { min-height: 76px; resize: vertical; }
.field-row textarea.input { min-height: 60px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #64748B 50%), linear-gradient(135deg, #64748B 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin: 10px 0; cursor: pointer; }
.chk input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--blue); }
.chk-card { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: #fff; }
.chk-card small { color: var(--muted); }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.var { background: var(--blue-soft); color: var(--blue-dark); padding: 3px 8px; border-radius: 6px; font-size: 12px; }
.vars { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }

/* ------------------------------------------------------------------- kilat */
.flash { display: flex; gap: 10px; align-items: center; padding: 13px 17px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; }
.flash .ic { width: 18px; height: 18px; flex: 0 0 18px; }
.flash-ok { background: var(--green-soft); color: #14532D; border: 1px solid #BBF7D0; }
.flash-err { background: var(--red-soft); color: #7F1D1D; border: 1px solid #FECACA; }

/* -------------------------------------------------------------- daftar */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.list li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-bottom: 13px; border-bottom: 1px solid #F1F4F9; }
.list li:last-child { border-bottom: none; padding-bottom: 0; }
.li-main { display: flex; flex-direction: column; min-width: 0; }
.li-main b { font-size: 13.5px; }
.li-main span { font-size: 12.5px; color: var(--muted); }
.li-side { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }

.dl { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.dl > div { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.dl dd.big { font-size: 18px; }

/* ------------------------------------------------------------------ grafik */
.bars { display: flex; align-items: flex-end; gap: 16px; min-height: 190px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #4F7DF3, var(--blue)); border-radius: 8px 8px 3px 3px; }
.bar-val { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar-lb { font-size: 12px; color: var(--muted-2); }

/* ------------------------------------------------------------ tata letak 2 kolom */
.split { display: flex; gap: 20px; align-items: flex-start; }
.split-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split-side { width: 372px; flex: 0 0 372px; display: flex; flex-direction: column; gap: 20px; }
.split-editor .split-side { width: 420px; flex: 0 0 420px; }

/* Layar lebar: kolom samping ikut menggulir layar sebagai satu kesatuan (semua kartunya)
   sehingga TIDAK ADA kartu yang saling menimpa. Kartu berisi tombol Simpan diletakkan
   PALING ATAS di kolom (lihat editor/recurring) supaya tombolnya selalu terlihat tanpa
   perlu menggulir. */
@media (min-width: 1181px) {
  .split-side {
    position: sticky; top: 20px; align-self: flex-start;
    max-height: calc(100vh - 32px); overflow-y: auto; padding-right: 2px;
  }
  /* pemilih template dibuat lebih ringkas agar kolom samping umumnya muat satu layar */
  .split-side .tpl-grid { gap: 10px; margin-bottom: 12px; }
  .split-side .tpl { padding: 8px 9px; gap: 4px; }
  .split-side .tpl-mini { height: 40px; padding: 5px; }
  .split-side .tpl small { font-size: 10.5px; line-height: 1.25; }
  .split-side .summary { gap: 8px; }
}

/* --------------------------------------------------------------- pratinjau */
.preview-frame { width: 100%; overflow: hidden; background: #EDF1F8; border-radius: var(--r-sm); padding: 10px; }
.preview-frame iframe { width: 100%; height: 78vh; border: 0; background: #fff; border-radius: 6px; box-shadow: 0 6px 18px rgba(15, 42, 84, .1); }
.preview-scale { position: relative; overflow: hidden; background: #EDF1F8; border-radius: var(--r-sm); padding: 10px; }
.preview-scale iframe.preview-a4 {
  width: 794px; height: 1123px; border: 0; background: #fff;
  transform-origin: top left; border-radius: 4px; box-shadow: 0 6px 18px rgba(15, 42, 84, .12);
}
.publink { margin-top: 18px; }
.publink label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-size: 12px; }

/* --------------------------------------------------------- pemilih template */
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.tpl {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm);
  padding: 10px; cursor: pointer; text-align: left; font-family: inherit;
  display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s;
}
.tpl:hover { border-color: #C7D2FE; }
.tpl.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.tpl b { font-size: 12.5px; }
.tpl small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.tpl-mini { display: block; height: 54px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; overflow: hidden; }
.tpl-mini i { display: block; border-radius: 2px; background: #DDE3EC; margin-bottom: 4px; }
.tpl-mini .m1 { height: 9px; width: 100%; background: #1D4ED8; }
.tpl-mini .m2 { height: 4px; width: 55%; }
.tpl-mini .m3 { height: 4px; width: 34%; }
.tpl-mini .m4 { height: 5px; width: 100%; background: #EEF1F6; margin-top: 5px; }
.tpl-mini .m5 { height: 5px; width: 100%; background: #EEF1F6; }
.tpl-minimal .m1 { background: #111827; } .tpl-minimal .m2, .tpl-minimal .m3 { background: #C9CED6; }
.tpl-modern .m1 { background: #0EA5E9; border-radius: 6px; } .tpl-modern .m4 { background: #E0F2FE; }
.tpl-classic { border-style: double; border-width: 3px; }
.tpl-classic .m1 { background: #7C2D12; } .tpl-classic .m4, .tpl-classic .m5 { background: #F5EDE8; }

.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--sw, #1D4ED8);
  box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0;
}
.swatch.active { box-shadow: 0 0 0 2px var(--blue); }
.swatch-custom { display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.swatch-custom input { width: 46px; height: 46px; border: 0; padding: 0; background: none; cursor: pointer; }

/* ---------------------------------------------------------------- ringkasan */
.summary { display: flex; flex-direction: column; gap: 10px; }
.sum-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.sum-row span { color: var(--muted); }
.sum-total { border-top: 2px solid var(--blue); padding-top: 12px; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sum-total span { color: var(--ink); }

/* ------------------------------------------------------------------ daftar periksa */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: center; font-size: 13.5px; }
.checklist .mark {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 1.5px dashed #C3CBD9; display: flex; align-items: center; justify-content: center; color: #fff;
}
.checklist .mark .ic { width: 14px; height: 14px; }
.checklist li.done .mark { background: var(--green); border: 0; }
.checklist li.done .cl-text { color: var(--muted); text-decoration: line-through; }
.checklist .cl-text { flex: 1; }

/* -------------------------------------------------------------------- kosong */
.empty { padding: 56px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.empty-icon .ic { width: 26px; height: 26px; }
.empty h3 { margin: 6px 0 0; font-size: 16px; }
.empty p { margin: 0 0 8px; color: var(--muted); max-width: 460px; font-size: 13.5px; }

/* ------------------------------------------------------------------ penjadwal */
.sched-box {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 18px; font-size: 13px; box-shadow: var(--shadow);
}
.sched-box > div:first-child { display: flex; align-items: center; gap: 9px; font-weight: 600; }

/* ------------------------------------------------------------------- modal */
.modal {
  border: 0; border-radius: var(--r); padding: 26px; max-width: 620px; width: calc(100% - 32px);
  box-shadow: 0 24px 60px rgba(15, 42, 84, .25); max-height: 88vh; overflow: auto;
}
.modal::backdrop { background: rgba(15, 30, 60, .5); backdrop-filter: blur(2px); }
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal p { margin: 0 0 18px; font-size: 13.5px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.confirm-body p { white-space: pre-line; color: #3F4A5C; }

/* -------------------------------------------------------------------- toast */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 999; max-width: 360px; }
.toast {
  background: #14315F; color: #fff; padding: 13px 17px; border-radius: var(--r-sm);
  font-size: 13.5px; box-shadow: 0 12px 30px rgba(15, 42, 84, .28);
  opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: none; }
.toast-err { background: #9F1239; }

/* -------------------------------------------------------- halaman sederhana */
body.simple {
  background: linear-gradient(160deg, #EEF3FF 0%, #F6F8FC 55%, #EAF0FB 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px;
  font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif; color: var(--ink); margin: 0;
}
.simple-card { background: #fff; border-radius: 20px; box-shadow: 0 18px 50px rgba(15, 42, 84, .14); padding: 34px 34px 30px; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 18px; }
.simple-brand { display: flex; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.simple-brand > div { display: flex; flex-direction: column; }
.simple-brand b { font-size: 16px; }
.simple-brand span { font-size: 12.5px; color: var(--muted); }
.simple-card h2 { margin: 0; font-size: 19px; }

/* ------------------------------------------------------------------- logo */
.logo-row { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.logo-box { width: 132px; height: 92px; border: 1px dashed #C7D2FE; border-radius: var(--r-sm); background: #F8FAFF; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-row .field { flex: 1 1 280px; }

/* ------------------------------------------------------------- responsif */
@media (max-width: 1180px) {
  .split, .split-editor { flex-direction: column; }
  .split-side, .split-editor .split-side { width: 100%; flex: 1 1 auto; }
  .card-sticky { position: static; }

  /* Di layar sempit kolom samping jatuh ke BAWAH formulir yang panjang, sehingga tombol
     simpan/kirim nyaris tak terjangkau. Di editor invoice tombolnya diangkat menjadi
     bilah tetap di bawah layar agar selalu bisa ditekan dari mana pun. */
  .page-actionbar .btn-col {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    flex-direction: row; flex-wrap: wrap; gap: 8px;
    padding: 10px 14px 14px; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(15, 42, 84, .12);
  }
  .page-actionbar .btn-col .btn { flex: 1 1 46%; justify-content: center; min-height: 44px; }
  .page-actionbar .btn-col #btnSaveDraft { flex-basis: 100%; }
  .page-actionbar .content { padding-bottom: 168px; }
  .page-actionbar .split-editor .card:last-child .hint { margin-bottom: 6px; }
}

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: 0 0 auto; height: auto; position: static; padding: 14px; gap: 12px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .nav-item { white-space: nowrap; padding: 9px 13px; }
  .nav-item.active { box-shadow: none; }
  .sidebar-foot { flex-direction: row; justify-content: space-between; align-items: center; }
  .sidebar-foot .sched-pill { display: none; }
  .nav-logout { background: rgba(220, 38, 38, .16); }
  .mobile-only { display: inline-flex; }
  .topbar { padding: 18px 16px 14px; }
  .content { padding: 0 16px 40px; }
  .card-head, .card-body { padding: 16px; }
  .table th, .table td { padding: 11px 12px; }
  .tpl-grid { grid-template-columns: 1fr 1fr; }
}
