:root { --ink:#18222b; --muted:#6b7a86; --line:#e6eaed; --bg:#f7f8f9; --teal:#0f766e; --teal-d:#0b5f58; --r:10px; }
html { -webkit-tap-highlight-color:transparent; }
body { background:var(--bg); color:var(--ink); font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; font-size:15px; }
a { color:var(--teal); }
h1,.h4,.h5 { letter-spacing:-.2px; }
.text-secondary { color:var(--muted)!important; }

/* Top bar & navigasi */
.topbar { background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.topbar .inner { height:56px; }
.brand { font-weight:700; color:var(--ink); text-decoration:none; font-size:1.05rem; }
.topnav a { color:var(--muted); text-decoration:none; padding:.4rem .8rem; border-radius:8px; font-weight:500; }
.topnav a:hover { color:var(--ink); background:#f0f3f4; }
.topnav a.active { color:var(--teal); background:#e8f3f1; }
.page { padding-top:1.25rem; padding-bottom:2rem; }
.bnav { position:fixed; left:0; right:0; bottom:0; z-index:30; background:#fff; border-top:1px solid var(--line);
        display:grid; grid-template-columns:repeat(5,1fr); padding-bottom:env(safe-area-inset-bottom); }
.bnav a { display:flex; flex-direction:column; align-items:center; gap:2px; padding:.5rem 0; color:var(--muted); text-decoration:none; font-size:.7rem; }
.bnav a i { font-size:1.3rem; line-height:1; }
.bnav a.active { color:var(--teal); }
.bnav .fab span { width:52px; height:52px; border-radius:50%; background:var(--teal); color:#fff; display:flex; align-items:center; justify-content:center;
                  margin-top:-24px; box-shadow:0 4px 12px rgba(15,118,110,.35); font-size:1.4rem; }
.bnav .fab { padding-top:0; }
@media (max-width:767.98px) { .page { padding-bottom:6rem; padding-top:1rem; } }

/* Komponen */
.btn { border-radius:8px; font-weight:500; }
.btn-primary { --bs-btn-bg:var(--teal); --bs-btn-border-color:var(--teal); --bs-btn-hover-bg:var(--teal-d); --bs-btn-hover-border-color:var(--teal-d); --bs-btn-active-bg:var(--teal-d); --bs-btn-active-border-color:var(--teal-d); }
.btn-outline-primary { --bs-btn-color:var(--teal); --bs-btn-border-color:var(--teal); --bs-btn-hover-bg:var(--teal); --bs-btn-hover-border-color:var(--teal); --bs-btn-active-bg:var(--teal); }
.form-control,.form-select { border-color:#d3dbe0; border-radius:8px; min-height:44px; }
.form-control:focus,.form-select:focus { border-color:var(--teal); box-shadow:0 0 0 .2rem rgba(15,118,110,.15); }
.form-label { font-weight:500; margin-bottom:.25rem; }
@media (max-width:767.98px) { .form-control,.form-select { font-size:16px; } .btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; } }
.panel { background:#fff; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.panel-h { padding:.8rem 1rem; border-bottom:1px solid var(--line); font-weight:600; display:flex; justify-content:space-between; align-items:center; gap:.5rem; }
.stat { background:#fff; border:1px solid var(--line); border-radius:var(--r); padding:1rem; height:100%; }
.stat .n { font-size:1.8rem; font-weight:700; line-height:1.1; }
.stat.warn .n { color:#b45309; } .stat.bad .n { color:#b91c1c; }
.table { margin-bottom:0; }
.table > :not(caption) > * > * { vertical-align:middle; padding:.7rem 1rem; }
.table thead th { font-weight:600; color:var(--muted); background:#fafbfb; white-space:nowrap; font-size:.85rem; }
.kv dt { font-weight:500; color:var(--muted); } .kv dd { margin-bottom:.6rem; }
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:1rem; }

/* Daftar aset */
.item { display:flex; gap:.9rem; align-items:center; padding:.75rem 1rem; border-bottom:1px solid var(--line); text-decoration:none; color:inherit; }
.item:last-child { border-bottom:0; } .item:hover { background:#fafbfb; color:inherit; }
.item .t { font-weight:600; } .item .s { color:var(--muted); font-size:.85rem; }
.min-w-0 { min-width:0; }
.thumb { width:56px; height:56px; border-radius:8px; object-fit:cover; background:#eef1f3; flex:none; display:flex; align-items:center; justify-content:center; color:var(--muted); font-weight:600; font-size:.8rem; }

/* Foto */
.photo-drop { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.4rem; aspect-ratio:4/3; width:100%;
              border:2px dashed #c4cdd3; border-radius:var(--r); background:#fff; overflow:hidden; position:relative; cursor:pointer; color:var(--muted); text-align:center; }
.photo-drop i { font-size:2.2rem; color:var(--teal); }
.photo-drop img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.photo-drop.has { border-style:solid; border-color:var(--line); }
.hero-photo { width:100%; max-height:380px; object-fit:cover; border-radius:8px; margin-bottom:1rem; display:block; }
.no-photo { display:block; padding:1rem; border:1px dashed #c4cdd3; border-radius:8px; margin-bottom:1rem; text-align:center; text-decoration:none; }
.only-fine { display:none!important; }
@media (pointer:fine) { .only-fine { display:inline-flex!important; } .only-touch { display:none!important; } }
.cam-box { position:fixed; inset:0; background:#000; z-index:100; display:flex; flex-direction:column; }
.cam-box video { flex:1; min-height:0; width:100%; object-fit:contain; }
.cam-actions { padding:1rem; display:flex; gap:.5rem; justify-content:center; }
details.more > summary { cursor:pointer; font-weight:500; color:var(--teal); padding:.4rem 0; list-style:none; }
details.more > summary::-webkit-details-marker { display:none; }

/* Tabel menjadi kartu di HP */
@media (max-width:767.98px) {
  table.stack thead { display:none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display:block; width:100%; }
  table.stack tr { padding:.7rem 1rem; border-bottom:1px solid var(--line); }
  table.stack tr:last-child { border-bottom:0; }
  table.stack td { border:0!important; padding:.15rem 0!important; display:flex; justify-content:space-between; gap:1rem; text-align:right; background:none!important; }
  table.stack td::before { content:attr(data-label); color:var(--muted); text-align:left; flex:none; }
  table.stack td[data-label=""]::before { display:none; }
  table.stack td[colspan] { justify-content:center; }
  table.stack td.text-end { justify-content:flex-start; flex-wrap:wrap; padding-top:.5rem!important; }
}

/* Label QR */
.label-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:10px; }
.label-card { background:#fff; border:1.5px solid #000; border-radius:4px; padding:8px; display:flex; gap:8px; align-items:center; break-inside:avoid; }
.label-card .qr { width:96px; height:96px; flex:none; }
.label-card .qr img, .label-card .qr canvas { width:96px!important; height:96px!important; }
.label-card .meta { min-width:0; flex:1; font-size:11px; line-height:1.25; }
.label-card .meta .nm { font-weight:700; font-size:12px; }
.label-card svg.bc { width:100%; height:auto; margin-top:4px; }
@media print {
  .no-print { display:none!important; }
  body { background:#fff; }
  main.container-xl { max-width:100%; padding:0!important; }
  .label-grid { grid-template-columns:repeat(3,1fr); gap:6px; }
}
