:root {
  --ink: #102129;
  --muted: #5d6a70;
  --line: #d9e1de;
  --soft: #f7f8f5;
  --white: #ffffff;
  --brand: #007c89;
  --brand-dark: #13272d;
  --gold: #c9942e;
  --green: #4f8a52;
  --clay: #b86145;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(16, 33, 41, 0.14);
  --soft-shadow: 0 12px 36px rgba(16, 33, 41, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

a.buttonlike {
  text-decoration: none;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(16, 33, 41, 0.96), rgba(19, 39, 45, 0.98)),
    var(--brand-dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 18px 0 40px rgba(16, 33, 41, 0.16);
}

.menu-scrim,
.mobile-menu-toggle {
  display: none;
}

.brand {
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand > span:first-child {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    url("../assets/tierra-firme-sello-cobre-192.png") center / cover no-repeat,
    var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
  color: transparent;
  font-size: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.brand strong {
  line-height: 1.15;
  white-space: nowrap;
}

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

.menu button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.menu button:hover,
.menu button.active {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.35;
}

.sidebar-note strong {
  color: var(--white);
}

.app {
  margin-left: 260px;
  padding: 24px;
  max-width: calc(100vw - 260px);
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

body[data-portal-type="interno"] .topbar {
  align-items: flex-start;
}

body[data-portal-type="interno"] .top-actions {
  justify-content: flex-end;
  max-width: min(100%, 520px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.02;
}

h2 {
  font-size: 1rem;
}

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

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-logo {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background:
    url("../assets/tierra-firme-sello-cobre-192.png") center / cover no-repeat,
    var(--brand-dark);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

button,
.button {
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--brand);
  font-weight: 800;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
}

.ghost {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.ghost:hover {
  color: var(--ink);
  background: #edf3f2;
}

.buttonlike {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--brand-dark);
  background: #eef6f5;
  font-size: 0.88rem;
  font-weight: 800;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

body[data-portal-type="cliente"] {
  background:
    linear-gradient(180deg, rgba(19, 39, 45, 0.12), rgba(247, 248, 245, 0) 340px),
    linear-gradient(90deg, rgba(201, 148, 46, 0.08), rgba(0, 124, 137, 0.05)),
    var(--soft);
}

body[data-portal-type="cliente"] .sidebar,
body[data-portal-type="cliente"] .mobile-tabbar,
body[data-portal-type="cliente"] .client-tabbar,
body[data-portal-type="cliente"] [data-scope="interno"],
body[data-portal-type="cliente"] .internal-only {
  display: none !important;
}

body[data-portal-type="cliente"] .app {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: clamp(12px, 3vw, 24px);
  max-width: 1120px;
}

body[data-portal-type="cliente"] .topbar {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 12% 0%, rgba(201, 148, 46, 0.26), transparent 34%),
    linear-gradient(135deg, rgba(16, 33, 41, 0.99), rgba(19, 39, 45, 0.96) 62%, rgba(0, 124, 137, 0.78)),
    var(--brand-dark);
  box-shadow: 0 18px 46px rgba(16, 33, 41, 0.18);
}

body[data-portal-type="cliente"] .topbar .eyebrow,
body[data-portal-type="cliente"] .topbar h1 {
  color: var(--white);
}

body[data-portal-type="cliente"] .topbar h1 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

body[data-portal-type="cliente"] .topbar .user-pill {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

body[data-portal-type="cliente"] .topbar .ghost {
  color: var(--brand-dark);
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.94);
}

body[data-portal-type="cliente"] .topbar .ghost:hover {
  color: var(--ink);
  background: #ffdf6b;
  border-color: #ffdf6b;
}

body[data-portal-type="cliente"] .client-app-screen {
  display: none !important;
}

body[data-portal-type="cliente"] .client-app-screen.active {
  display: grid !important;
}

.mobile-home,
.mobile-tabbar,
.client-tabbar {
  display: none;
}

body[data-portal-type="cliente"] [data-scope="interno"],
body[data-portal-type="cliente"] .internal-only {
  display: none;
}

body[data-portal-type="cliente"] .menu {
  display: none;
}

.dashboard-home {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 0;
  padding: 16px;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 12%, rgba(201, 148, 46, 0.28), transparent 30%),
    linear-gradient(135deg, rgba(16, 33, 41, 0.99), rgba(19, 39, 45, 0.96) 58%, rgba(0, 124, 137, 0.8)),
    var(--brand-dark);
  overflow: hidden;
}

.dashboard-home-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.dashboard-home-copy .eyebrow {
  grid-column: 1;
  grid-row: 1;
}

.dashboard-home-copy h2 {
  grid-column: 1;
  grid-row: 2;
}

.dashboard-home-copy .demo-toggle {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
}

.dashboard-home-copy h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.12rem, 1.45vw, 1.5rem);
  line-height: 1.08;
}

.dashboard-home-copy p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.45;
}

.dashboard-home-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.dashboard-home-status span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 7px 9px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.demo-toggle {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  font-weight: 800;
}

.demo-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.demo-toggle-light {
  margin-top: 0;
  color: var(--ink);
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(25, 43, 45, 0.08);
}

.dashboard-home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.dashboard-home-actions button {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--white);
  background: rgba(255, 255, 255, 0.105);
  text-align: left;
  box-shadow: none;
}

.dashboard-home-actions button:hover {
  color: var(--white);
  border-color: rgba(244, 197, 66, 0.72);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 32px rgba(8, 18, 20, 0.22);
  transform: translateY(-1px);
}

.dashboard-home-actions span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand-dark);
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.dashboard-home-actions strong {
  font-size: 0.92rem;
  line-height: 1.15;
}

.dashboard-home-actions small {
  grid-column: 2;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.75rem;
  line-height: 1.22;
}

.dashboard-home-actions button:hover small {
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-summary {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.dashboard-summary-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.dashboard-summary-head h2 {
  margin: 2px 0 0;
  color: var(--brand-dark);
  font-size: 1.15rem;
  line-height: 1.15;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 2px;
}

.metric,
.panel,
.form-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.metric {
  min-height: 82px;
  padding: 12px;
  border-top: 4px solid var(--brand);
}

.metric:nth-child(2) {
  border-top-color: var(--gold);
}

.metric:nth-child(3) {
  border-top-color: var(--clay);
}

.metric:nth-child(4) {
  border-top-color: var(--green);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.18rem, 1.8vw, 1.55rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.client-portal-shell {
  display: grid;
  gap: 18px;
}

.client-app-screen {
  display: none;
}

.client-app-screen.active {
  display: grid;
  gap: 18px;
}

.client-app-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.client-app-actions button {
  min-height: 74px;
  border-color: rgba(0, 124, 137, 0.22);
  color: var(--brand-dark);
  background: #f4fbfa;
}

.client-app-actions button strong,
.client-app-actions button span {
  display: block;
}

.client-app-actions button span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.client-app-actions button:hover,
.client-app-actions button.active {
  color: var(--white);
  background: var(--brand);
}

.client-app-actions button:hover span,
.client-app-actions button.active span {
  color: inherit;
}

.client-status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.client-status-actions .buttonlike,
.client-status-actions button {
  justify-content: center;
  width: 100%;
}

.client-screen-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-screen-head button {
  min-width: 72px;
}

.client-screen-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.client-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: center;
  overflow: hidden;
}

.client-hero h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.client-hero h1 {
  max-width: 760px;
}

.client-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}

.client-status-card {
  border: 1px solid rgba(201, 148, 46, 0.36);
  border-radius: 8px;
  padding: 18px;
  background: #fff8ec;
}

.client-status-card span,
.client-payment-box span,
.client-checklist span,
.timeline-item span,
.timeline-item small,
.payment-lines small {
  color: var(--muted);
  font-size: 0.86rem;
}

.client-status-card strong,
.payment-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 1.35rem;
}

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

.client-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.client-grid.client-app-screen {
  display: none;
}

.client-grid.client-app-screen.active {
  display: grid;
}

.client-table table {
  min-width: 720px;
}

.client-checklist,
.client-timeline,
.payment-lines {
  display: grid;
  gap: 10px;
}

