:root {
  --bg: #e8eef3;
  --surface: #ffffff;
  --surface-2: #e2eaf0;
  --ink: #101820;
  --muted: #536171;
  --line: #c6d3de;
  --brand: #0a5f70;
  --brand-dark: #063d49;
  --accent: #c98910;
  --success: #0b6f44;
  --warning: #995900;
  --danger: #b42318;
  --neutral: #586575;
  --shadow: 0 12px 28px rgba(28, 43, 55, 0.13);
  --danger-soft: #ffe6e3;
  --warning-soft: #fff1d1;
  --success-soft: #dcf2e8;
  --radius: 8px;
}

/* Validación Fase 2: panel por procesos, post-it y vista gerencial. */
.process-section,
.process-detail-head,
.management-hero {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading,
.process-detail-head,
.management-hero {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.section-heading h2,
.process-detail-head h2,
.management-hero h2 {
  margin: 3px 0 5px;
}

.section-heading > p,
.process-detail-head p,
.management-hero p {
  color: var(--muted);
  margin: 0;
  max-width: 560px;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.process-card {
  background: linear-gradient(145deg, #ffffff, #f5fafc);
  border: 1px solid #dce8ec;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(19, 57, 73, 0.07);
  color: var(--ink);
  display: grid;
  gap: 4px;
  min-height: 156px;
  padding: 20px;
  position: relative;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.process-card::before {
  background: var(--brand);
  border-radius: 18px 18px 0 0;
  content: "";
  height: 5px;
  inset: 0 0 auto;
  position: absolute;
}

.process-card:hover,
.process-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 14px 32px rgba(19, 57, 73, 0.13);
  transform: translateY(-2px);
}

.process-card-label {
  font-size: 15px;
  font-weight: 800;
}

.process-card strong {
  color: var(--brand-dark);
  font-size: 42px;
  line-height: 1;
  margin-top: 8px;
}

.process-card-main {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.process-card-secondary {
  border-top: 1px solid #e4ecef;
  color: #4e6873;
  font-size: 13px;
  margin-top: 8px;
  padding-top: 10px;
}

.process-card-secondary b {
  color: var(--ink);
}

.process-card-emision_aprobacion::before { background: #8b5cf6; }
.process-card-cobranzas::before { background: #0f9f8f; }
.process-card-facturacion::before { background: #2563eb; }
.process-card-renovaciones::before { background: #d97706; }
.process-card-siniestros::before { background: #dc2626; }

.dashboard-demo-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr);
}

.postit-panel {
  min-width: 0;
}

.postit-panel-header {
  align-items: start;
}

.postit-filters {
  align-items: end;
  background: #f5f8fa;
  border: 1px solid #e2eaed;
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
}

.postit-filters label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
}

.postit-filters select {
  min-width: 150px;
}

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

.postit-card {
  background: #fff9cf;
  border: 1px solid #eadc8a;
  border-radius: 14px;
  box-shadow: 0 9px 22px rgba(99, 76, 16, 0.09);
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 18px;
  position: relative;
}

.postit-card-link {
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  width: 100%;
}

.postit-card-link:hover,
.postit-card-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 70, 80, 0.14);
  outline: 3px solid rgba(0, 117, 128, 0.18);
}

.global-postit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.postit-list-modal,
.postit-detail-modal,
.document-detail-modal {
  width: min(980px, calc(100vw - 40px));
  max-height: min(88vh, 900px);
  overflow: auto;
}

.global-postit-board {
  max-height: 58vh;
  overflow: auto;
  padding: 4px;
}

.postit-detail-description {
  margin: 18px 0;
  padding: 18px;
  border-radius: 14px;
  background: #f7fbfc;
  font-size: 1.05rem;
  line-height: 1.6;
}

.related-records {
  display: grid;
  gap: 9px;
  margin: 22px 0;
}

.related-records h3 {
  margin-bottom: 2px;
}

.related-link,
.postit-stack-link {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.related-link:hover,
.related-link:focus-visible,
.postit-stack-link:hover,
.postit-stack-link:focus-visible {
  border-color: var(--brand);
  background: #f3fbfc;
}

.client-postits-panel {
  margin-bottom: 20px;
}

.dashboard-demo-grid > :only-child {
  grid-column: 1 / -1;
}

.postit-card::after {
  background: rgba(255,255,255,0.55);
  content: "";
  height: 10px;
  left: 35%;
  position: absolute;
  top: -5px;
  transform: rotate(-1deg);
  width: 30%;
}

.postit-card.priority-alta {
  background: #fff0d5;
  border-color: #f1c36b;
}

.postit-card.priority-urgente {
  background: #ffe4e1;
  border-color: #ef9a91;
}

.postit-card.state-terminado {
  background: #e9f8ef;
  border-color: #9bd4ad;
}

.postit-card.state-anulado_inactivo {
  background: #eef1f2;
  border-color: #cbd4d8;
  opacity: 0.82;
}

.postit-topline,
.postit-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.postit-priority {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.postit-description {
  font-size: 16px;
  font-weight: 750;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

.postit-meta {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.postit-meta div {
  min-width: 0;
}

.postit-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.postit-meta dd {
  font-size: 13px;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.age-label {
  background: #e7f4ee;
  border-radius: 999px;
  color: #166534;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  padding: 5px 8px;
  white-space: nowrap;
}

.age-atencion {
  background: #fff1c2;
  color: #8a4b05;
}

.age-critico {
  background: #fee2e2;
  color: #991b1b;
}

.postit-history {
  border-top: 1px dashed rgba(56, 65, 68, 0.25);
  padding-top: 9px;
}

.postit-history summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.postit-history ol {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding-left: 18px;
}

.postit-history li span,
.postit-history li small {
  display: block;
  font-size: 11px;
}

.empty-inline {
  align-items: center;
  border: 1px dashed #b8c9cf;
  border-radius: 14px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 160px;
  padding: 20px;
  text-align: center;
}

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

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

.management-card {
  background: #fff;
  border: 1px solid #dce8ec;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(19, 57, 73, 0.06);
  display: grid;
  gap: 8px;
  min-height: 140px;
  padding: 20px;
}

.management-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.management-card strong {
  color: var(--brand-dark);
  font-size: 36px;
}

.management-card small {
  color: var(--muted);
}

.management-card.future {
  background: repeating-linear-gradient(135deg,#f7f9fa,#f7f9fa 10px,#eef3f5 10px,#eef3f5 20px);
}

.management-card.future strong {
  font-size: 24px;
}

.table-link {
  color: var(--brand-dark);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .process-grid,
  .management-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-demo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .section-heading,
  .process-detail-head,
  .management-hero {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .process-grid,
  .postit-board,
  .process-detail-grid,
  .management-grid {
    grid-template-columns: 1fr;
  }

  .process-card {
    min-height: 138px;
    padding: 17px;
  }

  .process-card strong {
    font-size: 36px;
  }

  .postit-filters {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .postit-filters select,
  .postit-panel-header .primary-button {
    width: 100%;
  }

  .postit-meta {
    grid-template-columns: 1fr;
  }

  .postit-actions .compact-button {
    flex: 1 1 130px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #dce7ee 0, var(--bg) 260px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

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

select,
textarea,
input {
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #09212b;
  color: #eef9fb;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark,
.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.brand small,
.stack-item small,
td small {
  display: block;
  color: var(--muted);
}

.brand small {
  color: #a8c4cc;
}

.main-nav {
  display: grid;
  gap: 6px;
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: #cfe2e7;
}

.main-nav a.active,
.main-nav a:hover {
  background: #163947;
  color: #fff;
}

.mobile-menu-button,
.mobile-menu-close,
.mobile-menu-backdrop,
.mobile-footer-nav {
  display: none;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-note span,
.eyebrow {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-note span {
  color: #a8c4cc;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(240px, auto) minmax(280px, 420px);
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.user-chip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  min-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.user-chip .avatar {
  grid-row: 1 / span 2;
}

.user-meta {
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.user-meta strong,
.user-meta small {
  display: block;
  line-height: 1.2;
}

.user-chip a {
  grid-column: 3;
  grid-row: 2;
  color: var(--brand);
  font-weight: 400;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.search {
  display: flex;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 12px 14px;
  outline: 0;
}

.search button,
.ghost-button,
.primary-button {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: var(--radius);
  background: var(--brand-dark);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: 400;
  white-space: nowrap;
}

.button-link {
  white-space: nowrap;
}

.metric-grid,
.content-grid,
.card-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric-grid article,
.metric-card,
.panel,
.profile-head,
.client-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-grid article {
  display: none;
}

.metric-card {
  display: grid;
  min-height: 126px;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border: 0;
  color: #fff;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(28, 43, 55, 0.18);
}

.metric-card-clientes {
  background: #0a5f70;
}

.metric-card-clientes:hover {
  background: #074858;
}

.metric-card-polizas {
  background: #0b6f61;
}

.metric-card-polizas:hover {
  background: #07564b;
}

.metric-card-siniestros {
  background: #b76408;
}

.metric-card-siniestros:hover {
  background: #934d04;
}

.metric-card-pendientes {
  background: #b42318;
}

.metric-card-pendientes:hover {
  background: #8f1c14;
}

.metric-grid span,
.metric-card span {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.metric-grid strong,
.metric-card strong {
  display: block;
  margin: 0;
  font-size: 48px;
  line-height: 1;
}

.metric-grid small,
.metric-card small {
  color: var(--muted);
}

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  margin-bottom: 16px;
}

.panel,
.empty-state {
  padding: 18px;
}

.form-panel {
  margin-bottom: 16px;
}

.panel-wide {
  min-width: 0;
}

.panel-header,
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.desktop-label {
  display: none;
}

.mobile-label {
  display: inline;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f2f6f9;
}

.filter-panel {
  margin: 16px 0 22px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-left: 5px solid var(--primary, #165dff);
  border-radius: 14px;
  background: #f8fafc;
}

.filter-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-heading-full {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-size: 1.05rem;
}

.filter-heading small,
.client-table td small {
  display: block;
  color: #64748b;
  margin-top: 3px;
}

.eyebrow {
  display: block;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sort-control {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.sort-control:hover,
.sort-control:focus-visible {
  color: #1457c7;
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.clickable-row {
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.clickable-row:hover,
.clickable-row:focus-visible {
  background: #eff6ff;
  outline: 2px solid transparent;
  box-shadow: inset 4px 0 #2563eb;
}

.text-action {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #1457c7;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.text-action:hover,
.text-action:focus-visible {
  text-decoration: underline;
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.panel-subtitle {
  margin: 2px 0 0;
  color: #64748b;
  font-size: .88rem;
}

.pending-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.pending-category {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 16px;
  border: 1px solid #dbe4ee;
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.pending-category strong { font-size: 1.6rem; color: #1457c7; }
.pending-category small { grid-column: 1 / -1; color: #64748b; }
.pending-category.is-critical { border-left: 6px solid var(--danger); background: var(--danger-soft); }
.pending-category.is-active { box-shadow: 0 0 0 3px #93c5fd; }

.aging-legend,
.commission-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.aging-legend span,
.commission-flow span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf5f8;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
}

.aging-legend .is-critical { background: var(--danger-soft); color: #991b1b; }
.row-critical td { background: #fff5f5; }
.compact-button { padding: 7px 10px; min-height: 34px; white-space: nowrap; }

.inline-action {
  display: inline-flex;
  margin-top: 10px;
}

.claim-card {
  text-decoration: none;
  color: inherit;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}

.detail-list div {
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.detail-list dt { color: #64748b; font-size: .78rem; font-weight: 700; }
.detail-list dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.development-state { min-height: 54vh; display: grid; place-content: center; text-align: center; }
.development-badge { justify-self: center; padding: 7px 12px; border-radius: 999px; background: #fff7ed; color: #9a3412; font-weight: 900; letter-spacing: .08em; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.catalog-grid article { padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; }
.catalog-grid ul { margin: 10px 0 0; padding-left: 20px; max-height: 320px; overflow: auto; }
.catalog-grid li { margin: 6px 0; }

.filters-grid label,
.inline-filter label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filters-grid input,
.filters-grid select,
.inline-filter select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.text-link {
  color: var(--brand);
  font-weight: 700;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-weight: 700;
}

.notice-success {
  background: #dff3e9;
  color: var(--success);
  border-color: #b9e3cf;
}

.notice-error {
  background: #ffe1df;
  color: var(--danger);
  border-color: #f3b8b2;
}

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

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.choice-card {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px !important;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f9fb;
  color: var(--ink) !important;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.2;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-box {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.choice-box::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 140ms ease;
}

.choice-card.is-selected {
  border-color: var(--brand);
  background: #e4f2f5;
}

.choice-card.is-selected .choice-box {
  border-color: var(--brand);
  background: var(--brand);
}

.choice-card.is-selected .choice-box::after {
  transform: rotate(-45deg) scale(1);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
}

.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.field-message {
  color: var(--danger);
  font-weight: 800;
}

.form-grid textarea {
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.pending-table {
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.pending-table th,
.pending-table td {
  border-bottom: 0;
}

.pending-table th:last-child,
.pending-table td:last-child {
  width: 170px;
}

.pending-row td {
  border-top: 1px solid rgba(16, 24, 32, 0.06);
  border-bottom: 1px solid rgba(16, 24, 32, 0.06);
  background: #f6f9fb;
}

.pending-row td:first-child {
  border-left: 7px solid var(--neutral);
  border-radius: var(--radius) 0 0 var(--radius);
}

.pending-row td:last-child {
  border-right: 1px solid rgba(16, 24, 32, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.pending-critica td {
  background: var(--danger-soft);
}

.pending-critica td:first-child {
  border-left-color: var(--danger);
}

.pending-alta td {
  background: #ffeedd;
}

.pending-alta td:first-child {
  border-left-color: #d35400;
}

.pending-media td {
  background: var(--warning-soft);
}

.pending-media td:first-child {
  border-left-color: var(--warning);
}

.pending-baja td {
  background: #edf5f8;
}

.pending-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.badge-success {
  background: #dff3e9;
  color: var(--success);
}

.badge-warning {
  background: #fff0d3;
  color: var(--warning);
}

.badge-danger {
  background: #ffe1df;
  color: var(--danger);
}

.badge-neutral {
  background: #e9eef3;
  color: var(--neutral);
}

.stack-list {
  display: grid;
  gap: 10px;
}

.stack-list.compact {
  gap: 6px;
}

.stack-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.stack-item:hover,
.client-card:hover {
  border-color: #9fb7c4;
  box-shadow: 0 10px 22px rgba(28, 43, 55, 0.1);
}

.stack-item > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

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

.client-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.client-card:hover {
  transform: translateY(-1px);
}

.client-card p {
  color: var(--muted);
}

dl,
dd {
  margin: 0;
}

.client-card dl,
.inline-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  margin-bottom: 16px;
}

.profile-head > div {
  min-width: 0;
  flex: 1;
}

.avatar-large {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.document-item strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.claim-stack {
  display: grid;
  gap: 10px;
}

.claim-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.claim-card strong {
  line-height: 1.25;
}

.claim-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.claim-next {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.claim-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.claim-card-rojo {
  border-color: #efb2aa;
  background: var(--danger-soft);
}

.claim-card-ambar {
  border-color: #e7c173;
  background: var(--warning-soft);
}

.claim-card-verde {
  border-color: #b9dfcc;
  background: var(--success-soft);
}

.claim-card-cerrado {
  border-color: #cbd5df;
  background: #eef3f7;
}

.timeline-rojo {
  border-color: #efb2aa;
  background: var(--danger-soft);
}

.timeline-ambar {
  border-color: #e7c173;
  background: var(--warning-soft);
}

.timeline-verde {
  border-color: #b9dfcc;
  background: var(--success-soft);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px #f6ead0;
}

.timeline-item p {
  color: var(--muted);
}

.action-panel {
  padding: 0;
  overflow: hidden;
}

.action-panel summary {
  min-height: 48px;
  padding: 14px 18px;
  background: var(--brand-dark);
  color: #fff;
  cursor: pointer;
  font-weight: 400;
}

.action-panel[open] summary {
  background: var(--brand);
}

.action-panel form {
  padding: 18px;
}

.action-panel .panel-header {
  display: none;
}

.siniestros-list {
  margin-bottom: 16px;
}

.siniestros-list-original {
  display: none;
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: currentColor;
  color: currentColor;
  flex: 0 0 auto;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.icon-grid {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z'/%3E%3C/svg%3E");
}

.icon-users {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 11a4 4 0 1 0-3.46-6A4.5 4.5 0 1 0 7.5 12C4.46 12 2 14.02 2 16.5V19h11v-2.5c0-1.06.45-2.04 1.2-2.84A6.7 6.7 0 0 1 16 13c2.76 0 5 1.79 5 4v2h1v-2c0-3.31-2.69-6-6-6z'/%3E%3C/svg%3E");
}

.icon-folder {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
}

.icon-shield {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2 4 5v6c0 5.55 3.84 10.74 8 12 4.16-1.26 8-6.45 8-12V5z'/%3E%3C/svg%3E");
}

.icon-alert {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2 1 21h22zm1 16h-2v-2h2zm0-4h-2V8h2z'/%3E%3C/svg%3E");
}

.icon-clock {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 11h5v-2h-4V6h-2v7z'/%3E%3C/svg%3E");
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #102a35;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(120%);
  transition: transform 180ms ease;
  z-index: 20;
}

.toast.show {
  transform: translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 40;
}

.modal.is-open {
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 32, 0.54);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 26px 70px rgba(6, 22, 30, 0.34);
}

.modal-panel h2 {
  margin-bottom: 18px;
  padding-right: 42px;
}

.modal-panel h2 + form {
  margin-top: 4px;
}

.modal-panel-small {
  width: min(520px, 100%);
}

.consultation-modal {
  width: min(760px, 100%);
}

.consultation-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px;
  border-radius: 14px;
  background: #f2f6f9;
}

.consultation-head > div {
  flex: 1;
  min-width: 0;
}

.consultation-head h3,
.consultation-head p {
  margin: 0;
}

.consultation-section {
  margin-top: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #dbe3ee;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: #eef4f7;
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  z-index: 3;
  bottom: -2px;
  margin-top: 4px;
  padding: 12px 0 2px;
  border-top: 1px solid #dbe3ee;
  background: var(--surface);
  box-shadow: 0 -10px 18px rgba(255, 255, 255, .92);
}

.form-actions button {
  flex: 0 0 auto;
  max-width: 100%;
  white-space: nowrap;
}

.contact-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f9fb;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.nested-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.mini-details {
  margin-top: 12px;
}

.mini-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 400;
}

.muted {
  color: var(--muted);
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15, 107, 122, 0.16), rgba(214, 164, 58, 0.1)),
    var(--bg);
}

.login-panel {
  width: min(960px, 100%);
}

.login-card {
  width: min(440px, 100%);
  margin: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 18px;
  color: var(--ink);
}

.login-card h1 {
  margin-bottom: 8px;
}

.login-card p {
  color: var(--muted);
}

.login-hints {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}

.login-hints strong {
  color: var(--ink);
}

@media (min-width: 1081px) {
  .document-register-button .desktop-label {
    display: inline;
  }

  .document-register-button .mobile-label {
    display: none;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand span:last-child,
  .main-nav a {
    font-size: 0;
  }

  .main-nav a {
    justify-content: center;
  }

  .sidebar-note {
    display: none;
  }

  .content-grid,
  .card-grid,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .global-postit-actions {
    order: 4;
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .global-postit-actions .compact-button {
    width: 100%;
    min-height: 42px;
  }

  .postit-list-modal,
  .postit-detail-modal,
  .document-detail-modal {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 22px 18px 90px;
  }

  .global-postit-board {
    max-height: none;
    overflow: visible;
  }

  .client-table-wrap { overflow: visible; }
  .client-table thead { display: none; }
  .client-table, .client-table tbody, .client-table tr, .client-table td { display: block; width: 100%; min-width: 0; }
  .client-table tr { margin-bottom: 14px; padding: 12px; border: 1px solid #dbe3ee; border-radius: 14px; background: #fff; }
  .client-table td { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 7px 0; border: 0; }
  .client-table td::before { content: attr(data-label); color: #64748b; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
  .detail-list, .catalog-grid { grid-template-columns: 1fr; }
  .claim-detail-head { align-items: flex-start; }
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: min(308px, calc(100vw - 54px));
    height: 100vh;
    padding: 22px 18px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 40px rgba(7, 20, 28, 0.28);
  }

  .brand {
    justify-content: flex-start;
  }

  .main-nav {
    grid-template-columns: 1fr;
  }

  .main-nav a {
    justify-content: flex-start;
    min-height: 46px;
    font-size: 15px;
  }

  .brand span:last-child,
  .main-nav a {
    font-size: 15px;
  }

  .mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(6, 20, 28, 0.45);
  }

  .mobile-menu-open .mobile-menu-backdrop {
    display: block;
  }

  .mobile-menu-close {
    display: inline-grid;
    place-items: center;
    position: absolute;
    top: 16px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
  }

  .mobile-menu-button {
    display: inline-grid;
    gap: 4px;
    align-content: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    cursor: pointer;
  }

  .mobile-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
  }

  .mobile-footer-nav {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    height: 62px;
    padding: 8px 10px;
    border-radius: 18px;
    background: #09212b;
    box-shadow: 0 16px 34px rgba(7, 20, 28, 0.28);
  }

  .mobile-footer-nav a {
    display: grid;
    place-items: center;
    min-height: 44px;
    color: #b7cbd2;
  }

  .mobile-footer-nav a.active {
    width: 50px;
    height: 50px;
    margin: -22px auto 0;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(10, 95, 112, 0.34);
  }

  .mobile-footer-nav .icon {
    width: 20px;
    height: 20px;
  }

  .workspace {
    padding: 16px 14px 96px;
  }

  .topbar {
    grid-template-columns: 42px 1fr;
    gap: 12px;
  }

  .page-title {
    align-self: center;
  }

  .user-chip,
  .search {
    grid-column: 1 / -1;
  }

  .panel-header,
  .profile-head,
  .row-head {
    align-items: stretch;
    flex-direction: column;
  }

  .client-card dl,
  .inline-meta,
  .form-grid,
  .nested-grid {
    grid-template-columns: 1fr;
  }

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

  .metric-card {
    min-height: 96px;
    gap: 6px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: 38px;
  }

  .span-2 {
    grid-column: auto;
  }

  .search {
    width: 100%;
  }

  .user-chip {
    width: 100%;
  }

  .section-actions,
  .block-head {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .section-actions .primary-button,
  .section-actions .ghost-button,
  .form-actions .primary-button,
  .form-actions .ghost-button {
    width: 100%;
    min-height: 44px;
  }

  .modal.is-open {
    align-items: end;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  h1 {
    font-size: 24px;
  }

  table {
    min-width: 680px;
  }

  .pending-table-wrap {
    overflow-x: visible;
  }

  .pending-table {
    display: block;
    min-width: 0;
    border-spacing: 0;
  }

  .pending-table thead {
    display: none;
  }

  .pending-table tbody {
    display: grid;
    gap: 10px;
  }

  .pending-table tr,
  .pending-table td {
    display: block;
    width: 100% !important;
  }

  .pending-row {
    border-left: 7px solid var(--neutral);
    border-radius: var(--radius);
    overflow: hidden;
    background: #f6f9fb;
  }

  .pending-row td {
    border: 0;
    background: transparent !important;
    padding: 10px 12px;
  }

  .pending-row td:first-child {
    border-left: 0;
    border-radius: 0;
    padding-bottom: 4px;
  }

  .pending-row td:last-child {
    border-right: 0;
    border-radius: 0;
    padding-top: 0;
  }

  .pending-row strong {
    display: block;
    overflow-wrap: anywhere;
  }

  .pending-meta {
    display: grid;
    gap: 2px;
    margin-top: 4px;
  }

  .pending-row td:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
  }

  .pending-critica {
    border-left-color: var(--danger);
    background: var(--danger-soft);
  }

  .pending-alta {
    border-left-color: #d35400;
    background: #ffeedd;
  }

  .pending-media {
    border-left-color: var(--warning);
    background: var(--warning-soft);
  }

  .pending-baja {
    border-left-color: var(--neutral);
    background: #edf5f8;
  }
}
