/* Portal UMKM (umkm.natadayadigital.id). Warna & font dari /site/site.css; kelas portal berawalan k-. */
.k-body { background: var(--soft); font-size: 15px; line-height: 1.5; }
.k-boot { padding: 80px 20px; text-align: center; color: var(--muted); }
.k-top { position: sticky; top: 0; z-index: 20; background: var(--g800); color: #fff; }
.k-top-in { width: min(1320px, 100% - 24px); margin-inline: auto; display: flex; align-items: center; gap: 14px; min-height: 60px; flex-wrap: wrap; padding: 8px 0; }
.k-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.k-logo img { width: 32px; height: 32px; border-radius: 8px; background: #fff; }
.k-logo small { display: block; font-weight: 500; color: #9fc2b3; font-size: 12px; line-height: 1.2; }
.k-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.k-nav a { padding: 7px 12px; border-radius: 8px; color: #cfe3d9; font-weight: 600; font-size: 14px; }
.k-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.k-nav a.on { background: #fff; color: var(--g800); }
.k-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cfe3d9; }
.k-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--g100); color: var(--g800); white-space: nowrap; }
.k-chip.gold { background: var(--gold-50); color: var(--gold); }
.k-chip.red { background: #fdecec; color: #a32121; }
.k-chip.grey { background: #eef1f0; color: var(--muted); }
.k-main { width: min(1320px, 100% - 24px); margin: 18px auto 60px; }
.k-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.k-head h1 { font-size: 22px; }
.k-head p { color: var(--muted); font-size: 14px; }
.k-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.k-grow { flex: 1; min-width: 0; }
.k-right { text-align: right; }
.k-muted { color: var(--muted); font-size: 13px; }
.k-strong { color: var(--ink); font-weight: 700; }
.k-neg { color: #a32121; }
.k-pos { color: var(--g600); }
.k-body [hidden] { display: none !important; }
.k-end { justify-content: flex-end; }
.k-top .btn-outline-light { background: transparent; }
.k-sys .k-chip { justify-self: start; }
.k-card + .k-head, .k-grid + .k-head { margin-top: 22px; }
.k-gap { margin: 14px 0; }

.k-main, .k-card { min-width: 0; }
.k-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.k-card + .k-card { margin-top: 14px; }
.k-card h2 { font-size: 16px; margin-bottom: 10px; }
.k-grid { display: grid; gap: 14px; }
.k-grid.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.k-grid.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.k-grid.g4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.k-grid .k-card + .k-card { margin-top: 0; }
.k-kpi b { display: block; font-size: 22px; color: var(--ink); letter-spacing: -.02em; }
.k-kpi span { color: var(--muted); font-size: 13px; }

.k-sys { display: grid; gap: 8px; align-content: start; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
a.k-sys:hover { border-color: var(--g500); box-shadow: var(--shadow); }
.k-sys .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--g100); color: var(--g700); display: grid; place-items: center; }
.k-sys b { color: var(--ink); font-size: 17px; }
.k-sys.soon { cursor: default; opacity: .75; background: #fbfcfb; }
.k-sys.soon .ic { background: #eef1f0; color: var(--muted); }
.k-meter { height: 8px; border-radius: 99px; background: #e9eeec; overflow: hidden; }
.k-meter i { display: block; height: 100%; background: var(--g600); width: 0; }
.k-meter i.warn { background: #c98a16; }
.k-meter i.full { background: #c0392b; }

.k-input, .k-body select.k-input { width: 100%; padding: 9px 11px; border: 1px solid #d3ddd8; border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
.k-input:focus { outline: 2px solid var(--g500); outline-offset: 0; border-color: transparent; }
.k-input.sm, .k-body select.k-input.sm { width: auto; padding: 7px 9px; font-size: 14px; }
.k-input.sm.k-grow { min-width: 220px; }
.k-input.qty, .k-input.sm.qty { width: 74px; text-align: center; }
.k-field { display: grid; gap: 4px; margin-bottom: 10px; }
.k-field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.k-field small { color: var(--muted); font-size: 12px; }
.k-fields { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.k-fields .full { grid-column: 1 / -1; }
.k-check { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; cursor: pointer; }
.k-error { background: #fdecec; color: #8f1d1d; border-radius: 9px; padding: 9px 12px; font-size: 14px; margin-bottom: 10px; }
.k-note { background: var(--gold-50); border: 1px solid #eadcbc; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.btn-danger { border-color: #f1c6c6; color: #a32121; background: #fff; }
.btn-danger:hover { border-color: #a32121; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.k-table-wrap { overflow-x: auto; }
.k-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.k-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.k-table td { padding: 9px 10px; border-bottom: 1px solid #eef2f0; vertical-align: top; color: var(--ink); }
.k-table td.num, .k-table th.num { text-align: right; white-space: nowrap; }
.k-table tr.void td { text-decoration: line-through; color: var(--muted); }
.k-table tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.k-empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.k-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.k-tabs a { padding: 9px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.k-tabs a.on { color: var(--g700); border-color: var(--g700); }

/* ---------------------------------------------------------------- kasir */
.k-register { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
.k-register > * { min-width: 0; }
.k-products { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 12px; }
.k-product { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; display: grid; gap: 4px; align-content: space-between; min-height: 104px; }
.k-product:hover { border-color: var(--g500); box-shadow: var(--shadow); }
.k-product b { color: var(--ink); font-size: 14px; line-height: 1.3; }
.k-product .price { color: var(--g700); font-weight: 700; }
.k-cats { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.k-cats button { flex: none; border: 1px solid #d3ddd8; background: #fff; border-radius: 99px; padding: 5px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--body); }
.k-cats button.on { background: var(--g700); border-color: var(--g700); color: #fff; }
.k-cart { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
.k-line { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid #eef2f0; }
.k-line .k-row { flex-wrap: nowrap; }
.k-step { width: 30px; height: 30px; border-radius: 8px; border: 1px solid #d3ddd8; background: #fff; cursor: pointer; font-size: 17px; line-height: 1; flex: none; }
.k-sum { display: grid; gap: 4px; margin: 12px 0; font-size: 14px; }
.k-sum div { display: flex; justify-content: space-between; gap: 10px; }
.k-sum .grand { font-size: 22px; font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.k-pay { display: grid; grid-template-columns: 130px 1fr 150px 34px; gap: 8px; margin-bottom: 8px; align-items: start; }
.k-pay .extra { grid-column: 2 / 4; display: grid; gap: 6px; }
.k-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.k-receipt { font-family: Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.35; background: #fff; border: 1px dashed #c9d4cf; border-radius: 8px; padding: 14px; white-space: pre; overflow-x: auto; color: #111; width: max-content; max-width: 100%; margin: 0 auto 12px; }
.k-options { display: grid; gap: 6px; margin-bottom: 12px; }

/* ---------------------------------------------------------------- dialog & notifikasi */
.k-back { position: fixed; inset: 0; background: rgba(6, 30, 22, .55); z-index: 60; display: grid; place-items: start center; overflow: auto; padding: 40px 12px; }
.k-dialog { background: #fff; border-radius: 16px; width: min(520px, 100%); padding: 20px; box-shadow: var(--shadow-lg); }
.k-dialog.wide { width: min(760px, 100%); }
.k-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.k-dialog header h2 { font-size: 18px; }
.k-x { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; }
.k-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
#toasts { position: fixed; right: 14px; bottom: 14px; z-index: 90; display: grid; gap: 8px; max-width: min(380px, 100% - 28px); }
.k-toast { background: var(--g800); color: #fff; padding: 12px 16px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 14px; }
.k-toast.bad { background: #8f1d1d; }

/* ---------------------------------------------------------------- masuk */
.k-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 12px; }
.k-login .k-card { width: min(420px, 100%); padding: 26px; }
.k-login h1 { font-size: 22px; margin: 14px 0 4px; }
.k-login .brand { justify-content: center; width: 100%; }
.k-stores { display: grid; gap: 8px; margin-top: 12px; }
.k-login [data-login] { margin-top: 14px; }
.k-login [data-login] .btn-primary { margin-top: 14px; }
.k-login [data-login] + .k-muted { margin-top: 14px; }

#print { display: none; }
@media print {
  body.k-body > * { display: none !important; }
  body.k-body > #print { display: block !important; }
  #print pre { font-family: Consolas, "Courier New", monospace; font-size: 12px; margin: 0; }
  .k-body { background: #fff; }
  @page { margin: 4mm; }
}

@media (max-width: 980px) {
  .k-register { grid-template-columns: minmax(0, 1fr); }
  .k-cart { position: static; max-height: none; }
}
@media (max-width: 620px) {
  .k-fields { grid-template-columns: 1fr; }
  .k-pay { grid-template-columns: 1fr 1fr 34px; }
  .k-pay .extra { grid-column: 1 / -1; }
  .k-user .who { display: none; }
  .k-cart [data-act="pay"] { position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; z-index: 30; box-shadow: var(--shadow-lg); }
  .k-user { margin-left: auto; gap: 8px; }
  .k-nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .k-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .k-tabs a { white-space: nowrap; }
  .k-grid.g2, .k-grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .k-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-grid > * { min-width: 0; }
}
