/* =====================================================================
   APOTEK SEHAT — Tema "Clinical Teal"
   Identitas: bersih, teliti, menenangkan. Palet hijau-teal medis
   dengan aksen amber (peringatan) & rose (bahaya). Tipografi
   Plus Jakarta Sans (judul) + Inter (isi).
   ===================================================================== */

:root {
  /* Palet inti */
  --teal-900: #134e4a;
  --teal-800: #115e59;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  --ink:      #0f172a;   /* teks utama   */
  --ink-soft: #475569;   /* teks sekunder */
  --muted:    #94a3b8;   /* teks redup    */
  --line:     #e7eceb;   /* garis pemisah */
  --surface:  #ffffff;
  --canvas:   #eef3f2;   /* latar halaman */

  --amber:  #f59e0b;
  --amber-bg: #fff7ed;
  --rose:   #e11d48;
  --rose-bg: #fff1f2;
  --sky:    #0ea5e9;
  --violet: #7c3aed;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 20px -8px rgba(15,23,42,.18);
  --shadow-lg: 0 20px 50px -24px rgba(15,23,42,.28);

  --sidebar-w: 264px;

  /* Override variabel Bootstrap */
  --bs-primary: var(--teal-700);
  --bs-body-color: var(--ink);
  --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
}

h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,
.display-font { font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: -.01em; }

a { text-decoration: none; }

/* ---------------------------------------------------------------------
   LAYOUT  — sidebar + konten
   ------------------------------------------------------------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(185deg, var(--teal-800) 0%, var(--teal-900) 100%);
  color: #d7efec;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .28s ease;
}

.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 22px 20px;
}
.sidebar__logo {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff; font-size: 22px;
}
.sidebar__title { font-family:'Plus Jakarta Sans'; font-weight: 700; color:#fff; font-size: 17px; line-height:1.1; }
.sidebar__subtitle { font-size: 11px; color: #8fd3cb; letter-spacing:.04em; text-transform: uppercase; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 6px 14px 20px; }
.sidebar__section { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: #6fb9b0; margin: 18px 12px 8px; font-weight: 600; }

.nav-link-app {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; margin-bottom: 3px;
  color: #bfe6e0; border-radius: 11px;
  font-weight: 500; font-size: 14px;
  position: relative; transition: background .15s, color .15s;
}
.nav-link-app i { font-size: 18px; width: 22px; text-align: center; opacity:.9; }
.nav-link-app:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link-app.active {
  background: rgba(255,255,255,.14); color: #fff; font-weight: 600;
}
.nav-link-app.active::before {
  content:''; position:absolute; left:-14px; top:50%; transform:translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--teal-500);
}
.nav-link-app .badge { margin-left: auto; }

.sidebar__foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar__user { display:flex; align-items:center; gap:11px; }
.sidebar__avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink:0;
  display: grid; place-items: center; font-weight: 700; color: var(--teal-900);
  background: var(--teal-100); font-family:'Plus Jakarta Sans';
}

/* Konten utama */
.main { flex: 1; margin-left: var(--sidebar-w); display:flex; flex-direction: column; min-width:0; }

.topbar {
  height: 66px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px; position: sticky; top: 0; z-index: 1030;
}
.topbar__title { font-family:'Plus Jakarta Sans'; font-weight: 700; font-size: 19px; margin: 0; }
.topbar__crumb { font-size: 12.5px; color: var(--muted); }

.btn-hamburger { display:none; background:none; border:none; font-size:24px; color: var(--ink); }

.content { padding: 26px; flex: 1; }
@media (min-width: 1500px){ .content{ padding: 30px 38px; } }

/* ---------------------------------------------------------------------
   KARTU
   ------------------------------------------------------------------- */
.card-app {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-app__head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display:flex; align-items:center; gap: 12px;
}
.card-app__title { font-family:'Plus Jakarta Sans'; font-weight: 700; font-size: 16px; margin: 0; }
.card-app__body { padding: 20px 22px; }

/* Kartu statistik */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden; height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 14px;
}
.stat__label { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; margin: 0; }
.stat__value {
  font-family:'Plus Jakarta Sans'; font-weight: 800; font-size: 28px;
  letter-spacing: -.02em; line-height: 1.1; margin: 4px 0 0;
}
.stat__hint { font-size: 12px; color: var(--muted); margin-top: 6px; display:flex; align-items:center; gap:5px; }

