:root {
  --ink: #182539;
  --muted: #6c7482;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --border: rgba(24, 37, 57, 0.09);
  --primary: #166534;
  --primary-2: #15803d;
  --primary-rgb: 22, 101, 52;
  --primary-2-rgb: 21, 128, 61;
  --teal: #18b498;
  --warning: #f2a93b;
  --ok: #32b76a;
  --shadow: 0 24px 60px rgba(38, 25, 34, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 7% 12%, rgba(var(--primary-rgb), 0.2), transparent 36%),
    radial-gradient(circle at 91% 19%, rgba(24, 180, 152, 0.17), transparent 34%),
    linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Sora", sans-serif;
  letter-spacing: -0.03em;
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button,
.btn,
.nav-link,
.role-btn,
.icon-btn {
  transition: transform 0.16s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

button:hover,
.btn:hover,
.nav-link:hover,
.role-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.55);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.ambient--one {
  right: -120px;
  top: -140px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.5), transparent 70%);
}

.ambient--two {
  left: -160px;
  bottom: 20px;
  background: radial-gradient(circle, rgba(24, 180, 152, 0.33), transparent 68%);
}

.app-shell {
  position: relative;
  isolation: isolate;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px;
}

.screen {
  display: none;
}

.screen--active {
  display: block;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.card:hover {
  border-color: rgba(var(--primary-rgb), 0.16);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
}

.btn--primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.btn--soft {
  background: rgba(24, 37, 57, 0.08);
  color: var(--ink);
}

.btn--light {
  align-self: flex-start;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.login-layout {
  min-height: calc(100vh - 52px);
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: 1fr 420px;
  overflow: hidden;
}

.login-branding {
  padding: 46px;
  background:
    linear-gradient(165deg, rgba(var(--primary-rgb), 0.95), rgba(var(--primary-2-rgb), 0.86)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 36px rgba(var(--primary-rgb), 0.33);
}

.logo-mark--small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.login-branding h1 {
  font-size: clamp(2rem, 4.8vw, 3.3rem);
}

.login-branding p {
  max-width: 48ch;
  line-height: 1.7;
  opacity: 0.94;
}

.login-points {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.9;
}

.login-form {
  padding: 38px;
  background: var(--surface-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.login-form label,
.filters-grid label,
.profile-form label,
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 600;
  color: var(--ink);
}

input,
select {
  border: 1px solid rgba(24, 37, 57, 0.12);
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--ink);
  background: #ffffff;
  transition: all 0.2s ease;
}

input:hover,
select:hover {
  border-color: rgba(24, 180, 152, 0.3);
  background: rgba(24, 180, 152, 0.02);
}

input:focus-visible,
select:focus-visible {
  border-color: rgba(24, 180, 152, 0.5);
  background: #ffffff;
}

.topbar {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  position: sticky;
  top: 12px;
  z-index: 15;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px);
  overflow: visible;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand span {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
}

.topbar-brand strong,
.topbar-brand span {
  overflow-wrap: anywhere;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  flex-wrap: wrap;
}

.icon-btn--ghost {
  background: rgba(24, 37, 57, 0.1);
  color: var(--ink);
}

.role-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(24, 37, 57, 0.06);
  padding: 6px;
  border-radius: 999px;
}

.role-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.role-btn.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #1f304a, #294162);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(24, 37, 57, 0.08);
  padding: 0 10px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.menu-toggle span + span {
  margin-top: 5px;
}

.nav {
  justify-self: stretch;
  display: flex;
  gap: 6px;
  background: rgba(24, 37, 57, 0.05);
  border-radius: 999px;
  padding: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.nav-link--mobile-only {
  display: none;
}

.nav-mobile-tools {
  display: none;
}

.nav-link--logout {
  color: #ffffff;
  background: linear-gradient(135deg, #1f304a, #2a4264);
}

.nav-backdrop {
  display: none;
}

.icon-btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #1f304a, #273f60);
  cursor: pointer;
}

.btn[data-export-btn] {
  color: #ffffff;
  background: linear-gradient(135deg, #1f304a, #2c4466);
}

.btn[data-export-btn],
.recognition-actions .btn,
.modal__actions .btn,
.profile-actions .btn,
.quick-menu-grid button,
.topbar-tools .icon-btn,
.topbar-tools .role-btn {
  min-height: 44px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(24, 180, 152, 0.12);
  color: #0e7d5e;
  font-weight: 700;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #19b496;
  box-shadow: 0 0 0 6px rgba(25, 180, 150, 0.15);
}

.screen-view {
  display: none;
  margin-top: 16px;
  animation: rise 0.25s ease;
}

.screen-view.is-active {
  display: block;
}

.welcome,
.page-head,
.quick-menu,
.filters,
.table-wrap,
.profile-card,
.profile-form,
.role-panel,
.recognition-camera,
.recognition-log {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.welcome,
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.welcome h2,
.page-head h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 6px 0;
}

.muted {
  color: var(--muted);
}

.pill {
  align-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: #0e7d5e;
  background: rgba(24, 180, 152, 0.15);
  font-weight: 700;
}

.pill--success {
  color: #1c7a48;
  background: rgba(50, 183, 106, 0.15);
}

.pill--warn {
  color: #8a5d12;
  background: rgba(242, 169, 59, 0.18);
}

.stats-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid--history {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  border-radius: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto -26px -26px auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
}

.stat span {
  display: block;
  color: var(--muted);
}

.stat__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.stat__trend {
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.stat__trend--up {
  color: #177d5d;
  background: rgba(24, 180, 152, 0.16);
}

.stat__trend--flat {
  color: #2d4362;
  background: rgba(45, 67, 98, 0.12);
}

.stat__trend--warn {
  color: #8a5d12;
  background: rgba(242, 169, 59, 0.2);
}

.stat--rose::after {
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.7), transparent 70%);
}

.stat--teal::after {
  background: radial-gradient(circle, rgba(24, 180, 152, 0.66), transparent 70%);
}

.stat--ink::after {
  background: radial-gradient(circle, rgba(31, 48, 74, 0.64), transparent 70%);
}

.stat--warn::after {
  background: radial-gradient(circle, rgba(242, 169, 59, 0.7), transparent 70%);
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 1.8rem;
}

.stat small {
  color: var(--muted);
}

.quick-menu,
.role-panels,
.filters,
.table-wrap,
.profile-grid,
.recognition-grid {
  margin-top: 14px;
}

.quick-menu h3,
.filters h3,
.table-wrap h3,
.profile-form h3,
.role-panel h3,
.recognition-camera h3,
.recognition-log h3 {
  margin-bottom: 14px;
}

.quick-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-menu-grid button {
  border: 1px solid rgba(24, 37, 57, 0.1);
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.quick-menu-grid__title {
  font-weight: 800;
  color: #22324b;
}

.quick-menu-grid__desc {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
}

.role-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.activity-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.9;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.table-scroll {
  overflow-x: auto;
}

.table-wrap[data-history-table-wrap] table {
  min-width: 980px;
}

.history-meta-name {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.table-wrap[data-history-table-wrap] thead th,
.table-wrap[data-history-table-wrap] tbody td {
  white-space: nowrap;
}

.table-wrap[data-history-table-wrap] .admin-user-actions {
  flex-wrap: wrap;
}

.table-wrap {
  position: relative;
}

.table-wrap.is-loading::after {
  content: "Memuat data absensi...";
  position: absolute;
  inset: 56px 16px 16px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-weight: 700;
}

.table-wrap.is-loading .table-scroll {
  opacity: 0.45;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

thead th {
  text-align: left;
  background: #1d2e48;
  color: #ffffff;
  padding: 12px;
  font-size: 0.9rem;
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(24, 37, 57, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.badge--ok {
  color: #1c7a48;
  background: rgba(50, 183, 106, 0.15);
}

.badge--warn {
  color: #8a5d12;
  background: rgba(242, 169, 59, 0.18);
}

.badge--danger {
  color: #8d1e2c;
  background: rgba(209, 61, 88, 0.16);
}

.history-link {
  color: #0f7a5e;
  font-weight: 700;
  text-decoration: none;
}

.history-link:hover {
  text-decoration: underline;
}

.history-muted {
  color: var(--muted);
}

.admin-users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-user-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-user-actions .btn {
  padding: 7px 12px;
  min-height: 38px;
}

.admin-user-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-user-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  min-width: 0;
}

.admin-user-form input,
.admin-user-form select {
  width: 100%;
}

.modal[data-user-modal] {
  align-items: center;
  justify-items: center;
}

.modal[data-user-modal] .modal__box {
  width: min(100%, 760px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
}

.modal[data-user-modal] .modal__box h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  padding-bottom: 8px;
}

.modal[data-user-modal] .modal__actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: var(--surface);
  padding-top: 10px;
}

[data-user-tbody] td {
  vertical-align: middle;
}

@media (max-width: 780px) {
  .admin-users-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-users-head .btn {
    width: 100%;
  }

  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .modal[data-user-modal] .modal__box {
    width: min(100%, 520px);
    max-height: 88vh;
    padding: 16px;
  }

  .modal[data-user-modal] .modal__actions {
    flex-direction: column;
  }

  .modal[data-user-modal] .modal__actions .btn {
    width: 100%;
  }
}

.recognition-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.recognition-camera {
  position: relative;
  overflow: hidden;
}

.recognition-camera::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at center, rgba(24, 180, 152, 0.15), transparent 70%);
  pointer-events: none;
}

.recognition-camera--teal {
  border-color: rgba(24, 180, 152, 0.2);
}

.recognition-camera--teal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #18b498, transparent);
}

.recognition-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.recognition-header h3 {
  margin: 0;
}

.recognition-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(24, 180, 152, 0.2);
  color: #0f7a5e;
}

.recognition-status-text {
  margin-top: 8px;
  margin-bottom: 12px;
}

.camera-frame {
  position: relative;
  margin-top: 8px;
  border-radius: 18px;
  min-height: 280px;
  background:
    linear-gradient(180deg, rgba(20, 31, 50, 0.95), rgba(34, 50, 76, 0.95)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.03) 2px,
      transparent 2px,
      transparent 6px
    );
  overflow: hidden;
}

.camera-video,
.camera-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.camera-video {
  transform: scaleX(-1);
}

.camera-scan-line {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4de7c5, transparent);
  animation: scan 2.6s linear infinite;
  z-index: 2;
}

