/* KickStock 4.1 — tampilan */
/* ============ TEMA: hijau teal, segar & tenang ============ */
:root {
  --teal: #0d9488; --teal-600: #0f766e; --teal-700: #115e59; --teal-50: #f0fdfa; --teal-100: #ccfbf1;
  --ink: #0f1f1d; --muted: #5f6f6c; --line: #e3eae8; --bg: #f4f7f6; --card: #ffffff;
  --amber: #b45309; --amber-50: #fff7e6; --rose: #be123c; --rose-50: #fff1f3; --sky: #0369a1; --sky-50: #eef7fc;
  --radius: 16px; --sb-w: 248px; --ease: cubic-bezier(.2,.7,.2,1);
  --bs-primary: #0d9488; --bs-primary-rgb: 13,148,136; --bs-link-color: #0f766e; --bs-link-hover-color: #115e59;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: #0f1f1d; --bs-border-color: #e3eae8; --bs-border-radius: 10px;
}
body { background: var(--bg); font-size: 15px; -webkit-font-smoothing: antialiased; }
.num { font-variant-numeric: tabular-nums; }
.flex-none { flex: none; }
.btn-check:checked + .btn-outline-secondary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-outline-secondary { border-color: var(--line); color: #3d4b48; }
.btn-outline-secondary:hover { background: var(--teal-50); border-color: #b9ddd8; color: var(--teal-700); }
.nowrap { white-space: nowrap; }
.topbar h1 { white-space: nowrap; }
.imei { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .82rem; letter-spacing: .02em; color: var(--muted); }
.text-muted { color: var(--muted) !important; }

/* Tombol & form */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1rem; transition: transform .12s var(--ease), background .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-600); --bs-btn-hover-border-color: var(--teal-600);
  --bs-btn-active-bg: var(--teal-700); --bs-btn-active-border-color: var(--teal-700); --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: var(--teal);
  box-shadow: 0 4px 14px -6px rgba(13,148,136,.6); }
.btn-soft { background: var(--teal-50); color: var(--teal-700); border: 0; }
.btn-soft:hover { background: var(--teal-100); color: var(--teal-700); }
.btn-ghost { background: transparent; border: 0; color: var(--muted); }
.btn-ghost:hover { background: #eef2f1; color: var(--ink); }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; }
.btn.busy { pointer-events: none; opacity: .75; }
.btn.busy::before { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: -2px; animation: spin .6s linear infinite; }
.form-control, .form-select { border-radius: 10px; padding: .6rem .8rem; border-color: var(--line); font-size: 15px; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(13,148,136,.14); }
.form-label { font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }

/* Kartu */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,40,36,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 700; padding: 1rem 1.25rem; }
.card-body { padding: 1.25rem; }
.section-title { font-weight: 700; font-size: 1rem; margin: 0; }

/* Status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-teal { background: var(--teal-50); color: var(--teal-700); }
.pill-amber { background: var(--amber-50); color: var(--amber); }
.pill-sky { background: var(--sky-50); color: var(--sky); }
.pill-rose { background: var(--rose-50); color: var(--rose); }
.pill-gray { background: #eef2f1; color: #4b5a57; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 600; background: #eef2f1; color: #4b5a57; }
.tag-new { background: var(--sky-50); color: var(--sky); }

/* Tabel */
.table { --bs-table-bg: transparent; margin: 0; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: .8rem 1rem; white-space: nowrap; }
.table td { padding: .85rem 1rem; border-color: var(--line); vertical-align: middle; }
.table-hover tbody tr { transition: background .12s; }
.table-hover tbody tr:hover { --bs-table-hover-bg: var(--teal-50); }
.row-click { cursor: pointer; }

