/* ==========================================================================
   Sewa GMJ — tampilan aplikasi
   Mengikuti bahasa desain GMJ (website/landing-page/DESIGN.md):
   satu keluarga huruf Plus Jakarta Sans, ground pita tone, satu aksen merah,
   radius 18 untuk kartu dan 12 untuk kontrol, tanpa shadow.
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --tone: #f4f4f2;
  --ink: #101114;
  --muted: #5b6068;
  --line: #e5e5e0;
  --red: #e2231a;
  --red-dark: #c11d15;
  --red-tint: #fdf1f0;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--tone);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  min-height: 68px;
  padding: 0 clamp(14px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.merek {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.merek-logo { height: 34px; width: auto; }
.merek-teks {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.merek-teks b { font-weight: 800; color: var(--ink); }

header nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  min-width: 0;
  margin-left: auto;
}
header nav a {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
header nav a:hover { background: var(--tone); color: var(--ink); }
header nav a.aktif { background: var(--tone); color: var(--ink); font-weight: 700; }

header .kanan {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.siapa { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- kerangka halaman ---------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px clamp(14px, 3vw, 28px) 72px;
}

h1 {
  margin: 0 0 22px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h2 {
  margin: 30px 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ---------- tabel ---------- */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}
th:first-child { border-top-left-radius: var(--radius); }
th:last-child { border-top-right-radius: var(--radius); }
tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
th {
  position: sticky;
  top: 68px;
  z-index: 2;
  background: var(--tone);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: #fafaf8; }
td a { font-weight: 600; }
td a:hover { color: var(--red); }

.kanan, .kanan-teks { text-align: right; white-space: nowrap; }
td:first-child { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.kecil { font-size: 12.5px; color: var(--muted); }
.merah { color: var(--red); }
.aksi { white-space: nowrap; }
table.rapat th, table.rapat td { padding: 8px 12px; }
table tfoot td { background: var(--tone); font-weight: 700; }

/* ---------- kartu angka ---------- */

.kartu-baris {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.kartu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.kartu span {
  display: block;
  min-height: 2.6em;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kartu b {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.kartu.uang b { font-size: 20px; }
.kartu.merah { border-color: #f0cfcb; background: var(--red-tint); }
.kartu.merah b, .kartu.merah span { color: var(--red-dark); }

/* ---------- lencana status ----------
   Merah hanya untuk yang perlu ditindak, yang beres dibiarkan tenang. */

.lencana {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--tone);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.lencana.pesanan, .lencana.berjalan { background: var(--ink); border-color: var(--ink); color: #fff; }
.lencana.selesai, .lencana.lunas { background: var(--bg); border-color: #cfd2cd; color: var(--ink); }
.lencana.batal, .lencana.belum, .lencana.terlambat {
  background: var(--red-tint); border-color: #f0cfcb; color: var(--red-dark);
}
.lencana.sebagian { background: var(--bg); border-color: #f0cfcb; color: var(--red-dark); }

/* ---------- alat halaman ---------- */

.alat {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.alat > .utama { margin-left: auto; }
.cari { display: flex; gap: 8px; align-items: center; }
.cari input { min-width: 260px; }

/* ---------- kontrol ---------- */

input, select, textarea {
  font: inherit;
  font-size: 14.5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input::placeholder { color: #9aa0a6; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 35, 26, 0.14);
}
input[readonly] { background: var(--tone); color: var(--muted); }

button, .tombol {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 10px 18px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
button:hover, .tombol:hover { background: var(--tone); border-color: #d8d8d2; color: var(--ink); }

button.utama, .tombol.utama {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
button.utama:hover, .tombol.utama:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: #fff;
}

button.bahaya, .tombol.bahaya {
  background: var(--red-tint);
  border-color: #f0cfcb;
  color: var(--red-dark);
}
button.bahaya:hover, .tombol.bahaya:hover { background: #fbe3e0; color: var(--red-dark); }

.tombol-kecil {
  font-size: 13px;
  font-weight: 600;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
}
.tombol-kecil:hover { background: var(--tone); color: var(--ink); }

.tombol-baris { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; align-items: center; }

/* ---------- formulir ---------- */

.formulir {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.formulir p { color: var(--muted); font-size: 14px; }
.formulir label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.formulir label input, .formulir label select, .formulir label textarea {
  margin-top: 6px;
  font-weight: 500;
  color: var(--ink);
}
.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tiga { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.sebaris { display: flex; align-items: center; gap: 8px; }
.sebaris input { width: auto; }

.baris-form td { padding: 6px 8px; }
.baris-form th { position: static; }
.baris-form input, .baris-form select { min-width: 90px; }

.tabel-kaki {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.total-sementara { margin: 0; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.total-sementara b {
  margin-left: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.kotak-pilih {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  background: var(--bg);
  margin-bottom: 12px;
}
.pilih {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  font-weight: 500 !important;
  color: var(--ink) !important;
}
.pilih input { width: auto; margin-right: 8px; }

/* ---------- pesan dan keadaan kosong ---------- */

.pesan {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
}
.pesan.salah { border-left-color: var(--red); background: var(--red-tint); color: var(--red-dark); }

.kosong {
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed #dcdcd6;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  font-size: 14.5px;
}

/* ---------- kepala dokumen ---------- */

.kepala-dok {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.kepala-dok h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  text-transform: none;
  letter-spacing: -0.02em;
}

/* ---------- layar masuk ---------- */

.layar-masuk { background: var(--tone); }
.layar-masuk main { padding: 0; max-width: none; }

.kartu-sempit {
  max-width: 380px;
  margin: 10vh auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kartu-sempit h1 { margin: 0; font-size: 22px; }
.kartu-sempit form { display: flex; flex-direction: column; gap: 16px; }
.kartu-sempit label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kartu-sempit label input { margin-top: 6px; }
.masuk-logo { height: 72px; width: auto; align-self: center; margin-bottom: 4px; }

/* ---------- kabar data baru dari pengguna lain ---------- */

.kabar-baru {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: #fff;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(16, 17, 20, 0.55);
  font-size: 14px;
  z-index: 60;
}
.kabar-baru[hidden] { display: none; }
.kabar-baru button {
  border: 0;
  min-height: 34px;
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

/* ---------- layar kecil ---------- */

@media (max-width: 860px) {
  header { min-height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  header nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  header .kanan { margin-left: auto; border-left: 0; padding-left: 0; }
  th { position: static; }
  main { padding: 20px 14px 56px; }
  h1 { font-size: 22px; }
  .dua, .tiga { grid-template-columns: 1fr; }
  .cari input { min-width: 0; }
  table { font-size: 13px; }
  th, td { padding: 9px 10px; }
  .kartu b { font-size: 22px; }
}