.client-checklist details,
.timeline-item,
.payment-lines > div,
.payment-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.client-checklist details.done {
  border-color: #b8dfcf;
  background: #f0faf5;
}

.client-checklist summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.client-checklist summary::-webkit-details-marker {
  display: none;
}

.client-checklist strong,
.timeline-item strong,
.payment-lines strong {
  display: block;
  margin-bottom: 5px;
}

.client-checklist small {
  display: inline-flex;
  grid-row: 1 / span 2;
  grid-column: 2;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--brand-dark);
  background: #e3f2ee;
  font-weight: 800;
}

.client-checklist details p {
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.timeline-item p,
.client-note {
  margin: 5px 0;
  color: var(--muted);
  line-height: 1.4;
}

.payment-summary {
  margin-bottom: 10px;
  background: #fff8ec;
  border-color: #ecd8b8;
}

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

.client-method > div {
  border-left: 3px solid var(--brand);
  padding-left: 14px;
}

.client-method span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--gold);
  font-weight: 800;
}

.client-method strong {
  display: block;
  margin-bottom: 6px;
}

.client-method p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.map-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(0, 124, 137, 0.08), rgba(201, 148, 46, 0.08)),
    var(--white);
  box-shadow: var(--soft-shadow);
}

.map-hero h2 {
  margin: 0 0 10px;
  font-size: 2rem;
  letter-spacing: 0;
}

.map-hero p {
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.55;
}

.map-stat {
  border-radius: 8px;
  padding: 18px;
  color: var(--white);
  background: var(--brand-dark);
}

.map-stat strong {
  display: block;
  margin-bottom: 6px;
  font-size: 2.4rem;
  line-height: 1;
}

.map-stat span {
  color: rgba(255, 255, 255, 0.76);
}

.flow-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding: 4px 2px 10px;
}

.flow-board::before {
  content: "";
  position: absolute;
  left: 42px;
  right: 42px;
  top: 44px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold), #406f9f, var(--brand-dark));
  opacity: 0.45;
}

.flow-step {
  position: relative;
  z-index: 1;
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(23, 32, 34, 0.08);
}

.flow-step::after {
  content: "";
  position: absolute;
  top: 34px;
  right: -10px;
  width: 18px;
  height: 18px;
  border-top: 3px solid rgba(20, 108, 95, 0.45);
  border-right: 3px solid rgba(20, 108, 95, 0.45);
  transform: rotate(45deg);
  background: var(--soft);
}

.flow-step:last-child::after {
  display: none;
}

.flow-step.has-work {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.12), 0 14px 26px rgba(23, 32, 34, 0.1);
}

.flow-step.checkpoint {
  border-color: #d9aa57;
}

.flow-step.final-stage {
  border-color: #b9c7cf;
}

.flow-node {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.flow-node span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--brand-dark);
  font-weight: 800;
}

.flow-node strong {
  font-size: 1rem;
}

.flow-step p {
  min-height: 70px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.42;
}

.flow-step small {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--brand-dark);
  background: #e3f2ee;
  font-weight: 800;
}

.activation-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.activation-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #101719;
  color: var(--white);
}

.activation-strip strong {
  display: block;
  margin-bottom: 6px;
}

.activation-strip span {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.evidence-panel {
  margin-bottom: 18px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.evidence-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfd;
}

.evidence-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
}

.evidence-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.92rem;
}

.compact-hero {
  margin-bottom: 14px;
}

.library-jump {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.library-jump p:last-child {
  margin: 0;
  color: var(--muted);
}

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

.library-flow article {
  position: relative;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(20, 108, 95, 0.08), transparent 58%),
    var(--white);
}

.library-flow article::after {
  content: "";
  position: absolute;
  top: 32px;
  right: -16px;
  width: 20px;
  height: 2px;
  background: var(--gold);
}

.library-flow article:last-child::after {
  display: none;
}

.library-flow span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--brand);
  font-weight: 800;
}

.library-flow strong,
.support-ladder strong,
.law-grid strong,
.decision-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
}

.library-flow p,
.support-ladder p,
.law-grid p,
.decision-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.92rem;
}

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

.support-ladder,
.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.support-ladder article,
.decision-grid article,
.law-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfd;
}

.support-ladder span,
.decision-grid span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--white);
  background: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.law-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.law-grid a {
  display: inline-flex;
  margin-top: 12px;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.law-grid a:hover {
  color: var(--brand-dark);
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 28px;
  background: rgba(16, 23, 25, 0.32);
}

.tour-overlay[hidden] {
  display: none;
}

.tour-card {
  width: min(620px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

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

.tour-topline {
  margin-bottom: 14px;
}

.tour-topline span {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--white);
  background: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.tour-card h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.tour-card p {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.tour-actions {
  justify-content: flex-end;
}

.tour-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pitch-panel {
  margin-bottom: 18px;
}

.pitch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pitch-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfd;
}

.pitch-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
}

.pitch-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.48;
}

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

.process-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
}

.process-card.active-stage {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.12);
}

.process-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--brand);
  font-weight: 800;
}

.process-card h3 {
  margin: 14px 0 8px;
  font-size: 1.06rem;
}

.process-card p,
.legal-note p,
.document-grid p {
  color: var(--muted);
  line-height: 1.5;
}

.process-card p {
  margin: 0 0 12px;
}

.process-card ul,
.ops-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.5;
}

.process-card li,
.ops-list li {
  margin-bottom: 7px;
}

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

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

.document-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfd;
}

.document-grid strong {
  display: block;
  margin-bottom: 6px;
}

.document-grid p,
.legal-note p {
  margin: 0;
}

.map-live-panel {
  margin-bottom: 18px;
}

.stage-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stage-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.stage-chip strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.stage-chip span {
  color: var(--muted);
  font-size: 0.84rem;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 4px 8px;
  color: var(--ink);
  background: #eef4f3;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.stage-1 {
  border-color: #bfd7d2;
  background: #eef8f5;
}

.stage-2 {
  border-color: #f0d19a;
  background: #fff6df;
}

.stage-3 {
  border-color: #c8c7ef;
  background: #f1f0ff;
}

.stage-4 {
  border-color: #c7d8f0;
  background: #edf5ff;
}

.stage-5 {
  border-color: #b8dfcf;
  background: #eaf8f1;
}

.stage-6 {
  border-color: #dec5a9;
  background: #fff1e4;
}

.stage-7 {
  border-color: #b9c7cf;
  background: #edf3f5;
}

.compact-table {
  max-height: 360px;
}

.panel {
  padding: 18px;
}

.panel.dashboard-home {
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(16, 33, 41, 0.98), rgba(19, 39, 45, 0.94) 58%, rgba(0, 124, 137, 0.82)),
    var(--brand-dark);
}

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

.panel-head h2 {
  margin: 0;
}

.panel-head span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.workbench {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

#clientes .workbench {
  grid-template-columns: 1fr;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.section-toolbar h2 {
  margin: 0;
  font-size: 1.2rem;
}

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

.prospect-form-panel {
  display: none;
}

.client-form-panel {
  display: none;
}

#clientes .client-detail-panel {
  display: none;
}

#cartera .debt-detail-panel {
  display: none;
}

body:not(.prospect-form-open) #prospectos .workbench {
  display: block;
}

body:not(.prospect-form-open) #prospectos .prospect-form-panel {
  display: none !important;
}

body.prospect-form-open #prospectos .section-toolbar,
body.prospect-form-open #prospectos .prospect-map-layout,
body.prospect-form-open #prospectos .prospect-list-panel {
  display: none;
}

body.prospect-form-open #prospectos .workbench {
  display: block;
}

body.prospect-form-open #prospectos .prospect-form-panel {
  display: grid;
  width: min(100%, 720px);
  margin-inline: auto;
}

.prospect-form-back,
.client-form-back {
  width: max-content;
  margin-bottom: 4px;
}

body.client-form-open #clientes .section-toolbar,
body.client-form-open #clientes .client-detail-panel,
body.client-form-open #clientes .client-list-panel {
  display: none;
}

body.client-form-open #clientes .workbench {
  display: none;
}

body.client-form-open #clientes .client-form-panel {
  display: grid;
  width: min(100%, 720px);
  margin-inline: auto;
}

