* {
  box-sizing: border-box;
}

:root {
  --brand: #27b1be;
  --brand-deep: #1a8f9b;
  --brand-soft: #27b1be14;
  --bg: #0e2426;
  --surface: #142b2f;
  --surface2: #17343a;
  --line: #24454a;
  --text: #eaf6f7;
  --muted: #8fb3b6;
  --amber: #ffbe45;
  --rose: #ff6b6b;
  --shadow: 0 24px 60px #04141680;
  --shadow-soft: 0 8px 26px #04141640;
}

html,body{width:100%;max-width:100%;overflow-x:clip}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px Manrope,
    Arial,
    sans-serif;
  min-height: 100vh;
  position:relative;
}
/* single loader — use #bootScreen (inline in index.html); no .page-loader */

/* ambient */

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.35;
  max-width:none;
}

.ambient-one {
  width: 540px;
  height: 540px;
  background: #27b1be;
  top: -200px;
  right: -120px;
}

.ambient-two {
  width: 460px;
  height: 460px;
  background: #27b1be;
  bottom: -180px;
  left: 180px;
}

.topbar {
  height: 68px;
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  padding: 0 27px;
  background: #0e2426f0;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
  max-width:none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
}

.brand b {
  color: var(--brand);
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  font: 11px "DM Mono";
  color: #ffffff;
}

.shift-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  font: 10px "DM Mono";
  letter-spacing: 0.08em;
  color: #9fb3b6;
}

.shift-status i {
  height: 12px;
  width: 1px;
  background: #4a666a;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 5px var(--brand-soft);
}

.sidebar {
  position: fixed;
  z-index: 4;
  top: 68px;
  bottom: 0;
  width: 242px;
  padding: 12px 14px;
  background: #10282c;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar nav {
  display: grid;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
}

.sidebar,
.sidebar nav {
  scrollbar-width: thin;
  scrollbar-color: #3a5a5f transparent;
}

.nav-link {
  height: 30px;
  padding: 0 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 9px;
  text-decoration: none;
  color: #8fb3b6;
  font-weight: 600;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-link:first-letter {
  font-size: 18px;
}

.nav-link b {
  margin-left: auto;
  background: var(--brand-soft);
  color: var(--brand);
  font: 11px "DM Mono";
  padding: 3px 7px;
  border-radius: 12px;
}

.nav-section {
  margin: 10px 12px 2px;
  color: #7a969a;
  font: 10px "DM Mono";
  letter-spacing: 0.13em;
  flex-shrink: 0;
}

.officer-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 0;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font: 11px "DM Mono";
}

.officer-card strong,
.officer-card small {
  display: block;
}

.officer-card small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

main {
  position: relative;
  margin: 68px 0 0 242px;
  padding: 38px;
  max-width: 1600px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

#access.active-view {
  margin-top: -30px;
}
#access .page-heading {
  margin-top: 0;
  margin-bottom: 6px;
}

.eyebrow {
  font: 10px "DM Mono";
  letter-spacing: 0.13em;
  color: var(--brand);
  margin: 0 0 8px;
}

h1 {
  font-size: 28px;
  letter-spacing: -1px;
  margin: 0 0 7px;
  color: #f0fafa;
}

h2 {
  font-size: 17px;
  margin: 0;
  letter-spacing: -0.4px;
}

h3 {
  margin: 5px 0;
  font-size: 18px;
}

.muted {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.button {
  border: 0;
  border-radius: 9px;
  padding: 11px 16px;
  cursor: pointer;
  font: 700 12px Manrope;
  transition: 0.2s;
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #ffffff;
  box-shadow: 0 8px 25px var(--brand-soft);
}

.ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger {
  background: #3b1218;
  color: #ff8a8a;
  border: 1px solid #62242b;
}

.small {
  padding: 8px 10px;
}

.button-group {
  display: flex;
  gap: 9px;
}

.has-ico { display:inline-flex; align-items:center; gap:8px; }
.btn-ico { display:grid; place-items:center; flex-shrink:0; transition: transform .2s; }
.has-ico:hover .btn-ico { transform: translateY(-1px); }
#exportExcel .ico-arrow { transition: transform .2s; }
#exportExcel:hover .ico-arrow { animation: dlBounce .9s ease infinite; }
@keyframes dlBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(3px)} }
#printReport:hover .btn-ico { animation: printNudge .7s ease; }
@keyframes printNudge { 0%{transform:translateY(0)} 30%{transform:translateY(-2px)} 60%{transform:translateY(1px)} 100%{transform:translateY(0)} }


