:root {
  --brand: #045da1;
  --brand-dark: #034880;
  --brand-deep: #021833;
  --brand-mid: #033a6b;
  --brand-soft: #e4f0fc;
  --ink: #0b1520;
  --muted: #5c6b78;
  --surface: #ffffff;
  --bg: #f4f8fb;
  --border: #d5e3ef;
  --sidebar: #021833;
  --sidebar-2: #045da1;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(2, 24, 51, 0.08);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 78px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --fs-base: 16px;
  --fs-label: 0.95rem;
  --fs-title: clamp(1.75rem, 2.5vw, 2.15rem);
  --fs-section: 1.2rem;
  --auth-gradient: linear-gradient(180deg, #045da1 0%, #033a6b 42%, #021833 100%);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: 1.55;
  background:
    radial-gradient(1100px 420px at 10% -10%, #c5def6 0%, transparent 55%),
    radial-gradient(900px 380px at 100% 0%, #d9eaf8 0%, transparent 50%),
    var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

body.has-sidebar {
  background: #f2f6fa;
  display: block;
}

body.auth-theme {
  background-color: #045da1;
  background-image: var(--auth-gradient);
  color: #fff;
}

body.auth-theme .app-footer {
  display: none;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
}
.app-main-public {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.app-footer { border-top: 1px solid var(--border); background: rgba(255,255,255,.7); }

img {
  max-width: 100%;
  height: auto;
}

/* -- Dashboard shell -- */
.dash-shell {
  min-height: 100vh;
  display: flex;
  background: #f2f6fa;
}

.dash-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-2) 0%, var(--sidebar) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 1040;
  transition: width .22s ease;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  padding: 1.35rem 1.15rem 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: center;
}

.sidebar-logo {
  display: block;
  width: min(180px, 100%);
  height: auto;
}

.sidebar-brand-mark {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.05rem;
}

.sidebar-role-badge {
  display: block;
  width: 100%;
  align-self: stretch;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: .45rem .75rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.brand-mark-sm {
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1rem;
}

.brand-title {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
}

.brand-role {
  font-size: .75rem;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem .75rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .9rem;
  border-radius: 10px;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: .92rem;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
  position: relative;
}

.sidebar-link i {
  width: 1.15rem;
  text-align: center;
  opacity: .9;
  flex-shrink: 0;
  font-size: 1.05rem;
}

.sidebar-link-label {
  flex: 1;
  min-width: 0;
}

.sidebar-link-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255,255,255,.16);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.15rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  font-size: .82rem;
  opacity: .85;
  margin-bottom: .75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}

/* Desktop collapsed: icon rail */
@media (min-width: 992px) {
  .dash-shell.sidebar-collapsed .dash-sidebar {
    width: var(--sidebar-collapsed-width);
  }

  .dash-shell.sidebar-collapsed .sidebar-brand {
    padding: 1rem .55rem;
  }

  .dash-shell.sidebar-collapsed .sidebar-logo,
  .dash-shell.sidebar-collapsed .sidebar-role-badge,
  .dash-shell.sidebar-collapsed .sidebar-link-label,
  .dash-shell.sidebar-collapsed .sidebar-user,
  .dash-shell.sidebar-collapsed .sidebar-logout-label {
    display: none;
  }

  .dash-shell.sidebar-collapsed .sidebar-link-badge {
    position: absolute;
    top: .2rem;
    right: .15rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 .25rem;
    font-size: .62rem;
  }

  .dash-shell.sidebar-collapsed .sidebar-brand-mark {
    display: grid;
  }

  .dash-shell.sidebar-collapsed .sidebar-nav {
    padding: .85rem .55rem;
    align-items: center;
  }

  .dash-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 12px;
  }

  .dash-shell.sidebar-collapsed .sidebar-link i {
    width: auto;
    margin: 0;
    font-size: 1.1rem;
  }

  .dash-shell.sidebar-collapsed .sidebar-footer {
    padding: .85rem .55rem 1.1rem;
    display: flex;
    justify-content: center;
  }

  .dash-shell.sidebar-collapsed .sidebar-logout {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 12px;
  }

  .dash-shell.sidebar-collapsed .sidebar-logout i {
    margin: 0 !important;
  }

  .sidebar-collapse-btn .icon-expand {
    display: none;
  }
  .dash-shell.sidebar-collapsed .sidebar-collapse-btn .icon-collapse {
    display: none;
  }
  .dash-shell.sidebar-collapsed .sidebar-collapse-btn .icon-expand {
    display: inline-block;
  }
}

.dash-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1.25rem;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(8px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.topbar-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.topbar-title {
  font-weight: 700;
  font-size: 1.05rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-avatar {
  border: none;
  background: transparent;
  padding: 0;
  line-height: 1;
}
.topbar-avatar::after {
  display: none;
}
.topbar-avatar-circle {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1.5px solid var(--border);
}
.topbar-avatar:focus-visible .topbar-avatar-circle,
.topbar-avatar[aria-expanded="true"] .topbar-avatar-circle {
  box-shadow: 0 0 0 .2rem rgba(4, 93, 161, 0.2);
  border-color: var(--brand);
}

.topbar-user-menu {
  min-width: 14rem;
  border-radius: 12px;
  border-color: var(--border);
  box-shadow: var(--shadow);
  padding: .35rem;
  margin-top: .4rem !important;
}
.topbar-user-menu .dropdown-item {
  border-radius: 8px;
  font-weight: 600;
}
.topbar-user-info {
  max-width: 16rem;
}

.dash-content {
  flex: 1;
  padding: 1.25rem 1.25rem 2rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.dash-footer {
  padding: .75rem 1.25rem;
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.6);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 1035;
}

.sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
  .dash-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-content { padding: 1rem; }
  .sidebar-collapse-btn { display: none !important; }
}

/* -- Auth -- */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: start;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

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

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 2rem;
}

/* Gradient login (design reference) */
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 2.5rem;
  padding-top: max(2rem, env(safe-area-inset-top));
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}

