[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --sidebar: #0e2a47;
  --sidebar-soft: #173a5d;
  --primary: #1f5f9b;
  --primary-dark: #174a79;
  --text: #152236;
  --muted: #66768b;
  --border: #dce5ef;
  --success: #e7f8ee;
  --success-text: #1c7f49;
  --error: #fdeaea;
  --error-text: #a12d2d;
  --info: #e8f1fb;
  --info-text: #1d5fa0;
  --shadow: 0 14px 32px rgba(17, 37, 62, 0.08);
  --radius: 18px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p {
  margin-top: 0;
}

.auth-body {
  background:
    linear-gradient(135deg, rgba(14, 42, 71, 0.95), rgba(31, 95, 155, 0.88)),
    var(--bg);
}

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

.auth-card {
  width: min(100%, 520px);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 28px;
  box-shadow: 0 20px 48px rgba(6, 19, 32, 0.2);
  padding: 36px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-brand h1 {
  margin-bottom: 8px;
  font-size: 28px;
}

.auth-brand p,
.auth-hint,
.topbar p,
.panel-header p,
.step-card p,
.table-subtext,
.sidebar-footer span,
.sidebar-footer .muted-label,
.metric-card span {
  color: var(--muted);
}

.auth-hint {
  margin-top: 18px;
  font-size: 14px;
}


.auth-card--portal {
  max-width: 560px;
}

.auth-portal-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.auth-portal-switch__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f4f8fc;
  color: var(--text);
  font-weight: 700;
  padding: 10px 14px;
}

.auth-portal-switch__item.is-active {
  background: linear-gradient(135deg, var(--sidebar), var(--primary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.auth-portal-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fbff;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.auth-portal-panel strong {
  display: block;
  margin-bottom: 6px;
}

.auth-portal-panel p {
  margin: 0;
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), #0a223a);
  color: #fff;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  margin-top: 4px;
}

.menu {
  display: grid;
  gap: 10px;
}

.menu-item {
  display: block;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.92);
  transition: 0.2s ease;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  padding: 28px 32px 12px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.topbar h1 {
  margin-bottom: 6px;
  font-size: 28px;
}

.content {
  padding: 0 32px 32px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.two-col-hero {
  grid-template-columns: 1.2fr 0.8fr;
}

.cards-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.text-danger {
  color: #b91c1c;
  font-weight: 600;
}

.metric-card,
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-card strong {
  font-size: 34px;
  line-height: 1;
}

.panel {
  padding: 22px;
  margin-bottom: 20px;
}

.compact-panel {
  margin-bottom: 0;
}

.panel-soft {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
  border: 1px solid var(--border);
}


.accent-panel {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.step-list,
.summary-kpis,
.details-grid {
  display: grid;
  gap: 14px;
}

.step-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fbfdff;
}

.summary-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-kpis div,
.details-grid div {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.summary-kpis span,
.details-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.summary-kpis strong,
.details-grid strong {
  font-size: 24px;
}

.details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.note-box {
  margin-top: 14px;
  border-radius: 16px;
  background: #f7fafc;
  border: 1px solid var(--border);
  padding: 16px;
}

.note-box p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid.one-col {
  grid-template-columns: 1fr;
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-group-full {
  grid-column: 1 / -1;
}

label {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(31, 95, 155, 0.08);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-group input {
  width: auto;
}

.form-actions,
.filter-actions,
.topbar-actions,
.actions-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-delete-form {
  display: inline-flex;
  margin: 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

.table th,
.table td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.table thead th {
  background: #f5f9fd;
  color: #1d3557;
  font-size: 14px;
}

.table tbody tr:hover td {
  background: #fbfdff;
}

.table-small th,
.table-small td {
  padding: 12px;
  font-size: 14px;
}

.report-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 11px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

.btn-sm {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(0.97);
}

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

.alert {
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: opacity 0.4s ease;
}

.alert-success {
  background: var(--success);
  color: var(--success-text);
}

.alert-error {
  background: var(--error);
  color: var(--error-text);
}

.alert-info {
  background: var(--info);
  color: var(--info-text);
}

.fade-out {
  opacity: 0.98;
}

@media (max-width: 1200px) {
  .cards-grid,
  .step-list,
  .report-duo,
  .details-grid,
  .summary-kpis,
  .two-col-hero {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 16px;
  }

  .content,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cards-grid,
  .step-list,
  .report-duo,
  .details-grid,
  .summary-kpis,
  .form-grid,
  .filter-bar,
  .two-col-hero {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .topbar {
    flex-direction: column;
  }
}


.inline-beneficiaries-table input,
.inline-beneficiaries-table select {
  min-width: 120px;
}

.inline-beneficiaries-table input[type="text"] {
  min-width: 170px;
}

.check-cell {
  text-align: center;
}

.check-cell input {
  width: auto;
}

.inline-beneficiaries-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.inline-beneficiaries-table .row-index {
  color: var(--muted);
  font-weight: 700;
  width: 40px;
}

.inline-beneficiaries-table tbody tr.is-marked-delete {
  display: none;
}


.btn-danger {
  background: #fff3f3;
  color: var(--error-text);
  border-color: #f1c2c2;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.compact-filters {
  margin-bottom: 18px;
}

.compact-actions {
  align-self: end;
}

.centered-cell {
  text-align: center !important;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.compact-photo-grid {
  margin-top: 16px;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #edf3f9;
}

.photo-card span,
.photo-card small {
  display: block;
}

.photo-card-link:hover {
  box-shadow: var(--shadow);
}


.connection-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
}

.connection-badge.is-online {
  background: #e7f8ee;
  color: #166534;
  border-color: #b7e4c7;
}

.connection-badge.is-offline {
  background: #fff4e5;
  color: #9a3412;
  border-color: #fed7aa;
}

.auth-actions {
  margin-top: 16px;
}

.brand-mark-image {
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.brand-mark-image img {
  display: block;
  width: 100%;
  height: 100%;
}


.inline-form {
  display: inline-flex;
  margin: 0;
}

.inline-form .btn {
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 960px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}


.draft-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border: 1px dashed #94a3b8;
    border-radius: 14px;
    background: #f8fafc;
    flex-wrap: wrap;
}

.draft-toolbar__status {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: #334155;
}

.draft-toolbar__status strong {
    font-size: 0.95rem;
}

.draft-toolbar__status span,
.draft-toolbar__note {
    font-size: 0.86rem;
    color: #64748b;
}

.draft-toolbar__actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.55rem 0.8rem;
    font-size: 0.84rem;
}


.sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 700;
}

.sync-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}


.diagnostics-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 92;
}

.diagnostics-panel-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100vh;
  background: #fff;
  box-shadow: -24px 0 48px rgba(15, 23, 42, 0.18);
  z-index: 93;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.diagnostics-panel__header,
.diagnostics-panel__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.diagnostics-panel__header h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.diagnostics-panel__header p {
  margin: 0;
  color: var(--muted);
}

.diagnostics-panel__grid {
  overflow-y: auto;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.diagnostics-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.diagnostics-card__label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.diagnostics-card__value {
  font-weight: 700;
  word-break: break-word;
}

body.is-diagnostics-panel-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .diagnostics-panel-drawer {
    width: 100%;
    padding: 18px;
  }
}

.sync-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
}

.sync-panel-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100%);
  height: 100vh;
  background: #fff;
  box-shadow: -24px 0 48px rgba(15, 23, 42, 0.18);
  z-index: 91;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.sync-panel__header,
.sync-panel__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sync-panel__header h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.sync-panel__header p {
  margin: 0;
  color: var(--muted);
}

.sync-panel__actions {
  flex-wrap: wrap;
}

.sync-panel__list {
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.sync-panel__empty {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: #f8fbff;
}

.sync-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.sync-item.is-error {
  border-color: #f5c2c2;
  background: #fffafa;
}

.sync-item__top,
.sync-item__meta,
.sync-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-item__top {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.sync-item__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.sync-item__meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.sync-item__error {
  border-radius: 12px;
  padding: 10px 12px;
  background: #fdeaea;
  color: #912f2f;
  font-size: 13px;
  margin-bottom: 12px;
}

.sync-item__actions {
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.is-pending {
  background: #eef5fc;
  color: #1d5fa0;
}

.status-pill.is-error {
  background: #fdeaea;
  color: #a12d2d;
}

.status-pill.is-syncing {
  background: #eef7ee;
  color: #1c7f49;
}

@media (max-width: 860px) {
  .sync-panel-drawer {
    width: 100%;
    padding: 18px;
  }
}

body.is-sync-panel-open {
  overflow: hidden;
}


.update-banner,
.privacy-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: #fff8e6;
}

.update-banner strong,
.privacy-banner strong {
  display: block;
  margin-bottom: 4px;
}

.update-banner span,
.privacy-banner span {
  color: var(--muted);
  font-size: 14px;
}

.update-banner__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.privacy-banner {
  background: #eef5fc;
}

body.is-privacy-mode .content .panel,
body.is-privacy-mode .content .metric-card,
body.is-privacy-mode .content .data-table,
body.is-privacy-mode .content .details-grid,
body.is-privacy-mode .content .summary-kpis,
body.is-privacy-mode .content .cards-grid,
body.is-privacy-mode .content .step-card,
body.is-privacy-mode .content .alert,
body.is-privacy-mode .sync-panel-drawer,
body.is-privacy-mode .diagnostics-panel-drawer {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

body.is-privacy-mode .update-banner,
body.is-privacy-mode .privacy-banner,
body.is-privacy-mode .topbar,
body.is-privacy-mode .sidebar,
body.is-privacy-mode .draft-toolbar,
body.is-privacy-mode .auth-wrapper {
  filter: none;
  pointer-events: auto;
}

body.is-privacy-mode .content {
  position: relative;
}

body.is-privacy-mode .content::after {
  content: 'Modo privacidade ativo';
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.02em;
}


.btn.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
}

.form-actions.is-sticky-mobile {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.form-dirty-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
  font-size: 13px;
  font-weight: 700;
  margin-right: auto;
}

.mobile-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  display: none;
  align-items: stretch;
  gap: 8px;
  width: min(calc(100% - 24px), 760px);
  padding: 10px;
  border: 1px solid rgba(220, 229, 239, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.mobile-bottom-nav__item {
  flex: 1;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  cursor: pointer;
}

.mobile-bottom-nav__item.is-active {
  background: #eef5fc;
  color: var(--primary-dark);
}

.scroll-top-button {
  position: fixed;
  right: 18px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 71;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.scroll-top-button.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 0 16px 104px;
  }

  .topbar {
    padding: 20px 16px 12px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .sync-panel-drawer {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 861px) {
  .form-actions.is-sticky-mobile {
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
}


.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 120;
  padding: 12px 16px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #93c5fd;
}

.accessibility-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: #eefcf6;
}

.accessibility-banner strong {
  display: block;
  margin-bottom: 4px;
}

.accessibility-banner span {
  color: var(--muted);
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.is-accessibility-mode {
  font-size: 18px;
  line-height: 1.6;
}

body.is-accessibility-mode .topbar h1 {
  font-size: 32px;
}

body.is-accessibility-mode .btn,
body.is-accessibility-mode input,
body.is-accessibility-mode select,
body.is-accessibility-mode textarea,
body.is-accessibility-mode .menu-item,
body.is-accessibility-mode .mobile-bottom-nav__item,
body.is-accessibility-mode .sync-item__actions .btn {
  min-height: 48px;
}

body.is-accessibility-mode .btn,
body.is-accessibility-mode input,
body.is-accessibility-mode select,
body.is-accessibility-mode textarea {
  font-size: 16px;
}

body.is-accessibility-mode .panel,
body.is-accessibility-mode .metric-card,
body.is-accessibility-mode .auth-card {
  box-shadow: 0 0 0 2px rgba(31, 95, 155, 0.1), var(--shadow);
}

body.is-accessibility-mode .topbar,
body.is-accessibility-mode .content,
body.is-accessibility-mode .sidebar {
  letter-spacing: 0.01em;
}

body.is-accessibility-mode .data-table th,
body.is-accessibility-mode .data-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

body.is-accessibility-mode .cards-grid,
body.is-accessibility-mode .form-grid,
body.is-accessibility-mode .details-grid {
  gap: 22px;
}

body.is-accessibility-mode *:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


.sidebar-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-close,
.sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 79;
}

.topbar-leading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.topbar-leading > div {
  min-width: 0;
}

.device-ios .topbar,
.device-ios .content,
.device-ios .mobile-bottom-nav {
  padding-top: max(env(safe-area-inset-top), 0px);
}

@media (max-width: 860px) {
  .sidebar-toggle,
  .sidebar-close {
    display: inline-flex;
  }

  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 340px);
    height: 100vh;
    z-index: 80;
    transform: translateX(-108%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  }

  body.is-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(244, 247, 251, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(220, 229, 239, 0.9);
  }

  .topbar-leading {
    width: 100%;
    align-items: center;
  }

  .topbar-leading h1 {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .topbar-leading p {
    font-size: 13px;
    margin-bottom: 0;
  }

  .topbar-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-right: -2px;
    scrollbar-width: thin;
  }

  .topbar-actions .btn,
  .topbar-actions .inline-form {
    flex: 0 0 auto;
  }

  .panel,
  .metric-card,
  .auth-card {
    border-radius: 16px;
    padding: 16px;
  }

  .content {
    padding: 0 14px 112px;
  }

  .cards-grid,
  .details-grid,
  .summary-kpis,
  .step-list,
  .report-duo,
  .form-grid,
  .filter-bar,
  .two-col-hero {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .form-actions,
  .filter-actions,
  .actions-inline,
  .inline-beneficiaries-actions {
    align-items: stretch;
  }

  .form-actions .btn,
  .filter-actions .btn,
  .actions-inline .btn,
  .inline-beneficiaries-actions .btn {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  .table.table-responsive-cards,
  .table.table-responsive-cards thead,
  .table.table-responsive-cards tbody,
  .table.table-responsive-cards th,
  .table.table-responsive-cards td,
  .table.table-responsive-cards tr {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table.table-responsive-cards thead {
    display: none;
  }

  .table.table-responsive-cards tbody {
    display: grid;
    gap: 12px;
  }

  .table.table-responsive-cards tbody tr {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
    padding: 10px 12px;
  }

  .table.table-responsive-cards td {
    border-bottom: 1px solid #edf2f7;
    padding: 10px 0;
    text-align: left !important;
  }

  .table.table-responsive-cards td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .table.table-responsive-cards td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .table.table-responsive-cards td .btn,
  .table.table-responsive-cards td .inline-form,
  .table.table-responsive-cards td .actions-inline {
    width: 100%;
  }

  .table.table-responsive-cards td .actions-inline {
    display: grid;
  }

  .table.table-responsive-cards .centered-cell {
    text-align: left !important;
  }

  .inline-beneficiaries-table input,
  .inline-beneficiaries-table select {
    min-width: 0;
  }

  .mobile-bottom-nav {
    width: calc(100% - 16px);
    left: 8px;
    right: 8px;
    transform: none;
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 8px;
    gap: 6px;
  }

  .mobile-bottom-nav__item {
    min-height: 52px;
    border-radius: 14px;
    font-size: 12px;
    padding: 8px 6px;
  }

  .scroll-top-button {
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
  }

  body.is-app-shell-mobile {
    background:
      radial-gradient(circle at top, rgba(31, 95, 155, 0.18), transparent 36%),
      linear-gradient(180deg, #edf4fb 0%, #f7f9fc 100%);
  }

  body.is-app-shell-mobile .app-shell,
  body.is-app-shell-mobile .offline-shell {
    min-height: 100dvh;
  }

  body.is-app-shell-mobile .sidebar {
    border-top-right-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: 18px 0 34px rgba(15, 23, 42, 0.22);
  }

  body.is-app-shell-mobile .topbar {
    top: 0;
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: 14px;
    background: linear-gradient(180deg, rgba(244, 248, 252, 0.98), rgba(244, 247, 251, 0.92));
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }

  body.is-app-shell-mobile .topbar-leading {
    align-items: flex-start;
  }

  body.is-app-shell-mobile .topbar-leading h1 {
    font-size: 23px;
    line-height: 1.15;
  }

  body.is-app-shell-mobile .topbar-leading p {
    max-width: 34ch;
    line-height: 1.35;
  }

  body.is-app-shell-mobile .topbar-actions {
    gap: 8px;
    margin-inline: -2px;
    padding-inline: 2px;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  body.is-app-shell-mobile .topbar-actions > * {
    scroll-snap-align: start;
  }

  body.is-app-shell-mobile .topbar-actions .btn,
  body.is-app-shell-mobile .topbar-actions .inline-form,
  body.is-app-shell-mobile .connection-badge,
  body.is-app-shell-mobile .sync-badge {
    min-height: 44px;
    border-radius: 15px;
  }

  body.is-app-shell-mobile .content {
    padding: 8px 12px 118px;
  }

  body.is-app-shell-mobile .panel,
  body.is-app-shell-mobile .metric-card {
    border-radius: 22px;
    border: 1px solid rgba(220, 229, 239, 0.9);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  }

  body.is-app-shell-mobile .panel-header {
    gap: 10px;
  }

  body.is-app-shell-mobile .alert {
    border-radius: 18px;
  }

  body.is-app-shell-mobile .mobile-bottom-nav {
    width: calc(100% - 14px);
    left: 7px;
    right: 7px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    border-radius: 28px;
    padding: 8px;
    gap: 6px;
    background: rgba(14, 42, 71, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 42px rgba(6, 19, 32, 0.28);
  }

  body.is-app-shell-mobile .mobile-bottom-nav__item {
    min-height: 54px;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    line-height: 1.2;
    padding: 8px 4px;
  }

  body.is-app-shell-mobile .mobile-bottom-nav__item span {
    display: block;
    max-width: 7ch;
  }

  body.is-app-shell-mobile .mobile-bottom-nav__item.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  body.is-app-shell-mobile .scroll-top-button {
    right: 12px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    width: 50px;
    height: 50px;
  }

  body.is-app-shell-mobile .sync-panel-drawer,
  body.is-app-shell-mobile .diagnostics-panel-drawer {
    width: 100%;
    right: 0;
    left: 0;
    max-width: none;
    max-height: min(86vh, 860px);
    top: auto;
    bottom: 0;
    border-top-left-radius: 26px;
    border-top-right-radius: 26px;
    border-left: 0;
    box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.18);
  }

  body.is-app-shell-mobile.auth-body {
    background:
      linear-gradient(180deg, rgba(14, 42, 71, 0.98), rgba(31, 95, 155, 0.92)),
      var(--bg);
  }

  body.is-app-shell-mobile .auth-wrapper {
    min-height: 100dvh;
    padding: 0;
    align-items: end;
  }

  body.is-app-shell-mobile .auth-card {
    width: 100%;
    min-height: min(82dvh, 840px);
    max-width: none;
    border-radius: 28px 28px 0 0;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
  }

  body.is-app-shell-mobile .auth-brand {
    align-items: flex-start;
    margin-bottom: 22px;
  }

  body.is-app-shell-mobile .auth-brand h1 {
    font-size: 26px;
  }

  body.is-app-shell-mobile .auth-portal-switch {
    gap: 8px;
  }

  body.is-app-shell-mobile .auth-portal-switch__item {
    min-height: 52px;
    border-radius: 16px;
    font-size: 14px;
    text-align: center;
  }

  body.is-app-shell-mobile .auth-portal-panel {
    border-radius: 20px;
    padding: 16px;
  }
}


.results-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination__status {
  color: var(--muted);
  font-size: 14px;
}

.btn.is-disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

.offline-center-page .content {
  padding-bottom: 2rem;
}

.offline-shell {
  min-height: 100vh;
}

.offline-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
}

.offline-center-grid {
  align-items: start;
}

.offline-item-list {
  display: grid;
  gap: 0.85rem;
}

.offline-item-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.offline-item-card__top,
.offline-item-card__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.offline-item-card__actions {
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.offline-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.offline-editor-grid .panel-nested {
  grid-column: 1 / -1;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.empty-state {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.75);
}

@media (max-width: 860px) {
  .offline-shell {
    display: block;
  }

  .offline-sidebar {
    position: static;
    min-height: auto;
  }

  .offline-center-grid,
  .offline-editor-grid {
    grid-template-columns: 1fr;
  }

  .offline-item-card__top,
  .offline-item-card__actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

.form-section-title {
  border: 1px solid var(--border);
  background: #f7fafc;
  border-radius: 16px;
  padding: 14px 16px;
}

.form-section-title h3 {
  margin: 0;
  font-size: 16px;
}

.form-section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.details-grid-compact {
  margin-top: 12px;
}
