.user-initials {
  display: inline-flex;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #5d87ff;
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
}

.account-menu-trigger {
  display: inline-flex;
  border-radius: 50%;
}

.account-menu-trigger:focus-visible {
  outline: 3px solid rgba(93, 135, 255, .3);
  outline-offset: 3px;
}

.app-header .navbar-nav .nav-item.account-menu {
  position: relative;
}

.app-header .account-dropdown {
  right: 0;
  left: auto;
  width: min(278px, calc(100vw - 32px));
  min-width: 0;
  margin-top: 12px !important;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(42, 53, 71, .14);
}

.account-summary,
.account-logout {
  display: flex;
  align-items: center;
  color: #3f5573;
}

.account-summary {
  gap: 16px;
  padding: 18px 24px;
  white-space: normal;
}

.account-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 600;
}

.account-logout {
  width: 100%;
  gap: 14px;
  padding: 18px 24px;
  font-size: 1rem;
}

.account-logout .ti {
  font-size: 1.4rem;
}

.account-summary:hover,
.account-summary:focus,
.account-logout:hover,
.account-logout:focus {
  color: #3f5573;
  background: #eef3ff;
}

:root {
  --ink: #1d2935;
  --muted: #66737f;
  --line: #dfe5e8;
  --surface: #ffffff;
  --page: #eef3ff;
  --green: #18794e;
  --green-soft: #e7f4ed;
  --blue-soft: #e9f1fb;
  --amber-soft: #fff2d7;
  --primary: #5d87ff;
  --primary-dark: #4775f5;
  --primary-soft: #eef3ff;
}

body {
  color: var(--ink);
  background: var(--page);
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: 0;
}

.public-body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--primary-soft);
}

.home-page {
  min-height: 100vh;
  min-height: 100svh;
  background: #071122;
}

.public-nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  padding: 24px 32px;
}

.home-nav-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.public-brand:hover {
  color: #fff;
}

.public-brand-mark {
  width: 50px;
  height: 54px;
  display: grid;
  place-items: center;
}

.public-brand-mark img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.public-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.public-brand-copy strong {
  font-size: 18px;
  font-weight: 700;
}

.public-brand-copy small {
  margin-top: 4px;
  color: rgba(255, 255, 255, .74);
  font-size: 12px;
  font-weight: 500;
}

.home-admin-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  color: #fff;
  background: rgba(8, 17, 35, .18);
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color .2s ease, border-color .2s ease;
}

.home-admin-link:hover,
.home-admin-link:focus-visible {
  color: #fff;
  background: #5d87ff;
  border-color: #5d87ff;
}

.home-admin-link i {
  font-size: 19px;
}

.home-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 126px 32px 72px;
  overflow: hidden;
  isolation: isolate;
}

.home-hero-image,
.home-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-hero-image {
  z-index: -2;
  object-fit: cover;
  object-position: center center;
}

.home-overlay {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(4, 10, 24, .78) 0%, rgba(4, 10, 24, .62) 34%, rgba(4, 10, 24, .24) 64%, rgba(4, 10, 24, .1) 100%),
    linear-gradient(180deg, rgba(4, 10, 24, .34) 0%, rgba(4, 10, 24, .08) 46%, rgba(4, 10, 24, .36) 100%);
}

.home-copy {
  width: min(1180px, 100%);
  color: #fff;
  text-align: left;
}

.home-copy h1 {
  max-width: 680px;
  margin: 0 0 22px;
  color: #fff;
  font-size: 64px;
  line-height: 1.02;
  font-weight: 800;
  text-shadow: 0 3px 18px rgba(2, 8, 20, .72), 0 1px 3px rgba(2, 8, 20, .8);
}

.home-intro {
  max-width: 620px;
  margin: 0 0 34px;
  color: #fff;
  font-size: 18px;
  line-height: 1.7;
  text-shadow: 0 2px 10px rgba(2, 8, 20, .78);
}

.home-primary-action {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  color: #fff;
  background: #5d87ff;
  border: 2px solid #5d87ff;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(35, 72, 174, .32);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.home-primary-action:hover,
.home-primary-action:focus-visible {
  color: #fff;
  background: #4775f5;
  border-color: #4775f5;
  transform: translateY(-2px);
}

.home-primary-action i {
  font-size: 21px;
}

.kiosk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: #fff;
  border-bottom: 1px solid #dce5ff;
}

.kiosk-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 18px;
}

.kiosk-header-link {
  padding: 6px 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.kiosk-header-link:hover,
.kiosk-header-link:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.kiosk-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}


.kiosk-form .camera-panel,
.kiosk-form .details-panel {
  border-color: #dce5ff;
}