.login-panel {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  display: block;
  width: min(340px, 85vw);
  height: auto;
}

.login-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 2.25rem;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.login-avatar i {
  font-size: 2.4rem;
  color: var(--brand-deep);
}

.login-crest-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.75rem;
}

.login-crest {
  display: block;
  width: min(140px, 42vw);
  height: auto;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  background: #000;
}

.login-field {
  text-align: left;
  margin-bottom: 1.35rem;
}

.login-field label {
  display: block;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .55rem;
  padding-left: .35rem;
}

.login-field .form-control {
  width: 100%;
  min-height: 3.15rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: transparent;
  color: #fff;
  text-align: center;
  font-size: 16px; /* avoid iOS zoom on focus */
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .85rem 1.35rem;
  box-shadow: none;
}

.login-field .form-control::placeholder {
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .05em;
  font-weight: 500;
}

.login-field .form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 0 .2rem rgba(255, 255, 255, 0.18);
  outline: none;
}

.login-field .form-control:-webkit-autofill,
.login-field .form-control:-webkit-autofill:hover,
.login-field .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 1000px rgba(3, 58, 107, 0.55) inset;
}

.login-submit {
  width: 100%;
  min-height: 3.15rem;
  margin-top: .5rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: var(--brand-deep);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.login-submit:hover {
  transform: translateY(-1px);
  color: var(--brand);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.login-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .03em;
}

.login-links a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.login-alert {
  margin-bottom: 1rem;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  padding: .85rem 1rem;
  font-size: .92rem;
}

.login-alert a { color: #fff; font-weight: 700; }

.login-title {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 1.75rem;
}

/* Public registration keeps light panel on tinted page bg */
.reg-kicker { color: var(--brand); }
.reg-meta-item > i {
  background: var(--brand-soft);
  color: var(--brand);
}
.reg-page .form-control:focus,
.reg-page .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .25rem rgba(4, 93, 161, 0.15);
}

/* -- Public registration (wide) -- */
.reg-page {
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
  padding: 2rem 1.25rem 3rem;
  padding-top: max(1.5rem, env(safe-area-inset-top));
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.reg-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.reg-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.reg-logo {
  display: block;
  width: min(420px, 88vw);
  height: auto;
}

.reg-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.reg-header-copy {
  flex: 1;
  min-width: 220px;
}

.reg-header-left {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}

.reg-kicker {
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0;
}

.reg-title {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 .35rem;
  line-height: 1.2;
}

.reg-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42rem;
}

.reg-login-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  padding: .65rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.reg-login-link:hover { color: var(--brand-dark); border-color: #c8d6d3; }
.reg-login-link strong { color: var(--brand); font-weight: 600; }

.reg-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  max-width: 40rem;
}

.reg-meta-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.15rem;
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.reg-meta-item > i {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.reg-meta-label {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 500;
}

.reg-meta-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.reg-meta-countdown .cd-unit {
  display: inline-block;
  white-space: nowrap;
  margin-right: .2rem;
}
.reg-meta-countdown .cd-num {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.1;
}
.reg-meta-countdown .cd-suf {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: .08rem;
  vertical-align: .12em;
}
.reg-meta-countdown.is-urgent .reg-meta-value,
.reg-meta-countdown.is-urgent .cd-num {
  color: #dc2626;
}
.reg-meta-countdown.is-urgent .cd-suf {
  color: #f87171;
}
.reg-meta-countdown.is-urgent > i {
  background: #fef2f2;
  color: #dc2626;
}
.reg-meta-countdown.is-elapsed .reg-meta-label {
  color: var(--muted);
}
.reg-meta-countdown.is-elapsed .reg-meta-value {
  color: var(--muted);
  font-weight: 600;
}
.reg-meta-countdown.is-elapsed > i {
  background: #f1f5f9;
  color: #64748b;
}

.reg-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem 2.25rem;
}

.reg-section {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.reg-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.reg-section-head {
  margin-bottom: 1.35rem;
}
.reg-section-head h2 {
  font-size: var(--fs-section);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 .25rem;
}
.reg-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}
.reg-section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.reg-page .form-label {
  font-size: var(--fs-label);
  font-weight: 600;
  color: #374151;
  margin-bottom: .45rem;
}

.reg-page .form-control,
.reg-page .form-select {
  border-radius: 12px;
  border-color: #d8dee6;
  font-size: 16px;
  padding-top: .8rem;
  padding-bottom: .8rem;
}
.reg-page .form-control:focus,
.reg-page .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .25rem rgba(4, 93, 161, 0.15);
}