.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.stat-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.stat-card>span {
  float: right;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: var(--brand-soft);
  font-size: 17px;
  color: var(--brand);
}

.stat-card p {
  font: 10px "DM Mono";
  letter-spacing: 0.1em;
  color: #7a969a;
  margin: 20px 0 8px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
  color: var(--text);
}

.stat-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

.accent-teal {
  border-top: 2px solid var(--brand);
}

.accent-blue {
  border-top: 2px solid var(--brand);
}

.accent-amber {
  border-top: 2px solid var(--amber);
}

.accent-rose {
  border-top: 2px solid var(--rose);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.text-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
}

.vehicle-list,
.activity-list,
.log-list {
  display: grid;
}

.vehicle-row,
.activity-row,
.log-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.vehicle-row:first-child,
.activity-row:first-child,
.log-row:first-child {
  border-top: 0;
}

.plate {
  font: 500 12px "DM Mono";
  color: var(--text);
  background: var(--brand-soft);
  color: var(--brand-deep);
  padding: 5px 7px;
  border-radius: 5px;
  white-space: nowrap;
  border: 1px solid var(--line);
}

.vehicle-info {
  min-width: 0;
  flex: 1;
}

.vehicle-info strong,
.vehicle-info small {
  display: block;
}

.vehicle-info small,
.activity-row small,
.log-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.badge {
  font: 10px "DM Mono";
  padding: 4px 7px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-soft);
}

.badge.vendor {
  background: #4a350e1a;
  color: #ffd166;
  border-color: #4a350e33;
}

.badge.dinas {
  background: #1a446926;
  color: #87ceeb;
  border-color: #1a446933;
}

.badge.keluar {
  background: #3b12151a;
  color: #ff8a8a;
  border-color: #5a1c2033;
}

.empty {
  padding: 30px 10px;
  color: var(--muted);
  text-align: center;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 20px;
}

.form-panel {
  padding: 0;
  overflow: hidden;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px 0;
  gap: 6px;
}

.segment {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  font: 700 12px Manrope;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.segment.active {
  border-color: var(--brand);
  color: var(--brand);
}

.seg-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
  transition: transform .18s, background .18s, color .18s;
}

.segment.active .seg-icon {
  background: var(--brand);
  color: #fff;
}

.segment:hover .seg-icon { transform: translateY(-1px) scale(1.03); }

.segment.active .seg-in .seg-arrow { animation: arrowIn .9s ease infinite; }
.segment.active .seg-out .seg-arrow { animation: arrowOut .9s ease infinite; }

@keyframes arrowIn {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}
@keyframes arrowOut {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

form {
  padding: 16px;
}

#access form {
  padding: 14px 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

#access .form-grid {
  gap: 10px 14px;
}

.form-grid .field {
  display: block;
  color: #b3c2c3;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  padding-bottom: 14px;
}

.form-grid .field>input,
.form-grid .field>select,
.form-grid .field>textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.form-grid .field small {
  font-weight: 400;
  color: #6b8790;
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 10px;
  white-space: nowrap;
  line-height: 1;
}

.field {
  display: grid;
  gap: 6px;
  color: #b3c2c3;
  font-size: 12px;
  font-weight: 700;
}

