/* Simba Security Service HRM (brand: assets/images/logo.png, login: logox.png) */

:root {
  --brand-navy: #0a1f3c;
  --brand-navy-mid: #0f2847;
  --brand-navy-light: #152a45;
  --brand-red: #b91c2c;
  --brand-red-hover: #991b1b;
  --brand-red-muted: rgba(185, 28, 44, 0.14);
  --brand-white: #f8fafc;
  --brand-cream: #eef2f7;

  --bg: #070f1a;
  --bg-elevated: #0c1829;
  --panel: #0f2138;
  --panel-2: #132845;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: var(--brand-red);
  --accent-dim: var(--brand-red-hover);
  --link: #e2e8f0;
  --link-hover: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --sidebar-w: 268px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ——— App shell (logged-in) ——— */
body.page-app {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(185, 28, 44, 0.09) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 0% 100%, rgba(10, 31, 60, 0.9) 0%, transparent 45%);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
}

/* Mobile nav drawer (checkbox + label; no framework) */
.sidebar-nav-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-scrim {
  display: none;
}

.sidebar-menu-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.sidebar-menu-icon {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-navy) 0%, #061018 100%);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 1.5rem;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-link {
  display: block;
  line-height: 0;
}
.sidebar-brand-link:hover {
  opacity: 0.95;
  text-decoration: none;
}

.sidebar-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  object-position: left center;
}

.sidebar-product {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav a,
.nav .nav-link {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--brand-cream);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  text-decoration: none;
}
.nav a:hover,
.nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}
.nav a.is-active,
.nav .nav-link.is-active {
  background: rgba(185, 28, 44, 0.22);
  border-color: rgba(185, 28, 44, 0.45);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-red);
}

.sidebar-user {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: auto;
}

.sidebar-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-white);
}

.logout {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-red);
}
.logout:hover {
  color: #f87171;
  text-decoration: none;
}

/* Main column */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-elevated);
}

.topbar {
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-elevated) 100%);
  box-shadow: var(--shadow-soft);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.75rem 1.25rem;
  border-bottom: 3px solid var(--brand-red);
  max-width: 100%;
}

.topbar-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: clamp(1.05rem, 2.8vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.content {
  padding: 1.5rem 1.75rem 2rem;
  flex: 1;
}

.footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.footer-logo {
  max-height: 36px;
  width: auto;
  opacity: 0.85;
  object-fit: contain;
}

.footer-text {
  flex: 1;
  min-width: 200px;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}

/* Flash */
.flash {
  margin: 1rem 1.75rem 0;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-weight: 500;
}
.flash-success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  color: #86efac;
}
.flash-error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #fca5a5;
}

/* Cards */
.card {
  background: linear-gradient(145deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--brand-red);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(185, 28, 44, 0.35);
}
.btn:hover {
  background: var(--brand-red-hover);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(185, 28, 44, 0.4);
}
.btn:focus-visible {
  outline: 2px solid var(--brand-white);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.reg-col-num {
  width: 2.5rem;
  text-align: center;
  white-space: nowrap;
}
.reg-col-actions {
  width: 5.5rem;
  text-align: right;
  vertical-align: middle;
}
.reg-col-actions .btn-sm {
  white-space: nowrap;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.15);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data th,
table.data td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: rgba(10, 31, 60, 0.55);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data tr:last-child td {
  border-bottom: none;
}
table.data tr:hover td {
  background: var(--brand-red-muted);
}
table.data a {
  color: #fecaca;
  font-weight: 600;
}
table.data a:hover {
  color: #fff;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(7, 15, 26, 0.65);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--brand-red-muted);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.form-actions {
  margin-top: 1.35rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.field {
  margin-bottom: 1rem;
}

.dl-grid {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.5rem 1.25rem;
}
.dl-grid dt {
  color: var(--muted);
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
}
.dl-grid dd {
  margin: 0;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: linear-gradient(145deg, var(--panel) 0%, var(--brand-navy-mid) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  border-left: 4px solid var(--brand-red);
  box-shadow: var(--shadow);
}

.stat .num {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-white);
}
.stat .lbl {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

.badge {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--brand-red-muted);
  color: #fecaca;
  border: 1px solid rgba(185, 28, 44, 0.35);
}

/* ——— Login page ——— */
body.page-login {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(155deg, #0a1f3c 0%, #050a12 50%, #0f172a 100%);
  background-image: radial-gradient(ellipse 100% 80% at 85% 15%, rgba(185, 28, 44, 0.2) 0%, transparent 50%);
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 440px);
  min-height: 100vh;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.06) 0%, transparent 55%);
  pointer-events: none;
}

.login-brand-inner {
  position: relative;
  text-align: center;
  max-width: 420px;
  padding: 2rem 1.75rem 1.85rem;
  background: rgba(248, 250, 252, 0.98);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-logo {
  width: min(100%, 320px);
  height: auto;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(10, 31, 60, 0.12));
}

