@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Sora:wght@600;700;800&display=swap");

:root {
  /* Institutional Pipul palette from brand marks: yellow + black */
  --brand-yellow: #fce300;
  --brand-yellow-deep: #e6cf00;
  --brand-black: #0a0a0a;
  --ink: #1a1c1e;
  --ink-soft: #3d4450;
  --muted: #6b7280;
  --line: #e4e7ec;
  --line-strong: #cdd3dc;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --surface-3: #eef1f4;
  --page: #eceff2;
  --orange: var(--brand-yellow);
  --orange-deep: var(--brand-yellow-deep);
  --orange-soft: #fff9cc;
  --green: #1b7f4c;
  --green-soft: #e8f6ef;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --shadow: 0 10px 30px rgba(26, 28, 30, 0.08);
  --shadow-sm: 0 2px 8px rgba(26, 28, 30, 0.06);
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --actionbar-bg: rgba(255, 255, 255, 0.96);
  --card-head-bg: linear-gradient(180deg, #fff, #fafbfc);
  --login-panel-bg: linear-gradient(180deg, #f7f8fa 0%, #eef1f4 100%);
  --input-bg: #ffffff;
  --chip-bg: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "DM Sans", sans-serif;
  --display: "Sora", sans-serif;
  --on-brand: #0a0a0a;
  --focus-ring: rgba(252, 227, 0, 0.45);
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #e8eaed;
  --ink-soft: #c5cad3;
  --muted: #9aa3b2;
  --line: #2a303a;
  --line-strong: #3a4352;
  --surface: #1b2028;
  --surface-2: #14181f;
  --surface-3: #10141a;
  --page: #0a0c10;
  --orange: #fce300;
  --orange-deep: #ffe44d;
  --orange-soft: #2a2410;
  --green: #3dd68c;
  --green-soft: #12261c;
  --danger: #ff6b6b;
  --danger-soft: #2a1518;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --topbar-bg: rgba(12, 14, 18, 0.94);
  --actionbar-bg: rgba(12, 14, 18, 0.96);
  --card-head-bg: linear-gradient(180deg, #1e2430, #1b2028);
  --login-panel-bg: linear-gradient(180deg, #12161d 0%, #0a0c10 100%);
  --input-bg: #14191f;
  --chip-bg: rgba(255, 255, 255, 0.06);
  --on-brand: #0a0a0a;
  --focus-ring: rgba(252, 227, 0, 0.28);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  transition: background 0.2s ease, color 0.2s ease;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

/* ========== LOGIN ========== */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(252, 227, 0, 0.28), transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(252, 227, 0, 0.08), transparent 35%),
    linear-gradient(155deg, #000000 0%, #141414 52%, #0a0a0a 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-hero__glow {
  position: absolute;
  inset: auto -20% -30% auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(252, 227, 0, 0.22), transparent 68%);
  pointer-events: none;
}

.login-hero__mark-bg {
  position: absolute;
  right: -40px;
  bottom: -30px;
  width: min(420px, 55vw);
  opacity: 0.07;
  pointer-events: none;
  transform: rotate(-12deg);
}

.login-hero__mark-bg img {
  width: 100%;
  height: auto;
  filter: none;
  border-radius: 50%;
}

.login-hero__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  background: #000;
}

.brand-logo--sm {
  width: 40px;
  height: 40px;
}

.brand-logo--md {
  width: 56px;
  height: 56px;
}

.brand-logo--lg {
  width: 72px;
  height: 72px;
  border: 2px solid rgba(252, 227, 0, 0.55);
}

.brand-wordmark {
  display: block;
  height: 22px;
  width: auto;
  max-width: 118px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  mix-blend-mode: multiply;
}

.login-hero .brand-wordmark,
.sidebar .brand-wordmark,
html[data-theme="dark"] .topbar .brand-wordmark {
  filter: invert(1);
  mix-blend-mode: screen;
}

.sidebar .brand-wordmark {
  height: 18px;
  max-width: 96px;
  margin-bottom: 2px;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--brand-yellow);
  background: #111;
  color: var(--brand-yellow);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
}

.brand-word {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 26px;
  color: #fff;
}

.brand-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-yellow);
}