.field span {
  color: var(--brand);
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  padding: 9px 10px;
  font: 13px Manrope;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field small {
  font-weight: 400;
  color: #6b8790;
}

.full {
  margin-top: 12px;
}

form>.field.full:first-child {
  margin-top: 0;
}

.privacy-note {
  display: flex;
  gap: 10px;
  margin: 14px 0;
  color: #a7d8d8;
  background: #1a446020;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11px;
  border: 1px solid #2e6a78;
}

.privacy-note p {
  margin: 0;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 2px;
}

.form-actions .small-text {
  margin: 0;
  margin-right: auto;
  align-self: center;
}

#access .privacy-note {
  margin: 12px 0;
}

#access .form-actions {
  padding-top: 12px;
}

.access-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.shortcut-panel li {
  margin: 16px 0;
  color: #a7c2c2;
  font-size: 12px;
}

.privacy-card {
  border-color: #2e6a78;
  background: #142b2f !important;
}

.privacy-card p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.hidden {
  display: none;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar .search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 11px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: #7a969a;
}

.toolbar .search input {
  border: 0;
  padding-left: 0;
}

.toolbar select,
.toolbar>input {
  width: auto;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  text-align: left;
  color: #7a969a;
  font: 10px "DM Mono";
  letter-spacing: 0.08em;
  padding: 0 10px 11px;
  white-space: nowrap;
}

td {
  padding: 13px 10px;
  border-top: 1px solid var(--line);
  color: #cfdfdf;
  white-space: nowrap;
}

.table-action {
  border: 1px solid var(--brand-soft);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 6px;
  font: 700 10px Manrope;
  padding: 7px 9px;
  cursor: pointer;
}

.table-action:hover {
  background: #2e9aa520;
}

.attend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.attend-card .user-role {
  white-space: nowrap;
}

.attend-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.att-late {
  display: inline-flex;
  align-items: center;
  background: #3b12151a;
  border: 1px solid #62242b;
  color: #ff8a8a;
  border-radius: 999px;
  font: 700 10px "DM Mono";
  padding: 3px 8px;
  letter-spacing: 0.06em;
}

.late-count {
  color: #ff8a8a;
}

.report-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.report-controls .field {
  flex: 1;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.report-kpis article {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
}

.report-kpis span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.report-kpis strong {
  display: block;
  font: 600 20px "DM Mono";
  margin-top: 7px;
  color: var(--text);
}

.print-header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  font-size: 12px;
}

.report-footer {
  color: var(--muted);
  font-size: 10px;
  margin: 16px 0 0;
}

.two-column {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: start;
}

.log-row {
  align-items: flex-start;
}