.kiosk-heading,
.page-heading,
.band-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kiosk-heading {
  margin-bottom: 28px;
}

.kiosk-heading h1,
.page-heading h1 {
  margin: 0;
  font-size: 30px;
}

.kiosk-date {
  color: var(--muted);
}

.kiosk-eyebrow {
  color: var(--primary);
}

.kiosk-header .btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.kiosk-header .btn-outline-primary:hover,
.kiosk-header .btn-outline-primary:focus-visible,
.kiosk-main .btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.kiosk-main .btn-primary:hover,
.kiosk-main .btn-primary:focus-visible {
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.kiosk-main .form-control:focus,
.kiosk-main .form-select:focus {
  border-color: #8fabff;
  box-shadow: 0 0 0 .2rem rgba(93, 135, 255, .2);
}

.kiosk-main .badge.bg-primary {
  background-color: var(--primary) !important;
}

.kiosk-form {
  display: grid;
  grid-template-columns: minmax(340px, .85fr) minmax(420px, 1.15fr);
  gap: 28px;
  align-items: start;
}

.camera-panel,
.details-panel,
.dashboard-band,
.form-surface,
.detail-layout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h2,
.band-heading h2 {
  margin: 0;
  font-size: 18px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}

.camera-stage {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  aspect-ratio: 4 / 3;
  margin-bottom: 16px;
  overflow: hidden;
  background: #17213b;
  border-radius: 6px;
}

.camera-live,
.camera-result {
  grid-area: 1 / 1;
}

.camera-live {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  overflow: hidden;
}

.camera-live video,
.camera-live canvas {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  transform: none !important;
  display: block;
}

.camera-result {
  width: 100%;
  height: 100%;
}

.camera-result {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  color: #c7d0cb;
  background: rgba(14, 28, 55, .48);
}

.camera-result img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-actions {
  display: flex;
  gap: 10px;
}

.auth-body {
  min-height: 100vh;
  background: var(--primary-soft);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
  padding: 34px;
  background: #fff;
  border: 0;
  border-top: 4px solid var(--primary-dark);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(31, 53, 111, .22);
}

.auth-brand {
  max-width: 100%;
}

.auth-brand img {
  flex: 0 0 auto;
}

.auth-brand span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.auth-title {
  color: var(--primary);
  font-size: 28px;
  font-weight: 700;
}

.auth-subtitle {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.admin-content {
  padding-top: 98px;
  padding-bottom: 48px;
}

.page-heading {
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.stat-card > i {
  width: 48px;
  height: 48px;
  display: grid;
  flex: 0 0 48px;
  place-items: center;
  color: var(--primary);
  background: rgba(255, 255, 255, .72);
  border-radius: 8px;
  font-size: 28px;
}

.stat-card span,
.stat-card strong {
  display: block;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  margin-top: 2px;
  font-size: 28px;
}

.stat-primary {
  background: #e7efff;
  border-color: #c5d6ff;
}

.stat-primary > i { color: #4b75e6; }

.stat-primary-soft {
  background: #e6f7ef;
  border-color: #bfe8d4;
}

.stat-primary-soft > i { color: #18794e; }

.stat-primary-neutral {
  background: #fff3dc;
  border-color: #f2d7a0;
}

.stat-primary-neutral > i { color: #a56513; }

.dashboard-band {
  margin-bottom: 20px;
}

.band-heading {
  margin-bottom: 20px;
}

.trend-chart {
  height: 190px;
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 14px;
  align-items: end;
  padding-top: 12px;
}

.trend-item {
  height: 100%;
  display: grid;
  grid-template-rows: 24px 1fr 24px;
  gap: 5px;
  text-align: center;
}

.trend-track {
  height: 132px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-bottom: 1px solid #dce5ff;
}

.trend-bar {
  width: min(42px, 75%);
  min-height: 4px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
}

.trend-value,
.trend-label {
  color: var(--muted);
  font-size: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(5, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.admin-table th {
  white-space: nowrap;
  color: #52606a;
  font-size: 12px;
  text-transform: uppercase;
}

.visitor-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #e8ecea;
}

.action-buttons .btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
}

.empty-state {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.empty-state i {
  font-size: 34px;
}

.form-surface {
  max-width: 850px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 30px;
}

.detail-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #e8ecea;
}

.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #dce5ff;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 500;
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
}

.pagination {
  margin-bottom: 0;
}

@media (max-width: 1199px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .home-copy h1 { font-size: 48px; }
  .kiosk-form,
  .detail-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .app-header {
    padding-inline: 14px;
  }

  .app-header .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
    flex-grow: 1;
    min-width: 0;
  }

  .app-header .navbar-nav {
    margin-left: auto !important;
  }

  .app-header .navbar-nav .nav-item.account-menu {
    position: static;
  }

  .app-header .account-dropdown {
    position: fixed !important;
    top: 78px !important;
    right: 12px !important;
    left: auto !important;
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    margin-top: 0 !important;
    transform: none !important;
  }

  .home-overlay {
    background:
      linear-gradient(90deg, rgba(4, 10, 24, .74) 0%, rgba(4, 10, 24, .58) 58%, rgba(4, 10, 24, .34) 100%),
      linear-gradient(180deg, rgba(4, 10, 24, .34) 0%, rgba(4, 10, 24, .12) 46%, rgba(4, 10, 24, .4) 100%);
  }
  .public-nav { padding: 16px 18px; }
  .public-brand-copy small { display: none; }
  .home-admin-link { padding: 8px 12px; }
  .home-hero { padding: 112px 20px 54px; }
  .home-copy h1 { font-size: 38px; }
  .home-intro { font-size: 16px; line-height: 1.6; }
  .kiosk-header {
    width: 100%;
    min-height: 68px;
    padding: 10px 14px;
  }
  .kiosk-header .public-brand {
    min-width: 0;
    gap: 9px;
    font-size: 16px;
  }
  .kiosk-header .public-brand img {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }
  .kiosk-header .public-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .kiosk-heading,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .kiosk-heading { margin-bottom: 20px; }
  .kiosk-heading h1 { font-size: 28px; }
  .kiosk-main {
    width: 100%;
    padding: 24px 12px 40px;
  }
  .kiosk-form {
    width: 100%;
    min-width: 0;
    gap: 18px;
  }
  .camera-panel,
  .details-panel,
  .dashboard-band,
  .form-surface,
  .detail-layout { padding: 16px; }
  .camera-panel,
  .details-panel { min-width: 0; }
  .camera-panel .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  .camera-panel .section-heading > div { min-width: 0; }
  .camera-panel .section-heading h2 { font-size: 17px; }
  .camera-panel #camera-status { flex: 0 0 auto; }
  .camera-actions,
  .camera-actions .btn { width: 100%; }
  .kiosk-main .form-control,
  .kiosk-main .form-select { min-height: 44px; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-actions { grid-column: 1; }
  .trend-chart { gap: 6px; }
  .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
  .admin-content { padding-top: 88px; }
}

/* Rekap server-side DataTable */
.rekap-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.rekap-table-wrap {
  width: 100%;
  overflow-x: auto;
}

#visitor-table_wrapper .row {
  row-gap: 12px;
  align-items: center;
}

#visitor-table_wrapper .dataTables_filter input,
#visitor-table_wrapper .dataTables_length select {
  border-color: #dce5ff;
}

#visitor-table_wrapper .dataTables_filter input:focus,
#visitor-table_wrapper .dataTables_length select:focus {
  border-color: #5D87FF;
  box-shadow: 0 0 0 .2rem rgba(93, 135, 255, .16) !important;
}

#visitor-table_wrapper .page-item.active .page-link {
  background-color: #5D87FF;
  border-color: #5D87FF;
}

.action-buttons .btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
}