.face-guide {
  position: absolute;
  width: 180px;
  height: 220px;
  border-radius: 48% 48% 42% 42%;
  border: 2px dashed rgba(77, 231, 197, 0.7);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.camera-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: #dfe9ff;
  background: rgba(10, 16, 28, 0.46);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  z-index: 2;
}

.recognition-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-head,
.welcome,
.quick-menu,
.filters,
.table-wrap,
.profile-card,
.profile-form,
.role-panel,
.recognition-camera,
.recognition-log {
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.page-head:hover,
.welcome:hover,
.quick-menu:hover,
.filters:hover,
.table-wrap:hover,
.profile-card:hover,
.profile-form:hover,
.role-panel:hover,
.recognition-camera:hover,
.recognition-log:hover {
  transform: translateY(-1px);
}

.recognition-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.recognition-log-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(24, 37, 57, 0.08);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.recognition-log-list li:hover {
  border-color: rgba(24, 180, 152, 0.2);
  background: rgba(24, 180, 152, 0.04);
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.log-item strong {
  flex: 1;
}

.log-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.log-item--success::before {
  background: #32b76a;
  box-shadow: 0 0 8px rgba(50, 183, 106, 0.4);
}

.log-item--info::before {
  background: #5b7fa4;
  box-shadow: 0 0 8px rgba(91, 127, 164, 0.3);
}

.log-item--warn::before {
  background: #f2a93b;
  box-shadow: 0 0 8px rgba(242, 169, 59, 0.3);
}

.log-time {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
  min-width: 48px;
}

.recognition-log {
  position: relative;
  overflow: hidden;
}

.recognition-log--premium {
  border-color: rgba(24, 180, 152, 0.1);
}

.recognition-log--premium::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at center, rgba(24, 180, 152, 0.08), transparent 70%);
  pointer-events: none;
}