body.client-detail-open #clientes .section-toolbar,
body.client-detail-open #clientes .workbench {
  display: none;
}

body.client-detail-open #clientes .client-detail-panel {
  display: grid;
  width: min(100%, 820px);
  margin-inline: auto;
}

body.debt-detail-open #cartera .section-toolbar,
body.debt-detail-open #cartera .workbench {
  display: none;
}

body.debt-detail-open #cartera .debt-detail-panel {
  display: grid;
  width: min(100%, 900px);
  margin-inline: auto;
}

.prospect-map-layout {
  display: none;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

body.prospect-map-open .prospect-map-layout {
  display: grid;
}

body.prospect-map-open #prospectos .section-toolbar,
body.prospect-map-open #prospectos .workbench,
body.prospect-map-open #prospectos .prospect-detail {
  display: none;
}

body.prospect-map-open #prospectos .prospect-map-layout {
  display: block;
}

body.prospect-map-open #prospectos .map-panel {
  display: grid;
  gap: 12px;
}

.prospect-map-back {
  width: max-content;
}

body.prospect-detail-open #prospectos .section-toolbar,
body.prospect-detail-open #prospectos .workbench,
body.prospect-detail-open #prospectos .map-panel {
  display: none;
}

body.prospect-detail-open #prospectos .prospect-map-layout {
  display: block;
  margin-bottom: 0;
}

body.prospect-detail-open #prospectos .prospect-detail {
  display: grid;
  width: min(100%, 920px);
  margin-inline: auto;
  gap: 12px;
}

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

.prospect-map {
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #e7eeed;
}

.map-fallback {
  height: 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.prospect-detail {
  align-self: stretch;
}

.conversion-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(19, 39, 45, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: #fff7df;
}

.conversion-card.converted {
  background: #eaf4f2;
}

.conversion-card span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.conversion-card strong {
  display: block;
  margin: 3px 0;
}

.conversion-card p {
  margin: 0;
}

.prospect-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.module-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}

.module-jump button {
  border: 1px solid rgba(0, 124, 137, 0.2);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--brand-dark);
  background: #eaf4f2;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.module-jump button.active {
  border-color: rgba(201, 148, 46, 0.55);
  color: #102129;
  background: #ffd24a;
}

.prospect-module {
  border: 1px solid rgba(19, 39, 45, 0.1);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.prospect-module summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 950;
}

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

.module-head h3 {
  margin: 2px 0 0;
}

.module-head > span {
  border-radius: 999px;
  padding: 6px 9px;
  color: #102129;
  background: #ffd24a;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.module-note {
  margin: 0 0 12px;
  border-left: 4px solid var(--gold);
  padding: 9px 11px;
  color: var(--muted);
  background: #fffaf0;
  line-height: 1.45;
}

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

.value-grid article {
  border: 1px solid rgba(0, 124, 137, 0.16);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #ffffff, #f6fbfa);
}

.value-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--brand-dark);
}

.value-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.43;
}

.mini-link {
  display: inline-flex;
  width: max-content;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #102129;
  background: #ffd24a;
  font-size: 0.8rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.client-detail-panel,
.debt-detail-panel {
  gap: 12px;
  margin-bottom: 18px;
}

.debt-client-link {
  width: max-content;
}

.prospect-detail h2,
.client-detail-panel h2,
.debt-detail-panel h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.prospect-detail dl,
.client-detail-panel dl,
.debt-detail-panel dl {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.prospect-detail dt,
.client-detail-panel dt,
.debt-detail-panel dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.prospect-detail dd,
.client-detail-panel dd,
.debt-detail-panel dd {
  margin: 0;
  line-height: 1.42;
  word-break: break-word;
}

.prospect-detail a,
.client-detail-panel a,
.debt-detail-panel a,
td a {
  color: var(--brand);
  font-weight: 800;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.detail-metrics article,
.detail-stack article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.detail-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--brand-dark);
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.detail-stack {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.detail-stack strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-dark);
}

.detail-stack p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.client-accounts-panel {
  margin: 16px 0;
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: #f7fbfa;
}

.client-accounts-panel .module-head {
  margin-bottom: 10px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.debt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.debt-mini-card {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-height: 112px;
  padding: 12px;
  border: 1px solid rgba(0, 124, 137, 0.18);
  color: var(--ink);
  background: #f4fbfa;
  text-align: left;
  box-shadow: none;
}

.debt-mini-card:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: #fff8dc;
  transform: translateY(-1px);
}

.debt-mini-card strong {
  color: var(--brand-dark);
  line-height: 1.18;
}

.debt-mini-card small {
  color: var(--muted);
  line-height: 1.28;
}

.debt-mini-card em {
  display: inline-flex;
  margin-top: 3px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #102129;
  background: #ffd24a;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

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

.debt-profile-grid article {
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.debt-profile-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.debt-profile-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--brand-dark);
}

.debt-profile-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.client-upload-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.client-upload-card {
  display: grid;
  gap: 11px;
  align-content: start;
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.client-upload-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.client-upload-card input,
.client-upload-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfdfd;
}

.client-upload-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.client-upload-card .client-note.ok {
  color: var(--green);
  font-weight: 900;
}

.inline-form-action {
  justify-self: start;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.client-conversation {
  display: grid;
  gap: 9px;
  margin: 4px 0 10px;
}

.client-message {
  width: min(92%, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--white);
}

.client-message.out {
  justify-self: end;
  border-color: rgba(0, 124, 137, 0.25);
  background: #eaf7f5;
}

.client-message.in {
  justify-self: start;
  border-color: rgba(201, 148, 46, 0.28);
  background: #fffaf0;
}

.client-message div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}

.client-message strong {
  color: var(--brand-dark);
}

.client-message span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.client-message p {
  margin: 0;
  color: var(--ink);
  line-height: 1.42;
}

.client-history-page {
  margin: 16px 0;
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #f7fbfa, #ffffff);
}

.client-back-detail {
  width: max-content;
  margin-bottom: 8px;
}

.prospect-playbook {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.prospect-playbook-main {
  display: grid;
  gap: 6px;
  width: 100%;
  border-color: rgba(201, 148, 46, 0.5);
  padding: 14px;
  color: var(--brand-dark);
  background: #fff2c2;
  text-align: left;
}

.prospect-playbook-main span,
.prospect-playbook-main small {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.prospect-playbook-main strong {
  line-height: 1.35;
}

.prospect-playbook-main.copied small {
  color: var(--brand);
}

.prospect-playbook-main.copied small::after {
  content: " copiado";
}

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

.email-console {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.email-toolbar {
  margin: 12px 0;
}

.email-calendar {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.panel-head.compact {
  margin-bottom: 10px;
}

.panel-head.compact h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 1rem;
}

.email-calendar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.email-calendar-stats span {
  border: 1px solid rgba(0, 124, 137, 0.16);
  border-radius: 8px;
  padding: 9px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.84rem;
}

.email-calendar-stats strong {
  display: block;
  color: var(--brand-dark);
  font-size: 1.15rem;
}

.subsection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}

.subsection-head h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 1rem;
}

.subsection-head .module-note {
  margin: 4px 0 0;
}

.subsection-head span {
  flex: 0 0 auto;
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--brand-dark);
  background: rgba(0, 124, 137, 0.06);
  font-size: 0.8rem;
  font-weight: 700;
}

.email-calendar-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.email-calendar-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 4px 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
}

.email-calendar-item span {
  grid-row: span 2;
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.email-calendar-item strong,
.email-calendar-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.email-calendar-item small {
  color: var(--muted);
  line-height: 1.35;
}

.email-preview {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.email-preview > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.email-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.email-preview-actions .button,
.email-preview-actions .buttonlike,
.email-preview-actions button {
  min-height: 38px;
}

.email-meta-list {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.email-meta-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.email-meta-list dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.4;
}

.email-body-card {
  min-height: 0;
}

.message-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 168px;
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.message-card:nth-child(2n) {
  border-color: rgba(201, 148, 46, 0.28);
  background: linear-gradient(180deg, #ffffff, #fffaf0);
}

.message-card h3 {
  margin: 3px 0 0;
  color: var(--brand-dark);
  font-size: 1rem;
}

.message-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.email-playbook {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.email-plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.email-plan-calendar-panel,
.email-plan-editor {
  min-width: 0;
}

.email-plan-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  margin: 14px 0;
}

.email-plan-filters select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
}

.email-plan-calendar {
  display: grid;
  gap: 16px;
}

.email-plan-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdfd;
}

.email-plan-day h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--brand-dark);
  font-size: 1rem;
  text-transform: capitalize;
}