/* ============ LOGIN ============ */
#login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, #5eead4 0%, transparent 55%), radial-gradient(900px 500px at 110% 110%, #99f6e4 0%, transparent 50%), linear-gradient(160deg, #0f766e, #134e4a); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 24px; padding: 32px 28px; box-shadow: 0 30px 60px -20px rgba(4,47,46,.5); animation: rise .5s var(--ease); }
.logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(140deg, #14b8a6, #0f766e); color: #fff; display: grid; place-items: center; font-size: 1.5rem; box-shadow: 0 8px 20px -8px rgba(13,148,136,.8); }

/* ============ LAYOUT APP ============ */
.progress-top { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #2dd4bf, var(--teal)); z-index: 3000; opacity: 0; transition: width .4s var(--ease), opacity .3s; }
.progress-top.on { opacity: 1; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sb-w); background: #fff; border-right: 1px solid var(--line); z-index: 1040; display: flex; flex-direction: column; transition: transform .25s var(--ease); }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.sb-brand .logo { width: 40px; height: 40px; border-radius: 12px; font-size: 1.1rem; }
.sb-brand b { font-size: 1.05rem; display: block; line-height: 1.2; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { flex: none; display: block; }
.brand-word { font-weight: 800; letter-spacing: .04em; line-height: 1; font-size: 1.45rem; color: var(--ink); }
.brand-word span { color: var(--teal); }
.brand-tag { font-size: .8rem; font-weight: 500; color: var(--muted); margin-top: 5px; }
.sb-brand .brand-word { font-size: 1.08rem; margin-bottom: 4px; }
.sb-brand small { color: var(--muted); font-size: .75rem; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.sb-head { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #93a19e; padding: 14px 12px 6px; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #3d4b48; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; text-decoration: none; }
.sb-link i { font-size: 1.1rem; width: 20px; text-align: center; color: #7b8a87; transition: color .15s; }
.sb-link:hover { background: #f1f5f4; color: var(--ink); }
.sb-link.active { background: var(--teal-50); color: var(--teal-700); font-weight: 700; }
.sb-link.active i { color: var(--teal); }
.sb-user { margin: 12px; padding: 12px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); display: grid; place-items: center; font-weight: 700; flex: none; }
.main { margin-left: var(--sb-w); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(244,247,246,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar h1 { font-size: 1.35rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.topbar .sub { color: var(--muted); font-size: .82rem; }
.content { padding: 4px 28px 32px; max-width: 1320px; }
.page-in { animation: pageIn .28s var(--ease); }

/* KPI */
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; height: 100%; transition: transform .2s var(--ease), box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(16,40,36,.3); }
.kpi .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.kpi .v { font-size: 1.6rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: .82rem; font-weight: 500; }
.ic-teal { background: var(--teal-50); color: var(--teal); } .ic-amber { background: var(--amber-50); color: var(--amber); }
.ic-sky { background: var(--sky-50); color: var(--sky); } .ic-rose { background: var(--rose-50); color: var(--rose); }
.hero { border-radius: var(--radius); padding: 22px; color: #fff; background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%); position: relative; overflow: hidden; height: 100%; }
.hero::after { content: ''; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero .v { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }
.hero .l { opacity: .85; font-size: .85rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr 40px; gap: 12px; align-items: center; padding: 8px 0; }
.bar-track { height: 10px; background: #eef2f1; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #2dd4bf, var(--teal)); border-radius: 999px; width: 0; transition: width .8s var(--ease); }
.todo { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty i { font-size: 2rem; display: block; margin-bottom: 8px; color: #b9c6c3; }

/* Skeleton */
.sk { background: linear-gradient(90deg, #edf1f0 25%, #f6f8f8 50%, #edf1f0 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }

/* Scan */
.scan-box { border: 2px dashed #b9ddd8; border-radius: var(--radius); background: var(--teal-50); padding: 18px; transition: border-color .2s, background .2s; }
.scan-box:focus-within { border-color: var(--teal); background: #e6fbf7; }
.scan-input { font-size: 1.2rem; font-family: ui-monospace, monospace; border: 0; background: #fff; }
.flash { animation: flash .9s var(--ease); }
#reader { width: 100%; border-radius: 12px; overflow: hidden; }
#reader video { border-radius: 12px; }

/* Modal & toast */
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(4,47,46,.35); }
.modal-header, .modal-footer { border: 0; padding: 18px 22px; }
.modal-header .modal-title { font-weight: 700; font-size: 1.1rem; }
.modal-body { padding: 4px 22px 8px; }
.modal-backdrop.show { opacity: .35; }
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 2100; display: flex; flex-direction: column; gap: 8px; }
.toast-x { display: flex; align-items: center; gap: 10px; background: #0f1f1d; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: .9rem; font-weight: 500; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); animation: toastIn .3s var(--ease); max-width: 360px; }
.toast-x.out { animation: toastOut .25s var(--ease) forwards; }
.toast-x i { font-size: 1.1rem; }

/* Navigasi bawah (HP) */
.bottom-nav { display: none; }
.backdrop { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
@keyframes flash { 0% { background: #99f6e4; } 100% { background: transparent; } }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 40px -20px rgba(0,0,0,.25); }
  .sidebar.show { transform: none; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,31,29,.35); z-index: 1035; animation: pageIn .2s; }
  .main { margin-left: 0; padding-bottom: 84px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 1.15rem; }
  #page-actions .form-select { max-width: 150px; font-size: 13px; padding: .45rem 2rem .45rem .7rem; min-width: 0 !important; }
  .content { padding: 4px 14px 24px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bn-item { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: #7b8a87; padding: 6px 0; border: 0; background: none; }
  .bn-item i { font-size: 1.25rem; }
  .bn-item.active { color: var(--teal); }
  .bn-scan { position: relative; top: -18px; justify-self: center; width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--bg); background: linear-gradient(140deg, #14b8a6, #0f766e); color: #fff; font-size: 1.5rem; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(13,148,136,.8); }
  .bn-scan:active { transform: scale(.94); }
  .toast-wrap { top: auto; bottom: 92px; left: 16px; right: 16px; align-items: center; }
}
@media (max-width: 576px) {
  .modal-dialog { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; }
  .modal.fade .modal-dialog { transform: translateY(100%); transition: transform .3s var(--ease); }
  .modal.show .modal-dialog { transform: none; }
  .modal-content { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .modal-content::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: #d5dedc; margin: 10px auto 0; }
  .modal-dialog-scrollable { height: auto; max-height: 92vh; }
  .modal-dialog-centered { min-height: 0; align-items: flex-end; }
  .card-body { padding: 1rem; }
  /* tabel jadi kartu */
  .table-stack thead { display: none; }
  .table-stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table-stack td { display: inline-block; border: 0; padding: 2px 8px 2px 0; }
  .table-stack td.blk { display: block; }
  .table-stack td:empty { display: none; }
}
/* Kasir */
.sale-item { display: grid; grid-template-columns: minmax(0,1fr) 170px 40px; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sale-item:last-child { border-bottom: 0; }
.deal-input { text-align: right; font-weight: 700; }
.deal-input.under { border-color: #f59e0b; background: #fffbeb; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .92rem; }
.sum-total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; font-size: 1.05rem; font-weight: 800; }
.pay-opt .btn { padding: .6rem .4rem; font-size: .85rem; }
.btn-check:checked + .btn-pay { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-pay { border: 1px solid var(--line); background: #fff; color: #3d4b48; }
.tt-box { background: #fbfcfc; border-top: 1px solid var(--line); }
/* QC */
.qc-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; height: 100%; display: flex; flex-direction: column; gap: 10px; transition: transform .2s var(--ease), box-shadow .2s; }
.qc-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(16,40,36,.3); }
.chk { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.chk:last-child { border-bottom: 0; }
.seg { display: inline-flex; background: #eef2f1; border-radius: 10px; padding: 3px; flex: none; }
.seg input { display: none; }
.seg label { padding: 5px 12px; border-radius: 8px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg input:checked + label.ok { background: #fff; color: var(--teal-700); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:checked + label.no { background: var(--rose); color: #fff; }
.grade-opt .btn { text-align: left; padding: .7rem .8rem; }
.grade-opt .btn b { font-size: 1.1rem; display: block; }
/* Action sheet scan */
.act-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; text-align: left; margin-bottom: 10px; transition: background .15s; }
.act-btn:hover { background: var(--teal-50); }
.act-btn .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex: none; }
/* Nota */
.nota { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: #000; background: #fff; margin: 0 auto; line-height: 1.35; padding: 4px; }
.nota.w58 { width: 48mm; font-size: 10.5px; } .nota.w80 { width: 72mm; font-size: 11.5px; } .nota.wA5 { width: 128mm; font-size: 12.5px; }
.nota .c { text-align: center; } .nota .r { text-align: right; } .nota .b { font-weight: 700; }
.nota hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; opacity: 1; }
.nota .ln { display: flex; justify-content: space-between; gap: 8px; }
.nota-wrap { background: #eef2f1; border-radius: 12px; padding: 16px 8px; overflow-x: auto; }
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  #print-area .nota { margin: 0; padding: 0; }
}
.scan-err { background: var(--rose-50); color: #881337; border-radius: 12px; padding: 12px 14px; font-size: .88rem; }
@media (max-width: 576px) {
  .sale-item { grid-template-columns: minmax(0,1fr) 40px; }
  .sale-item .deal-col { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