.login-hero__copy {
  position: relative;
  z-index: 1;
}

.login-hero__copy h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  max-width: 11ch;
}

.login-hero__copy p {
  margin: 0;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.55;
}

.login-hero__meta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(252, 227, 0, 0.22);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.chip img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: var(--login-panel-bg);
  position: relative;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  border-color: var(--orange);
  color: var(--ink);
}

.theme-toggle__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-yellow);
  box-shadow: inset -4px -2px 0 0 var(--surface);
}

html[data-theme="dark"] .theme-toggle__icon {
  box-shadow: none;
  background: radial-gradient(circle at 30% 30%, #fff9c4 0 35%, transparent 36%),
    radial-gradient(circle at 70% 40%, #ffe86a 0 12%, transparent 13%),
    var(--brand-yellow);
}

.login-panel .theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
}

.login-card h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 26px;
}

.login-card .subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field select,
.control {
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  padding: 0 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input:focus,
.field select:focus,
.control:focus {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 12px;
}

.role-tabs label {
  position: relative;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.role-tabs input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-tabs input:checked + span {
  display: block;
  background: var(--input-bg);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  border-radius: 10px;
  padding: 10px 8px;
  border: 1px solid var(--line);
}

.role-tabs span {
  display: block;
  padding: 10px 8px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 11px;
  height: 46px;
  padding: 0 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--brand-yellow);
  color: var(--on-brand);
  width: auto;
  min-width: 88px;
  padding: 0 20px;
}

.btn--primary:hover {
  background: var(--brand-yellow-deep);
}

.login-card .btn--primary {
  width: 100%;
}

.btn--compact {
  height: 40px;
  min-width: 88px;
  padding: 0 18px;
  width: auto !important;
  flex: 0 0 auto;
  align-self: flex-end;
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: var(--surface-2);
}

.btn--danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f2c7c7;
}

.btn--danger:hover {
  background: #fadada;
}

.btn--solid-dark {
  background: var(--ink);
  color: #fff;
}