.recognition-log span {
  color: var(--muted);
}

.recognition-role-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(24, 37, 57, 0.18);
}

.recognition-proof {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(24, 37, 57, 0.1);
  background: rgba(24, 180, 152, 0.06);
}

.recognition-proof p {
  margin: 4px 0;
  font-size: 0.9rem;
}

.recognition-proof a {
  color: #0f7a5e;
  font-weight: 700;
  text-decoration: none;
}

.recognition-proof a:hover {
  text-decoration: underline;
}

.recognition-role-note h4 {
  margin-bottom: 6px;
}

.recognition-camera.is-loading .camera-frame {
  filter: saturate(0.6);
}

.recognition-camera.is-loading .camera-frame::after {
  content: "Memproses vektor wajah...";
  position: absolute;
  inset: auto 12px 12px auto;
  color: #dfe9ff;
  background: rgba(10, 16, 28, 0.56);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.empty-state {
  text-align: center;
}

.empty-state__icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.is-hidden {
  display: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 12px;
}

.profile-card {
  text-align: center;
  position: relative;
  overflow: hidden;
  border-color: rgba(24, 180, 152, 0.1);
}

.profile-card--teal::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle at center, rgba(24, 180, 152, 0.08), transparent 70%);
  pointer-events: none;
}

.avatar {
  width: 86px;
  height: 86px;
  margin: 6px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.22);
}