.action-buttons .btn i {
  font-size: 18px;
}

.action-button-primary {
  color: #5D87FF;
  background: #edf2ff;
  border-color: #dce5ff !important;
}

.action-button-primary:hover,
.action-button-primary:focus {
  color: #fff;
  background: #5D87FF;
}

.action-button-danger {
  color: #dc3545;
  background: #fff1f2;
  border-color: #ffd8dc !important;
}

.action-button-danger:hover,
.action-button-danger:focus {
  color: #fff;
  background: #dc3545;
}

@media (max-width: 900px) {
  .rekap-filter-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 700px) {
  .rekap-filter-grid {
    grid-template-columns: 1fr;
  }

  .rekap-filter-grid .filter-actions,
  .rekap-filter-grid .filter-actions .btn {
    width: 100%;
  }

  #visitor-table_wrapper > .row:first-child > div,
  #visitor-table_wrapper > .row:last-child > div {
    text-align: left !important;
  }

  #visitor-table_wrapper .dataTables_filter label,
  #visitor-table_wrapper .dataTables_filter input {
    width: 100%;
    margin-left: 0;
  }
}
/* Password visibility and primary page accents */
.page-wrapper,
.body-wrapper {
  min-height: 100vh;
  background: var(--page);
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 48px;
}

.password-field .form-control.is-invalid {
  padding-right: 76px;
  background-position: right 48px center;
}

.password-toggle-button {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #52606a;
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
}

.password-toggle-button:hover,
.password-toggle-button:focus-visible {
  color: var(--primary);
  background: var(--primary-soft);
}

.password-toggle-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.password-toggle-button .ti {
  font-size: 20px;
}