.email-plan-slots {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.email-plan-slot {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 116px;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  padding: 12px 14px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
}

.email-plan-slot:hover,
.email-plan-slot.selected {
  background: #eef8f5;
}

.email-plan-time {
  color: var(--gold-dark);
  font-size: 1rem;
  font-weight: 900;
}

.email-plan-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.email-plan-main strong,
.email-plan-main small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.email-plan-main small {
  color: var(--muted);
  line-height: 1.35;
}

.email-plan-badge {
  justify-self: end;
  border-radius: 999px;
  padding: 6px 9px;
  background: #e3f2ee;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.email-plan-editor {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.email-plan-form {
  display: grid;
  gap: 12px;
}

.email-plan-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.email-plan-form input,
.email-plan-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.45;
}

.email-plan-form textarea {
  resize: vertical;
}

.email-editor-guide {
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
}

.email-editor-guide h3 {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: 1rem;
}

@media (max-width: 980px) {
  .email-plan-layout {
    grid-template-columns: 1fr;
  }

  .email-plan-editor {
    position: static;
  }
}

@media (max-width: 680px) {
  .email-plan-filters,
  .email-plan-slot {
    grid-template-columns: 1fr;
  }

  .email-plan-badge {
    justify-self: start;
  }
}

.mini-copy {
  width: max-content;
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.mini-copy.copied::after {
  content: " listo";
}

.prospect-playbook details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.prospect-playbook summary {
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 900;
}

.prospect-playbook p,
.prospect-playbook ul,
.prospect-playbook dl {
  margin: 10px 0 0;
}

.prospect-playbook li {
  margin: 6px 0;
}

.prospect-playbook dt {
  margin-top: 10px;
}

.prospect-playbook dd {
  margin-top: 4px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td,
.selected-row td {
  background: #f0f8f6;
}

.form-panel {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.form-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfdfd;
}

.form-panel textarea {
  resize: vertical;
}

.wide {
  min-width: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(16, 33, 41, 0.05);
}

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

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

th {
  color: var(--brand-dark);
  background: #eef4f3;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #f9fcfb;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--brand-dark);
  background: #e3f2ee;
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.warn {
  color: #6a4500;
  background: #fff2cf;
}

.pill.danger {
  color: var(--danger);
  background: #fee4e2;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--brand-dark);
  background: #fff2cf;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.whatsapp-workbench {
  display: grid;
  gap: 14px;
}

.whatsapp-inbox-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(0, 124, 137, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfd;
}

.whatsapp-inbox-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(150px, 0.55fr) minmax(260px, 1.4fr);
  gap: 10px;
  align-items: end;
}

.whatsapp-inbox-form .form-actions {
  grid-column: 1 / -1;
}

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

.whatsapp-inbox-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.whatsapp-inbox-item.is-done {
  opacity: 0.68;
}

.whatsapp-inbox-item > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.whatsapp-inbox-item h3 {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 1rem;
}

.whatsapp-inbox-item header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.whatsapp-inbox-item > header > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--brand-dark);
  background: #eef6f5;
  font-size: 0.82rem;
  font-weight: 900;
}

.whatsapp-inbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  gap: 12px;
}

.message-bubble {
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: normal;
}

.message-bubble.inbound {
  background: #f7fbff;
}

.message-bubble.suggestion {
  border-color: rgba(175, 118, 0, 0.22);
  background: #fff8e7;
}

.whatsapp-section {
  display: grid;
  gap: 10px;
}

.whatsapp-card-list {
  display: grid;
  gap: 14px;
}

.whatsapp-prospect-card {
  border: 1px solid rgba(0, 124, 137, 0.16);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(0, 124, 137, 0.055), rgba(255, 255, 255, 0) 42%),
    var(--white);
  box-shadow: 0 10px 28px rgba(16, 33, 41, 0.07);
}

.whatsapp-prospect-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.whatsapp-prospect-card h3 {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.whatsapp-prospect-card header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.whatsapp-prospect-card > header > span {
  flex: 0 0 auto;
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--brand-dark);
  background: #eef6f5;
  font-size: 0.84rem;
  font-weight: 800;
}

.whatsapp-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.whatsapp-card-grid > section,
.whatsapp-card-grid > aside {
  min-width: 0;
}

.module-head.compact {
  align-items: flex-start;
  margin-bottom: 8px;
}

.whatsapp-message-preview {
  margin: 0 0 10px;
  border: 1px solid rgba(217, 225, 222, 0.95);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
  color: var(--ink);
  white-space: normal;
}

.whatsapp-history-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.whatsapp-history-item {
  border: 1px solid rgba(217, 225, 222, 0.95);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfd;
}

.whatsapp-history-item span {
  display: block;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 0.84rem;
}

.whatsapp-history-item small {
  color: var(--muted);
}

.whatsapp-history-item p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
}

.row-actions button,
.row-actions .buttonlike {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  color: var(--ink);
  background: #eef4f3;
  font-size: 0.82rem;
  font-weight: 800;
}

.row-actions button:hover,
.row-actions .buttonlike:hover {
  background: #dfeae8;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.quick-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--brand-dark);
  background: #fbfdfd;
  font-size: 0.82rem;
  font-weight: 800;
}

.quick-actions a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.list {
  display: grid;
  gap: 9px;
}

.list-item,
.funnel-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background:
    linear-gradient(90deg, rgba(0, 124, 137, 0.08), transparent 46%),
    #fbfdfd;
}

.list-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-dark);
  font-size: 0.95rem;
}

.list-item span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

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

.funnel-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.funnel-row strong {
  font-size: 0.88rem;
}

.funnel-row > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border-radius: 8px;
  color: var(--brand-dark);
  background: #eef6f5;
  font-weight: 900;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #dfe7e7;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--brand));
}

.empty {
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(16, 23, 25, 0.72), rgba(16, 23, 25, 0.72)),
    url("../assets/medellin-skyline.jpg") center/cover no-repeat;
}

.login-shell {
  width: min(100%, 440px);
}

.login-panel {
  display: grid;
  gap: 22px;
  border-radius: 8px;
  padding: 28px;
  background: var(--white);
  box-shadow: var(--shadow);
}

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

.login-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-error {
  border: 1px solid #fecdca;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--danger);
  background: #fff4f3;
  font-weight: 800;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
}

.login-form input:focus {
  outline: 3px solid rgba(20, 108, 95, 0.18);
  border-color: var(--brand);
}

.login-form button {
  margin-top: 4px;
  min-height: 44px;
}

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

.login-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--brand-dark);
  background: #eef6f5;
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
}

.login-links a:hover {
  border-color: #f4c542;
  background: #ffd24a;
}

.public-demo-body {
  background:
    linear-gradient(180deg, rgba(16, 33, 41, 0.05), rgba(247, 248, 245, 0) 280px),
    var(--soft);
  overflow-x: hidden;
}

.public-demo {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 26px);
}

.demo-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  border: 1px solid rgba(217, 225, 222, 0.92);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(247, 248, 245, 0.94);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.demo-topbar .brand {
  min-width: 300px;
  color: var(--ink);
}

.demo-topbar .brand > span:first-child {
  color: transparent;
  background:
    url("../assets/tierra-firme-sello-cobre-192.png") center / cover no-repeat,
    var(--ink);
}

.demo-topbar .brand .demo-brand-copy {
  display: grid;
  gap: 2px;
  width: auto;
  height: auto;
  border: 0;
  padding: 0;
  place-items: start;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
}

