/* app.css — OTW (Orderan Tepat Waktu) UI — mobile-first
   Palette taken straight from the OTW logo: black #141414 + lime #B5C730.
   Lime is bright, so it is only ever used as a BACKGROUND behind dark text,
   or as large artwork. For text on white we use --lime-deep, which is the
   same hue darkened until it is comfortably readable.
   Success green and failure red are deliberately left alone — couriers read
   those colours at a glance all day and must not have to relearn them. */
:root {
  --ink: #141414;          /* logo black — top bars, headings, primary text */
  --ink-soft: #2E322B;
  --lime: #B5C730;         /* logo lime — fills and highlights only */
  --lime-deep: #69731C;    /* lime, readable as text on white */
  --lime-tint: #F5F7E2;    /* pale lime for badges and soft panels */
  --light: #F5F6F1;        /* page background */
  --grey: #63665E;
  --green: #16804B;        /* delivered / success */
  --red: #C0392B;          /* failed / alarm */
  --line: #E1E3DA;

  /* aliases kept so existing markup using var(--navy) / var(--orange) still works */
  --navy: var(--ink);
  --orange: var(--lime-deep);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--light); color: #1E211C;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.topbar {
  background: var(--ink); color: #fff; padding: 11px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { display: flex; align-items: center; gap: 11px; }
.topbar-brand img { height: 28px; width: auto; max-width: 140px; object-fit: contain; display: block; }
.topbar b { font-size: 15px; font-weight: 600; }
.topbar .who { font-size: 12px; color: #A9AD9F; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Toggle bahasa ID / EN
   Dulu warnanya menyatu dengan latar gelap sehingga sulit terlihat.
   Sekarang: satu wadah bergaris jelas, tombol aktif diisi warna lime. */
.lang-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(255,255,255,.14); border: 1.5px solid rgba(255,255,255,.45);
  border-radius: 999px;
}
.lang-toggle button {
  padding: 5px 13px; border-radius: 999px; background: transparent;
  color: #fff; border: 0; font-size: 12.5px; font-weight: 700;
  cursor: pointer; line-height: 1.4; letter-spacing: .3px;
}
.lang-toggle button:hover { background: rgba(255,255,255,.18); filter: none; }
.lang-toggle button.active {
  background: var(--lime); color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.lang-toggle button.active:hover { background: var(--lime); }
/* Di halaman berlatar terang (login), teks putih tidak terbaca — pakai versi ini. */
.lang-toggle.on-light { background: #fff; border-color: var(--ink); }
.lang-toggle.on-light button { color: var(--ink); }
.lang-toggle.on-light button:hover { background: var(--light); }
.lang-toggle.on-light button.active { background: var(--ink); color: var(--lime); box-shadow: none; }
.lang-toggle.on-light button.active:hover { background: var(--ink); }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px 14px 40px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 15px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--ink); }

button, .btn {
  display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 12px 18px;
  text-decoration: none; text-align: center; line-height: 1.3;
  transition: filter .12s, background .12s;
}
button:hover, .btn:hover { filter: brightness(.94); }
button:active, .btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lime); color: var(--ink); }
.btn-navy    { background: var(--ink);  color: #fff; }
.btn-green   { background: var(--green); color: #fff; }
.btn-ghost   { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-block   { display: block; width: 100%; }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }

input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; font-size: 15px; background: #fff; color: #1E211C;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(181,199,48,.45);
}
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--grey); margin: 10px 0 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.muted { color: var(--grey); font-size: 12.5px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill-wait { background: #EEEFE9; color: var(--grey); }
.pill-run  { background: var(--lime-tint); color: var(--lime-deep); }
.pill-done { background: #E7F6EE; color: #14633C; }

.list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.big { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.5px; }
.progress { height: 10px; background: #E8EAE1; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--lime); transition: width .3s; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; color: var(--grey); font-size: 11.5px; font-weight: 600; padding: 7px 6px; border-bottom: 2px solid var(--line); }
td { padding: 8px 6px; border-bottom: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; max-width: 90vw; z-index: 99; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.err { background: var(--red); }
.toast.ok  { background: var(--green); }

.scanbox { border: 2px dashed var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
#reader { width: 100%; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  padding: 9px 14px; border-radius: 999px; background: #fff;
  border: 1.5px solid var(--line); color: var(--ink); font-size: 13.5px; font-weight: 600;
}
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi .card { margin: 0; text-align: center; padding: 11px 6px; }
.kpi .big { font-size: 22px; }

sig-pad, canvas.sig { width: 100%; height: 140px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; touch-action: none; }
.warn   { background: var(--lime-tint); border: 1px solid #D8DEA8; color: #4E5615; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.danger { background: #FBEAEA; border: 1px solid #EFB9B9; color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: 13px; }