.ic-teal  { background: var(--teal-50);  color: var(--teal-700); }
.ic-amber { background: var(--amber-bg); color: var(--amber); }
.ic-rose  { background: var(--rose-bg);  color: var(--rose); }
.ic-sky   { background: #eff6ff;         color: var(--sky); }
.ic-violet{ background: #f5f3ff;         color: var(--violet); }

/* ---------------------------------------------------------------------
   TABEL
   ------------------------------------------------------------------- */
.table-app { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-app thead th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: #fafbfb; white-space: nowrap;
}
.table-app tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-app tbody tr:last-child td { border-bottom: none; }
.table-app tbody tr { transition: background .12s; }
.table-app tbody tr:hover { background: var(--teal-50); }
.table-app .text-end, .table-app th.text-end { text-align: right; }

.cell-strong { font-weight: 600; color: var(--ink); }
.cell-muted  { color: var(--muted); font-size: 13px; }

/* Pil / badge */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  line-height: 1; white-space: nowrap;
}
.pill-teal  { background: var(--teal-50);  color: var(--teal-700); }
.pill-amber { background: var(--amber-bg); color: #b45309; }
.pill-rose  { background: var(--rose-bg);  color: var(--rose); }
.pill-gray  { background: #f1f5f9;         color: var(--ink-soft); }
.pill-sky   { background: #eff6ff;         color: #0369a1; }
.pill-dot::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; }

/* ---------------------------------------------------------------------
   TOMBOL & FORM (override Bootstrap)
   ------------------------------------------------------------------- */
.btn { font-weight: 600; border-radius: 11px; padding: 9px 16px; font-size: 14px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-teal { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.btn-teal:hover { background: var(--teal-800); border-color: var(--teal-800); color: #fff; }
.btn-soft { background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-100); }
.btn-soft:hover { background: var(--teal-100); color: var(--teal-800); }
.btn-icon { width: 34px; height: 34px; padding: 0; display:inline-grid; place-items:center; }

.form-label { font-weight: 600; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: 11px; border: 1px solid #d8e0df; padding: 10px 13px; font-size: 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20,184,166,.16);
}
.input-group-text { border-radius: 11px; background: #f1f5f4; border-color:#d8e0df; color: var(--ink-soft); font-weight:600; }

/* Search box di topbar/halaman */
.search-box { position: relative; max-width: 320px; }
.search-box i { position:absolute; left:13px; top:50%; transform:translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 38px; }

/* ---------------------------------------------------------------------
   LOGIN
   ------------------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(20,184,166,.35), transparent 60%),
    linear-gradient(200deg, var(--teal-700), var(--teal-900));
  color:#fff; padding: 56px; display:flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side::after{
  content:''; position:absolute; right:-120px; bottom:-120px; width:380px; height:380px;
  border-radius:50%; border: 60px solid rgba(255,255,255,.05);
}
.auth-form-col { display:grid; place-items:center; padding: 40px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { width:54px;height:54px;border-radius:15px;background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.2); display:grid;place-items:center;font-size:28px; }
.auth-feature { display:flex; gap:13px; align-items:flex-start; margin-bottom:18px; }
.auth-feature i { font-size:20px; color: var(--teal-100); margin-top:2px; }
@media (max-width: 900px){
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display:none; }
}

/* ---------------------------------------------------------------------
   POS / KASIR
   ------------------------------------------------------------------- */
.pos-grid { display:grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items:start; }
@media (max-width: 1100px){ .pos-grid { grid-template-columns: 1fr; } }

.product-tile {
  border:1px solid var(--line); border-radius: var(--radius-sm); padding: 14px;
  cursor:pointer; transition: all .15s; background:#fff; height:100%;
}
.product-tile:hover { border-color: var(--teal-500); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-tile.disabled { opacity:.5; pointer-events:none; }
.product-tile__name { font-weight:600; font-size:13.5px; line-height:1.3; }
.product-tile__price { color: var(--teal-700); font-weight:700; font-family:'Plus Jakarta Sans'; }

.cart-line { display:flex; gap:10px; align-items:center; padding:11px 0; border-bottom:1px dashed var(--line); }
.qty-btn { width:28px;height:28px;border-radius:8px;border:1px solid var(--line);background:#fff;
  display:grid;place-items:center;cursor:pointer; color:var(--ink-soft); }
.qty-btn:hover { background: var(--teal-50); color:var(--teal-700); }

/* ---------------------------------------------------------------------
   MISC
   ------------------------------------------------------------------- */
.empty-state { text-align:center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 48px; color: var(--line); margin-bottom: 12px; display:block; }

.divider-soft { height:1px; background: var(--line); border:0; margin: 18px 0; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5d3; border-radius: 99px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }

.modal-content { border:none; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom:1px solid var(--line); padding: 18px 22px; }
.modal-title { font-family:'Plus Jakarta Sans'; font-weight:700; font-size:17px; }
.modal-body { padding: 20px 22px; }
.modal-footer { border-top:1px solid var(--line); padding: 14px 22px; }

/* Overlay sidebar mobile */
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(15,23,42,.4); z-index:1035; }

@media (max-width: 992px){
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .btn-hamburger { display:inline-block; }
  .sidebar-overlay.show { display:block; }
}

@media (prefers-reduced-motion: reduce){
  * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   STRUK THERMAL 58mm — tambahkan di bagian PALING BAWAH style.css
   ===================================================================== */

/* ----- Tampilan struk di layar (preview & modal) ----- */
.struk-wrap {
  width: 58mm;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #000;
  background: #fff;
}
.struk-logo {
  display: block;
  max-width: 40mm;
  max-height: 20mm;
  margin: 0 auto 6px;
  object-fit: contain;
}
.struk-nama {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  margin-bottom: 2px;
}
.struk-sub {
  text-align: center;
  font-size: 10px;
  color: #444;
}
.struk-garis {
  border-top: 1px dashed #000;
  margin: 5px 0;
}
.struk-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.struk-row-sub {
  font-size: 10px;
  color: #555;
  padding-left: 4px;
}
.struk-item-nama {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.struk-total {
  font-weight: 700;
  font-size: 13px;
}
.struk-footer {
  text-align: center;
  font-size: 10px;
  color: #555;
  margin-top: 6px;
}

/* Pratinjau di pengaturan */
.struk-preview {
  width: 58mm;
  border: 1px dashed #ccc;
  border-radius: 4px;
  padding: 8px;
  background: #fff;
}