.demo-topbar .brand .demo-brand-copy small {
  display: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.demo-main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.demo-main-nav a:hover {
  color: var(--brand);
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.demo-home-link {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--brand-dark);
  background: var(--white);
  font-weight: 900;
}

.demo-actions button {
  min-height: 44px;
}

.demo-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px clamp(14px, 3vw, 28px) 34px;
  color: var(--muted);
  background: var(--white);
  font-size: 0.9rem;
}

.demo-footer div {
  display: grid;
  gap: 6px;
}

.demo-footer strong {
  color: var(--brand-dark);
}

.demo-footer p {
  margin: 0;
}

.demo-contact-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: 24px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(42px, 6vw, 70px) clamp(14px, 3vw, 28px);
  color: var(--white);
  background: #17333a;
  border-radius: 8px 8px 0 0;
}

.demo-contact-strip h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.demo-contact-strip p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.76);
}

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

.demo-contact-grid a {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(16, 33, 41, 0.09);
}

.demo-contact-grid a:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.demo-contact-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.demo-contact-grid strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.05rem;
}

.demo-tabs {
  position: sticky;
  top: 82px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.demo-tabs button {
  min-width: 0;
  overflow-wrap: anywhere;
}

.demo-tabs button {
  min-height: 42px;
  border-color: transparent;
  color: var(--brand-dark);
  background: transparent;
}

.demo-tabs button.active,
.demo-tabs button:hover {
  color: var(--white);
  background: var(--brand);
}

.demo-page {
  display: none;
}

.demo-page.active {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.public-demo .client-hero {
  position: relative;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(16, 33, 41, 0.98), rgba(19, 39, 45, 0.92) 62%, rgba(0, 124, 137, 0.84)),
    var(--brand-dark);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.public-demo .client-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -105px;
  width: 300px;
  height: 220px;
  border: 1px solid rgba(201, 148, 46, 0.32);
  border-radius: 8px;
  transform: rotate(-8deg);
}

.public-demo .client-hero > * {
  position: relative;
  z-index: 1;
}

.public-demo .client-hero p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.78);
}

.public-demo .client-status-card {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.public-demo .client-status-card span {
  color: rgba(255, 255, 255, 0.68);
}

.public-demo .client-status-card strong {
  color: var(--white);
}

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

.demo-flow {
  margin-bottom: 0;
}

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

.service-menu-grid article,
.mini-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfd;
}

.service-menu-grid span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--brand);
  font-weight: 800;
}

.service-menu-grid strong,
.mini-list strong {
  display: block;
  margin-bottom: 7px;
  color: var(--brand-dark);
}

