/* NOA Costing & Penawaran - gaya dasar (cetak biru bagian 12) */
:root {
  --green-900: #1B3D2F;
  --green-700: #1F5A45;
  --green-100: #E3ECE6;
  --orange: #E8A33D;
  --orange-100: #FBEBD2;
  --cream: #F7F3EA;
  --cream-200: #EFE8D8;
  --ink: #1D2420;
  --ink-soft: #5B6660;
  --line: #DDD5C4;
  --white: #FFFFFF;
  --red: #A6402F;
  --red-100: #F6E1DC;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
}
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: 1.625rem; font-weight: 800; }
h2 { font-size: 1.125rem; font-weight: 700; }
.h-sm { font-size: 1rem; margin-top: 1.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--green-700); font-weight: 600; }
code { background: var(--cream-200); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.muted { color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- Pita mode uji ---------- */
.env-banner {
  background: var(--orange); color: var(--green-900);
  text-align: center; font-weight: 700; font-size: .875rem; padding: .4rem 1rem;
}

/* ---------- Tombol & formulir ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 1.25rem; border-radius: var(--radius);
  border: 1.5px solid transparent; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { background: var(--green-900); }
.btn-accent { background: var(--orange); color: var(--green-900); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.4); min-height: 38px; padding: 0 .9rem; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }

.form { display: flex; flex-direction: column; margin-top: 1.25rem; }
.form label { font-weight: 600; font-size: .9375rem; margin: 1rem 0 .375rem; }
.form label:first-of-type { margin-top: 0; }
.form input {
  width: 100%; min-height: var(--tap); padding: .625rem .875rem;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font: inherit; background: var(--white); color: var(--ink);
}
.form input:focus { border-color: var(--green-700); outline: none; box-shadow: 0 0 0 3px var(--green-100); }
.form small { color: var(--ink-soft); font-size: .8125rem; margin-top: .375rem; }
.form .btn { margin-top: 1.5rem; }
.pw { position: relative; }
.pw input { padding-right: 7.5rem; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 34px; padding: 0 .75rem; border: 0; border-radius: var(--radius-sm);
  background: var(--cream-200); color: var(--green-900); font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer;
}

/* ---------- Pesan ---------- */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; font-size: .9375rem; }
.alert-ok { background: var(--green-100); color: var(--green-900); }
.alert-err { background: var(--red-100); color: var(--red); }
.alert-info { background: var(--orange-100); color: #6B4A12; }

/* ---------- Halaman masuk ---------- */
.bare-main { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.auth {
  width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line);
}
.auth-side { position: relative; background: var(--green-900); color: var(--cream); min-height: 520px; }
.auth-side .contour { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(247,243,234,.22); }
.auth-side-text { position: absolute; left: 2rem; right: 2rem; bottom: 2rem; }
.brand-line { font-size: 1.375rem; font-weight: 800; line-height: 1.25; margin-bottom: .5rem; }
.brand-tag { color: rgba(247,243,234,.75); margin: 0; max-width: 28ch; }
.auth-main { padding: 2.5rem 2.25rem; }
.auth-logo { border-radius: 12px; margin-bottom: 1.25rem; display: block; }

.panel { width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem; }
.panel-narrow { max-width: 520px; }
.error-body { color: var(--ink-soft); }
.error-body pre.debug { white-space: pre-wrap; background: var(--cream-200); padding: .75rem; border-radius: var(--radius-sm); font-size: .8125rem; }

.checklist { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.checklist li { display: flex; gap: .75rem; align-items: flex-start; padding: .625rem .75rem; border-radius: var(--radius); background: var(--cream); }
.checklist li p { margin: .25rem 0 0; font-size: .875rem; color: var(--red); }
.checklist .dot {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .8125rem;
}
.checklist .is-ok .dot { background: var(--green-700); color: var(--white); }
.checklist .is-bad .dot { background: var(--red); color: var(--white); }

/* ---------- Aplikasi (setelah login) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.25rem; padding-top: max(.75rem, env(safe-area-inset-top));
  background: var(--green-900); color: var(--white);
}
.topbar-brand { display: flex; align-items: center; gap: .625rem; color: var(--white); text-decoration: none; font-weight: 800; }
.topbar-brand img { border-radius: 8px; }
.topbar-brand small { display: block; font-weight: 500; font-size: .75rem; color: rgba(255,255,255,.65); }
.topbar-user { display: flex; align-items: center; gap: .75rem; }
.topbar-user form { margin: 0; }
.topbar-name { font-weight: 600; font-size: .9375rem; }

.container { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.status {
  display: flex; gap: 1rem; align-items: center;
  background: var(--green-700); color: var(--white);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem;
}
.status h1 { margin-bottom: .25rem; }
.status p { margin: 0; color: rgba(255,255,255,.85); }
.status-mark {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--orange); color: var(--green-900);
  display: grid; place-items: center; font-size: 1.75rem; font-weight: 800;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.grid .card { margin-bottom: 0; }
.grid { margin-bottom: 1rem; }
.card .btn { margin-top: 1rem; }
.facts { margin: 0; display: grid; gap: .5rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .5rem; }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.pill { display: inline-block; padding: .125rem .625rem; border-radius: 999px; background: var(--cream-200); font-size: .8125rem; font-weight: 700; }
.pill-green { background: var(--green-100); color: var(--green-900); }
.note { font-size: .875rem; color: var(--ink-soft); margin: .75rem 0 0; }

.devices, .log { list-style: none; padding: 0; margin: 0; }
.devices li, .log li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; padding: .625rem 0; border-bottom: 1px solid var(--cream-200); }
.devices li:last-child, .log li:last-child { border-bottom: 0; }
.log li { justify-content: space-between; }
.devices .muted, .log .muted { font-size: .875rem; }

.table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
.perm { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.perm th, .perm td { padding: .5rem .625rem; border-bottom: 1px solid var(--cream-200); text-align: left; vertical-align: middle; }
.perm thead th { font-size: .8125rem; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.perm tbody th { font-weight: 500; min-width: 220px; }
.lock { display: inline-block; margin-left: .375rem; font-size: .6875rem; font-weight: 700; color: #6B4A12; background: var(--orange-100); padding: .05rem .4rem; border-radius: 4px; }
.lv { display: inline-block; min-width: 72px; text-align: center; padding: .125rem .5rem; border-radius: 6px; font-size: .8125rem; font-weight: 700; }
.lv-0 { background: transparent; color: #A39C8E; border: 1px dashed var(--line); }
.lv-1 { background: var(--cream-200); color: var(--ink); }
.lv-2 { background: var(--orange-100); color: #6B4A12; }
.lv-3 { background: var(--green-700); color: var(--white); }

/* ---------- HP ---------- */
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { min-height: 180px; }
  .auth-side-text { left: 1.25rem; right: 1.25rem; bottom: 1.25rem; }
  .brand-line { font-size: 1.125rem; }
  .brand-tag { display: none; }
  .auth-main { padding: 1.75rem 1.25rem; }
  .auth-main .auth-logo { display: none; }
  .panel { padding: 1.5rem 1.25rem; }
  .grid { grid-template-columns: 1fr; }
  .topbar-name { display: none; }
  .status { padding: 1.25rem; }
  .status-mark { width: 44px; height: 44px; font-size: 1.375rem; }
  h1 { font-size: 1.375rem; }
  .perm tbody th { min-width: 160px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
