/* MIPOS Demo & Loan Unit Tracker — styled after the MIPOS POS catalog (Oct 2026):
   SUNMI orange bands, charcoal slanted section tags, cream table rows, bold black headings, orange ticks. */
:root {
  --orange: #F7931E; --orange-2: #EE7D00; --orange-soft: #FFE8C7; --cream: #FFF6EA; --cream-2: #FFF1DC;
  --ink: #1d1d1d; --charcoal: #2d2d2d; --muted: #6f6a63; --line: #F3D7AE; --bg: #FBF8F3; --white: #fff;
  --ok: #1d8a4e; --ok-bg: #e3f5ea; --warn: #b26a00; --warn-bg: #fff0d6; --bad: #c62828; --bad-bg: #fdeaea;
  --info: #1d5fbf; --info-bg: #e6efff; --mute-bg: #eeebe6; --wa: #1fa855;
  --r: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(120,70,0,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 Poppins, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--orange-2); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
code { background: var(--cream-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.small { font-size: 12.5px; } .muted { color: var(--muted); } .nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; }
.right { text-align: right; } .grow { flex: 1; } .big { font-size: 28px; font-weight: 800; }
.c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-warn { color: var(--warn); }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrap-sm { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--orange); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 18px; font: 600 14px/1.2 Poppins, system-ui, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .15s; }
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn-dark { background: var(--charcoal); } .btn-white { background: #fff; color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-danger { background: #fff; color: var(--bad); box-shadow: inset 0 0 0 1.5px #f3c3c3; }
.btn-wa { background: var(--wa); color: #fff; }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
form { margin: 0; }

/* ---------- admin header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 20px; color: #fff;
  background: var(--orange); box-shadow: 0 2px 0 var(--charcoal); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand-sub { font-size: 11px; font-weight: 700; line-height: 1.15; text-transform: uppercase; letter-spacing: .04em; border-left: 2px solid rgba(255,255,255,.6); padding-left: 10px; }
.mainnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a { color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.mainnav a:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.mainnav a.on { background: #fff; color: var(--ink); }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; white-space: nowrap; }
.who .linkbtn { color: #fff; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 18px; flex-wrap: wrap; }
.pagehead h1 { font-size: 26px; font-weight: 800; }
.pageactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .mainnav { order: 3; flex-basis: 100%; }
  .who-name { display: none; }
  .brand-sub { display: none; }
  .who { margin-left: auto; }
  .wrap { padding: 16px 12px 70px; }
  .pagehead h1 { font-size: 21px; }
}

/* ---------- catalog-style section tag ---------- */
.tagrow { display: flex; align-items: center; gap: 12px; margin: 28px 0 12px; flex-wrap: wrap; }
.tag { position: relative; display: inline-flex; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tag span { background: var(--charcoal); color: #fff; padding: 7px 34px 7px 16px; clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%); }
.tag::after { content: ""; width: 26px; margin-left: -10px; background: var(--orange); clip-path: polygon(16px 0, 100% 0, 10px 100%, 0 100%); }
.tag-sub { color: var(--muted); font-size: 13px; }
.h2 { font-size: 22px; font-weight: 800; margin: 2px 0 4px; }
.h3 { font-size: 16px; font-weight: 700; margin: 14px 0 8px; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { display: flex; flex-direction: column; background: #fff; border-radius: var(--r); padding: 16px 18px 14px; box-shadow: var(--shadow); color: var(--ink);
  border-top: 6px solid var(--orange); position: relative; overflow: hidden; }
.kpi:hover { text-decoration: none; transform: translateY(-1px); }
.kpi-label { font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .03em; }
.kpi-value { font-size: 44px; font-weight: 800; line-height: 1.05; margin: 4px 0; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.k-ok { border-top-color: var(--ok); } .k-ok .kpi-value { color: var(--ok); }
.k-orange { border-top-color: var(--orange); } .k-orange .kpi-value { color: var(--orange-2); }
.k-warn { border-top-color: #f2b01e; } .k-warn .kpi-value { color: var(--warn); }
.k-bad { border-top-color: var(--bad); } .k-bad .kpi-value { color: var(--bad); }
@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi-value { font-size: 34px; } .kpi { padding: 12px 14px; } }

/* ---------- cards, tables ---------- */
.card { background: #fff; border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.cards { gap: 14px; align-items: start; } .cards > .card { margin: 0; }
.tblwrap { overflow-x: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 14px; border: 1.5px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { background: var(--orange-soft); text-align: left; font-weight: 700; padding: 10px 12px; font-size: 13px; white-space: nowrap; border-bottom: 1.5px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:nth-child(even) td { background: var(--cream); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot th { background: var(--cream-2); border-top: 1.5px solid var(--line); border-bottom: 0; }
.tbl .num { text-align: center; }
.tbl td.num { font-size: 16px; }
.rowlink { cursor: pointer; } .rowlink:hover td { background: #fff3df !important; }
.rates input.money { width: 120px; }
.rates-sm td { font-size: 16px; font-weight: 600; }
.nc { color: #a59c90; font-style: italic; font-weight: 400; font-size: 13px; }
.mcell { display: flex; gap: 10px; align-items: center; }
.mthumb { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); flex: none; }
.mthumb-empty { display: inline-block; background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 6px, #fff 6px, #fff 12px); }
.empty { background: #fff; border: 2px dashed var(--line); border-radius: var(--r); padding: 26px; text-align: center; color: var(--muted); margin-bottom: 14px; }
.empty p { margin: 0 0 12px; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); } .b-info { background: var(--info-bg); color: var(--info); }
.b-mute { background: var(--mute-bg); color: #5d574f; } .b-demo { background: #6b3fa0; color: #fff; letter-spacing: .05em; font-size: 10.5px; }
.b-demo2 { background: #f1e7fb; color: #6b3fa0; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.flabel { font-weight: 600; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 11px; border: 1.5px solid #e6d3b8; border-radius: 9px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
input[readonly] { background: var(--cream); }
input[type=file] { font: inherit; font-size: 13px; max-width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--orange); width: 18px; height: 18px; flex: none; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; margin: 4px 0; }
.grid2, .grid3, .grid4, .grid5 { display: grid; gap: 14px 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: span 4; } .span5 { grid-column: span 5; }
@media (max-width: 860px) {
  .grid2, .grid3, .grid4, .grid5 { grid-template-columns: 1fr; }
  .span2, .span3, .span4, .span5 { grid-column: auto; }
}
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.filters input[type=search] { max-width: 360px; }
.filters select { width: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; box-shadow: inset 0 0 0 1.5px var(--line); }
.tabs a.on { background: var(--charcoal); color: #fff; box-shadow: none; }
.tabs .cnt { opacity: .65; font-weight: 500; margin-left: 2px; }
.stickybar { position: sticky; bottom: 0; background: rgba(251,248,243,.94); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 10px; flex-wrap: wrap; z-index: 5; border-top: 1px solid var(--line); margin-top: 10px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: #145c35; } .flash.bad { background: var(--bad-bg); color: #8e1c1c; } .flash.info { background: var(--info-bg); color: #163f7c; }
.warnbox { background: var(--warn-bg); flex-wrap: wrap; }
.card-details { margin: 22px 0; }
.card-details > summary { cursor: pointer; font-weight: 700; padding: 10px 0; color: var(--orange-2); }
.upload { margin-top: 8px; flex-wrap: wrap; }

/* ---------- unit picker ---------- */
.picker-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.picker-tools input { max-width: 380px; }
.picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.pick { background: #fff; border-radius: 10px; border: 1.5px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pick-on { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(247,147,30,.25); background: #fffaf2; }
.pick-busy { opacity: .62; background: #faf8f5; }
.pick-busy.pick-on { opacity: 1; }
.pick-main { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; line-height: 1.35; }
.pick-main input { margin-top: 3px; }
.pick-price { display: flex; gap: 8px; }
.pick-price label { flex: 1; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.pick-price input { padding: 6px 8px !important; font-size: 14px !important; }
.totals { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; background: var(--charcoal) !important; color: #fff; }
.totals b { color: var(--orange); }

/* ---------- loan page ---------- */
.loanstatus { display: flex; gap: 22px; flex-wrap: wrap; }
.loanstatus > div { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.linkcard .copyrow { display: flex; gap: 8px; margin-bottom: 10px; }
.sigprev { max-width: 260px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: block; margin: 6px 0 10px; }
.notes { background: var(--cream); padding: 8px 10px; border-radius: 8px; }
.activity { list-style: none; padding: 0; margin: 0; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.activity li { padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity li:last-child { border-bottom: 0; }
.modelhead, .unithead { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.modelhead .mthumb { width: 120px; height: 120px; }
.unithead { justify-content: space-between; align-items: flex-start; }
.minikpis { display: flex; gap: 8px; flex-wrap: wrap; }
.minikpis > div { background: var(--cream); border-radius: 10px; padding: 8px 12px; text-align: center; min-width: 72px; }
.minikpis b { display: block; font-size: 24px; line-height: 1.1; } .minikpis span { font-size: 11.5px; color: var(--muted); }

/* ---------- photos ---------- */
.photos { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.ph { position: relative; margin: 0; width: 120px; height: 120px; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: pointer; line-height: 1; }
.previews { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.previews img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- public pages ---------- */
body.public { background: #fff; }
.pubhead { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; max-width: 1240px; margin: 0 auto; }
.pubbrand { display: flex; align-items: flex-end; gap: 6px; color: var(--orange-2); font-weight: 800; font-size: 13px; }
.pubbrand img { height: 38px; width: auto; }
.hero { background: var(--orange); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; right: -80px; top: 0; bottom: 0; width: 46%; background: var(--orange-2); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); opacity: .55; }
.hero-inner { position: relative; max-width: 1240px; margin: 0 auto; padding: 56px 20px 60px; color: #fff; }
.hero-kicker { display: inline-block; background: var(--charcoal); color: #fff; padding: 5px 26px 5px 12px; font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .05em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 58px); font-weight: 800; text-transform: uppercase; color: var(--ink); max-width: 820px; letter-spacing: -.01em; }
.hero p { font-size: 18px; max-width: 640px; margin: 16px 0 24px; color: #fff; font-weight: 500; }
.stepgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stepgrid li { background: var(--cream); border-radius: var(--r); padding: 16px; border-top: 5px solid var(--orange); display: flex; flex-direction: column; gap: 4px; }
.stepgrid b { font-size: 17px; }
.stepgrid span { font-size: 14px; color: #4b463f; }
@media (max-width: 860px) { .stepgrid { grid-template-columns: 1fr 1fr; } .hero-inner { padding: 36px 16px 40px; } }
@media (max-width: 520px) { .stepgrid { grid-template-columns: 1fr; } }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mcard { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.mcard-img { background: linear-gradient(180deg, var(--cream) 0%, #fff 100%); height: 210px; display: flex; align-items: center; justify-content: center; padding: 14px; }
.mcard-img img { max-height: 100%; object-fit: contain; }
.mcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mcard-body h3 { font-size: 19px; font-weight: 800; text-transform: uppercase; }
.mcard-body .btn { margin-top: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; }
.ptable th { background: var(--orange-soft); padding: 5px; font-weight: 600; border: 1px solid var(--line); }
.ptable td { padding: 6px 4px; border: 1px solid var(--line); background: var(--cream); }
.trackbox p { max-width: 760px; }
.pubfoot { background: var(--charcoal); color: #ddd; padding: 24px 20px; display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; font-size: 14px; margin-top: 30px; }
.pubfoot a { color: var(--orange); }

/* customer portal */
.portalbg { background: var(--bg); }
.portal { max-width: 640px; margin: 0 auto; padding: 4px 14px 30px; }
.portal-top { margin: 8px 0 12px; } .portal-top h1 { font-size: 26px; font-weight: 800; }
.pbanner { border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; color: #fff; }
.pbanner > b { font-size: 26px; font-weight: 800; line-height: 1.15; }
.pbanner .pb-k { text-transform: uppercase; font-weight: 800; font-size: 12px; letter-spacing: .08em; opacity: .9; }
.p-ok { background: var(--ok); } .p-warn { background: var(--orange-2); } .p-bad { background: var(--bad); } .p-info { background: var(--charcoal); } .p-mute { background: #8a837a; }
.countdown { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 700; background: rgba(0,0,0,.18); border-radius: 8px; padding: 4px 10px; align-self: flex-start; margin: 4px 0; }
.pcard { background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.pcard h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eqlist { list-style: none; padding: 0; margin: 0; }
.eqlist li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.eqlist li:last-child { border-bottom: 0; }
.kv { width: 100%; border-collapse: collapse; font-size: 15px; }
.kv th { text-align: left; font-weight: 500; color: var(--muted); padding: 7px 0; width: 50%; }
.kv td { text-align: right; padding: 7px 0; font-weight: 600; }
.kv tr + tr th, .kv tr + tr td { border-top: 1px solid var(--line); }
.kv .tot th, .kv .tot td { font-weight: 800; color: var(--ink); font-size: 16px; }
.terms { white-space: pre-wrap; font-size: 13.5px; background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 360px; overflow-y: auto; margin-bottom: 14px; }
.signform { display: flex; flex-direction: column; gap: 12px; }
.sigwrap { position: relative; }
.sigpad { width: 100%; height: 190px; border: 2px dashed #e0b67c; border-radius: 12px; background: #fff; touch-action: none; display: block; }
.sigclear { position: absolute; top: 8px; right: 12px; font-size: 13px; color: var(--muted); }
.contact p { margin-top: 0; }

/* sign-in / error */
.login-bg { background: var(--orange) !important; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.center-card { max-width: 400px; margin: 60px auto; background: #fff; border-radius: 18px; padding: 28px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
.login { margin: 0; width: 100%; text-align: left; }
.login img { display: block; margin: 0 auto 10px; }
.login h1 { font-size: 20px; text-align: center; font-weight: 800; }
.login > p { text-align: center; }
.center-card h1 { font-size: 22px; margin: 12px 0 6px; }