.avatar--rose {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.avatar--teal {
  background: linear-gradient(135deg, #18b498, #2ac9b0);
}

.avatar--ink {
  background: linear-gradient(135deg, #182539, #243d5e);
}

.profile-card h3 {
  margin-bottom: 4px;
}

.profile-card p {
  margin-bottom: 4px;
}

.profile-role {
  display: inline-block;
  font-weight: 700;
  color: #0f7a5e;
  background: rgba(24, 180, 152, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.profile-card small {
  color: var(--muted);
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-form--enhanced {
  border-color: rgba(24, 180, 152, 0.08);
}

.form-section {
  grid-column: 1 / -1;
}

.form-section h3,
.form-section p {
  margin-bottom: 6px;
}

.form-section h3 {
  font-size: 1.2rem;
}

.form-section p {
  color: var(--muted);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

.form-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #182539;
}

.profile-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn--secondary {
  background: rgba(24, 37, 57, 0.05);
  color: var(--muted);
}

.btn--secondary:hover {
  background: rgba(24, 37, 57, 0.08);
}

.logout-card {
  max-width: 520px;
  margin: 11vh auto;
  padding: 28px;
  border-radius: var(--radius-xl);
  text-align: center;
}

.logout-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: #ffffff;
  background: linear-gradient(135deg, #24b083, #4fd38f);
}

.logout-card h2 {
  margin-bottom: 8px;
}

.logout-card p {
  margin-bottom: 18px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 38, 0.5);
  display: none;
  place-items: center;
  z-index: 20;
  padding: 20px;
}

.modal.is-open {
  display: grid;
}

.modal__box {
  width: min(100%, 420px);
  border-radius: 20px;
  padding: 22px;
}

.modal__box h3 {
  margin-bottom: 8px;
}

.modal__actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  border-radius: 14px;
  padding: 12px 14px;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(18, 28, 42, 0.24);
  animation: toastIn 0.2s ease;
}

.toast--success {
  background: linear-gradient(135deg, #1aa581, #27c791);
}

.toast--info {
  background: linear-gradient(135deg, #2a4264, #3a5b88);
}

.toast--warn {
  background: linear-gradient(135deg, #d58d27, #f0ad45);
}

.is-hidden-role {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scan {
  0% {
    top: 16%;
  }
  50% {
    top: 82%;
  }
  100% {
    top: 16%;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    top: 0;
    row-gap: 10px;
    z-index: 10000;
  }

  .menu-toggle {
    display: inline-block;
  }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: min(84vw, 320px);
    height: 100dvh;
    display: grid;
    align-content: start;
    gap: 6px;
    grid-template-columns: 1fr;
    padding: 18px 12px 16px;
    background: #ffffff;
    box-shadow: 0 24px 44px rgba(17, 28, 43, 0.22);
    border-right: 1px solid var(--border);
    border-radius: 0 18px 18px 0;
    z-index: 10002;
    transform: translateX(-106%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav.is-open .nav-link {
    width: 100%;
    text-align: left;
    white-space: normal;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 46px;
    color: #2a3c56;
    background: rgba(24, 37, 57, 0.05);
  }

  .nav.is-open .nav-link.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
  }

  .nav-link--mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-mobile-tools {
    display: grid;
    gap: 8px;
    padding: 8px 2px 2px;
  }

  .role-switch--mobile {
    width: 100%;
    justify-content: space-between;
    background: rgba(24, 37, 57, 0.08);
  }

  .role-switch--mobile .role-btn {
    flex: 1 1 50%;
    text-align: center;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 24, 38, 0.32);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar-tools {
    display: none;
  }

  .topbar-logout {
    display: none;
  }

  .stats-grid,
  .quick-menu-grid,
  .filters-grid,
  .profile-form {
    grid-template-columns: 1fr 1fr;
  }

  .recognition-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-card {
    text-align: center;
  }

  .recognition-header {
    flex-direction: row;
    gap: 12px;
  }

  .recognition-status-badge {
    width: auto;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 10px;
  }

  .login-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    overflow: hidden;
  }

  .login-branding,
  .login-form {
    gap: 10px;
    padding: 20px;
    border-radius: 18px;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    top: 0;
    z-index: 10000;
  }

  .topbar-brand {
    min-width: 0;
  }

  .topbar-brand strong,
  .topbar-brand span {
    max-width: 100%;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav {
    left: 10px;
    width: min(88vw, 320px);
    border-radius: 16px;
  }

  .welcome,
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-head-actions {
    width: 100%;
    gap: 6px;
  }

  .page-head-actions .btn,
  .page-head-actions .pill,
  .page-head-actions .status-dot {
    width: 100%;
    justify-content: center;
  }

  .quick-menu-grid button {
    gap: 2px;
  }

  .quick-menu-grid__desc {
    font-size: 0.8rem;
  }

  .stats-grid,
  .stats-grid--history,
  .quick-menu-grid,
  .filters-grid,
  .profile-form,
  .modal__actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .profile-actions,
  .recognition-actions {
    flex-direction: column;
  }

  .btn[data-export-btn],
  .recognition-actions .btn,
  .modal__actions .btn,
  .profile-actions .btn,
  .quick-menu-grid button,
  .topbar-tools .icon-btn,
  .topbar-tools .role-btn {
    min-height: 46px;
  }

  .recognition-grid,
  .profile-grid,
  .login-layout {
    gap: 12px;
  }

  .role-table .table-scroll,
  .role-panel .table-scroll {
    overflow-x: hidden;
  }

  table[data-division-table] {
    min-width: 0;
    table-layout: fixed;
  }

  table[data-division-table] th,
  table[data-division-table] td {
    padding: 9px 8px;
    font-size: 0.85rem;
    white-space: normal;
    word-break: break-word;
  }

  table[data-user-table] {
    min-width: 0;
    table-layout: fixed;
  }

  table[data-user-table] th,
  table[data-user-table] td {
    padding: 9px 8px;
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
  }

  table[data-user-table] th:nth-child(3),
  table[data-user-table] th:nth-child(4),
  table[data-user-table] th:nth-child(5),
  table[data-user-table] td:nth-child(3),
  table[data-user-table] td:nth-child(4),
  table[data-user-table] td:nth-child(5) {
    display: none;
  }

  table[data-user-table] .admin-user-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  table[data-user-table] .admin-user-actions .btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .recognition-camera,
  .recognition-log,
  .role-panel,
  .table-wrap,
  .quick-menu,
  .filters,
  .profile-card,
  .profile-form,
  .welcome,
  .page-head {
    padding: 18px;
    border-radius: 18px;
  }

  .recognition-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .table-wrap[data-history-table-wrap] {
    overflow: hidden;
  }

  .table-wrap[data-history-table-wrap] .table-scroll {
    overflow-x: hidden;
  }

  table[data-history-table] {
    min-width: 0;
    table-layout: fixed;
  }

  table[data-history-table] thead th,
  table[data-history-table] tbody td {
    padding: 10px 8px;
    white-space: normal;
    word-break: break-word;
    font-size: 0.88rem;
  }

  table[data-history-table] thead th:nth-child(3),
  table[data-history-table] thead th:nth-child(6),
  table[data-history-table] thead th:nth-child(8),
  table[data-history-table] thead th:nth-child(9),
  table[data-history-table] thead th:nth-child(10),
  table[data-history-table] tbody td:nth-child(3),
  table[data-history-table] tbody td:nth-child(6),
  table[data-history-table] tbody td:nth-child(8),
  table[data-history-table] tbody td:nth-child(9),
  table[data-history-table] tbody td:nth-child(10) {
    display: none;
  }

  table[data-history-table] thead th:nth-child(1),
  table[data-history-table] tbody td:nth-child(1) {
    width: 34px;
  }

  table[data-history-table] .badge {
    padding: 4px 8px;
    font-size: 0.76rem;
  }

  .table-wrap[data-history-table-wrap] .admin-user-actions .btn {
    min-height: 34px;
    padding: 6px 10px;
  }

  .recognition-status-badge {
    width: 100%;
    justify-content: center;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 72px;
    height: 72px;
    font-size: 1.4rem;
  }

  .stats-grid,
  .stats-grid--history {
    gap: 10px;
  }

  .stat strong {
    font-size: 1.6rem;
  }

  .camera-frame {
    min-height: 230px;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    top: 12px;
    width: auto;
  }
}