.log-time {
  font: 10px "DM Mono";
  color: var(--brand);
  min-width: 104px;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.data-grid p,
.compliance li {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.danger-panel {
  border-color: #62242b;
}

.compliance {
  margin-top: 20px;
}

.compliance li {
  margin: 7px 0;
}

.exit-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 12px;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font: 13px Manrope;
}

.exit-option:hover {
  background: var(--brand-soft);
}

.exit-option.selected {
  border-color: var(--brand);
  background: #1a44601a;
}

.toast {
  position: fixed;
  z-index: 10;
  bottom: 25px;
  right: 25px;
  background: #143b44;
  color: var(--text);
  border: 1px solid var(--brand);
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  transform: translateY(90px);
  opacity: 0;
  transition: 0.3s;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: none;
  opacity: 1;
}

dialog {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  width: min(440px, calc(100% - 30px));
  border-radius: 14px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: #02080d80;
  backdrop-filter: blur(3px);
}

dialog form {
  padding: 25px;
}

.dialog-icon {
  color: var(--brand);
  font-size: 26px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.mobile-only {
  display: none;
}

@media (max-width: 1000px) {

  .stats-grid,
  .report-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .access-layout,
  .two-column {
    grid-template-columns: 1fr;
  }

  .access-side {
    grid-template-columns: 1fr 1fr;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 210px;
  }

  main {
    margin-left: 210px;
    padding: 28px;
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 16px;
  }

  .shift-status {
    display: none;
  }

  .mobile-only {
    display: block;
    margin-left: auto;
  }

  .icon-button {
    border: 0;
    background: var(--surface2);
    color: var(--brand);
    border-radius: 7px;
    padding: 8px;
    border: 1px solid var(--brand-soft);
  }

  .sidebar {
    transform: translateX(-100%);
    transition: 0.2s;
    width: 245px;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: none;
  }

  main {
    margin: 68px 0 0;
    padding: 22px 15px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 24px;
  }

  .stats-grid,
  .report-kpis,
  .form-grid,
  .access-side {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    gap: 15px;
  }

  .panel {
    padding: 16px;
  }

  .form-panel {
    padding: 0;
  }

  .toolbar,
  .report-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar select,
  .toolbar>input {
    width: 100%;
  }

  .button-group {
    width: 100%;
  }

  .button-group .button {
    flex: 1;
  }

  .report-controls .button {
    width: 100%;
  }

  .table-wrap {
    margin: 0 -5px;
  }

  .privacy-note {
    margin: 16px 0;
  }

  .stat-card {
    padding: 15px;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-family: Arial;
  }

  .topbar,
  .sidebar,
  .view:not(#reports),
  .page-heading,
  .report-controls,
  .report-kpis,
  .button-group,
  .ambient {
    display: none !important;
  }

  main {
    margin: 0;
    padding: 0;
    max-width: none;
  }

  .view#reports {
    display: block;
  }

  .panel {
    border: 0;
    box-shadow: none;
    background: #fff;
    padding: 0;
  }

  .printable {
    display: block;
  }

  table {
    font-size: 9px;
  }

  td,
  th {
    color: #000;
    border-color: #bbb;
    padding: 6px;
  }

  .report-footer {
    color: #333;
  }

  @page {
    margin: 15mm;
  }
}

.custom-select-wrapper {
  position: relative;
}

#handoverMismatchField {
  position: relative;
}

.confirm-body {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.confirm-row span {
  color: var(--muted);
  white-space: nowrap;
}

.confirm-row b {
  text-align: right;
}

.custom-select-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  padding: 11px 12px;
  font: 13px Manrope;
  cursor: pointer;
}

#handoverMismatchField .custom-select-btn {
  background: var(--surface2);
}

.custom-select-btn:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.custom-select-dropdown {
  position: absolute;
  z-index: 7;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
}

.csd-search {
  padding: 8px;
}

.csd-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  padding: 8px 10px;
  font: 13px Manrope;
  outline: none;
}

.csd-search input:focus {
  border-color: var(--brand);
}

.csd-list {
  max-height: 200px;
  overflow: auto;
}

#exitOptions {
  display: grid;
  gap: 8px;
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.csd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  font: 13px Manrope;
}

.csd-item:last-child {
  border-bottom: 0;
}

.csd-item:hover,
.csd-item.selected {
  background: var(--brand-soft);
  color: var(--brand);
}

.csd-check {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.csd-item.selected .csd-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.csd-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 80% 10%, #27b1be80, transparent 35%),
    #0a1e20;
  overflow: auto;
}

.auth-overlay.hidden {
  display: none;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 80px #000a;
  position: relative;
  overflow: hidden;
}
.login-watermark {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 420px;
  height: 420px;
  object-fit: contain;
  opacity: 0.11;
  pointer-events: none;
  user-select: none;
}

.login-card .brand {
  justify-content: center;
  text-align: center;
  margin-bottom: 30px;
  font-size: 22px;
  letter-spacing: 2px;
  cursor: default;
  pointer-events: none;
}

.login-card h1 {
  font-size: 27px;
}

.login-card form {
  padding: 20px 0 0;
}

.login-card .button {
  width: 100%;
  margin-top: 20px;
}

.login-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 18px;
}

.login-error {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  background: #3b12151a;
  color: #ff8a8a;
  border: 1px solid #62242b;
  border-radius: 8px;
  font-size: 12px;
}

.login-error.show {
  display: block;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 14px;
  font-size: 11px;
  color: #9fb3b6;
}

