:root {
  --navy: #24323d;
  --navy-soft: #334958;
  --accent: #466a85;
  --accent-strong: #385a73;
  --bg: #e8edf2;
  --card: #f7f9fb;
  --ink: #24303a;
  --muted: #5d6b76;
  --line: #d2dbe3;
  --ok: #4f7d5f;
  --warn: #94652f;
  --danger: #a34b4f;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(36, 48, 58, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ---------- Login ---------- */

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(70, 106, 133, 0.28), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(36, 50, 61, 0.50), transparent 60%),
    var(--navy);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 24px;
  padding: 32px 26px 28px;
  box-shadow: 0 24px 60px rgba(24, 34, 44, 0.22);
}

.login-logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--navy);
  color: #fff;
  margin-bottom: 20px;
}

.company-eyebrow {
  margin: 0 0 8px;
  color: var(--navy-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.login-card p.subtitle {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.login-card .field {
  margin-bottom: 18px;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 12px rgba(36, 48, 58, 0.20);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 15px;
  min-width: 0;
}

.brand svg {
  flex: none;
}

.brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
}

.brand-copy .company-name {
  color: rgba(255, 255, 255, 0.68);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy .app-name {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chip {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.reset-btn {
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.logout-btn svg {
  flex: none;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 18px 16px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wrap.wide {
  max-width: 1180px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(210, 219, 227, 0.85);
  padding: 20px;
}

.card h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* ---------- Form ---------- */

.form-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.save-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.save-hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label,
.field .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.label-guide {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.driver-shell .label-guide {
  font-size: 11.5px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #f2f5f8;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder {
  color: #6d7a85;
}

input:focus,
select:focus {
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(70, 106, 133, 0.14);
}

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.vehicle-input {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.vehicle-input .vehicle-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #e9eef3;
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.vehicle-input input {
  flex: 1;
  min-width: 0;
  border-radius: 0 12px 12px 0;
}

.vehicle-input:focus-within .vehicle-prefix {
  border-color: var(--accent);
  background: #e2e9f0;
}

.vehicle-prefix-group {
  display: flex;
  align-items: stretch;
  gap: 3px;
  padding: 3px;
  border: 1.5px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #eef3f8;
}

.vehicle-prefix-group button {
  min-width: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.vehicle-prefix-group button.active {
  background: var(--navy);
  color: #fff;
}

.vehicle-input:focus-within .vehicle-prefix-group {
  border-color: var(--accent);
}

.driver-shell .vehicle-prefix-group button {
  padding: 0 12px;
  font-size: 16px;
}

.vehicle-input .vehicle-prefix-select {
  flex: none;
  width: auto;
  min-width: 72px;
  padding: 0 10px;
  border-radius: 12px 0 0 12px;
  border-right: 0;
  background: #eef3f8;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.vehicle-input .vehicle-prefix-select:focus {
  border-color: var(--accent);
  background: #fff;
}

.segment {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: #e7ecf1;
  border: 1px solid var(--line);
}

.segment.three {
  grid-template-columns: repeat(3, 1fr);
}

.segment.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segment button {
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--navy-soft);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segment button:hover {
  background: rgba(255, 255, 255, 0.55);
}

.segment button.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(36, 48, 58, 0.22);
}

.container-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.container-box input {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
  font-size: 17px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.container-note {
  font-size: 12px;
  min-height: 16px;
  color: var(--muted);
}

.container-note.ok {
  color: var(--ok);
}

.container-note.warn {
  color: var(--warn);
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: #e5eaf0;
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(70, 106, 133, 0.28);
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.big {
  height: 54px;
  font-size: 16px;
  border-radius: 14px;
  width: 100%;
}

.btn.ghost {
  background: var(--card);
  border-color: var(--line);
  color: var(--navy);
}

.btn.ghost:hover {
  background: #eef2f6;
}

.btn.small {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn.danger {
  background: #f3e3e3;
  color: var(--danger);
}

.btn.danger-solid {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 8px 18px rgba(166, 75, 75, 0.22);
}

.btn.danger-solid:hover {
  background: #8a3c3c;
}

.form-error {
  min-height: 18px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

dialog.modal {
  border: 0;
  border-radius: 18px;
  padding: 24px;
  width: min(430px, calc(100vw - 32px));
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(36, 48, 58, 0.28);
}

dialog.modal::backdrop {
  background: rgba(36, 48, 58, 0.45);
}

dialog.modal h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

dialog.modal p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

dialog.modal .field {
  margin-bottom: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.audit-diff {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.audit-diff:empty {
  display: none;
}

.audit-block h4 {
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audit-block pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2f5f8;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

#auditDialog {
  width: min(560px, calc(100vw - 32px));
}

dialog.modal {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

dialog.modal form .field {
  margin-bottom: 14px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

/* ---------- History ---------- */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #f8f9fb;
}

.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.history-ship {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.history-driver {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.history-actions .link-btn {
  font-size: 12px;
  padding: 2px 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 8px;
  background: #e7ecf1;
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 600;
}

.tag.bongkar {
  background: #f3ead8;
  color: #7a5a2e;
}

.tag.muat {
  background: #e0e9ef;
  color: #3d5f7a;
}

.tag.relokasi {
  background: #e8e7f5;
  color: #4f4f7a;
}

.tag.behandle {
  background: #e3edf0;
  color: #3f6770;
}

.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.code {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 8px;
  background: #e9eff5;
  border: 1px solid #c9d6e1;
  color: #42647e;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 22px 10px;
}

/* ---------- Rit Saya ---------- */

.rit-driver {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.rit-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.rit-stat {
  background: #f2f5f8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.rit-stat span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rit-stat strong {
  font-size: 22px;
  line-height: 1.25;
  color: var(--navy);
}

.rit-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.rit-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rit-filter label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rit-filter input,
.rit-filter select {
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
}

.rit-reset {
  height: 40px;
}

.rit-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.rit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 320px;
}

.rit-table thead th {
  background: #eef2f6;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.rit-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #e9eef3;
}

.rit-table tbody tr:last-child td {
  border-bottom: 0;
}

.rit-table th:nth-child(3),
.rit-table th:nth-child(4),
.rit-table td:nth-child(3),
.rit-table td:nth-child(4) {
  text-align: center;
}

.rit-table td.empty {
  text-align: center;
  padding: 18px;
  color: var(--muted);
}

.rit-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
}

.rit-detail-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rit-detail-table {
  min-width: 640px;
}

.rit-detail-table .code-list {
  margin-top: 0;
}

.rit-detail-table th:nth-child(2),
.rit-detail-table td:nth-child(2),
.rit-detail-table th:nth-child(4),
.rit-detail-table td:nth-child(4),
.rit-detail-table th:nth-child(5),
.rit-detail-table td:nth-child(5),
.rit-detail-table th:nth-child(7),
.rit-detail-table td:nth-child(7),
.rit-detail-table th:nth-child(8),
.rit-detail-table td:nth-child(8) {
  text-align: center;
}

.rit-detail-table th:nth-child(3),
.rit-detail-table td:nth-child(3) {
  text-align: left;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.detail-actions .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.detail-actions .action-btn:active {
  transform: translateY(1px);
}

.detail-actions .detail-edit {
  border: 1px solid #b9d4e5;
  background: #eef4f8;
  color: #365f7d;
}

.detail-actions .detail-edit:hover {
  background: #e2eef6;
}

.detail-actions .detail-delete {
  border: 1px solid #e3c2c2;
  background: #f8eded;
  color: var(--danger);
}

.detail-actions .detail-delete:hover {
  background: #f2e2e2;
}

.detail-actions .action-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.detail-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.trash-actions {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.detail-page-info {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid #e6d6b8;
  background: #f3ead8;
  color: #7a5a2e;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.offline-banner.offline {
  border-bottom-color: #e3c2c2;
  background: #f8eded;
  color: #a34b4f;
}

.offline-banner .btn {
  height: 34px;
  font-size: 12px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 60;
  max-width: min(92vw, 460px);
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 14px 34px rgba(36, 48, 58, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.ok {
  background: var(--ok);
}

.toast.error {
  background: var(--danger);
}

/* ---------- Admin ---------- */

.admin-shell {
  background: var(--bg);
  min-height: 100vh;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.filters .field {
  gap: 6px;
}

.filters input,
.filters select {
  height: 42px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filters .filter-submit {
  align-self: end;
  min-width: 0;
}

.filters .filter-submit .filter-actions {
  width: 100%;
}

.filters .filter-submit .btn {
  flex: 1;
  height: 42px;
  padding: 0 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.stat {
  border-radius: 14px;
  padding: 14px 16px;
  background: #f2f5f8;
  border: 1px solid var(--line);
}

.stat .stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.stat .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.stat.accent .stat-value {
  color: var(--accent);
}

.tabs {
  display: flex;
  gap: 6px;
  background: #e6ebf1;
  padding: 5px;
  border-radius: 12px;
  width: fit-content;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  color: var(--navy-soft);
  cursor: pointer;
}

.tabs button.active {
  background: var(--card);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(36, 48, 58, 0.10);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 62vh;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1000px;
}

table.data thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f6;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #e9eef3;
  vertical-align: top;
}

table.data tbody tr:hover {
  background: #f3f6f9;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data.compact {
  min-width: 620px;
}

table.data .mono {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.table-foot .count {
  font-size: 13px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-edit,
.row-delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.row-edit svg,
.row-delete svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.row-edit {
  border: 1px solid #c3d4e1;
  background: #e9eff5;
  color: #42647e;
}

.row-edit:hover {
  background: #dfe8f1;
}

.row-delete {
  border: 1px solid #e4caca;
  background: #f8eded;
  color: var(--danger);
}

.row-delete:hover {
  background: #f3e3e3;
}

#adminEditContainerInputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Tablet / layar lebar ---------- */

@media (min-width: 700px) {
  .login-card {
    max-width: 460px;
    padding: 42px 38px 38px;
  }

  .login-card h1 {
    font-size: 28px;
  }

  .login-card p.subtitle {
    font-size: 15px;
  }

  .topbar {
    padding: 15px 28px;
    padding-top: calc(15px + env(safe-area-inset-top));
  }

  .brand {
    font-size: 17px;
  }

  .brand-copy .company-name {
    font-size: 10.5px;
  }

  .brand-copy .app-name {
    font-size: 17px;
  }

  .wrap:not(.wide) {
    max-width: 740px;
    padding: 26px 28px calc(52px + env(safe-area-inset-bottom));
    gap: 20px;
  }

  .wrap:not(.wide) .card {
    padding: 26px;
  }

  .wrap:not(.wide) .card h2 {
    font-size: 18px;
  }

  .form-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 18px;
  }

  .form-card .field-full,
  .form-card > .btn,
  .form-card > .save-block {
    grid-column: 1 / -1;
  }

  .field label,
  .field .label {
    font-size: 14px;
  }

  .form-card input[type="text"] {
    height: 54px;
    font-size: 17px;
  }

  .segment button {
    height: 52px;
    font-size: 16px;
  }

  #containerInputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  #containerInputs .container-box:only-child {
    grid-column: 1 / -1;
  }

  .container-box input {
    height: 58px;
    font-size: 21px;
  }

  .btn.big {
    height: 62px;
    font-size: 18px;
    border-radius: 16px;
  }

  .history-item {
    padding: 15px 16px;
  }

  .history-ship {
    font-size: 15px;
  }

  .history-time {
    font-size: 13px;
  }

  .history-driver {
    font-size: 13px;
  }

  .rit-driver {
    font-size: 13px;
  }

  .rit-stat strong {
    font-size: 26px;
  }

  .rit-table {
    font-size: 14px;
  }

  .code {
    font-size: 14px;
    padding: 5px 10px;
  }

  .tag {
    height: 26px;
    font-size: 13px;
  }
}

@media (min-width: 1024px) {
  .wrap:not(.wide) {
    max-width: 1080px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    grid-template-areas:
      "form rit"
      "detail detail";
    align-items: start;
    gap: 22px;
  }

  .wrap:not(.wide) > * {
    min-width: 0;
  }

  .wrap:not(.wide) .form-card {
    grid-area: form;
  }

  .wrap:not(.wide) .rit-card {
    grid-area: rit;
  }

  .wrap:not(.wide) .detail-card {
    grid-area: detail;
  }
}

/* ---------- Spacing & alignment polish ---------- */

.card {
  padding: 22px;
}

.section-head {
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-head h2 {
  line-height: 1.25;
}

.section-head > .filter-actions {
  margin-left: auto;
}

.form-card {
  gap: 20px;
}

.field {
  gap: 7px;
}

.field label,
.field .label {
  line-height: 1.3;
}

.login-card .field {
  margin-bottom: 20px;
}

.login-card .hint {
  margin-top: -2px;
}

.modal-actions {
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn {
  min-width: 104px;
}

dialog.modal {
  width: min(460px, calc(100vw - 32px));
  padding: 26px;
}

dialog.modal h3 {
  margin-bottom: 10px;
}

dialog.modal p {
  margin-bottom: 18px;
  line-height: 1.5;
}

dialog.modal form .field {
  margin-bottom: 16px;
}

.form-error {
  margin-bottom: 6px;
}

.history-list {
  gap: 12px;
}

.history-item {
  padding: 14px 16px;
}

.history-top {
  gap: 8px;
  margin-bottom: 8px;
}

.history-meta {
  gap: 6px 8px;
}

.code-list {
  gap: 6px;
  margin-top: 10px;
}

.history-actions {
  margin-top: 10px;
}

.rit-summary {
  gap: 10px;
  margin-bottom: 16px;
}

.rit-stat {
  padding: 12px 14px;
}

.rit-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.rit-filter label {
  line-height: 1.25;
}

.rit-filter input,
.rit-filter select,
.rit-filters .btn.rit-reset {
  height: 42px;
}

.rit-table thead th {
  padding: 10px 12px;
}

.rit-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
}

.rit-detail-table {
  font-size: 12.5px;
  table-layout: fixed;
}

.rit-detail-table th:nth-child(1) { width: 13%; }
.rit-detail-table th:nth-child(2) { width: 8%; }
.rit-detail-table th:nth-child(3) { width: 16%; }
.rit-detail-table th:nth-child(4) { width: 12%; }
.rit-detail-table th:nth-child(5) { width: 8%; }
.rit-detail-table th:nth-child(6) { width: 16%; }
.rit-detail-table th:nth-child(7) { width: 9%; }
.rit-detail-table th:nth-child(8) { width: 18%; }

.rit-detail-table thead th {
  padding: 9px 8px;
}

.rit-detail-table tbody td {
  padding: 9px 8px;
}

.rit-detail-table .tag {
  height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

.rit-detail-table .code {
  font-size: 11px;
  padding: 3px 7px;
}

.rit-detail-table td:nth-child(1),
.rit-detail-table td:nth-child(2),
.rit-detail-table td:nth-child(5),
.rit-detail-table td:nth-child(7) {
  white-space: nowrap;
}

.detail-card .rit-detail-head {
  margin: 0 0 14px;
}

.detail-card .rit-detail-head h3 {
  font-size: 16px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: -0.01em;
}

.filters {
  gap: 14px 12px;
}

.filters .field {
  min-width: 0;
}

.stats {
  gap: 14px;
}

.stat {
  padding: 16px 18px;
}

.tabs {
  flex-wrap: wrap;
  max-width: 100%;
}

.tabs button {
  padding: 9px 14px;
}

.table-wrap {
  max-height: 64vh;
}

table.data {
  min-width: 1080px;
}

table.data thead th {
  padding: 12px 14px;
}

table.data tbody td {
  padding: 11px 14px;
  vertical-align: middle;
}

table.data .code-list {
  margin-top: 0;
}

table.data .code {
  white-space: nowrap;
}

table.data:not(.compact) th:nth-child(1),
table.data:not(.compact) td:nth-child(1),
table.data:not(.compact) th:nth-child(2),
table.data:not(.compact) td:nth-child(2),
table.data:not(.compact) th:nth-child(3),
table.data:not(.compact) td:nth-child(3),
table.data:not(.compact) th:nth-child(6),
table.data:not(.compact) td:nth-child(6),
table.data:not(.compact) th:nth-child(7),
table.data:not(.compact) td:nth-child(7),
table.data:not(.compact) th:nth-child(10),
table.data:not(.compact) td:nth-child(10),
table.data:not(.compact) th:nth-child(11),
table.data:not(.compact) td:nth-child(11) {
  text-align: center;
}

.row-actions {
  justify-content: center;
}

table.data.compact {
  min-width: 640px;
}

table.data.compact th:nth-child(2),
table.data.compact td:nth-child(2),
table.data.compact th:nth-child(3),
table.data.compact td:nth-child(3) {
  text-align: center;
}

.table-foot {
  margin-top: 14px;
}

@media (min-width: 700px) {
  .wrap:not(.wide) .card {
    padding: 24px;
  }

  .form-card {
    gap: 20px 18px;
  }
}

@media (min-width: 1024px) {
  .wrap:not(.wide) {
    gap: 24px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 560px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .login-card {
    padding: 26px 20px 24px;
  }

  .brand span,
  .brand-copy {
    display: none;
  }

  .history-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .rit-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rit-filter:nth-child(3),
  .rit-reset {
    grid-column: auto;
  }

  dialog.modal {
    padding: 22px 18px;
  }
}

/* ---------- Driver readability ---------- */

.driver-shell .brand {
  font-size: 16px;
}

.driver-shell .field label,
.driver-shell .field .label {
  font-size: 15px;
  line-height: 1.35;
}

.driver-shell .hint,
.driver-shell .container-note {
  font-size: 13px;
}

.driver-shell input[type="text"],
.driver-shell input[type="password"],
.driver-shell input[type="date"],
.driver-shell input[type="time"],
.driver-shell input[type="search"],
.driver-shell select {
  height: 56px;
  padding: 0 15px;
  font-size: 18px;
}

.driver-shell .vehicle-input .vehicle-prefix {
  min-width: 58px;
  padding: 0 14px;
  font-size: 17px;
}

.driver-shell .segment button {
  height: 52px;
  font-size: 16px;
}

.driver-shell #ship {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.driver-shell .container-box input {
  height: 60px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.driver-shell #ship::placeholder,
.driver-shell .container-box input::placeholder {
  font-weight: 500;
}

.driver-shell .btn {
  min-height: 48px;
  font-size: 15px;
}

.driver-shell .btn.small {
  min-height: 44px;
  font-size: 14px;
}

.driver-shell .btn.big {
  height: 60px;
  font-size: 18px;
}

.driver-shell .save-hint {
  font-size: 13px;
}

.driver-shell .reset-btn,
.driver-shell .icon-btn,
.driver-shell .logout-btn {
  height: 44px;
}

.driver-shell .logout-btn {
  padding: 0 14px;
  font-size: 13px;
}

.driver-shell .icon-btn {
  width: 44px;
}

.driver-shell .chip {
  padding: 8px 12px;
  font-size: 13px;
}

.driver-shell .card h2 {
  font-size: 18px;
}

.driver-shell .section-head {
  margin-bottom: 16px;
}

.driver-shell .login-card p.subtitle {
  font-size: 15px;
}

.driver-shell .toast {
  font-size: 15px;
}

.driver-shell .empty {
  font-size: 14px;
}

.driver-shell .rit-stat span {
  font-size: 11.5px;
}

.driver-shell .rit-stat strong {
  font-size: 26px;
}

.driver-shell .rit-filter label {
  font-size: 12.5px;
}

.driver-shell .rit-filter input,
.driver-shell .rit-filter select {
  height: 48px;
  font-size: 17px;
}

.driver-shell .rit-filters .btn.rit-reset {
  height: 48px;
  font-size: 14px;
}

.driver-shell .rit-table {
  font-size: 14px;
}

.driver-shell .rit-table thead th {
  padding: 10px 8px;
  font-size: 11.5px;
}

.driver-shell .rit-table tbody td {
  padding: 10px 8px;
}

.driver-shell .rit-detail-table {
  min-width: 720px;
  font-size: 14px;
}

.driver-shell .rit-detail-table th {
  font-size: 11px;
}

.driver-shell .rit-detail-table .tag {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.driver-shell .rit-detail-table .code {
  padding: 4px 8px;
  font-size: 12px;
}

.driver-shell .detail-actions .action-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.driver-shell .history-ship {
  font-size: 16px;
}

.driver-shell .history-time {
  font-size: 12.5px;
}

.driver-shell .history-driver {
  font-size: 13px;
}

.driver-shell .tag {
  height: 26px;
  font-size: 13px;
}

.driver-shell .code {
  padding: 4px 9px;
  font-size: 13px;
}

.driver-shell .history-item {
  padding: 14px 16px;
}

.driver-shell .history-actions .link-btn {
  font-size: 13px;
}

.driver-shell dialog.modal {
  padding: 26px 22px;
}

.driver-shell dialog.modal h3 {
  font-size: 22px;
}

.driver-shell dialog.modal p {
  font-size: 15px;
}

@media (max-width: 560px) {
  .driver-shell dialog.modal {
    padding: 22px 18px;
  }
}

.driver-shell .detail-page-info {
  font-size: 14px;
}

.driver-shell .detail-pagination .btn {
  min-width: 110px;
}

@media (max-width: 560px) {
  .detail-pagination {
    flex-wrap: wrap;
  }

  .detail-page-info {
    order: -1;
    flex-basis: 100%;
  }

  .driver-shell .detail-pagination .btn {
    flex: 1;
    min-width: 0;
  }
}

/* ---------- Brand hierarchy ---------- */

.login-card .company-eyebrow {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-transform: none;
}

.login-card h1 {
  margin: 0 0 14px;
  color: var(--navy-soft);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-copy .company-name {
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-copy .app-name {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (min-width: 700px) {
  .login-card .company-eyebrow {
    font-size: 21px;
  }

  .login-card h1 {
    font-size: 17px;
  }

  .brand-copy .company-name {
    font-size: 14px;
  }

  .brand-copy .app-name {
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .login-card .company-eyebrow {
    font-size: 16px;
  }

  .login-card h1 {
    font-size: 14px;
  }
}
