:root {
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --emerald: #10b981;
  --grad: linear-gradient(120deg, #0d9488 0%, #10b981 100%);
  --ink: #0d2b28;
  --muted: #5f7c78;
  --line: #d9e9e6;
  --card: rgba(255, 255, 255, 0.82);
  --radius: 16px;
  --shadow: 0 12px 30px rgba(13, 148, 136, 0.10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #f1fbf8;
  background-image:
    radial-gradient(900px 500px at 10% -5%, rgba(16, 185, 129, 0.22), transparent 60%),
    radial-gradient(700px 460px at 95% 0%, rgba(45, 212, 191, 0.22), transparent 60%),
    radial-gradient(700px 520px at 60% 110%, rgba(13, 148, 136, 0.14), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-700); }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px;
  flex: 0 0 244px;
  padding: 22px 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  border-right: 1px solid rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.32);
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px rgba(18, 49, 99, 0.18);
  padding: 2px;
}

.login-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
  border-radius: 20px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 12px 26px rgba(18, 49, 99, 0.16);
}

.struk-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

input[type="file"] {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.brand-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 6px; }

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 10px 4px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav a:hover { background: rgba(13, 148, 136, 0.08); }

.nav a.aktif {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.28);
}

.nav a .ic { width: 18px; text-align: center; }

.isi {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 46px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.topbar h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.01em; }
.topbar .sub { color: var(--muted); font-size: 13.5px; }

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 8px 14px 8px 8px;
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}

.who .n { font-size: 13.5px; font-weight: 600; }
.who .r { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }

.hamburger { display: none; }

/* ---------- Kartu ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.card h2 { margin: 0 0 4px; font-size: 16.5px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.grid { display: grid; gap: 20px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.dua { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.kasir { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); align-items: start; }

.kpi-card { display: flex; flex-direction: column; gap: 6px; }
.kpi-card .lbl { font-size: 12.5px; color: var(--muted); }
.kpi-card .val { font-size: 25px; font-weight: 700; letter-spacing: -0.01em; }
.kpi-card .note { font-size: 12.5px; color: var(--muted); }

/* ---------- Form ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

input[type="text"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.13);
}

.field { margin-bottom: 14px; }

.baris { display: flex; gap: 14px; flex-wrap: wrap; }
.baris > * { flex: 1 1 160px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { border-color: var(--teal-600); }

.btn.utama {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.3);
}

.btn.bahaya { color: #b42318; border-color: #f3c9c4; background: #fff5f4; }
.btn.kecil { padding: 7px 12px; font-size: 13px; }
.btn.besar { padding: 15px 20px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Tabel ---------- */
.tabel-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: rgba(13, 148, 136, 0.05); }
td.angka, th.angka { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; }

.kosong { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(13, 148, 136, 0.12);
  color: var(--teal-700);
}
.badge.kuning { background: #fef3c7; color: #92400e; }
.badge.merah { background: #fee4e2; color: #b42318; }
.badge.abu { background: #eceff1; color: #546e7a; }

.pesan {
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.pesan.ok { background: #e7f8f1; color: #0b6b53; border: 1px solid #bfe9d9; }
.pesan.err { background: #fdecea; color: #a4262c; border: 1px solid #f6cfcb; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-card { width: 100%; max-width: 400px; padding: 30px 30px 26px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; text-align: center; }
.login-brand h1 { margin: 0; font-size: 22px; }
.login-brand p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Kasir ---------- */
.cari-produk { position: relative; }
#hasil-cari {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(13, 43, 40, 0.16);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}
.hasil-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.hasil-item:hover, .hasil-item.sorot { background: rgba(13, 148, 136, 0.10); }
.hasil-item .nm { font-size: 14px; font-weight: 600; }
.hasil-item .kt { font-size: 12px; color: var(--muted); }
.hasil-item .hr { font-size: 14px; font-weight: 600; white-space: nowrap; }

.keranjang { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; }
.item-pilih { display: flex; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); }
.item-pilih .nm { font-size: 14px; font-weight: 600; }
.item-pilih .kt { font-size: 12px; color: var(--muted); }

.qty-ctrl { display: flex; align-items: center; gap: 4px; }
.qty-ctrl button {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; color: var(--ink); line-height: 1;
}
.qty-ctrl input { width: 52px; text-align: center; padding: 5px 4px; }

.total-box { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.total-box .row { display: flex; justify-content: space-between; font-size: 14px; }
.total-box .row.big { font-size: 22px; font-weight: 700; border-top: 1px dashed var(--line); padding-top: 10px; }
.kembalian { background: rgba(16, 185, 129, 0.12); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; font-weight: 600; }

/* ---------- Struk ---------- */
.struk {
  width: 300px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 18px;
  font-family: "Courier New", monospace;
  font-size: 12.5px;
  color: #111;
}
.struk .c { text-align: center; }
.struk .b { font-weight: 700; }
.struk hr { border: none; border-top: 1px dashed #999; margin: 10px 0; }
.struk .row { display: flex; justify-content: space-between; gap: 8px; }
.struk .row .l { flex: 1; min-width: 0; word-break: break-word; }
.struk-aksi { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(13, 43, 40, 0.42);
  display: none; place-items: center; padding: 20px; z-index: 60;
  backdrop-filter: blur(3px);
}
.modal-bg.buka { display: grid; }
.modal { background: #fff; border-radius: 20px; padding: 26px; width: 100%; max-width: 400px; box-shadow: 0 30px 60px rgba(13,43,40,.28); }
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14.5px; }
.modal .row.big { font-size: 21px; font-weight: 700; border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; }

.tombol-aksi { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .grid.kasir { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.8);
    padding: 14px 16px; gap: 14px;
  }
  .sidebar .nav { display: none; }
  .sidebar.buka .nav { display: flex; }
  .hamburger { display: inline-flex; margin-left: auto; }
  .brand { padding: 0; }
  .isi { padding: 18px 16px 40px; gap: 20px; }
  .topbar h1 { font-size: 20px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .struk-aksi, .no-print { display: none !important; }
  .isi { padding: 0; }
  .card { box-shadow: none; border: none; padding: 0; background: #fff; }
  .struk { border: none; width: auto; max-width: 300px; }
}