.service-menu-grid p,
.mini-list span {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

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

.warning-list article {
  border-color: #efd7a8;
  background: #fffaf0;
}

.public-demo-body .tour-overlay {
  pointer-events: none;
  place-items: end end;
  padding: 18px;
  background: transparent;
}

.public-demo-body .tour-card {
  pointer-events: auto;
  width: min(430px, 100%);
  border-color: #b8dfcf;
}

.demo-highlight {
  position: relative;
  z-index: 18;
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  box-shadow: 0 0 0 9999px rgba(16, 23, 25, 0.18), var(--shadow);
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    gap: 16px;
    overflow-y: auto;
  }

  .app {
    margin-left: 0;
    padding: 18px;
    max-width: none;
  }

  body.menu-open {
    overflow: hidden;
  }

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

  .menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(16, 33, 41, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.menu-open .menu-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body[data-portal-type="cliente"] .mobile-menu-toggle,
  body[data-portal-type="cliente"] .menu-scrim {
    display: none;
  }

  .client-metrics,
  .client-grid,
  .client-hero,
  .client-method,
  .panel-grid,
  .workbench,
  .email-console,
  .prospect-map-layout,
  .map-hero,
  .process-grid,
  .ops-lanes,
  .stage-summary,
  .activation-strip,
  .evidence-grid,
  .library-flow,
  .support-ladder,
  .decision-grid,
  .law-grid,
  .pitch-grid,
  .document-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-home-actions,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-jump {
    align-items: stretch;
    flex-direction: column;
  }

  .library-flow article::after {
    display: none;
  }

  .email-preview {
    position: static;
  }

  .email-preview-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .tour-overlay {
    place-items: end stretch;
    padding: 14px;
  }

  .tour-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .flow-board {
    grid-template-columns: repeat(7, 180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  body[data-portal-type="cliente"] .sidebar {
    position: static;
    width: auto;
    transform: none;
    padding-bottom: 14px;
  }

  body[data-portal-type="cliente"] .sidebar-note {
    margin-top: 0;
  }

  .public-demo {
    padding: 12px;
  }

  .demo-topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .demo-actions,
  .demo-footer {
    flex-direction: column;
  }

  .demo-actions button {
    justify-content: center;
    width: 100%;
  }

  .demo-home-link {
    display: inline-flex;
    width: 100%;
  }

  .demo-main-nav {
    display: none;
  }

  .demo-contact-strip,
  .demo-contact-grid {
    grid-template-columns: 1fr;
  }

  .demo-tabs {
    top: 0;
    width: 100%;
    grid-template-columns: repeat(4, minmax(112px, 1fr));
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .demo-tabs button {
    min-height: 44px;
    padding-inline: 10px;
    font-size: 0.88rem;
    scroll-snap-align: start;
  }

  .public-demo .client-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .public-demo .client-hero h1 {
    max-width: 100%;
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .public-demo .client-hero p:not(.eyebrow) {
    max-width: 100%;
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .public-demo .client-status-card {
    width: 100%;
    min-width: 0;
  }

  .public-demo .client-grid,
  .public-demo .client-metrics,
  .public-demo .demo-flow,
  .public-demo .support-ladder,
  .public-demo .decision-grid,
  .public-demo .service-menu-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .public-demo .panel,
  .public-demo .metric,
  .public-demo .client-table,
  .public-demo .table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .public-demo .client-table table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .public-demo .client-table td,
  .public-demo .client-table th {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

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

  .service-menu-grid {
    grid-template-columns: 1fr;
  }

  .public-demo-body .tour-overlay {
    place-items: end stretch;
    padding: 10px;
  }
}

@media (max-width: 520px) {
  .public-demo {
    padding: 8px;
  }

  .demo-topbar {
    position: static;
    border-radius: 8px;
    padding: 10px;
  }

  .demo-topbar .brand {
    min-width: 0;
    width: 100%;
  }

  .demo-topbar .brand .demo-brand-copy strong {
    font-size: 0.96rem;
    line-height: 1.08;
  }

  .demo-topbar .brand .demo-brand-copy small {
    font-size: 0.72rem;
  }

  .demo-actions {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    width: 100%;
  }

  .demo-actions button,
  .demo-home-link {
    min-height: 42px;
    padding-inline: 10px;
    font-size: 0.86rem;
  }

  .demo-tabs {
    position: sticky;
    grid-template-columns: repeat(4, minmax(106px, 1fr));
    margin-inline: -2px;
  }

  .demo-page.active {
    gap: 10px;
  }

  .public-demo .client-hero {
    padding: 16px;
  }

  .public-demo .client-hero h1 {
    font-size: clamp(1.55rem, 7.5vw, 1.95rem);
  }

  .public-demo .client-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .public-demo .metric {
    padding: 12px;
  }

  .public-demo .metric strong {
    font-size: 1.05rem;
    line-height: 1.15;
  }

  .public-demo .panel-head h2 {
    font-size: 1rem;
  }

  .public-demo .client-table table,
  .public-demo .client-table thead,
  .public-demo .client-table tbody,
  .public-demo .client-table tr,
  .public-demo .client-table th,
  .public-demo .client-table td {
    display: block;
  }

  .public-demo .client-table thead {
    display: none;
  }

  .public-demo .client-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fbfdfd;
  }

  .public-demo .client-table tr + tr {
    margin-top: 8px;
  }

  .public-demo .client-table td {
    border-bottom: 1px solid #edf2f0;
    padding: 8px 0;
  }

  .public-demo .client-table td:last-child {
    border-bottom: 0;
  }

  .demo-contact-strip {
    padding: 28px 12px;
  }

  .demo-contact-strip h2 {
    font-size: 1.65rem;
  }
}

@media (max-width: 720px) {
  body {
    background: #f4f7f6;
  }

  .app {
    padding: 12px 12px 86px;
    max-width: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: -12px -12px 14px;
    border-width: 0 0 1px;
    border-radius: 0;
    padding: 10px 12px;
  }

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

  .dashboard-home-copy .eyebrow,
  .dashboard-home-copy h2,
  .dashboard-home-copy .demo-toggle {
    grid-column: 1;
    grid-row: auto;
  }

  .top-actions {
    width: 100%;
    display: flex;
  }

  .top-actions #startTour,
  .top-actions #exportData,
  .top-actions #resetDemo {
    display: none;
  }

  .user-pill {
    flex: 1;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .top-actions .buttonlike {
    justify-content: center;
    min-width: 74px;
  }

  h1 {
    font-size: 1.45rem;
  }

  .mobile-home {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: var(--white);
    box-shadow: var(--soft-shadow);
  }

  #tablero .dashboard-home + .mobile-home {
    display: none;
  }

  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .section-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .section-toolbar-actions button {
    width: 100%;
  }

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

  .mobile-home-head h2 {
    margin: 0;
    font-size: 1.2rem;
  }

  .mobile-home .mobile-menu-toggle {
    min-width: 72px;
  }

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

  .mobile-action-grid button {
    min-height: 116px;
    display: grid;
    align-content: start;
    gap: 7px;
    border-color: #d5e3df;
    color: var(--ink);
    background: #fbfdfd;
    text-align: left;
  }

  .mobile-action-grid button:nth-child(3n + 1) {
    border-top: 4px solid var(--brand);
  }

  .mobile-action-grid button:nth-child(3n + 2) {
    border-top: 4px solid var(--gold);
  }

  .mobile-action-grid button:nth-child(3n + 3) {
    border-top: 4px solid #406f9f;
  }

  .mobile-action-grid button:hover {
    color: var(--ink);
    background: #eef6f5;
  }

  .mobile-action-grid span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--white);
    background: var(--brand-dark);
    font-weight: 900;
  }

  .mobile-action-grid strong {
    display: block;
    font-size: 0.98rem;
  }

  .mobile-action-grid small {
    color: var(--muted);
    line-height: 1.25;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    border-top: 1px solid var(--line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 30px rgba(16, 33, 41, 0.12);
    backdrop-filter: blur(14px);
  }

  .mobile-tabbar button {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    padding: 6px 4px;
    color: var(--muted);
    background: transparent;
    font-size: 0.78rem;
  }

  .mobile-tabbar button::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    margin: 0 auto 5px;
    border-radius: 999px;
    background: transparent;
  }

  .mobile-tabbar button.active,
  .mobile-tabbar button[aria-expanded="true"] {
    color: var(--brand-dark);
    background: #eaf4f2;
  }

  .mobile-tabbar button.active::before,
  .mobile-tabbar button[aria-expanded="true"]::before {
    background: var(--brand);
  }

  .mobile-tabbar span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
  }

  body[data-portal-type="cliente"] .app {
    padding: 10px;
  }

  body[data-portal-type="cliente"] .topbar,
  body[data-portal-type="cliente"] .sidebar,
  body[data-portal-type="cliente"] .mobile-tabbar {
    display: none;
  }

  body[data-portal-type="cliente"] .client-tabbar {
    display: none;
  }

  body[data-portal-type="cliente"] .client-portal-shell {
    display: block;
    min-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  body[data-portal-type="cliente"] .client-app-screen {
    display: none !important;
  }

  body[data-portal-type="cliente"] .client-app-screen.active {
    display: grid !important;
  }

  body[data-portal-type="cliente"] .client-hero {
    width: 100%;
    max-width: 100%;
    min-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
    align-content: stretch;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow-x: hidden;
    border-radius: 8px;
    padding: clamp(18px, 5vw, 24px);
    color: var(--white);
    background:
      linear-gradient(135deg, rgba(16, 33, 41, 0.98), rgba(19, 39, 45, 0.94) 60%, rgba(0, 124, 137, 0.86)),
      var(--brand-dark);
  }

  body[data-portal-type="cliente"] .client-hero h2 {
    font-size: clamp(1.6rem, 7vw, 2.05rem);
    line-height: 1.1;
  }

  body[data-portal-type="cliente"] .client-hero p:not(.eyebrow) {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.74);
  }

  body[data-portal-type="cliente"] .client-status-card {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
  }

  body[data-portal-type="cliente"] .client-status-card span,
  body[data-portal-type="cliente"] .client-status-card strong {
    color: var(--white);
  }

  body[data-portal-type="cliente"] .client-app-actions {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 12px;
    margin-top: 18px;
  }

  body[data-portal-type="cliente"] .client-app-actions button {
    width: 100%;
    min-width: 0;
    min-height: clamp(82px, 11dvh, 104px);
    display: grid;
    align-content: space-between;
    justify-items: start;
    padding: 14px;
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    line-height: 1.15;
    text-align: left;
  }

  body[data-portal-type="cliente"] .client-app-actions button strong {
    font-size: clamp(1.08rem, 4.4vw, 1.32rem);
  }

  body[data-portal-type="cliente"] .client-app-actions button span {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem;
    line-height: 1.2;
  }

  body[data-portal-type="cliente"] .client-app-actions button:hover,
  body[data-portal-type="cliente"] .client-app-actions button.active {
    color: var(--brand-dark);
    background: var(--white);
  }

  body[data-portal-type="cliente"] .client-app-actions button:last-child:nth-child(odd) {
    grid-column: auto;
  }

  body[data-portal-type="cliente"] .client-status-actions {
    grid-template-columns: 1fr;
  }

  body[data-portal-type="cliente"] .client-status-actions .buttonlike,
  body[data-portal-type="cliente"] .client-status-actions button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    border-color: #f4c542;
    color: #102129;
    background: #ffd24a;
    font-size: 0.95rem;
    box-shadow: 0 10px 24px rgba(201, 148, 46, 0.28);
  }

  body[data-portal-type="cliente"] .client-status-actions .buttonlike:hover,
  body[data-portal-type="cliente"] .client-status-actions button:hover,
  body[data-portal-type="cliente"] .client-screen-head button:hover {
    color: #102129;
    background: #ffdf6b;
  }

  body[data-portal-type="cliente"] .client-screen-head {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    margin: -14px -14px 14px;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(14px);
  }

  body[data-portal-type="cliente"] .client-screen-head button {
    min-width: 0;
    min-height: 42px;
    border-color: #f4c542;
    padding-inline: 12px;
    color: #102129;
    background: #ffd24a;
    box-shadow: 0 8px 18px rgba(201, 148, 46, 0.24);
    white-space: nowrap;
  }

  body[data-portal-type="cliente"] .client-screen-head h2 {
    font-size: 1.18rem;
    line-height: 1.15;
  }

  body[data-portal-type="cliente"] .client-app-screen:not([data-client-screen="inicio"]) {
    min-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
    align-content: start;
    justify-items: center;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  body[data-portal-type="cliente"] .client-app-screen:not([data-client-screen="inicio"]) > .panel,
  body[data-portal-type="cliente"] .client-app-screen:not([data-client-screen="inicio"]) > section,
  body[data-portal-type="cliente"] .client-app-screen:not([data-client-screen="inicio"]) > div {
    width: min(100%, 480px);
    margin-inline: auto;
  }

  body[data-portal-type="cliente"] .client-app-screen.active::after {
    content: none;
  }

  body[data-portal-type="cliente"] .client-grid,
  body[data-portal-type="cliente"] .client-method {
    grid-template-columns: 1fr;
  }

  body[data-portal-type="cliente"] .client-grid.client-app-screen.active {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body[data-portal-type="cliente"] .client-metrics {
    width: min(100%, 480px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: auto;
  }

  body[data-portal-type="cliente"] .client-metrics .metric:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .client-upload-grid {
    grid-template-columns: 1fr;
  }

  body[data-portal-type="cliente"] .client-method {
    width: min(100%, 480px);
    margin-inline: auto;
  }

  body[data-portal-type="cliente"] .client-table tbody {
    width: 100%;
    max-width: 100%;
    justify-items: center;
  }

  body[data-portal-type="cliente"] .client-table table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  body[data-portal-type="cliente"] .client-table tr {
    width: min(100%, 480px);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body[data-portal-type="cliente"] .client-table td {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 4px;
    overflow-wrap: anywhere;
  }

  body[data-portal-type="cliente"] .client-table td > *,
  body[data-portal-type="cliente"] .client-table td strong,
  body[data-portal-type="cliente"] .client-table td small,
  body[data-portal-type="cliente"] .client-table .pill {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .panel,
  .form-panel,
  .metric {
    padding: 14px;
  }

  .metrics,
  .client-metrics {
    gap: 10px;
  }

  .metric strong {
    font-size: 1.3rem;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-hero,
  .client-hero {
    padding: 16px;
  }

  .map-hero h2,
  .client-hero h2 {
    font-size: 1.45rem;
  }

  body[data-portal-type="cliente"] .client-hero h2 {
    font-size: clamp(1.6rem, 7vw, 2.05rem);
  }

  .map-stat strong {
    font-size: 1.8rem;
  }

  .workbench,
  .client-grid,
  .prospect-map-layout {
    gap: 12px;
  }

  #clientes .client-detail-panel,
  #clientes .form-panel,
  #cartera .debt-detail-panel {
    display: none;
  }

  #clientes .workbench,
  #cartera .workbench {
    display: block;
  }

  body.client-form-open #clientes .workbench {
    display: none;
  }

  #clientes .client-list-panel {
    width: min(100%, 540px);
    margin-inline: auto;
  }

  body.client-detail-open #clientes .workbench {
    display: none;
  }

  body.client-detail-open #clientes .client-detail-panel {
    display: grid;
    width: min(100%, 540px);
    min-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    margin-inline: auto;
  }

  body.debt-detail-open #cartera .workbench {
    display: none;
  }

  body.debt-detail-open #cartera .debt-detail-panel {
    display: grid;
    width: min(100%, 540px);
    min-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    margin-inline: auto;
  }

  body.client-form-open #clientes .client-form-panel {
    display: grid;
    width: min(100%, 540px);
    min-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    margin-inline: auto;
  }

  #clientes .client-back,
  #clientes .client-form-back,
  #cartera .debt-back {
    width: 100%;
    min-height: 46px;
    margin-bottom: 4px;
    border-color: #f4c542;
    color: #102129;
    background: #ffd24a;
    box-shadow: 0 8px 18px rgba(201, 148, 46, 0.24);
  }

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

  .debt-profile-grid,
  .debt-card-grid {
    grid-template-columns: 1fr;
  }

  #clientsTable td:nth-child(3),
  #clientsTable td:nth-child(5),
  #clientsTable td:nth-child(6),
  #clientsTable td:nth-child(7) {
    display: none;
  }

  #clientsTable tr {
    position: relative;
    width: 100%;
  }

  #clientsTable tr::after {
    content: "Ver detalle";
    display: inline-flex;
    margin: 0 12px 12px;
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--brand-dark);
    background: #eaf4f2;
    font-size: 0.78rem;
    font-weight: 900;
  }

  body:not(.prospect-detail-open) #prospectos .prospect-map-layout,
  #prospectos .form-panel {
    display: none;
  }

  body.prospect-map-open:not(.prospect-detail-open) #prospectos .prospect-map-layout {
    display: block;
    margin-bottom: 12px;
  }

  body.prospect-map-open:not(.prospect-detail-open) #prospectos .prospect-detail {
    display: none;
  }

  body.prospect-map-open:not(.prospect-detail-open) #prospectos .prospect-map {
    min-height: 260px;
  }

  #prospectos .workbench {
    display: block;
  }

  #prospectos .prospect-list-panel {
    width: min(100%, 540px);
    margin-inline: auto;
  }

  body.prospect-detail-open #prospectos .workbench {
    display: none;
  }

  body.prospect-detail-open #prospectos .prospect-map-layout {
    display: block;
    margin-bottom: 0;
  }

  body.prospect-detail-open #prospectos .map-panel {
    display: none;
  }

  #prospectos .prospect-detail {
    display: block;
    width: min(100%, 540px);
    min-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    margin-inline: auto;
  }

  #prospectos .prospect-back {
    width: 100%;
    min-height: 46px;
    margin-bottom: 14px;
    border-color: #f4c542;
    color: #102129;
    background: #ffd24a;
    box-shadow: 0 8px 18px rgba(201, 148, 46, 0.24);
  }

  #prospectsTable td:nth-child(3),
  #prospectsTable td:nth-child(4),
  #prospectsTable td:nth-child(6),
  #prospectsTable td:nth-child(7),
  #prospectsTable td:nth-child(8) {
    display: none;
  }

  .prospect-intel-grid {
    grid-template-columns: 1fr;
  }

  #prospectsTable tr {
    position: relative;
    width: 100%;
  }

  #prospectsTable td {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  #prospectsTable td:nth-child(2) strong {
    font-size: 1.05rem;
  }

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

  .form-actions button,
  .form-actions .button {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

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

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--white);
    box-shadow: 0 8px 22px rgba(16, 33, 41, 0.06);
  }

  td {
    position: relative;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 1px solid #edf2f0;
    padding: 9px 0;
    font-size: 0.88rem;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  td:empty,
  td[data-label=""]::before {
    display: none;
  }

  .row-actions,
  .quick-actions {
    grid-column: 1 / -1;
  }

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

  .row-actions button,
  .quick-actions a {
    justify-content: center;
    width: 100%;
    min-height: 38px;
  }

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

  .prospect-map {
    min-height: 320px;
  }

  .tour-card {
    max-height: calc(100vh - 28px);
    overflow: auto;
  }

  .demo-topbar .brand {
    min-width: 0;
  }

  .demo-tabs {
    display: flex;
    overflow-x: auto;
  }

  .demo-tabs button {
    min-width: max-content;
    padding-inline: 14px;
  }

  .demo-contact-strip {
    border-radius: 0;
  }
}