.login-card__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.login-card__brand .brand-logo {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.login-footnote {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.clock-inline {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* ========== APP SHELL ========== */

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app--shell {
  grid-template-columns: 248px 1fr;
  grid-template-rows: auto 1fr auto;
}

.sidebar {
  grid-row: 1 / -1;
  grid-column: 1;
  background: #0b0d11;
  color: #d7dbe3;
  border-right: 1px solid rgba(252, 227, 0, 0.12);
  padding: 18px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

html[data-theme="light"] .sidebar {
  background: #111318;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__brand strong {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  color: #fff;
}

.sidebar__brand span {
  display: block;
  font-size: 11px;
  color: var(--brand-yellow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-link,
.nav-group__label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #c5cad3;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-link:hover,
.nav-group__label:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-link.is-active {
  background: var(--brand-yellow);
  color: #0a0a0a;
}

.nav-group__label {
  justify-content: space-between;
  cursor: pointer;
}

.nav-group__label span:last-child {
  font-size: 10px;
  color: #8b93a3;
}

.nav-sub {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 8px 12px;
}

.nav-group.is-open .nav-sub {
  display: flex;
}

.nav-sub a {
  padding: 8px 12px;
  border-radius: 8px;
  color: #9aa3b2;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.nav-sub a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-sub a.is-active {
  color: #0a0a0a;
  background: var(--brand-yellow);
}

.sidebar__foot {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app--shell .topbar {
  grid-column: 2;
}

.app--shell .content {
  grid-column: 2;
}

.app--shell .actionbar {
  grid-column: 2;
}

.btn--tiny {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  min-width: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 26px;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.placeholder-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar--wordmark {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar--wordmark .topbar__brand {
  justify-self: start;
  margin-right: auto;
}

.topbar--wordmark .topbar__right {
  justify-self: end;
}

.brand-wordmark--lg {
  height: 36px;
  max-width: 220px;
}

.block-save-end {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__brand .brand-logo {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .topbar__brand .brand-logo {
  border-color: rgba(252, 227, 0, 0.35);
}

.topbar__titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar__titles strong {
  font-family: var(--display);
  font-size: 15px;
}

.topbar__titles span {
  font-size: 12px;
  color: var(--muted);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.user-menu {
  position: relative;
}

.user-menu__btn {
  appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding-right: 28px;
  position: relative;
}

.user-menu__btn::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
}

.user-menu.is-open .user-menu__btn {
  border-color: var(--brand-yellow);
}

.user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.user-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.user-menu__item:hover {
  background: var(--surface-2);
}

.user-menu__item .theme-toggle__icon {
  flex: 0 0 16px;
}

.user-menu__item--danger {
  color: var(--danger);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-yellow);
  color: var(--on-brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-meta strong {
  font-size: 13px;
}

.user-meta span {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

.content {
  width: min(1180px, calc(100% - 40px));
  margin: 22px auto 40px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 28px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.badge--ok {
  background: var(--green-soft);
  border-color: #b7e0c8;
  color: var(--green);
}

.badge--warn {
  background: var(--orange-soft);
  border-color: #efe28a;
  color: #6b5c00;
}

html[data-theme="dark"] .badge--warn {
  border-color: #5a5018;
  color: var(--brand-yellow);
}

.search-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.search-card input {
  height: 46px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  padding: 0 14px 0 42px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E")
    14px center / 18px no-repeat,
    var(--surface-2);
}

.search-card input:focus {
  outline: none;
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background-color: var(--input-bg);
}

.layout {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 16px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--card-head-bg);
}

.card__head h2 {
  margin: 0;
  font-size: 16px;
  font-family: var(--display);
}

.card__head span {
  font-size: 12px;
  color: var(--muted);
}

.card__body {
  padding: 18px;
}

.block-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: end;
  margin-top: 12px;
}

.block-save-row--docs {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.block-save-row .doc-slot {
  margin: 0;
}

.block-save-row__btn,
#btnSavePersonal,
#btnSaveTaxiDocs {
  min-width: 88px;
  height: 40px;
  padding: 0 20px;
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .block-save-row,
  .block-save-row--docs {
    grid-template-columns: 1fr;
  }
  .block-save-row__btn {
    justify-self: end;
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 14px;
}

.address-numbers {
  display: grid;
  grid-template-columns: 140px 150px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: end;
  margin: 12px 0;
}

.address-numbers .doc-slot {
  margin: 0;
  min-height: 42px;
  height: 42px;
  padding: 0 8px;
  align-self: end;
  box-sizing: border-box;
}

.address-numbers .doc-icon {
  width: 32px;
  height: 32px;
}

.address-numbers .doc-slot .doc-preview {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.address-numbers .doc-slot__meta strong {
  font-size: 12px;
}

.address-numbers .doc-slot__meta span {
  display: none;
}

.span-2 {
  grid-column: span 2;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-block label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field-block input,
.field-block select {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  padding: 0 12px;
  color: var(--ink);
}

.field-block input:focus,
.field-block select:focus {
  outline: none;
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.content--dvr {
  padding-bottom: 24px;
  max-width: 860px;
}

.dvr-section {
  margin-bottom: 18px;
}

.phone-combo {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 8px;
}

.phone-combo select,
.phone-combo input {
  min-width: 0;
  width: 100%;
}

.phone-combo select {
  font-size: 13px;
  padding: 0 8px;
}

.field-block--sm {
  max-width: 180px;
}

.face-capture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
}

.face-capture__frame {
  width: 220px;
  height: 220px;
  padding: 0;
  border: 2px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.face-capture__frame:hover {
  border-color: var(--brand-yellow);
}

.face-capture.is-filled .face-capture__frame {
  border-style: solid;
  border-color: var(--brand-yellow);
}

.face-capture__preview,
.face-capture__frame .doc-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  flex: none;
  background: transparent;
}

.face-capture__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  pointer-events: none;
  padding: 16px;
  text-align: center;
}

.face-capture__placeholder svg {
  width: 42px;
  height: 42px;
}

.face-capture__placeholder strong {
  font-size: 14px;
  color: var(--ink);
}

.face-capture__placeholder span {
  font-size: 12px;
}

.face-capture.is-filled .face-capture__placeholder {
  display: none;
}

.face-capture__tools {
  display: flex;
  gap: 6px;
}

#btnSaveFacePhoto {
  min-width: 88px;
  height: 40px;
  padding: 0 20px;
}

.webcam-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.webcam-modal:not(.is-open),
.webcam-modal[hidden] {
  display: none !important;
}

.webcam-modal.is-open {
  display: flex !important;
}

.webcam-modal__panel {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.webcam-modal__panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.webcam-modal video,
.webcam-modal__shot {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}

.webcam-modal video {
  transform: scaleX(-1);
}

.webcam-modal__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.webcam-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.field-with-doc {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.field-with-doc > input,
.field-with-doc > select {
  flex: 1 1 auto;
  min-width: 0;
}

.doc-preview {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  overflow: hidden;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.doc-icons {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.doc-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.doc-icon:hover {
  border-color: var(--brand-yellow);
  color: var(--ink);
  background: var(--input-bg);
}

.doc-icon svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.doc-icon--erase {
  display: none;
  color: var(--danger);
}

[data-slot].is-filled .doc-icon--erase,
.field-block.is-filled .doc-icon--erase,
.doc-slot.is-filled .doc-icon--erase {
  display: inline-flex;
}

[data-slot].is-filled .doc-icon--upload,
.field-block.is-filled .doc-icon--upload {
  border-color: #2f9d63;
  color: #1b7f4c;
}

.doc-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.doc-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}

.doc-slot.is-filled {
  border-style: solid;
  border-color: #2f9d63;
}

.doc-slot .doc-preview {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.doc-slot__meta {
  flex: 1;
  min-width: 0;
}

.doc-slot__meta strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.doc-slot__meta span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 860px) {
  .doc-slots {
    grid-template-columns: 1fr;
  }
}

.dvr-subhead {
  margin: 22px 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.dvr-subhead:first-child {
  margin-top: 0;
}

.field-help {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.nested-card {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.is-hidden,
[hidden] {
  display: none !important;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 168px minmax(140px, 1fr);
  gap: 12px 14px;
  margin-top: 0;
}

.field-block--code select {
  font-size: 13px;
  padding: 0 8px;
}

.driver-class-card {
  margin: 8px 0 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.section-approve,
.section-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.section-approve .btn,
.section-actions .btn,
.section-actions .btn--primary,
[data-save-section] {
  width: auto !important;
  min-width: 88px;
  height: 40px;
  padding: 0 20px;
  flex: 0 0 auto;
}

[data-save-section] {
  max-width: 140px;
}

#btnActivate {
  min-width: 158px;
  max-width: none;
}

.review-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.review-overlay:not(.is-open),
.review-overlay[hidden] {
  display: none !important;
}

.review-overlay.is-open {
  display: flex !important;
}

.review-panel {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
}

.review-panel__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.review-panel__brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  flex: 0 0 40px;
}

.review-panel__kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.review-panel__kicker-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--ink-soft);
}

.review-panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.review-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: 0 0 18px;
}

.review-list li.is-run .review-dot {
  border-color: var(--brand-yellow);
  animation: review-pulse 0.8s ease infinite;
}

.review-list li.is-ok .review-dot {
  border-color: #2f9d63;
  background: #2f9d63;
}

.review-list li.is-fail .review-dot {
  border-color: var(--danger);
  background: var(--danger);
}

@keyframes review-pulse {
  50% { box-shadow: 0 0 0 6px rgba(252, 227, 0, 0.18); }
}

.review-message {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

.review-panel.is-ok .review-message {
  color: #1b7f4c;
}

.review-panel.is-fail .review-message {
  color: var(--danger);
}

.review-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.section-approve__status {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.section-approve__status.is-ok {
  color: #2f9d63;
}

@media (max-width: 860px) {
  .contact-row,
  .phone-combo,
  .address-numbers {
    grid-template-columns: 1fr;
  }

  .address-numbers .doc-slot {
    height: auto;
  }

  .field-block--sm {
    max-width: none;
  }
}

.segmented--choice {
  max-width: 340px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 10px;
}

.segmented--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  text-align: center;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.segmented input:checked + span {
  background: var(--input-bg);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.upload-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-tile {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}

.upload-tile.is-filled {
  border-style: solid;
  border-color: #b7e0c8;
  background: var(--green-soft);
}

.upload-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, transparent 46%, var(--line-strong) 46%, var(--line-strong) 54%, transparent 54%),
    linear-gradient(45deg, transparent 46%, var(--line-strong) 46%, var(--line-strong) 54%, transparent 54%),
    var(--input-bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.upload-copy span {
  font-size: 12px;
  color: var(--muted);
}

.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-actions .btn {
  height: 34px;
  min-width: 84px;
  font-size: 12px;
  border-radius: 8px;
  padding: 0 10px;
}

.section-spacer {
  margin-top: 16px;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}

.feature-chip input {
  accent-color: var(--brand-yellow);
}

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 28px;
  background: var(--actionbar-bg);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .btn--ghost {
  background: var(--surface-2);
}

html[data-theme="dark"] .btn--solid-dark {
  background: #2b3340;
  color: var(--ink);
}

html[data-theme="dark"] .search-card input {
  background-color: var(--input-bg);
  color: var(--ink);
}

html[data-theme="dark"] .login-hero {
  background:
    radial-gradient(circle at 18% 18%, rgba(252, 227, 0, 0.22), transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(252, 227, 0, 0.06), transparent 35%),
    linear-gradient(155deg, #000000 0%, #121212 55%, #070707 100%);
}

.actionbar__left,
.actionbar__right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.actionbar .btn {
  min-width: 120px;
  width: auto;
}

.hint-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--orange-soft);
  border: 1px solid #efe28a;
  color: #6b5c00;
  font-size: 12px;
  line-height: 1.45;
}

html[data-theme="dark"] .hint-banner {
  border-color: #5a5018;
  color: #ffe86a;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .app--shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    min-height: 0;
    grid-row: auto;
  }

  .app--shell .topbar,
  .app--shell .content,
  .app--shell .actionbar {
    grid-column: 1;
  }

  .login-page,
  .layout,
  .grid-2,
  .grid-3,
  .address-numbers {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .login-hero {
    min-height: 280px;
    padding: 32px 24px;
  }

  .content {
    width: calc(100% - 24px);
  }

  .page-header,
  .topbar,
  .actionbar,
  .search-card {
    flex-direction: column;
    align-items: stretch;
  }

  .actionbar {
    padding: 12px 16px;
  }

  .actionbar__left,
  .actionbar__right {
    width: 100%;
  }

  .actionbar .btn {
    flex: 1;
  }
}

/* ========== PIPUL NOTICE BANNER ========== */

.pipul-notice-host {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(440px, calc(100% - 24px));
  pointer-events: none;
}

.pipul-notice {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 5px 40px 1fr auto;
  gap: 0 12px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  position: relative;
  animation: pipul-notice-in 0.28s ease;
}

.pipul-notice__accent {
  grid-row: 1 / span 2;
  align-self: stretch;
  background: var(--brand-yellow);
}

.pipul-notice--success .pipul-notice__accent {
  background: var(--green);
}

.pipul-notice--error .pipul-notice__accent {
  background: var(--danger);
}

.pipul-notice__logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-top: 14px;
  object-fit: cover;
  background: #000;
}

.pipul-notice__body {
  padding: 14px 0 16px;
  min-width: 0;
}

.pipul-notice__title {
  margin: 0 0 3px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: #8a7a00;
}

.pipul-notice--success .pipul-notice__title {
  color: var(--green);
}

.pipul-notice--error .pipul-notice__title {
  color: var(--danger);
}

html[data-theme="dark"] .pipul-notice__title {
  color: var(--brand-yellow);
}

html[data-theme="dark"] .pipul-notice--success .pipul-notice__title {
  color: var(--green);
}

html[data-theme="dark"] .pipul-notice--error .pipul-notice__title {
  color: var(--danger);
}

.pipul-notice__message {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
}

.pipul-notice__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  margin: 8px 6px 0 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pipul-notice__close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.pipul-notice__progress {
  position: absolute;
  left: 5px;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--brand-yellow);
  transform-origin: left center;
  animation: pipul-notice-progress linear forwards;
}

.pipul-notice--success .pipul-notice__progress {
  background: var(--green);
}

.pipul-notice--error .pipul-notice__progress {
  background: var(--danger);
}

.pipul-notice.is-leaving {
  animation: pipul-notice-out 0.22s ease forwards;
}

@keyframes pipul-notice-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pipul-notice-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes pipul-notice-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.badge--danger {
  background: var(--danger-soft);
  border-color: #f3b4b4;
  color: var(--danger);
}

.data-table a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.data-table a:hover {
  color: var(--brand-yellow-deep);
  text-decoration: underline;
}

html[data-theme="dark"] .data-table a:hover {
  color: var(--brand-yellow);
}

.support-agent {
  font-weight: 600;
  font-size: 13px;
}

.support-agent.is-empty {
  font-weight: 500;
  color: var(--muted);
}

.contact-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-actions__btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.contact-actions__btn svg {
  width: 16px;
  height: 16px;
}

.data-table .contact-actions__btn:hover {
  color: var(--brand-yellow-deep);
  border-color: var(--brand-yellow);
  text-decoration: none;
  background: var(--surface-3);
}

html[data-theme="dark"] .data-table .contact-actions__btn:hover {
  color: var(--brand-yellow);
}

.contact-actions__btn[data-kind="whatsapp"]:hover {
  color: #25d366;
  border-color: #25d366;
}

.contact-actions__btn[data-kind="delete"] {
  color: var(--danger);
}

.contact-actions__btn[data-kind="delete"]:hover,
html[data-theme="dark"] .data-table .contact-actions__btn[data-kind="delete"]:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.contact-actions__btn.is-off {
  opacity: 0.38;
  cursor: not-allowed;
}
  font-weight: 400;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.chip-filter {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
}

.chip-filter.is-active {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--on-brand);
}

.fact-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fact-board.is-single {
  grid-template-columns: 1fr;
}

.fact-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  min-width: 0;
}

.fact-group__title {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--brand-yellow);
}

.fact-group--identity .fact-group__title { border-left-color: var(--brand-yellow); }
.fact-group--contact .fact-group__title { border-left-color: #5b8def; }
.fact-group--ids .fact-group__title { border-left-color: #f0a202; }
.fact-group--address .fact-group__title { border-left-color: #3dd68c; }
.fact-group--company .fact-group__title { border-left-color: #b388ff; }
.fact-group--license .fact-group__title { border-left-color: #46c2c2; }
.fact-group--ownership .fact-group__title { border-left-color: #5b8def; }
.fact-group--permit .fact-group__title { border-left-color: #f0a202; }
.fact-group--specs .fact-group__title { border-left-color: var(--brand-yellow); }
.fact-group--features .fact-group__title { border-left-color: #46c2c2; }
.fact-group--mechanical .fact-group__title { border-left-color: #b388ff; }
.fact-group--payout .fact-group__title { border-left-color: #3dd68c; }

.fact-rows {
  display: flex;
  flex-direction: column;
}

.fact-row {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.fact-row:last-child {
  border-bottom: 0;
}

.fact-row:nth-child(even) {
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}

.fact-row dt {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
}

.fact-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.35;
}

.fact-row.is-empty dd {
  font-weight: 500;
  color: var(--muted);
  opacity: 0.7;
}

.fact-row.is-missing {
  background: var(--danger-soft);
}

.fact-row.is-missing dt,
.fact-row.is-missing dd {
  color: var(--danger);
}

.fact-row.is-missing dd {
  font-weight: 700;
}

@media (max-width: 900px) {
  .fact-board {
    grid-template-columns: 1fr;
  }

  .fact-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.kv dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.kv dd {
  margin: 4px 0 0;
  font-size: 14px;
  word-break: break-word;
}

.kv--missing dt,
.kv--missing dd {
  color: var(--danger);
}

.kv--missing dd {
  font-weight: 700;
}

.docs-count.is-short {
  color: var(--danger);
  font-weight: 700;
}

.contact-actions__btn.is-alert {
  color: var(--danger);
  border-color: var(--danger);
}

html[data-theme="dark"] .data-table .contact-actions__btn.is-alert:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.doc-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-card.is-missing {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.doc-card.is-missing strong,
.doc-card.is-missing .doc-flag {
  color: var(--danger);
}

.doc-flag {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.doc-thumb {
  position: relative;
  height: 168px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-3);
  display: grid;
  place-items: center;
}

.doc-thumb img,
.doc-thumb__img {
  width: 100%;
  height: 100%;
  max-height: 168px;
  object-fit: contain;
  image-orientation: from-image;
  transform-origin: center center;
}

.doc-thumb__img.is-rot-90 {
  transform: rotate(90deg) scale(0.72);
}
.doc-thumb__img.is-rot-180 {
  transform: rotate(180deg);
}
.doc-thumb__img.is-rot-270 {
  transform: rotate(270deg) scale(0.72);
}

.doc-rotate {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #111;
  background: #f5c518;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.doc-rotate:hover {
  filter: brightness(1.05);
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
}

.image-viewer.is-open {
  display: block;
}

.image-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.image-viewer__stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 24px;
  box-sizing: border-box;
}

.image-viewer__img {
  max-width: min(92vw, 1100px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  transform-origin: center center;
}

.image-viewer__img.is-rot-90 {
  transform: rotate(90deg);
  max-width: calc(100vh - 120px);
  max-height: min(92vw, 1100px);
}

.image-viewer__img.is-rot-180 {
  transform: rotate(180deg);
}

.image-viewer__img.is-rot-270 {
  transform: rotate(270deg);
  max-width: calc(100vh - 120px);
  max-height: min(92vw, 1100px);
}

.image-viewer__bar {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.image-viewer__rotate,
.image-viewer__close {
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.image-viewer__rotate {
  color: #111;
  background: #fce300;
}

.image-viewer__close {
  color: #fff;
  background: #333;
}

.doc-empty {
  font-size: 12px;
  color: var(--muted);
}

.doc-restricted {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  background: var(--surface-2, #f3f4f6);
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.doc-meta {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.doc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-issues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.review-issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

.review-issue__link {
  color: var(--danger);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.35;
}

.review-issue__link:hover {
  color: var(--danger);
  opacity: 0.86;
}

.review-issue .btn {
  flex: 0 0 auto;
  width: auto;
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
}

.fact-row,
.doc-card,
.fact-group,
.detail-footer {
  scroll-margin-top: 88px;
}

.fact-row {
  grid-template-columns: 42% minmax(0, 1fr) auto;
}

.fact-edit {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  width: auto;
  min-width: 0;
  align-self: center;
}

.fact-edit--add {
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
}

.fact-row.is-target,
.doc-card.is-target,
.fact-group.is-target,
.detail-footer.is-target {
  outline: 2px solid var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.field-editor {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.field-editor.is-open {
  display: flex;
}

.reminder-modal__card {
  width: min(640px, 100%);
  max-height: 92vh;
  overflow: auto;
}

.reminder-modal__frame {
  width: 100%;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin: 0 0 16px;
}

.contact-actions__btn[data-kind="remind"]:hover {
  color: #0c0c0c;
  background: #fce300;
  border-color: #fce300;
}

.field-editor__card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.field-editor__card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.field-editor__hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.field-editor__fields {
  display: grid;
  gap: 12px;
}

.field-editor__fields label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.field-editor__fields input,
.field-editor__fields select {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.field-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .fact-row {
    grid-template-columns: 1fr auto;
  }

  .fact-row dt {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .kv-grid,
  .doc-grid {
    grid-template-columns: 1fr;
  }
}

