/* ============================================================
   SIMLAB — tema panel instrumen laboratorium
   Warna dasar mengikuti perangkat lab: slate-teal + sinyal amber.
   ============================================================ */
:root {
  --lab-deep:    #17394a;   /* header & sidebar */
  --lab-deep-2:  #0f2733;
  --lab-line:    #d8dee4;
  --lab-bg:      #f5f7f8;
  --lab-accent:  #0f8ea8;   /* aksi utama */
  --lab-signal:  #c2650a;   /* peringatan stok */
  --lab-ok:      #1f7a4d;
  --lab-text:    #1d2b33;
}

body {
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--lab-deep);
  border-bottom: 3px solid var(--lab-accent);
  padding: .45rem 0;
}
.topbar .navbar-brand { color: #fff; font-weight: 600; letter-spacing: .01em; }
.topbar .navbar-brand:hover { color: #fff; }
.brand-sub { color: #9fc0cd; font-weight: 400; font-size: .8rem; border-left: 1px solid #38606f; padding-left: .6rem; }
.btn-scan { background: var(--lab-accent); border-color: var(--lab-accent); color: #fff; }
.btn-scan:hover { background: #0b7288; color: #fff; }
.btn-user { background: transparent; color: #dceaf0; border: 1px solid #38606f; }
.btn-user:hover { background: #1e4759; color: #fff; }
.role-badge { background: #38606f; color: #e7f2f6; font-weight: 500; font-size: .7rem; }

/* ---------- Kerangka halaman ---------- */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  width: 232px; flex: 0 0 232px;
  background: var(--lab-deep-2);
  min-height: calc(100vh - 56px);
  position: sticky; top: 56px;
}
.sidebar .nav-link {
  color: #b8cdd6; border-radius: 0; padding: .6rem 1rem;
  display: flex; align-items: center; gap: .6rem; font-size: .93rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link:hover { background: #16303e; color: #fff; }
.sidebar .nav-link.active { background: #16303e; color: #fff; border-left-color: var(--lab-accent); }
.sidebar .nav-section {
  color: #6f909e; font-size: .72rem; padding: 1.1rem 1rem .35rem;
  letter-spacing: .06em; border-top: 1px solid #1c3d4d; margin-top: .5rem;
}
.sidebar-foot { padding: 1rem; font-size: .75rem; color: #7fa0ae; border-top: 1px solid #1c3d4d; margin-top: 1rem; }
.content { flex: 1 1 auto; padding: 1.25rem 1.5rem 3rem; min-width: 0; }
@media (max-width: 991.98px) {
  .sidebar { min-height: auto; position: static; width: 260px; }
  .content { padding: 1rem; }
}

/* ---------- Kartu & tabel ---------- */
.card { border: 1px solid var(--lab-line); border-radius: 6px; box-shadow: none; }
.card-header {
  background: #fff; border-bottom: 1px solid var(--lab-line);
  font-weight: 600; padding: .75rem 1rem;
}
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; font-weight: 600; margin: 0; }
.page-head .sub { color: #5b6b75; font-size: .87rem; margin-top: .15rem; }

.table { font-size: .89rem; }
.table > thead > tr > th {
  background: #eef2f4; color: #45565f; font-weight: 600;
  border-bottom: 1px solid var(--lab-line); white-space: nowrap;
}
.table code { color: var(--lab-deep); font-size: .85em; }
.table-hover > tbody > tr:hover > * { background: #f0f7f9; }

/* ---------- Kartu statistik dashboard ---------- */
.stat {
  background: #fff; border: 1px solid var(--lab-line); border-radius: 6px;
  padding: .85rem 1rem; height: 100%;
  border-top: 3px solid var(--lab-deep);
}
.stat .label { font-size: .78rem; color: #5b6b75; }
.stat .value { font-size: 1.7rem; font-weight: 600; line-height: 1.2; }
.stat .meta { font-size: .75rem; color: #7b8892; }
.stat.is-ok      { border-top-color: var(--lab-ok); }
.stat.is-warn    { border-top-color: var(--lab-signal); }
.stat.is-danger  { border-top-color: #b02a37; }
.stat.is-accent  { border-top-color: var(--lab-accent); }

/* ---------- Timeline riwayat ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--lab-line); }
.timeline li { position: relative; padding: 0 0 1.1rem 1rem; }
.timeline li::before {
  content: ""; position: absolute; left: -1.52rem; top: .3rem;
  width: .7rem; height: .7rem; border-radius: 50%; background: #fff;
  border: 2px solid var(--lab-accent);
}
.timeline .t-head { font-weight: 600; font-size: .9rem; }
.timeline .t-meta { font-size: .78rem; color: #6b7a83; }
.timeline .t-desc { font-size: .86rem; }

/* ---------- Label cetak (barcode + QR) ----------
   Ukuran 95 x 32 mm, dua kolom pada A4. Lebar area barcode 70 mm menjaga
   modul Code 128 tetap >= 0,28 mm agar terbaca pemindai genggam.        */
.label-sheet { display: flex; flex-wrap: wrap; gap: 3mm; align-content: flex-start; }
.label-item {
  width: 95mm; height: 32mm; box-sizing: border-box;
  border: 1px dashed #9aa4ab; border-radius: 1mm;
  padding: 2mm 2.5mm; display: flex; gap: 2.5mm; align-items: stretch;
  page-break-inside: avoid; break-inside: avoid; overflow: hidden;
}
.label-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.label-brand {
  display: flex; align-items: center; gap: 1.5mm;
  font-size: 6pt; font-weight: 600; color: #17394a; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.label-logo { height: 4.5mm; width: auto; flex: 0 0 auto; }
.label-item .l-name {
  font-size: 8.5pt; font-weight: 700; line-height: 1.15; margin-top: .6mm;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.label-item .l-meta {
  font-size: 6pt; color: #52606a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.label-item .l-bar { margin-top: auto; }
.label-item .l-bar svg {
  display: block; width: 70mm; height: 9mm;
  preserveAspectRatio: none;                 /* diatur juga pada atribut SVG */
}
.label-item .l-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 7pt; letter-spacing: .04em; text-align: center; width: 70mm;
}
.label-qr { flex: 0 0 17mm; display: flex; align-items: center; }
.label-qr svg { width: 17mm; height: 17mm; display: block; }

@media print {
  .label-sheet { gap: 2mm; }
  .label-item { border-color: #ccc; }
}

/* ---------- Halaman login ---------- */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--lab-deep-2);
  padding: 1.5rem;
}
.auth-card { width: 100%; max-width: 880px; background: #fff; border-radius: 8px; overflow: hidden; display: flex; }
.auth-side { background: var(--lab-deep); color: #cfe2ea; padding: 2.25rem; width: 42%; }
.auth-side h2 { color: #fff; font-size: 1.25rem; font-weight: 600; }
.auth-form { padding: 2.25rem; flex: 1; }
.auth-flash { position: fixed; top: 1rem; right: 1rem; z-index: 20; max-width: 340px; }
.auth-demo { font-size: .8rem; color: #94b4c2; border-top: 1px solid #2b5364; margin-top: 1.4rem; padding-top: .9rem; }
@media (max-width: 767.98px) { .auth-card { flex-direction: column; } .auth-side { width: 100%; } }

/* ---------- Scan ---------- */
#reader { border: 1px solid var(--lab-line); border-radius: 6px; overflow: hidden; background: #000; }
.scan-input { font-size: 1.05rem; letter-spacing: .04em; font-family: ui-monospace, Consolas, monospace; }
.scan-result-empty { color: #6b7a83; text-align: center; padding: 2.5rem 1rem; }

.low-stock { color: var(--lab-signal); font-weight: 600; }
.form-label { font-size: .85rem; font-weight: 500; color: #435560; margin-bottom: .25rem; }
.required::after { content: " *"; color: #b02a37; }
.filter-bar { background: #fff; border: 1px solid var(--lab-line); border-radius: 6px; padding: .75rem; }

/* ---------- Identitas institusi ---------- */
.brand-logo {
  height: 30px; width: auto;
  background: #fff; border-radius: 4px; padding: 2px;
}
.auth-logo {
  height: 62px; width: auto;
  background: #fff; border-radius: 6px; padding: 4px;
}
.print-kop {
  border-bottom: 3px double #17394a;
  padding-bottom: .6rem;
}

@media print {
  .print-kop { border-bottom: 2px solid #000; }
}