.role-chip {
  color: var(--brand);
  font: 10px "DM Mono";
  border: 1px solid var(--brand-soft);
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 4px 7px;
}

.logout {
  padding: 8px 11px;
}

.user-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 20px;
}

.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.user-role {
  color: var(--brand);
  font: 11px "DM Mono";
}

@media (max-width: 700px) {
  .auth-user {
    display: none;
  }

  .user-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 26px 22px;
  }
}

#handover .two-column.wide {
  grid-template-columns: 1fr;
}

td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
  line-height: 1.45;
}

#activeTable {
  border-collapse: separate;
  border-spacing: 0;
}

#activeTable td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
}

#activeTable tbody tr:last-child td {
  border-bottom: 0;
}

#activeTable td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.vehicle-row,
.activity-row {
  padding: 16px 0;
}

.vehicle-row {
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.vehicle-row:first-child,
.activity-row:first-child {
  border-top: 0;
  margin-top: 0;
}

.activity-row {
  border-top: 1px solid var(--line);
}

input.invalid {
  border-color: var(--rose) !important;
  box-shadow: 0 0 0 3px #ff8a8a2a !important;
  color: #ff8a8a !important;
}
/* autofill cache — jangan jadi putih (Chrome/Safari autofill) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active,
input:-internal-autofill-selected,
textarea:-internal-autofill-selected,
select:-internal-autofill-selected {
  -webkit-box-shadow: 0 0 0 5000px var(--surface2) inset !important;
  box-shadow: 0 0 0 5000px var(--surface2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text) !important;
  background-color: var(--surface2) !important;
  background-clip: content-box !important;
  transition: background-color 9999s ease-in-out 0s !important;
}
.field input:-webkit-autofill,
.toolbar input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 5000px var(--surface2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
}
.paginate{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:16px}
.pg{min-width:36px;height:34px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface2);color:var(--text);font:700 13px Manrope;cursor:pointer}
.pg.active{background:var(--brand);border-color:var(--brand-deep);color:#fff}
.pg:disabled{opacity:.4;cursor:not-allowed}
/* FIT — hard lock no x-scroll, tables wrap not scroll */
html{overflow-x:clip}
body{overflow-x:clip}
main,.view,.panel,.table-wrap{max-width:100%;overflow-x:hidden}
*{min-width:0}
img{max-width:100%}
.table-wrap{overflow:visible;max-width:100%}
table{width:100%;table-layout:fixed;border-collapse:collapse;display:table;white-space:normal}
th,td{word-break:break-word;overflow-wrap:anywhere;white-space:normal;vertical-align:top;font-size:12px}
.access-layout,.dashboard-grid,.user-grid,.two-column{max-width:100%}
.toolbar,.filters,.button-group,.report-controls{flex-wrap:wrap;max-width:100%;gap:8px}
.toolbar input,.toolbar select,.report-controls input,.report-controls select{max-width:100%;min-width:0;flex:1 1 120px}
@media (max-width: 980px){
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .dashboard-grid{grid-template-columns:1fr}
  .access-layout{grid-template-columns:1fr}
  .user-grid{grid-template-columns:1fr}
  main{padding:24px 16px}
}
@media (max-width: 780px){
  .topbar{padding:0 14px}
  #mobileMenuButton{display:inline-grid !important}
  .sidebar{transform:translateX(-100%);transition:transform .25s;z-index:20}
  .sidebar.open{transform:translateX(0)}
  main{margin-left:0;padding:20px 14px}
  .form-grid{grid-template-columns:1fr}
  .page-heading{flex-direction:column;align-items:flex-start}
  h1{font-size:24px}
  .ambient-one,.ambient-two{width:320px;height:320px;filter:blur(80px)}
  th,td{font-size:11px;padding:7px 5px}
}
@media (max-width: 480px){
  .stats-grid{grid-template-columns:1fr}
  .segmented{gap:4px}
  .segment{padding:6px 8px;font-size:11px}
  .button{padding:10px 12px}
}