@media (max-width: 360px) {
  body[data-portal-type="cliente"] .client-metrics {
    grid-template-columns: 1fr;
  }

  body[data-portal-type="cliente"] .client-metrics .metric:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

/* Tablero operativo: override final para evitar que .panel lo deje blanco. */
body[data-portal-type="interno"] #tablero .dashboard-home.panel {
  color: #ffffff;
  background-color: #13272d;
  background-image: linear-gradient(135deg, rgba(16, 33, 41, 0.98), rgba(19, 39, 45, 0.94) 58%, rgba(0, 124, 137, 0.82));
}

body[data-portal-type="interno"] #tablero .dashboard-home.panel .eyebrow,
body[data-portal-type="interno"] #tablero .dashboard-home.panel h2,
body[data-portal-type="interno"] #tablero .dashboard-home.panel strong {
  color: #ffffff;
}

body[data-portal-type="interno"] #tablero .dashboard-home.panel p:not(.eyebrow),
body[data-portal-type="interno"] #tablero .dashboard-home.panel small {
  color: rgba(255, 255, 255, 0.74);
}

/* Theme unificado con la web pública */
body,
.public-demo-body {
  background:
    linear-gradient(180deg, rgba(19, 39, 45, 0.05), rgba(247, 248, 245, 0) 320px),
    var(--soft);
}

.topbar,
.demo-topbar {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 34px rgba(16, 33, 41, 0.07);
}

.demo-main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 9px;
}

.demo-main-nav a:hover {
  color: var(--brand-dark);
  background: #eef4f3;
}

.demo-actions button,
.demo-tabs button.active,
.demo-tabs button:hover {
  box-shadow: 0 10px 24px rgba(0, 124, 137, 0.18);
}

.panel,
.metric,
.form-panel,
.client-checklist details,
.timeline-item,
.payment-lines > div,
.payment-summary,
.service-menu-grid article,
.demo-tabs {
  border-color: rgba(217, 225, 222, 0.95);
  box-shadow: 0 14px 34px rgba(16, 33, 41, 0.08);
}