.reg-page .form-control-lg,
.reg-page .form-select-lg {
  min-height: 3.15rem;
  font-size: 1.05rem;
}

.reg-page .form-text {
  font-size: .92rem;
  margin-top: .45rem;
}
.reg-page .form-text:empty {
  display: none;
}
.reg-page .form-text.is-error {
  color: #b42318;
}
.reg-page .form-text.is-ok {
  color: #067647;
}
.reg-page .form-text.is-pending {
  color: var(--muted);
}

.reg-claim-panel {
  margin-top: .25rem;
  padding: 1rem 1.1rem;
  border: 1px solid #d7e0e6;
  border-radius: 14px;
  background: #f7fafb;
}
.reg-claim-copy {
  margin-bottom: .85rem;
}
.reg-claim-copy strong {
  display: block;
  margin-bottom: .25rem;
  color: #1f2a33;
}
.reg-claim-copy p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}
.reg-claim-dropzone {
  border: 1.5px dashed #9bb0bc;
  border-radius: 12px;
  background: #fff;
  min-height: 8.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.reg-claim-dropzone:hover,
.reg-claim-dropzone:focus {
  border-color: var(--brand);
  background: #f3faf7;
  outline: none;
}
.reg-claim-dropzone.has-file {
  cursor: default;
  border-style: solid;
  border-color: #b7d7c3;
  background: #eef6f1;
}
.reg-claim-drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  text-align: center;
  color: #4b5c66;
  min-height: 6.5rem;
}
.reg-claim-drop-empty > i {
  font-size: 1.6rem;
  color: var(--brand);
}
.reg-claim-drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin-top: .25rem;
}
.reg-claim-drop-hint {
  font-size: .82rem;
  color: var(--muted);
}
.reg-claim-drop-preview {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.reg-claim-drop-preview img {
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cfd8de;
  background: #fff;
}
.reg-claim-drop-preview-meta {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}
.reg-claim-drop-preview-meta span {
  font-size: .92rem;
  font-weight: 600;
  color: #1f2a33;
}
.reg-claim-crop-wrap {
  max-height: min(60vh, 420px);
  background: #111;
  border-radius: 10px;
  overflow: hidden;
}
.reg-claim-crop-wrap img {
  display: block;
  max-width: 100%;
}

.reg-page .form-control[readonly] {
  background-color: #f4f7f8;
  cursor: default;
}
.reg-page .form-control.is-loaded {
  background-color: #eef6f1;
  border-color: #b7d7c3;
}

.reg-code-group .btn {
  font-size: 1rem;
  font-weight: 600;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  border-radius: 0 12px 12px 0;
}
.reg-code-group .form-control {
  border-radius: 12px 0 0 12px;
}

.reg-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.reg-actions .btn-brand {
  min-width: 220px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 12px;
  padding-top: .85rem;
  padding-bottom: .85rem;
}

.reg-actions-hint {
  color: var(--muted);
  font-size: .95rem;
}

.reg-page .child-row {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  background: #f8fafb;
}

.reg-page .child-row-head {
  position: absolute;
  top: .75rem;
  right: .85rem;
  margin: 0;
  z-index: 1;
}

.reg-page .child-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: .28rem .7rem;
  line-height: 1.2;
}