/* High-contrast copy on the light panel (fixes tagline / note vs navy page bg) */
body.page-login .login-brand .login-tagline {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0a1f3c;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.page-login .login-brand .login-brand-note,
body.page-login .login-brand .login-brand-note.muted {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  color: #334155;
  font-weight: 500;
}

.login-aside {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border-left: 1px solid var(--border);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(165deg, var(--panel) 0%, #0a1628 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 2rem 2rem 2.25rem;
  box-shadow: var(--shadow);
}

.login-heading {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-card .sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-flash {
  margin: 0 0 1rem !important;
}

.login-form .btn-login {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.7rem 1rem;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }
  .login-brand {
    padding: 2rem max(1.25rem, env(safe-area-inset-left, 0px)) 1rem max(1.25rem, env(safe-area-inset-right, 0px));
  }
  .login-aside {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
  }
}

/* ——— Employment registration form ——— */
.reg-form {
  max-width: 960px;
}
.reg-title {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.reg-instruction {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--brand-red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-red-muted);
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}
.reg-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.2rem;
  margin-bottom: 1.25rem;
  background: rgba(0, 0, 0, 0.18);
}
.reg-section legend {
  padding: 0 0.5rem;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.reg-hr {
  background: rgba(185, 28, 44, 0.06);
  border-color: rgba(185, 28, 44, 0.22);
}
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--text);
  margin: 0;
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
}
.radio-row input {
  width: auto;
  accent-color: var(--brand-red);
}
.reg-table-wrap {
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Children, education, trainings: keep natural column widths; scroll horizontally on narrow viewports */
.reg-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
}

.reg-table-scroll > .reg-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.reg-table-scroll .reg-table th {
  white-space: nowrap;
}

.reg-table-scroll .reg-table input:not([type="hidden"]),
.reg-table-scroll .reg-table select {
  min-width: 8.75rem;
}

.reg-table-scroll .reg-table input[type="date"] {
  min-width: 11.25rem;
}

.reg-table-scroll .reg-col-num {
  width: auto;
}

.reg-table-scroll .reg-col-actions {
  width: auto;
  white-space: nowrap;
}

.reg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.reg-table th,
.reg-table td {
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  vertical-align: middle;
}
.reg-table th {
  background: rgba(10, 31, 60, 0.5);
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.reg-table input,
.reg-table select {
  margin: 0;
  font-size: 0.88rem;
}
.em-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}
.em-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.em-num {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.reg-cert {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: rgba(10, 31, 60, 0.25);
}
.err {
  color: #fca5a5;
  font-weight: 600;
}

.view-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--brand-red);
}

.reg-form a {
  color: #fecaca;
  font-weight: 600;
}
.reg-form a:hover {
  color: #fff;
}

/* ——— Tablet & phone ——— */
@media (max-width: 960px) {
  .sidebar-menu-btn {
    display: inline-flex;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 88;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-nav-input:checked ~ .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 90;
    width: min(300px, 88vw);
    max-width: 100%;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    padding-top: max(1.25rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
  }

  .sidebar-nav-input:checked ~ .sidebar {
    transform: translateX(0);
  }

  .main {
    width: 100%;
    min-width: 0;
  }

  .content {
    padding: 1.1rem max(1rem, env(safe-area-inset-right, 0px)) 1.5rem max(1rem, env(safe-area-inset-left, 0px));
  }

  .flash {
    margin: 0.75rem max(1rem, env(safe-area-inset-left, 0px)) 0 max(1rem, env(safe-area-inset-right, 0px));
  }

  body.page-app:has(#sidebar-nav:checked) {
    overflow: hidden;
  }

  .topbar-inner {
    padding: 0.95rem max(1rem, env(safe-area-inset-right, 0px)) 1rem max(1rem, env(safe-area-inset-left, 0px));
  }

  .footer {
    padding: 0.85rem max(1rem, env(safe-area-inset-left, 0px)) 1rem max(1rem, env(safe-area-inset-right, 0px));
  }

  .stats {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-scrim {
    transition: none;
  }
}

@media (max-width: 640px) {
  /* Avoid iOS zoom-on-focus when fields use small font sizes */
  input,
  select,
  textarea {
    font-size: 1rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .btn {
    width: 100%;
    justify-content: center;
  }

  .toolbar form {
    display: flex;
    width: 100%;
    margin-left: 0 !important;
  }

  .toolbar form .btn {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .dl-grid {
    grid-template-columns: 1fr;
    gap: 0.2rem 0;
  }

  .dl-grid dt {
    margin-top: 0.55rem;
  }

  .dl-grid dt:first-of-type {
    margin-top: 0;
  }

  table.data {
    font-size: 0.85rem;
  }

  table.data th,
  table.data td {
    padding: 0.55rem 0.5rem;
  }

  .card {
    padding: 1rem 1rem 1.15rem;
  }

  .reg-section {
    padding: 0.85rem 0.75rem 1rem;
  }

  /* Languages / other compact reg tables only — wide tables use .reg-table-scroll + horizontal scroll */
  .reg-table-wrap:not(.reg-table-scroll) .reg-table {
    font-size: 0.8rem;
  }

  .reg-table-wrap:not(.reg-table-scroll) .reg-table th,
  .reg-table-wrap:not(.reg-table-scroll) .reg-table td {
    padding: 0.35rem 0.35rem;
  }

  .reg-table-wrap:not(.reg-table-scroll) .reg-table input,
  .reg-table-wrap:not(.reg-table-scroll) .reg-table select {
    font-size: 1rem;
  }

  .reg-title {
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.35rem 1rem 1.5rem;
  }

  .login-brand-inner {
    padding: 1.35rem 1rem 1.25rem;
  }

  .login-aside {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .login-shell {
    min-height: 100dvh;
  }
}