.public-demo .client-hero,
body[data-portal-type="cliente"] .client-hero,
body[data-portal-type="interno"] #tablero .dashboard-home.panel {
  background:
    radial-gradient(circle at 15% 12%, rgba(201, 148, 46, 0.28), transparent 30%),
    linear-gradient(135deg, rgba(16, 33, 41, 0.99), rgba(19, 39, 45, 0.95) 58%, rgba(0, 124, 137, 0.78)),
    var(--brand-dark);
}

.demo-contact-strip {
  background:
    radial-gradient(circle at 12% 10%, rgba(201, 148, 46, 0.22), transparent 28%),
    linear-gradient(135deg, #13272d, #17333a 62%, #007c89);
}

/* Brand refresh: Tierra Firme should feel like one product, not loose admin pages. */
.brand > span:first-child,
.brand-mark {
  background:
    url("../assets/tierra-firme-sello-cobre-192.png") center / cover no-repeat,
    var(--brand-dark);
  color: transparent;
  font-size: 0;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

.login-brand span {
  flex: 0 0 42px;
}

body[data-portal-type="interno"] {
  background:
    linear-gradient(180deg, rgba(19, 39, 45, 0.12), rgba(247, 248, 245, 0) 360px),
    linear-gradient(90deg, rgba(201, 148, 46, 0.07), rgba(0, 124, 137, 0.05)),
    var(--soft);
}

body[data-portal-type="interno"] .topbar {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(16, 33, 41, 0.98), rgba(19, 39, 45, 0.96) 62%, rgba(0, 124, 137, 0.82)),
    var(--brand-dark);
  box-shadow: 0 18px 46px rgba(16, 33, 41, 0.18);
}

body[data-portal-type="interno"] .topbar .eyebrow,
body[data-portal-type="interno"] .topbar h1 {
  color: var(--white);
}

body[data-portal-type="interno"] .topbar .user-pill {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

body[data-portal-type="interno"] .topbar .ghost {
  color: var(--brand-dark);
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.92);
}

body[data-portal-type="interno"] .topbar .ghost:hover {
  color: var(--ink);
  background: #ffdf6b;
  border-color: #ffdf6b;
}

body[data-portal-type="interno"] .view > .section-toolbar.panel,
body[data-portal-type="interno"] #mapa > .map-hero,
body[data-portal-type="interno"] #pitches > .map-hero {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(16, 33, 41, 0.98), rgba(19, 39, 45, 0.95) 58%, rgba(0, 124, 137, 0.78)),
    var(--brand-dark);
  box-shadow: 0 18px 46px rgba(16, 33, 41, 0.16);
}

body[data-portal-type="interno"] .view > .section-toolbar.panel .eyebrow,
body[data-portal-type="interno"] .view > .section-toolbar.panel h2,
body[data-portal-type="interno"] #mapa > .map-hero h2,
body[data-portal-type="interno"] #pitches > .map-hero h2 {
  color: var(--white);
}

body[data-portal-type="interno"] .view > .section-toolbar.panel .ghost {
  color: var(--brand-dark);
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.94);
}

body[data-portal-type="interno"] .view > .section-toolbar.panel button:not(.ghost) {
  color: var(--ink);
  border-color: #f4c542;
  background: #ffd24a;
  box-shadow: 0 10px 24px rgba(201, 148, 46, 0.26);
}

body[data-portal-type="interno"] .demo-toggle-light {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

body[data-portal-type="interno"] .panel,
body[data-portal-type="interno"] .form-panel {
  background:
    linear-gradient(135deg, rgba(0, 124, 137, 0.045), rgba(255, 255, 255, 0) 46%),
    #ffffff;
}

body[data-portal-type="interno"] .panel-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(217, 225, 222, 0.86);
}

body[data-portal-type="interno"] table thead th {
  color: var(--white);
  background: var(--brand-dark);
  border-bottom-color: var(--brand-dark);
}

body[data-portal-type="interno"] table tbody tr:nth-child(even) td {
  background: rgba(238, 246, 245, 0.54);
}

body[data-portal-type="interno"] .clickable-row:hover td,
body[data-portal-type="interno"] tbody tr:hover td {
  background: #eaf4f2;
}

body[data-portal-type="interno"] .quick-actions a {
  border-color: rgba(0, 124, 137, 0.22);
  background: #eef6f5;
}

.inline-response-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 124, 137, 0.18);
  border-radius: 8px;
  background: #f8fbfa;
}

.inline-response-box summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--brand-dark);
}

.inline-response-box label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.86rem;
  font-weight: 800;
}

.inline-response-box textarea {
  width: 100%;
  min-width: 260px;
  resize: vertical;
}

.login-body {
  background:
    linear-gradient(rgba(16, 33, 41, 0.72), rgba(16, 33, 41, 0.72)),
    url("../assets/medellin-dashboard.webp") center/cover no-repeat,
    var(--brand-dark);
}

.login-panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 245, 0.96));
}

/* Demo cliente: header de marca consistente con la web publica. */
.public-demo .demo-topbar {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 12% 0%, rgba(201, 148, 46, 0.28), transparent 32%),
    linear-gradient(135deg, rgba(16, 33, 41, 0.98), rgba(19, 39, 45, 0.96) 62%, rgba(0, 124, 137, 0.8)),
    var(--brand-dark);
  box-shadow: 0 18px 46px rgba(16, 33, 41, 0.18);
}

.public-demo .demo-topbar .brand {
  min-width: 300px;
  color: var(--white);
}

.public-demo .demo-topbar .brand > span:first-child {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    url("../assets/tierra-firme-sello-cobre-192.png") center / cover no-repeat,
    #102129;
  color: transparent;
  font-size: 0;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
}

.public-demo .demo-topbar .brand .demo-brand-copy strong {
  color: var(--white);
  font-size: clamp(1.02rem, 1.45vw, 1.24rem);
  line-height: 1.05;
  white-space: nowrap;
}

.public-demo .demo-main-nav a {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
}

.public-demo .demo-main-nav a:hover {
  color: var(--ink);
  background: #ffd24a;
}

.public-demo .demo-home-link,
.public-demo .demo-actions button {
  color: var(--brand-dark);
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.94);
}

.public-demo .demo-actions button:hover,
.public-demo .demo-home-link:hover {
  border-color: #ffd24a;
  background: #ffd24a;
}

@media (max-width: 760px) {
  .public-demo .demo-topbar {
    gap: 12px;
  }

  .public-demo .demo-topbar .brand {
    min-width: 0;
    width: 100%;
  }

  .public-demo .demo-main-nav {
    width: 100%;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
  }
}

@media (max-width: 520px) {
  .public-demo .demo-topbar .brand .demo-brand-copy strong {
    font-size: 0.98rem;
  }
}

body:not(.prospect-form-open) #prospectos .prospect-form-panel,
body:not(.client-form-open) #clientes .client-form-panel,
body.client-detail-open #clientes .client-form-panel {
  display: none !important;
}

body.client-form-open:not(.client-detail-open) #clientes .client-form-panel {
  display: grid !important;
}

@media (max-width: 720px) {
  #whatsappProspectos .whatsapp-workbench {
    gap: 12px;
  }

  #whatsappProspectos .whatsapp-prospect-card {
    padding: 12px;
  }

  #whatsappProspectos .whatsapp-prospect-card > header,
  #whatsappProspectos .whatsapp-inbox-item > header {
    display: grid;
    grid-template-columns: 1fr;
  }

  #whatsappProspectos .whatsapp-prospect-card > header > span,
  #whatsappProspectos .whatsapp-inbox-item > header > span {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    overflow-wrap: anywhere;
    text-align: left;
  }

  #whatsappProspectos .whatsapp-card-grid,
  #whatsappProspectos .whatsapp-inbox-grid,
  #whatsappProspectos .whatsapp-inbox-form {
    grid-template-columns: 1fr;
  }

  #whatsappProspectos .module-head.compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #whatsappProspectos .whatsapp-message-preview,
  #whatsappProspectos .message-bubble {
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.48;
    font-size: 0.94rem;
  }

  #whatsappProspectos .row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #whatsappProspectos .row-actions button,
  #whatsappProspectos .row-actions .buttonlike {
    width: 100%;
    min-height: 40px;
  }

  #whatsappProspectos .inline-response-box {
    width: 100%;
  }
}