.age-mismatch-btn {
  text-decoration: none !important;
  line-height: 1;
  vertical-align: baseline;
}
.age-mismatch-btn:hover,
.age-mismatch-btn:focus {
  opacity: .85;
}
.age-mismatch-btn .fa-circle-info {
  font-size: .95em;
}

.age-mismatch-block + .age-mismatch-block {
  margin-top: 1rem;
}
.age-mismatch-heading {
  display: block;
  width: 100%;
  margin: 0 0 .75rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: center;
  box-sizing: border-box;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}
.stat-tile .label { color: var(--muted); font-size: .85rem; }
.stat-tile .value { font-size: 1.75rem; font-weight: 700; color: var(--brand-dark); line-height: 1.2; }
.stat-tile .stat-value-muted {
  font-size: .65em;
  font-weight: 600;
  color: var(--muted);
}
.stat-tile .stat-sub {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  margin-top: .65rem;
  font-size: .8rem;
  color: var(--muted);
}
.stat-tile .stat-sub strong {
  color: var(--text, #1e293b);
  font-weight: 600;
}

.user-kebab {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.sidebar-viewas-tag {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .35rem;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 4px;
  background: rgba(255,255,255,.2);
  vertical-align: middle;
}

.view-as-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #9a3412;
  font-size: .875rem;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.table thead th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  background: #f8fafc;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.child-row {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: .75rem;
  background: #fafbfc;
}

.qr-box {
  display: inline-block;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

#qrStatusBadge .badge {
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  font-weight: 600;
  font-size: .82rem;
  padding: .55rem .85rem;
  max-width: 100%;
}

.scan-result {
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
}
.scan-result.ok { background: #ecfdf5; border: 1px solid #a7f3d0; }
.scan-result.bad { background: #fef2f2; border: 1px solid #fecaca; }

#toast-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
  width: min(380px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: .65rem;
  pointer-events: none;
}

.uiws-toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  font-size: .95rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
}
.uiws-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.uiws-toast i { margin-top: .15rem; font-size: 1.1rem; }
.uiws-toast-success { border-color: #a7f3d0; }
.uiws-toast-success i { color: #059669; }
.uiws-toast-danger { border-color: #fecaca; }
.uiws-toast-danger i { color: #dc2626; }
.uiws-toast-warning { border-color: #fde68a; }
.uiws-toast-warning i { color: #d97706; }
.uiws-toast-info { border-color: #bfdbfe; }
.uiws-toast-info i { color: #2563eb; }

/* -- Custom modal -- */
body.uiws-modal-open { overflow: hidden; }

.uiws-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.85rem max(0.75rem, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.uiws-modal-overlay.show { opacity: 1; }

.uiws-modal {
  width: min(460px, 100%);
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  padding: 1.25rem 1.25rem 1.1rem;
  transform: translateY(12px) scale(.98);
  transition: transform .2s ease;
  margin: auto;
  overflow: hidden;
}
.uiws-modal:has(.reg-review),
.uiws-modal:has(.scan-pass-details) {
  width: min(520px, 100%);
}
.uiws-modal:has(.scan-pass-details) > .uiws-modal-icon {
  display: none;
}
.uiws-modal-overlay.show .uiws-modal {
  transform: translateY(0) scale(1);
}

.uiws-modal-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: .85rem;
  flex-shrink: 0;
  font-size: 1.25rem;
  background: var(--brand-soft);
  color: var(--brand);
}
.uiws-modal-danger .uiws-modal-icon { background: #fef2f2; color: #dc2626; }
.uiws-modal-success .uiws-modal-icon { background: #ecfdf5; color: #059669; }
.uiws-modal-warning .uiws-modal-icon { background: #fffbeb; color: #d97706; }

.uiws-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: .15rem;
}

.uiws-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 .5rem;
}

.uiws-modal-message {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.reg-review-list {
  margin: 0;
  display: grid;
  gap: .65rem;
}
.reg-review-list > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 38%) 1fr;
  gap: .5rem .75rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--border);
}
.reg-review-list dt {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}
.reg-review-list dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}
.reg-review-children {
  margin-top: 1rem;
}
.reg-review-children > strong {
  display: block;
  margin-bottom: .55rem;
  font-size: .9rem;
}
.reg-review-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .75rem;
  padding: .55rem .7rem;
  margin-bottom: .45rem;
  background: #f8fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
}
.reg-review-child-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: .2rem .55rem;
}

.uiws-modal-field { margin-bottom: .9rem; }
.uiws-modal-field .form-label {
  font-weight: 600;
  font-size: .92rem;
}
.uiws-modal-field .form-control,
.uiws-modal-field .form-select {
  border-radius: 12px;
  font-size: 1rem;
  padding: .7rem .85rem;
}

.uiws-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
  background: #fff;
}
.uiws-modal-actions .btn {
  min-width: 100px;
  border-radius: 11px;
  font-weight: 600;
  padding: .6rem 1rem;
}
.uiws-modal-actions .btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.uiws-modal-actions .btn-brand:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.scan-children {
  margin: 0;
  padding-left: 1.15rem;
}
.scan-child-dq {
  list-style: none;
  margin: 0.4rem 0 0.15rem -1.15rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #e11d48;
  border-radius: 10px;
  background: #fff7f7;
}
.scan-child-waived {
  list-style: none;
  margin: 0.4rem 0 0.15rem -1.15rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #f97316;
  border-radius: 10px;
  background: #fff7ed;
}
.scan-history-panel {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.scan-history-list {
  margin: 0;
}
.scan-history-list li:last-child {
  margin-bottom: 0 !important;
}

.pagination .page-link { color: var(--brand); }
.pagination .page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sortable .sort-icon {
  margin-left: .35rem;
  opacity: .4;
  font-size: .75rem;
}
.th-sortable:hover .sort-icon,
.th-sortable.is-sorted .sort-icon {
  opacity: 1;
  color: var(--brand);
}

@media (max-width: 767.98px) {
  .reg-meta {
    grid-template-columns: 1fr;
    max-width: 28rem;
  }
}

@media (max-width: 991.98px) {
  .reg-panel { padding: 1.25rem 1rem 1.35rem; }
  .reg-page {
    padding: 1rem .85rem 2rem;
    min-height: auto;
  }
  .reg-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .reg-header-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .reg-subtitle {
    max-width: 28rem;
  }
  .reg-login-link {
    margin-inline: auto;
  }
  .reg-logo {
    width: min(300px, 82vw);
  }
  .auth-shell {
    place-items: start center;
    align-content: start;
    padding: 1.25rem 1rem 2rem;
  }
  .login-shell {
    align-items: flex-start;
    justify-content: center;
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem 1rem 2rem;
  }
  .login-panel {
    max-width: 100%;
  }
  .login-logo {
    width: min(280px, 80vw);
  }
  .login-title {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
  .login-avatar {
    width: 72px;
    height: 72px;
    margin-bottom: 1.5rem;
  }
  .login-crest {
    width: min(112px, 38vw);
  }
  .dash-shell {
    min-height: 100dvh;
  }
  .dash-sidebar {
    height: 100dvh;
  }
  .dash-content {
    padding: 1rem .85rem 1.5rem;
  }
  .dash-topbar {
    padding: .65rem .85rem;
  }
  .topbar-logo {
    height: 28px;
    max-width: 96px;
  }
  .topbar-title {
    font-size: .95rem;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .form-select,
  .filter-bar .form-control,
  .filter-bar .btn {
    width: 100%;
  }
  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-card {
    overflow: visible;
  }
  .panel-card .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
  }
  .app-main-public {
    min-height: 100dvh;
  }
}

@media (max-width: 576px) {
  .auth-card { padding: 1.35rem; }
  .stat-tile .value { font-size: 1.45rem; }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }
  .stat-tile {
    padding: .9rem 1rem;
  }
  .reg-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .reg-actions .btn-brand { width: 100%; }
  .reg-actions-hint { text-align: center; }
  .reg-code-group { flex-direction: column; }
  .reg-code-group .form-control,
  .reg-code-group .btn {
    width: 100%;
    border-radius: 12px !important;
  }
  .reg-code-group .btn { margin-top: .5rem; }
  .reg-page .form-control-lg,
  .reg-page .form-select-lg {
    font-size: 16px;
    min-height: 2.9rem;
  }
  .child-row .row > [class*="col-"] {
    margin-bottom: .35rem;
  }
  .uiws-modal-actions { flex-direction: column-reverse; }
  .uiws-modal-actions .btn { width: 100%; }
  .login-links {
    flex-direction: column;
    align-items: center;
    gap: .85rem;
  }
  .topbar-title {
    font-size: .95rem;
  }
}

.dq-panel {
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 14px;
  padding: 1rem;
}
.dq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dq-title {
  margin: 0;
  font-weight: 700;
  color: #912018;
}
.dq-sub {
  color: #912018;
  opacity: .85;
  font-size: .92rem;
}
.dq-details {
  margin-top: .85rem;
}
.dq-panel[data-dq-open="0"] {
  padding-bottom: 1rem;
}
.dq-panel[data-dq-open="1"] {
  padding-bottom: .25rem;
}
.dq-child {
  background: #fff;
  border: 1px solid #f3d2ce;
  border-radius: 12px;
  padding: .85rem 1rem .35rem;
  margin-bottom: .75rem;
}
.dq-child-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .35rem;
}
.dq-badge {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #fef3f2;
  color: #b42318;
  border-radius: 999px;
  padding: .2rem .55rem;
}
.dq-child-head strong {
  color: #1f2937;
}
.dq-reason {
  border-top: 1px solid #f6eeec;
  padding: .7rem 0 .55rem;
}
.dq-kicker {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #b42318;
  margin-bottom: .35rem;
}
.dq-reason p {
  margin: 0;
  color: #3f3f46;
}
.dq-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .32rem 0;
}
.dq-row span {
  color: #6b7280;
}
.dq-row strong {
  color: #111827;
  text-align: right;
}
.dq-fallback {
  color: #7a271a;
  margin-bottom: .75rem;
}
.dq-panel-modal {
  background: #fff;
  border-color: #f3d2ce;
  padding: .25rem .75rem .1rem;
}
.dq-modal-block .dq-row {
  padding: .4rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.dq-modal-block .dq-row:last-child {
  border-bottom: 0;
}
.badge.badge-waived,
span.badge-waived {
  --bs-badge-color: #fff;
  background-color: #f97316;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}
.waive-child-pick {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: .35rem 0 .15rem;
  font-size: .92rem;
}
