:root {
  --ink: #1a2433;
  --ink-soft: rgba(26, 36, 51, 0.68);
  --card-bg: rgba(255, 252, 247, 0.9);
  --card-bg-strong: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(180, 166, 148, 0.26);
  --panel-shadow: 0 24px 60px rgba(24, 31, 46, 0.12);
  --accent: #ca4638;
  --accent-dark: #942e24;
  --accent-soft: rgba(202, 70, 56, 0.14);
  --emerald-soft: rgba(24, 162, 111, 0.12);
  --cream: #f7f2ea;
  --paper: #fffdf8;
}

body.portal-theme {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background-color: #f1ebe3;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.portal-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(251, 247, 240, 0.8) 0%,
      rgba(246, 239, 229, 0.66) 38%,
      rgba(255, 253, 248, 0.92) 100%
    );
  pointer-events: none;
  z-index: 0;
}

body.portal-theme.theme-main {
  background-image: url("/static/images/bg-main-dashboard.png");
}

body.portal-theme.theme-batches {
  background-image: url("/static/images/bg-batches.png");
}

body.portal-theme.theme-expedientes {
  background-image: url("/static/images/bg-expedientes.png");
}

body.portal-theme.theme-admin {
  background-image: url("/static/images/bg-admin.png");
}

.portal-theme.theme-drops {
  background-image:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.78), transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(242, 199, 171, 0.34), transparent 26%),
    linear-gradient(180deg, rgba(249, 244, 236, 0.96), rgba(244, 237, 228, 0.78));
}

.navbar,
main.container,
.dora-floating {
  position: relative;
  z-index: 1;
}

.portal-topbar {
  padding-top: 18px;
}

.portal-topbar__inner {
  min-height: 84px;
  padding: 14px 22px;
  border: 1px solid rgba(194, 178, 161, 0.32);
  border-radius: 28px;
  background: rgba(255, 252, 248, 0.84);
  box-shadow: 0 18px 42px rgba(28, 31, 44, 0.1);
  backdrop-filter: blur(16px) saturate(138%);
}

.portal-brand {
  color: var(--ink) !important;
  font-size: 1rem;
  text-decoration: none;
}

.portal-brand span {
  display: grid;
  line-height: 1.08;
}

.portal-brand .editorial-brand,
.portal-brand .editorial-brand--portal {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  line-height: 1;
}

.portal-brand .editorial-brand__wordmark {
  display: inline-flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.portal-brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.03em;
}

.portal-brand small {
  color: rgba(83, 92, 108, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-nav {
  gap: 6px;
  align-items: center;
}

.portal-nav-link {
  padding: 0.7rem 0.95rem !important;
  border-radius: 999px;
  color: rgba(43, 52, 66, 0.74) !important;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible,
.portal-nav-link.is-active {
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(201, 74, 57, 0.16);
}

.portal-nav-link.is-active {
  color: var(--accent-dark) !important;
}

.portal-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(194, 178, 161, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.portal-user-meta {
  display: grid;
  gap: 1px;
}

.portal-user-role {
  color: rgba(83, 92, 108, 0.7);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-user-meta strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.navbar.bg-dark {
  background: transparent !important;
}

.auth-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px 0 0;
}

.auth-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border: 1px solid rgba(173, 196, 216, 0.18);
  border-radius: 28px;
  background: rgba(7, 16, 32, 0.18);
  box-shadow: 0 16px 36px rgba(2, 10, 20, 0.14);
  backdrop-filter: blur(12px) saturate(125%);
}

.auth-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1;
  text-decoration: none;
  color: #f8fbff;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-brand .brand-mark {
  width: min(176px, 30vw);
  height: auto;
  margin-bottom: -18px;
}

.auth-brand span {
  font-size: 1rem;
  color: #f8fbff;
  line-height: 0.9;
  -webkit-text-stroke: 1px rgba(4, 10, 18, 0.92);
  text-shadow: 0 1px 2px rgba(4, 10, 18, 0.85);
}

.auth-back {
  align-self: flex-start;
}

.brand-mark {
  width: 38px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(202, 70, 56, 0.18));
}

main.container {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.76), rgba(255, 255, 255, 0.84));
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(14px);
  padding: 1.15rem 1.15rem 2rem;
}

main.container.auth-main {
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  padding: 0;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 28px) 0 12px;
}

.auth-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.24);
  backdrop-filter: blur(18px) saturate(135%);
}

.auth-panel-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  color: #f8fbff;
  padding: 10px 8px;
}

.auth-panel-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.auth-panel-copy p {
  margin: 0;
  color: rgba(248, 251, 255, 0.92);
  line-height: 1.6;
  max-width: 60ch;
}

.auth-list {
  margin: 2px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: rgba(248, 251, 255, 0.9);
  line-height: 1.45;
}

.auth-list li::marker {
  color: #43d3b5;
}

.auth-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(186, 201, 220, 0.76);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.16);
}

.auth-card h1 {
  margin: 0 0 12px;
}

.auth-panel-compact {
  grid-template-columns: 0.9fr 0.8fr;
}

.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.auth-links-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.auth-links-row .auth-link-left {
  justify-self: start;
}

.auth-links-row .auth-link-right {
  justify-self: end;
}

.admin-access-panel {
  background: rgba(255, 250, 244, 0.78);
  border-color: rgba(194, 168, 133, 0.24);
  box-shadow: 0 26px 60px rgba(36, 28, 18, 0.12);
}

.admin-access-panel .auth-panel-copy {
  color: #1d2734;
}

.admin-access-panel .auth-panel-copy p,
.admin-access-panel .auth-list {
  color: rgba(53, 64, 79, 0.86);
}

.admin-access-panel .auth-list li::marker {
  color: #c94a39;
}

.batch-state-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.12);
}

.batch-state-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.batch-state-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.68);
}

.batch-state-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.1;
}

.batch-state-code {
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.72);
  font-weight: 700;
}

.batch-state-desc {
  font-size: 0.96rem;
  color: rgba(15, 23, 42, 0.78);
  line-height: 1.45;
}

.batch-state-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
}

.batch-state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip-success {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.24);
}

.chip-warning {
  background: rgba(250, 204, 21, 0.18);
  color: #854d0e;
  border-color: rgba(250, 204, 21, 0.28);
}

.chip-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.22);
}

.batch-state-success {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(220, 252, 231, 0.94));
}

.batch-state-warning {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(254, 249, 195, 0.94));
}

.batch-state-danger {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(254, 202, 202, 0.94));
}

.batch-state-info {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.94));
}

.card,
.table-responsive,
.alert {
  background: var(--card-bg);
  border-color: var(--glass-border) !important;
  box-shadow: 0 18px 38px rgba(27, 31, 42, 0.08);
  backdrop-filter: blur(10px);
}

.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  padding: 0.92rem 0.95rem;
  border-bottom-color: rgba(186, 174, 159, 0.22);
}

.table thead th {
  white-space: nowrap;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(83, 92, 108, 0.7);
  font-weight: 700;
}

.table .badge {
  font-size: 0.74rem;
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
}

.upload-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: rgba(15, 23, 42, 0.78);
  font-size: 0.9rem;
}

.upload-limits span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 252, 0.9);
}

.card-kpi {
  border: 1px solid rgba(194, 178, 161, 0.2);
  border-left: 0;
  border-top: 4px solid rgba(202, 70, 56, 0.4);
  background: rgba(255, 255, 255, 0.9);
}

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

.crm-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(2, 6, 23, 0.12);
}

.crm-eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}

.crm-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 850;
}

.crm-header p {
  margin: 6px 0 0;
  max-width: 68ch;
  color: rgba(15, 23, 42, 0.7);
}

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

.crm-grid {
  display: grid;
  gap: 14px;
}

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

.crm-kpi,
.crm-panel {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.08);
}

.crm-kpi {
  padding: 18px;
  display: grid;
  gap: 6px;
  border-top: 4px solid rgba(202, 70, 56, 0.44);
}

.crm-kpi-alert {
  border-top-color: #b45309;
}

.crm-kpi span,
.crm-panel-title span,
.crm-note {
  color: rgba(15, 23, 42, 0.62);
}

.crm-kpi strong {
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  line-height: 1;
}

.crm-kpi small {
  color: rgba(15, 23, 42, 0.66);
  font-weight: 650;
}

.crm-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.crm-panel {
  padding: 16px;
  overflow: hidden;
}

.crm-panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.crm-panel-title h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 850;
}

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

.crm-mini-grid div,
.crm-status-list div,
.crm-leads div {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.88);
}

.crm-mini-grid-link {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.88);
  color: inherit;
  text-decoration: none;
}

.crm-mini-grid div {
  padding: 12px;
  display: grid;
  gap: 2px;
}

.crm-mini-grid-link {
  padding: 12px;
  display: grid;
  gap: 2px;
}

.crm-mini-grid strong {
  font-size: 1.3rem;
}

.crm-mini-grid span {
  color: rgba(15, 23, 42, 0.64);
  font-size: 0.86rem;
}

.crm-status-list,
.crm-leads {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.crm-status-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.crm-leads div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
}

.crm-leads span {
  color: rgba(15, 23, 42, 0.64);
  font-size: 0.9rem;
}

.crm-note {
  margin: 12px 0 0;
  font-size: 0.9rem;
}

@media (max-width: 992px) {
  .crm-header,
  .crm-split {
    grid-template-columns: 1fr;
  }

  .crm-header {
    display: grid;
    align-items: start;
  }

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

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

  .auth-panel-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .crm-kpis,
  .crm-mini-grid {
    grid-template-columns: 1fr;
  }
}

.expediente-summary-card,
.expediente-admin-card,
.expediente-docs-card {
  border: 0;
  overflow: hidden;
}

.expediente-summary-card .card-body,
.expediente-admin-card .card-body,
.expediente-docs-card .card-body {
  padding: 1.15rem 1.2rem;
}

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

.expediente-field {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.86);
}

.expediente-field span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(71, 85, 105, 0.82);
  font-weight: 700;
}

.expediente-field strong {
  font-size: 1rem;
  color: #0f172a;
  line-height: 1.25;
}

.expediente-field small {
  color: rgba(71, 85, 105, 0.9);
  font-size: 0.84rem;
}

.expediente-status-badge {
  font-size: 0.82rem;
  padding: 0.55rem 0.78rem;
  letter-spacing: 0.04em;
}

.expediente-admin-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.expediente-admin-actions form {
  margin: 0;
}

.expediente-admin-actions .btn {
  width: 100%;
}

.expediente-upload-grid {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 12px;
  align-items: end;
}

.expediente-upload-grid .d-grid {
  align-self: end;
}

.expediente-doc-table th {
  white-space: nowrap;
}

.expediente-doc-table td {
  vertical-align: middle;
}

.dora-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.24);
  padding: 8px 12px 8px 8px;
  max-width: 250px;
}

.dora-floating:hover {
  color: #0f172a;
  transform: translateY(-1px);
}

.dora-floating img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
}

a {
  color: var(--accent-dark);
}

a:hover {
  color: var(--accent);
}

.btn {
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #ce4f3d, #a93126);
  border-color: #b43b2d;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(135deg, #d45b46, #a72a1d);
  border-color: #a72a1d;
}

.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-warning {
  border-width: 1px;
  background: rgba(255, 255, 255, 0.78);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  border-radius: 14px;
  border-color: rgba(194, 178, 161, 0.5);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(202, 70, 56, 0.48);
  box-shadow: 0 0 0 4px rgba(202, 70, 56, 0.08);
}

.list-group-item {
  border-color: rgba(194, 178, 161, 0.18);
}

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

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid rgba(194, 178, 161, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.72), transparent 32%),
    linear-gradient(135deg, rgba(255, 251, 246, 0.96), rgba(247, 241, 232, 0.9));
  box-shadow: 0 20px 48px rgba(30, 35, 48, 0.08);
}

.page-hero-main {
  max-width: 70ch;
}

.page-hero-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.page-hero p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

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

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 1rem 1.2rem 0.9rem;
  background: transparent;
  border-bottom: 1px solid rgba(194, 178, 161, 0.18);
}

.section-header h2,
.section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.soft-panel {
  overflow: hidden;
}

.soft-panel .card-body {
  padding: 1.2rem;
}

.portal-list .list-group-item,
.list-group-item-action {
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.78);
}

.portal-list .list-group-item + .list-group-item,
.list-group-item + .list-group-item {
  border-top: 1px solid rgba(194, 178, 161, 0.16);
}

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

.action-tile {
  display: grid;
  gap: 6px;
  min-height: 128px;
  padding: 18px;
  border: 1px solid rgba(194, 178, 161, 0.24);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  color: var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.action-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(202, 70, 56, 0.24);
  box-shadow: 0 18px 36px rgba(28, 34, 44, 0.08);
}

.action-tile strong {
  font-size: 1rem;
}

.action-tile span {
  color: var(--ink-soft);
  line-height: 1.55;
}

.action-tile-primary {
  background: linear-gradient(135deg, rgba(252, 245, 238, 0.98), rgba(248, 232, 218, 0.94));
}

.dashboard-nova-card {
  background:
    radial-gradient(circle at bottom right, rgba(202, 70, 56, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 243, 236, 0.92));
}

.dashboard-nova-tag {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.crm-lead-link {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.88);
  color: inherit;
  text-decoration: none;
}

.crm-lead-link:hover {
  border-color: rgba(202, 70, 56, 0.22);
  color: inherit;
}

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

.admin-drop-description {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(194, 178, 161, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  white-space: pre-wrap;
  line-height: 1.65;
  color: var(--ink);
}

@media (max-width: 992px) {
  main.container {
    border-radius: 14px;
    padding: 0.8rem 0.8rem 1.5rem;
  }

  .portal-topbar__inner,
  .page-hero {
    border-radius: 22px;
  }

  .portal-topbar__inner,
  .page-hero,
  .portal-user-pill {
    display: grid;
  }

  .portal-nav {
    margin: 12px 0;
  }

  .page-hero-actions {
    justify-content: flex-start;
  }

  .action-tiles,
  .admin-drop-grid {
    grid-template-columns: 1fr;
  }

  .dora-floating span {
    display: none;
  }

  .dora-floating {
    padding-right: 8px;
  }
}

@media (max-width: 768px) {
  .auth-topbar-inner {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 22px;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    border-radius: 22px;
    padding: 16px;
  }

  .portal-topbar {
    padding-top: 12px;
  }

  .auth-links-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .auth-links-row .auth-link-left,
  .auth-links-row .auth-link-right {
    justify-self: stretch;
  }

  .batch-state-card {
    flex-direction: column;
  }

  .page-hero {
    padding: 18px;
  }

  .expediente-summary-grid,
  .expediente-admin-actions,
  .expediente-upload-grid {
    grid-template-columns: 1fr;
  }

  .batch-state-legend {
    justify-content: flex-start;
  }

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

/* 2026-05 editorial portal refresh */
body.portal-theme {
  background-color: #f5f0e8;
  background-image: none !important;
}

body.portal-theme::before {
  background:
    radial-gradient(980px 480px at 8% 0%, rgba(255, 255, 255, 0.78), transparent 68%),
    radial-gradient(760px 320px at 100% 10%, rgba(235, 221, 205, 0.48), transparent 60%),
    linear-gradient(180deg, rgba(248, 243, 236, 0.98), rgba(244, 238, 230, 0.98));
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: 16px;
  margin-bottom: 18px;
}

.portal-topbar__inner {
  min-height: 76px;
  padding: 12px 20px;
  border-radius: 26px;
  border: 1px solid rgba(198, 184, 168, 0.24);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(29, 34, 43, 0.08);
  backdrop-filter: blur(20px) saturate(135%);
}

.portal-brand strong {
  font-size: 0.99rem;
  letter-spacing: -0.04em;
}

.portal-brand small {
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.portal-nav {
  gap: 2px;
}

.portal-nav-link {
  padding: 0.72rem 0.88rem !important;
  border-radius: 14px;
  background: transparent;
  color: rgba(43, 52, 66, 0.72) !important;
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible {
  background: rgba(246, 240, 232, 0.92);
  box-shadow: inset 0 -2px 0 rgba(201, 74, 57, 0.2);
}

.portal-nav-link.is-active {
  color: var(--accent-dark) !important;
  background: transparent;
  box-shadow: inset 0 -2px 0 rgba(201, 74, 57, 0.92);
}

.portal-user-pill {
  gap: 12px;
  padding: 8px 10px 8px 12px;
  border-radius: 20px;
  border-color: rgba(198, 184, 168, 0.24);
  background: rgba(255, 255, 255, 0.94);
}

.portal-user-role {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

main.container {
  max-width: 1460px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0 0 2rem;
}

.portal-page-shell,
.crm-shell {
  gap: 22px;
}

.kicker,
.page-hero-kicker,
.crm-eyebrow,
.dashboard-nova-tag {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c34a3d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-hero,
.crm-header {
  align-items: flex-start;
  padding: clamp(24px, 3vw, 34px);
  border-radius: 30px;
  border: 1px solid rgba(198, 184, 168, 0.24);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(246, 240, 232, 0.94));
  box-shadow: 0 24px 58px rgba(28, 31, 40, 0.08);
}

.page-hero-main {
  display: grid;
  gap: 8px;
  max-width: 74ch;
}

.page-hero h1,
.crm-header h1 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.page-hero p,
.crm-header p,
.section-header p,
.action-tile span,
.portal-user-meta strong,
.crm-note {
  color: rgba(32, 40, 52, 0.66);
}

.page-hero-actions,
.crm-actions {
  gap: 10px;
}

.card,
.table-responsive,
.alert,
.crm-kpi,
.crm-panel,
.soft-panel,
.auth-card {
  border: 1px solid rgba(198, 184, 168, 0.22) !important;
  border-radius: 26px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 20px 52px rgba(24, 28, 37, 0.06);
  backdrop-filter: blur(16px) saturate(132%);
}

.table-responsive {
  overflow: hidden;
}

.table > :not(caption) > * > * {
  padding: 1rem 0.96rem;
  border-bottom-color: rgba(198, 184, 168, 0.18);
}

.table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(97, 105, 118, 0.72);
}

.table tbody tr:hover {
  background: rgba(246, 240, 232, 0.58);
}

.table .badge {
  border-radius: 999px;
  padding: 0.44rem 0.72rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.card-header,
.section-header {
  padding: 1.2rem 1.3rem 1rem;
  border-bottom-color: rgba(198, 184, 168, 0.16);
}

.section-header h2,
.section-title,
.crm-panel-title h2 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.soft-panel .card-body,
.crm-panel {
  padding: 1.25rem;
}

.card-kpi {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(198, 184, 168, 0.2);
  background: rgba(255, 255, 255, 0.92);
}

.card-kpi::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 18px;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c94a39, #ebb170);
}

.card-kpi .card-body {
  padding-top: 30px;
}

.portal-list .list-group-item,
.list-group-item-action {
  padding: 0.96rem 1rem;
  background: transparent;
}

.action-tile {
  min-height: 148px;
  padding: 20px;
  border-radius: 24px;
  border-color: rgba(198, 184, 168, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 243, 236, 0.94));
}

.action-tile:hover {
  border-color: rgba(201, 74, 57, 0.28);
  box-shadow: 0 22px 44px rgba(28, 34, 44, 0.08);
}

.action-tile strong {
  font-size: 1.02rem;
}

.action-tile-primary,
.dashboard-nova-card {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.66), transparent 34%),
    linear-gradient(180deg, rgba(252, 246, 240, 0.98), rgba(246, 234, 224, 0.94));
}

.batch-state-card,
.crm-mini-grid div,
.crm-status-list div,
.crm-leads div,
.crm-lead-link,
.expediente-field,
.admin-drop-description {
  border-radius: 18px;
  border-color: rgba(198, 184, 168, 0.2);
  background: rgba(255, 255, 255, 0.76);
}

.crm-kpis {
  gap: 16px;
}

.crm-kpi {
  padding: 20px;
  border-top: 1px solid rgba(198, 184, 168, 0.22);
}

.crm-kpi strong {
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
}

.crm-panel-title {
  margin-bottom: 14px;
}

.crm-lead-link:hover {
  border-color: rgba(201, 74, 57, 0.28);
  background: rgba(255, 255, 255, 0.88);
}

.expediente-summary-grid,
.expediente-admin-actions,
.expediente-upload-grid {
  gap: 14px;
}

.expediente-field {
  padding: 14px 16px;
}

.btn {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 700;
}

.btn-sm {
  min-height: 34px;
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #c94a39, #a93126);
  border-color: #a93126;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(135deg, #d55a46, #a6291d);
  border-color: #a6291d;
}

.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-warning {
  background: rgba(255, 255, 255, 0.78);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  min-height: 46px;
  border-radius: 14px;
  border-color: rgba(198, 184, 168, 0.42);
  background: rgba(255, 255, 255, 0.96);
}

.auth-shell {
  min-height: calc(100vh - 160px);
  align-items: center;
}

.auth-panel {
  border: 1px solid rgba(198, 184, 168, 0.22);
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.5), transparent 36%),
    linear-gradient(180deg, rgba(254, 252, 248, 0.96), rgba(246, 239, 229, 0.94));
  box-shadow: 0 24px 60px rgba(24, 28, 37, 0.1);
  backdrop-filter: blur(20px);
}

.auth-panel-copy,
.auth-panel-copy p,
.auth-list {
  color: var(--ink);
}

.auth-panel-copy p,
.auth-list,
.auth-list li {
  color: rgba(32, 40, 52, 0.72);
}

.auth-list li::marker {
  color: var(--accent);
}

.auth-card {
  background: rgba(255, 255, 255, 0.92);
}

.auth-topbar-inner {
  border-color: rgba(198, 184, 168, 0.24);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 36px rgba(20, 24, 32, 0.08);
}

.auth-brand,
.auth-brand span {
  color: #151c26;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

@media (max-width: 992px) {
  .portal-topbar__inner {
    padding: 14px;
    border-radius: 22px;
  }

  .portal-user-pill {
    justify-content: space-between;
  }

  .page-hero,
  .crm-header {
    padding: 20px;
    border-radius: 24px;
  }

  main.container {
    padding-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  .portal-topbar {
    padding-top: 10px;
    margin-bottom: 14px;
  }

  .portal-nav {
    gap: 6px;
  }

  .portal-nav-link {
    padding: 0.64rem 0.78rem !important;
  }

  .page-hero h1,
  .crm-header h1 {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }

  .card,
  .table-responsive,
  .alert,
  .crm-kpi,
  .crm-panel,
  .soft-panel,
  .auth-card {
    border-radius: 22px;
  }

  .action-tile {
    min-height: 126px;
    border-radius: 20px;
  }
}

/* 2026-05 editorial portal shell v2 */
body.portal-theme {
  background: linear-gradient(180deg, #f7f2ea 0%, #f2ece4 100%);
  color: #17202c;
}

body.portal-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.82), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.58), transparent 30%);
  z-index: -1;
}

.editorial-brand--portal {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.portal-brand {
  padding: 0;
  margin-right: 22px;
}

.portal-brand .editorial-brand__title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #121924;
}

.portal-brand .editorial-brand__sub {
  font-family: "Bebas Neue", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  color: #c94a39;
}

.portal-topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
}

.portal-topbar__inner {
  padding: 16px 22px;
  border-radius: 34px;
  border: 1px solid rgba(149, 130, 111, 0.14);
  background: rgba(255, 252, 247, 0.92);
  box-shadow: 0 18px 46px rgba(39, 31, 22, 0.08);
  backdrop-filter: blur(18px) saturate(128%);
}

.portal-history-bar {
  margin-bottom: 16px;
}

.history-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 16px;
  border: 1px solid rgba(149, 130, 111, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: #1e2530;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(39, 31, 22, 0.08);
}

.history-back:hover,
.history-back:focus-visible {
  background: rgba(246, 239, 231, 0.96);
  color: #111924;
}

.history-back--portal {
  background: rgba(255, 255, 255, 0.88);
}

.portal-nav {
  gap: 8px;
}

.portal-nav-link {
  min-height: 42px;
  padding: 0 14px !important;
  border-radius: 16px;
  border: 1px solid transparent;
  color: #27303b !important;
  font-weight: 700;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible {
  background: rgba(246, 239, 231, 0.9);
  border-color: rgba(149, 130, 111, 0.16);
}

.portal-nav-link.is-active {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(201, 74, 57, 0.18);
  color: #b33b2d !important;
}

.portal-user-pill {
  border-radius: 22px;
  border: 1px solid rgba(149, 130, 111, 0.14);
  background: rgba(255, 255, 255, 0.82);
}

.portal-page-shell {
  gap: 22px;
}

.page-hero,
.soft-panel,
.portal-theme .card,
.portal-theme .table-responsive,
.portal-theme .list-group-item {
  border-radius: 34px !important;
  border-color: rgba(149, 130, 111, 0.14) !important;
  background: rgba(255, 252, 247, 0.94) !important;
  box-shadow: 0 20px 54px rgba(39, 31, 22, 0.08) !important;
}

.page-hero {
  padding: clamp(28px, 3vw, 42px);
}

.page-hero-kicker,
.dashboard-nova-tag,
.portal-user-role {
  color: #c94a39;
}

.page-hero h1,
.portal-theme h1,
.portal-theme .display-title {
  color: #111924;
  letter-spacing: -0.05em;
}

.page-hero p,
.portal-theme p,
.portal-theme .text-muted {
  color: #656d79 !important;
}

.card-kpi .card-body {
  padding: 1.4rem 1.5rem;
}

.card-kpi .h3,
.card-kpi .h6 {
  color: #111924;
}

.portal-theme .table > :not(caption) > * > * {
  padding-top: 1rem;
  padding-bottom: 1rem;
  background: transparent !important;
}

.portal-theme .table thead th {
  color: #7a8390;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-theme .list-group-item {
  margin: 0 14px 12px;
  padding: 1rem 1.1rem;
}

.action-tile {
  border-radius: 26px;
  border: 1px solid rgba(149, 130, 111, 0.14);
  background: rgba(255, 255, 255, 0.76);
}

.action-tile-primary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 240, 231, 0.98));
}

@media (max-width: 991px) {
  .portal-topbar__inner {
    padding: 14px 16px;
    border-radius: 26px;
  }

  .page-hero,
  .soft-panel,
  .portal-theme .card,
  .portal-theme .table-responsive,
  .portal-theme .list-group-item {
    border-radius: 26px !important;
  }
}

/* 2026-05 reference recreation - section 1 header/nav */
body.portal-theme {
  background:
    linear-gradient(180deg, rgba(248, 245, 240, 0.92), rgba(244, 239, 232, 0.96)),
    #f7f2ea;
}

.portal-topbar {
  top: 0;
  padding-top: 0;
  margin-bottom: 0 !important;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(34, 30, 26, 0.06);
}

.portal-topbar__inner {
  max-width: none;
  min-height: 72px;
  padding: 0 34px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(128%);
}

.portal-brand {
  width: auto;
  min-width: 190px;
  margin-right: 34px;
}

.editorial-brand--portal {
  align-items: center;
  width: max-content;
  min-width: 150px;
}

.editorial-brand__app-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: block;
  object-fit: cover;
  border-radius: 11px;
  box-shadow: 0 10px 18px rgba(6, 15, 28, 0.22);
}

.editorial-brand__wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.portal-brand .editorial-brand__title,
.editorial-brand__title {
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  line-height: 1;
}

.portal-brand .editorial-brand__sub,
.editorial-brand__sub {
  position: relative;
  width: 100%;
  margin-top: 2px;
  padding-top: 3px;
  font-family: "Sora", sans-serif;
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.48em;
  line-height: 1;
  text-align: center;
  color: #c94a39;
}

.portal-brand .editorial-brand__sub::before,
.editorial-brand__sub::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 14px;
  height: 1px;
  background: rgba(201, 74, 57, 0.72);
  transform: translateX(-50%);
}

.portal-theme .footer--legal-premium {
  margin-top: 38px;
  padding: 28px 0 34px;
  border-top: 1px solid rgba(194, 178, 161, 0.28);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.82), rgba(247, 241, 233, 0.96));
  backdrop-filter: blur(14px);
}

.portal-theme .footer-grid--legal {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.portal-theme .footer-legal-copy {
  display: grid;
  gap: 10px;
  max-width: 980px;
  justify-items: center;
  text-align: center;
}

.portal-theme .footer-legal-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #17202c;
}

.portal-theme .footer-legal-copy p {
  margin: 0;
  color: rgba(56, 66, 79, 0.84);
  line-height: 1.62;
}

.portal-theme .footer-grid--legal .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 980px;
  margin: 0 auto;
}

.portal-theme .footer-grid--legal .footer-links a,
.portal-theme .footer-grid--legal .footer-links button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(194, 178, 161, 0.42);
  background: rgba(255, 255, 255, 0.92);
  color: #213041;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(30, 37, 48, 0.06);
}

.portal-theme .footer-grid--legal .footer-links button {
  cursor: pointer;
}

.portal-theme .cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, calc(100vw - 24px));
  padding: 14px 16px;
  border: 1px solid rgba(214, 227, 244, 0.28);
  border-radius: 18px;
  background: rgba(16, 24, 36, 0.94);
  color: #edf3ff;
  box-shadow: 0 18px 44px rgba(6, 15, 28, 0.24);
  z-index: 80;
}

.portal-theme .cookie-banner p {
  margin: 0;
  text-align: center;
  line-height: 1.55;
}

.portal-theme .cookie-banner a {
  color: #b8dcff;
}

.portal-theme .cookie-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.portal-theme .cookie-actions button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(157, 184, 213, 0.42);
  border-radius: 999px;
  font-weight: 800;
}

.portal-nav {
  gap: 18px;
  align-items: stretch;
}

.portal-nav-link {
  min-height: 72px;
  padding: 0 2px !important;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: rgba(20, 27, 38, 0.82) !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: none !important;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible {
  color: #111924 !important;
  border-color: transparent;
}

.portal-nav-link.is-active {
  position: relative;
  color: #bd3e31 !important;
  border-color: transparent;
}

.portal-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: #d33c34;
}

.portal-nav-link--admin {
  opacity: 0.72;
}

.portal-user-pill {
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.portal-user-meta {
  min-width: 124px;
  text-align: left;
}

.portal-user-role {
  color: rgba(80, 86, 96, 0.72);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
}

.portal-user-meta strong {
  display: block;
  max-width: 138px;
  overflow: hidden;
  color: #1a222f;
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-pill .btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.portal-history-bar {
  margin-top: 16px;
}

main.container {
  max-width: 1340px;
  padding-top: 22px;
}

@media (max-width: 1180px) {
  .portal-topbar__inner {
    padding: 10px 18px;
  }

  .portal-brand {
    width: auto;
    margin-right: 18px;
  }

  .portal-nav {
    gap: 10px;
    flex-wrap: wrap;
  }

  .portal-nav-link {
    min-height: 38px;
  }

  .portal-nav-link.is-active::after {
    bottom: 3px;
  }
}

@media (max-width: 760px) {
  .portal-topbar {
    position: relative;
  }

  .portal-topbar__inner {
    align-items: flex-start;
    gap: 12px;
  }

  .portal-topbar .navbar-collapse {
    display: grid !important;
    gap: 10px;
  }

  .portal-nav {
    gap: 8px;
  }

  .portal-user-pill {
    justify-content: flex-start;
  }
}

/* 2026-05 reference recreation - section 2 dashboard cards */
.dashboard-reference-shell {
  display: grid;
  gap: 18px;
}

.dashboard-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4px 2px;
}

.dashboard-welcome h1 {
  margin: 0;
  color: #141b26;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.dashboard-welcome p {
  margin: 4px 0 0;
  color: rgba(79, 87, 99, 0.78) !important;
  font-size: 0.86rem;
}

.dashboard-welcome time {
  display: grid;
  justify-items: end;
  gap: 4px;
  padding-top: 2px;
  color: #151d29;
}

.dashboard-welcome time span {
  color: rgba(86, 94, 106, 0.72);
  font-size: 0.72rem;
}

.dashboard-welcome time strong {
  font-size: 1rem;
  font-weight: 750;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 4px;
}

.dashboard-kpi-card {
  min-height: 94px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  border: 1px solid rgba(150, 133, 115, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 38px rgba(39, 31, 22, 0.08);
}

.dashboard-kpi-card p,
.dashboard-kpi-card small {
  margin: 0;
}

.dashboard-kpi-card p {
  color: rgba(70, 78, 91, 0.7) !important;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-kpi-card strong {
  display: block;
  margin-top: 2px;
  color: #141b26;
  font-size: 1.52rem;
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.04em;
}

.dashboard-kpi-card small {
  display: block;
  max-width: 18ch;
  margin-top: 8px;
  overflow: hidden;
  color: rgba(85, 95, 108, 0.74);
  font-size: 0.62rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
}

.dashboard-kpi-icon--blue {
  background: rgba(43, 129, 180, 0.12);
  color: #286d93;
}

.dashboard-kpi-icon--amber {
  background: rgba(224, 148, 55, 0.14);
  color: #b66a18;
}

.dashboard-kpi-icon--orange {
  background: rgba(236, 112, 54, 0.14);
  color: #d25a26;
}

.dashboard-kpi-icon--green {
  background: rgba(49, 173, 121, 0.14);
  color: #19875a;
}

.dashboard-kpi-icon--gold {
  background: rgba(218, 166, 55, 0.15);
  color: #b17a0f;
}

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

@media (max-width: 640px) {
  .dashboard-welcome {
    display: grid;
  }

  .dashboard-welcome time {
    justify-items: start;
  }

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

/* 2026-05 reference recreation - section 3 dashboard operations */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.dashboard-panel,
.dashboard-upload-panel,
.dashboard-nova-mini {
  border: 1px solid rgba(150, 133, 115, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 38px rgba(39, 31, 22, 0.07);
}

.dashboard-panel {
  overflow: hidden;
}

.dashboard-panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 12px;
}

.dashboard-panel h2,
.dashboard-panel-head h2 {
  margin: 0;
  color: #151c27;
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: -0.04em;
}

.dashboard-panel-head a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(150, 133, 115, 0.16);
  border-radius: 999px;
  color: rgba(31, 39, 52, 0.72);
  font-size: 0.68rem;
  font-weight: 750;
  text-decoration: none;
}

.dashboard-table-wrap {
  padding: 0 14px 14px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(150, 133, 115, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
}

.dashboard-table th,
.dashboard-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(150, 133, 115, 0.12);
  vertical-align: middle;
}

.dashboard-table th {
  color: rgba(91, 99, 112, 0.74);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-table td {
  color: #283241;
  font-weight: 600;
}

.dashboard-table td a {
  color: #283241;
  font-weight: 760;
  text-decoration: none;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(50, 137, 180, 0.12);
  color: #266785;
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-empty {
  padding: 18px !important;
  text-align: center;
  color: rgba(86, 94, 106, 0.72) !important;
}

.dashboard-batch-list {
  display: grid;
  gap: 9px;
  padding: 0 14px 14px;
}

.dashboard-batch-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(150, 133, 115, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  color: inherit;
  text-decoration: none;
}

.dashboard-batch-row > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(38, 48, 62, 0.06);
  color: #344152;
  font-size: 0.86rem;
}

.dashboard-batch-row strong {
  display: block;
  color: #1a2230;
  font-size: 0.75rem;
}

.dashboard-batch-row small {
  color: rgba(87, 96, 110, 0.74);
  font-size: 0.62rem;
}

.dashboard-batch-row em {
  min-width: 76px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(48, 168, 111, 0.12);
  color: #238255;
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.dashboard-empty-row {
  grid-template-columns: 36px minmax(0, 1fr);
}

.dashboard-upload-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.dashboard-upload-dropzone {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  min-height: 110px;
  padding: 18px;
  border: 1px dashed rgba(103, 113, 127, 0.34);
  border-radius: 14px;
  color: #1b2533;
  text-align: center;
  text-decoration: none;
}

.dashboard-upload-dropzone span {
  font-size: 1.6rem;
  line-height: 1;
}

.dashboard-upload-dropzone strong {
  font-size: 0.78rem;
}

.dashboard-upload-dropzone small {
  max-width: 32ch;
  color: rgba(85, 94, 108, 0.74);
  font-size: 0.58rem;
  line-height: 1.35;
}

.dashboard-upload-dropzone b {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 3px;
  padding: 0 12px;
  border-radius: 7px;
  background: #17202c;
  color: #fff;
  font-size: 0.62rem;
}

.dashboard-action-strip {
  display: contents;
}

.dashboard-action-strip a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 110px;
  padding: 14px;
  border: 1px solid rgba(150, 133, 115, 0.12);
  border-radius: 14px;
  background: rgba(248, 246, 242, 0.74);
  color: #1b2533;
  text-align: center;
  text-decoration: none;
}

.dashboard-action-strip span {
  color: #1f2a38;
  font-size: 1.15rem;
}

.dashboard-action-strip strong {
  color: #1b2533;
  font-size: 0.72rem;
}

.dashboard-action-strip small {
  color: rgba(85, 94, 108, 0.72);
  font-size: 0.58rem;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.56fr) minmax(260px, 0.62fr);
  gap: 18px;
}

.dashboard-panel--activity,
.dashboard-panel--shortcuts {
  padding: 18px 20px;
}

.dashboard-timeline {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.dashboard-timeline a,
.dashboard-timeline-empty {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(150, 133, 115, 0.12);
  color: inherit;
  text-decoration: none;
}

.dashboard-timeline a:last-child {
  border-bottom: 0;
}

.dashboard-timeline a > span {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border: 2px solid #cf4438;
  border-radius: 999px;
}

.dashboard-timeline strong {
  display: block;
  color: #1d2634;
  font-size: 0.7rem;
}

.dashboard-timeline small,
.dashboard-timeline em,
.dashboard-timeline-empty {
  color: rgba(85, 94, 108, 0.74);
  font-size: 0.62rem;
  font-style: normal;
}

.dashboard-shortcuts {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-shortcuts a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(150, 133, 115, 0.14);
  border-radius: 9px;
  color: rgba(40, 49, 63, 0.78);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-nova-mini {
  position: relative;
  min-height: 148px;
  padding: 28px 150px 22px 22px;
  align-self: stretch;
  overflow: hidden;
}

.dashboard-nova-mini::before {
  content: "";
  position: absolute;
  right: 30px;
  bottom: 18px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: rgba(235, 231, 223, 0.88);
}

.dashboard-nova-mini strong {
  display: block;
  color: #111924;
  font-size: 0.8rem;
}

.dashboard-nova-mini span {
  display: block;
  margin-top: 6px;
  color: rgba(70, 79, 94, 0.8);
  font-size: 0.68rem;
  line-height: 1.45;
}

.dashboard-nova-mini img {
  position: absolute;
  right: 8px;
  bottom: -3px;
  width: 170px;
  height: auto;
  filter: drop-shadow(0 18px 26px rgba(31, 26, 22, 0.22));
}

@media (max-width: 1180px) {
  .dashboard-main-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-upload-dropzone {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .dashboard-upload-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-upload-dropzone {
    grid-column: auto;
  }

  .dashboard-nova-mini {
    padding-right: 110px;
  }

  .dashboard-nova-mini img,
  .dashboard-nova-mini::before {
    width: 126px;
  }
}

@media (max-width: 760px) {
  .portal-topbar {
    background: rgba(255, 255, 255, 0.96);
  }

  .portal-topbar__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
    padding: 16px 14px 12px;
  }

  .portal-brand {
    width: 100%;
    margin-right: 0;
  }

  .editorial-brand--portal {
    min-width: 176px;
  }

  .portal-brand .editorial-brand__title {
    font-size: 1.28rem;
  }

  .portal-brand .editorial-brand__sub {
    font-size: 0.66rem;
    letter-spacing: 0.52em;
  }

  .portal-topbar .navbar-collapse {
    width: 100%;
    min-width: 0;
  }

  .portal-nav {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
    padding: 0 0 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .portal-nav::-webkit-scrollbar {
    display: none;
  }

  .portal-nav .nav-item {
    flex: 0 0 auto;
  }

  .portal-nav-link {
    min-height: 38px;
    padding: 0 13px !important;
    border: 1px solid rgba(147, 132, 116, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76) !important;
    font-size: 0.76rem;
  }

  .portal-nav-link.is-active::after {
    left: 12px;
    right: 12px;
    bottom: -6px;
    height: 3px;
  }

  .portal-user-pill {
    width: 100%;
    justify-content: space-between;
    padding-top: 2px;
  }

  .portal-user-meta {
    min-width: 0;
  }

  .portal-user-meta strong {
    max-width: 220px;
  }

  main.container {
    width: 100%;
    max-width: none;
    padding: 16px 8px 36px;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }
}

/* 2026-05 Partners compact pass */
.portal-topbar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.portal-back-slot {
  flex: 0 0 auto;
}

.portal-back-slot .history-back {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: -0.01em;
  box-shadow: none;
}

.portal-brand {
  width: auto;
  min-width: 152px;
  margin-right: 8px;
}

.portal-brand .editorial-brand__title {
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}

.portal-brand .editorial-brand__sub {
  margin-top: 5px;
  font-size: 0.6rem;
  letter-spacing: 0.42em;
}

.portal-topbar .navbar-collapse {
  display: flex !important;
  align-items: center;
  min-width: 0;
}

.portal-nav {
  gap: 16px;
  justify-content: center;
}

.portal-nav-link {
  min-height: 60px;
  font-size: 0.7rem;
}

.portal-user-pill {
  margin-left: auto;
}

main.container {
  max-width: 1280px;
  padding-top: 18px;
}

.portal-page-shell,
.crm-shell,
.dashboard-reference-shell {
  gap: 16px;
}

.page-hero,
.crm-header {
  padding: clamp(20px, 2.4vw, 30px);
  border-radius: 26px !important;
}

.page-hero h1,
.crm-header h1 {
  font-size: clamp(2rem, 3.1vw, 3rem);
}

.page-hero p,
.crm-header p {
  margin-top: 8px;
  line-height: 1.45;
}

.portal-theme .table > :not(caption) > * > * {
  padding-top: 0.74rem;
  padding-bottom: 0.74rem;
}

.card,
.table-responsive,
.alert,
.crm-kpi,
.crm-panel,
.soft-panel,
.dashboard-panel,
.dashboard-upload-panel,
.dashboard-nova-mini {
  border-radius: 20px !important;
}

.crm-header {
  align-items: center;
}

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

.crm-kpi {
  min-height: 118px;
  padding: 16px;
}

.crm-kpi strong {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
}

.crm-split {
  gap: 12px;
}

.crm-panel {
  padding: 14px;
}

.crm-mini-grid div,
.crm-status-list div,
.crm-leads div,
.crm-lead-link {
  border-radius: 14px;
}

.crm-nova-identity,
.crm-cleanup-form,
.crm-admin-links {
  display: grid;
  gap: 10px;
}

.crm-nova-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 144px;
  padding: 14px;
  border: 1px solid rgba(149, 130, 111, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 16% 50%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(135deg, rgba(249, 245, 239, 0.96), rgba(255, 255, 255, 0.86));
}

.crm-nova-card img {
  width: 132px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(32, 26, 22, 0.18));
}

.crm-nova-card span,
.crm-cleanup-form label {
  color: #c94a39;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.crm-nova-card strong {
  display: block;
  color: #111924;
  font-size: 1.22rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.crm-nova-card p {
  margin: 6px 0 0;
  color: rgba(48, 57, 70, 0.7) !important;
  font-size: 0.78rem;
  line-height: 1.45;
}

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

.crm-widget-voice-form {
  display: grid;
  gap: 6px;
  align-content: start;
}

.crm-nova-selectors label,
.crm-cleanup-form label {
  display: grid;
  gap: 5px;
}

.crm-cleanup-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(160px, 0.7fr) auto;
  align-items: end;
}

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

.crm-admin-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(149, 130, 111, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #1b2533;
  font-size: 0.82rem;
  font-weight: 760;
  text-decoration: none;
}

.view-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(149, 130, 111, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.view-toolbar button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(33, 42, 55, 0.72);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 780;
}

.view-toolbar button.is-active {
  background: #17202c;
  color: #fff;
}

.view-surface[data-current-view="grid"] .table-responsive,
.view-surface[data-current-view="cards"] .table-responsive {
  display: none;
}

.view-surface[data-current-view="grid"] .dashboard-table-wrap,
.view-surface[data-current-view="grid"] .dashboard-batch-list {
  display: none;
}

.view-surface[data-current-view="compact"] .portal-record-grid,
.view-surface[data-current-view="list"] .portal-record-grid {
  display: none;
}

.portal-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px;
}

.dashboard-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-panel .view-toolbar {
  transform: scale(0.88);
  transform-origin: right center;
}

.portal-record-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(149, 130, 111, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: inherit;
  text-decoration: none;
}

.portal-record-card strong {
  color: #121924;
  font-size: 0.9rem;
}

.portal-record-card span,
.portal-record-card small {
  color: rgba(72, 82, 96, 0.76);
  font-size: 0.72rem;
  font-weight: 650;
}

@media (max-width: 1180px) {
  .crm-kpis,
  .crm-cleanup-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portal-topbar__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    width: 100%;
  }

  .portal-back-slot {
    grid-column: 1;
    grid-row: 1;
  }

  .portal-brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    min-width: 0;
    margin: 0;
  }

  .portal-topbar .navbar-collapse {
    grid-column: 1 / -1;
    display: grid !important;
    gap: 8px;
    width: 100%;
  }

  .portal-nav {
    order: 2;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 8px;
    scrollbar-width: none;
  }

  .portal-nav::-webkit-scrollbar {
    display: none;
  }

  .portal-nav-link {
    min-height: 38px;
    padding: 0 13px !important;
    border: 1px solid rgba(149, 130, 111, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .portal-nav-link.is-active::after {
    display: none;
  }

  .portal-user-pill {
    order: 1;
    width: 100%;
    margin: 0;
    padding: 6px 8px;
    border-radius: 16px;
  }

  .portal-user-meta strong {
    max-width: 178px;
  }

  .crm-kpis,
  .crm-nova-selectors,
  .crm-cleanup-form,
  .crm-admin-links,
  .crm-nova-card {
    grid-template-columns: 1fr;
  }
}

/* 2026-05 portal nav: keep operational links centered after removing external Drops. */
@media (min-width: 761px) {
  .portal-topbar .navbar-collapse {
    flex: 1 1 auto;
    justify-content: center;
    gap: 18px;
  }

  .portal-topbar .portal-nav.navbar-nav {
    flex: 0 1 auto;
    justify-content: center;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .portal-topbar .portal-user-pill {
    flex: 0 0 auto;
    margin-left: 0;
  }
}

/* 2026-05 launch audit: compact authenticated portal on phones. */
@media (max-width: 760px) {
  body.portal-theme {
    overflow-x: hidden;
  }

  .portal-topbar {
    width: 100%;
    margin: 8px auto 12px !important;
    padding-top: 0 !important;
  }

  .portal-topbar__inner {
    width: min(100vw - 12px, 100%);
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px 8px;
    align-items: center;
    min-height: 0 !important;
    padding: 9px 10px 8px !important;
    border-radius: 22px !important;
  }

  .portal-back-slot {
    grid-column: 1;
    grid-row: 1;
  }

  .portal-back-slot .history-back {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .portal-brand {
    grid-column: 1 / 3;
    grid-row: 1;
    justify-self: start;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .portal-back-slot + .portal-brand {
    grid-column: 2;
    justify-self: center;
  }

  .portal-brand .editorial-brand__title {
    font-size: 1rem !important;
    line-height: 0.95;
  }

  .portal-brand .editorial-brand__sub {
    margin-top: 2px;
    padding-left: 0;
    padding-top: 3px;
    font-size: 0.52rem !important;
    letter-spacing: 0.36em !important;
  }

  .portal-topbar .navbar-collapse {
    display: contents !important;
  }

  .portal-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap;
    justify-content: flex-start !important;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 1px 0 3px !important;
    scrollbar-width: none;
  }

  .portal-nav::-webkit-scrollbar {
    display: none;
  }

  .portal-nav .nav-item {
    flex: 0 0 auto;
  }

  .portal-nav-link {
    min-height: 32px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    font-size: 0.62rem !important;
    white-space: nowrap;
  }

  .portal-nav-link.is-active::after {
    display: none !important;
  }

  .portal-user-pill {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .portal-user-meta {
    display: none !important;
  }

  .portal-user-pill .btn {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
  }

  main.container {
    width: 100%;
    max-width: none;
    padding: 10px 8px 36px !important;
    overflow-x: hidden;
  }

  .portal-page-shell,
  .crm-shell,
  .dashboard-reference-shell {
    width: 100%;
    max-width: 100%;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
  }

  .page-hero,
  .crm-header {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-content: stretch !important;
    padding: 18px !important;
    border-radius: 22px !important;
    overflow: hidden;
  }

  .page-hero-main,
  .crm-header > *,
  .page-hero-actions,
  .section-header,
  .soft-panel,
  .portal-theme .card,
  .portal-theme .table-responsive,
  .dashboard-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .page-hero h1,
  .crm-header h1 {
    font-size: clamp(2rem, 11vw, 2.8rem);
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .page-hero p,
  .crm-header p {
    max-width: 100% !important;
    font-size: 1rem !important;
    line-height: 1.32 !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .section-header {
    align-items: flex-start;
    gap: 8px;
  }

  .section-header,
  .dashboard-panel-head {
    flex-wrap: wrap;
  }

  .view-toolbar,
  .dashboard-panel-actions {
    max-width: 100%;
    overflow-x: auto;
  }

  .portal-theme .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portal-theme .table {
    min-width: 660px;
  }
}

/* 2026-05-17 safety pass: definitive mobile portal header/dropdown behavior. */
.portal-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(34, 42, 54, 0.15);
  border-radius: 999px;
  background: #fff;
  color: #1b2330;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 20px rgba(19, 27, 40, 0.08);
}

.portal-mobile-toggle span {
  font-size: 0.98rem;
  line-height: 1;
}

@media (max-width: 760px) {
  .portal-topbar {
    position: sticky;
    top: max(6px, env(safe-area-inset-top));
    z-index: 60;
    margin: 6px 0 10px !important;
  }

  .portal-topbar__inner {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: min(100vw - 12px, 100%);
    padding: 10px !important;
    border-radius: 22px !important;
  }

  .portal-back-slot {
    order: 1;
    flex: 0 0 auto;
  }

  .portal-back-slot .history-back {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.72rem;
  }

  .portal-brand {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
  }

  .portal-brand .editorial-brand {
    align-items: flex-start;
  }

  .portal-brand .editorial-brand__title {
    font-size: 1.82rem !important;
    line-height: 0.88;
  }

  .portal-brand .editorial-brand__sub {
    margin-top: 2px;
    font-size: 0.56rem !important;
    letter-spacing: 0.34em !important;
  }

  .portal-mobile-toggle {
    order: 3;
    margin-left: auto;
  }

  .portal-topbar .navbar-collapse {
    order: 4;
    width: 100%;
    display: none !important;
    margin-top: 4px;
    padding: 10px;
    border: 1px solid rgba(34, 42, 54, 0.09);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 28px rgba(20, 30, 44, 0.08);
  }

  .portal-topbar.is-mobile-nav-open .navbar-collapse {
    display: block !important;
  }

  .portal-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .portal-nav .nav-item {
    width: 100%;
  }

  .portal-nav-link {
    width: 100%;
    min-height: 34px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    text-align: center;
    font-size: 0.72rem !important;
    white-space: nowrap;
  }

  .portal-nav-link.is-active::after {
    display: none !important;
  }

  .portal-user-pill {
    margin-top: 8px !important;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid rgba(34, 42, 54, 0.08);
    padding-top: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .portal-user-meta {
    display: block !important;
    min-width: 0;
  }

  .portal-user-meta strong {
    display: block;
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
  }

  .portal-user-role {
    font-size: 0.58rem;
  }

  .portal-user-pill .btn {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.72rem;
  }
}

/* 2026-05-17 portal mobile nav lock: always collapsed behind Menu button on phones. */
@media (max-width: 900px) {
  .portal-mobile-toggle {
    display: inline-flex !important;
  }

  .portal-topbar .navbar-collapse {
    display: none !important;
    width: 100% !important;
  }

  .portal-topbar.is-mobile-nav-open .navbar-collapse {
    display: block !important;
  }

  .portal-topbar .portal-nav.navbar-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .portal-topbar .portal-nav .nav-item {
    width: 100%;
  }

  .portal-topbar .portal-nav-link {
    width: 100%;
    min-height: 36px !important;
    padding: 0 10px !important;
    text-align: center;
    white-space: nowrap;
    font-size: 0.74rem !important;
  }
}

/* 2026-05-17 final launch polish: strict mobile collapse and compact topbar spacing. */
@media (max-width: 900px) {
  .portal-topbar {
    position: sticky;
    top: max(4px, env(safe-area-inset-top));
    z-index: 78;
  }

  .portal-topbar__inner {
    gap: 8px !important;
    padding: 10px !important;
  }

  .portal-topbar .navbar-collapse,
  .portal-topbar .navbar-collapse.show {
    display: none !important;
  }

  .portal-topbar.is-mobile-nav-open .navbar-collapse,
  .portal-topbar.is-mobile-nav-open .navbar-collapse.show {
    display: block !important;
  }

  .portal-topbar .portal-nav.navbar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* 2026-05-17 desktop alignment pass: center top panel content and support Volver+Inicio actions. */
.portal-history-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (min-width: 992px) {
  .portal-topbar__inner {
    min-height: 86px;
    align-items: center !important;
  }

  .portal-topbar .navbar-collapse {
    align-items: center !important;
  }

  .portal-topbar .portal-nav.navbar-nav {
    align-items: center !important;
  }

  .portal-topbar .portal-nav-link {
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* 2026-05-19 admin CRM compact polish: visual-only density pass. */
body.portal-theme.theme-admin {
  background-color: #f6f1ea;
  background-size: cover;
}

.theme-admin main.container {
  max-width: 1360px;
  padding-top: 12px;
}

.theme-admin .crm-shell {
  gap: 12px;
}

.theme-admin .crm-header {
  min-height: 0;
  padding: 18px 20px !important;
  border-radius: 18px !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(249, 244, 237, 0.9)),
    radial-gradient(circle at 92% 18%, rgba(15, 118, 110, 0.14), transparent 32%);
  box-shadow: 0 16px 34px rgba(26, 31, 42, 0.07);
}

.theme-admin .crm-eyebrow {
  margin-bottom: 4px;
  color: #0f766e;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.theme-admin .crm-header h1 {
  font-size: clamp(1.85rem, 2.5vw, 2.55rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.theme-admin .crm-header p {
  max-width: 76ch;
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.38;
}

.theme-admin .crm-actions .btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.74rem;
}

.theme-admin .crm-kpis {
  gap: 10px;
}

.theme-admin .crm-kpi,
.theme-admin .crm-panel {
  border-radius: 16px !important;
  border-color: rgba(133, 118, 100, 0.18) !important;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(24, 30, 40, 0.055);
  backdrop-filter: blur(12px) saturate(126%);
}

.theme-admin .crm-kpi {
  position: relative;
  min-height: 92px;
  padding: 13px 14px;
  gap: 4px;
  overflow: hidden;
}

.theme-admin .crm-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #c94a39, #ebb170);
}

.theme-admin .crm-kpi-alert::before {
  background: linear-gradient(180deg, #b45309, #f1b65f);
}

.theme-admin .crm-kpi span,
.theme-admin .crm-panel-title span,
.theme-admin .crm-mini-grid span,
.theme-admin .crm-leads span {
  font-size: 0.74rem;
  line-height: 1.25;
}

.theme-admin .crm-kpi span {
  color: rgba(43, 51, 64, 0.7);
  font-weight: 820;
}

.theme-admin .crm-kpi strong {
  font-size: clamp(1.42rem, 1.9vw, 1.9rem);
  letter-spacing: -0.035em;
}

.theme-admin .crm-kpi small {
  font-size: 0.72rem;
  line-height: 1.2;
}

.theme-admin .crm-split {
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.84fr);
  gap: 12px;
}

.theme-admin .crm-panel {
  padding: 12px;
}

.theme-admin .crm-panel-title {
  align-items: start;
  margin-bottom: 10px;
}

.theme-admin .crm-panel-title h2 {
  color: #151c27;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.theme-admin .table-responsive {
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.theme-admin .table {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.theme-admin .table > :not(caption) > * > * {
  padding: 0.52rem 0.66rem;
}

.theme-admin .table thead th {
  background: rgba(246, 240, 232, 0.82);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.theme-admin .table small,
.theme-admin .table .badge {
  font-size: 0.68rem;
}

.theme-admin .crm-mini-grid {
  gap: 8px;
}

.theme-admin .crm-mini-grid div,
.theme-admin .crm-status-list div,
.theme-admin .crm-leads div,
.theme-admin .crm-lead-link {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.theme-admin .crm-mini-grid-link {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-decoration: none;
}

.theme-admin .crm-mini-grid div {
  min-height: 66px;
  padding: 9px 10px;
}

.theme-admin .crm-mini-grid-link {
  min-height: 66px;
  padding: 9px 10px;
}

.theme-admin .crm-mini-grid strong {
  font-size: 1.12rem;
  line-height: 1;
}

.theme-admin .crm-status-list,
.theme-admin .crm-leads {
  gap: 6px;
  margin-top: 8px;
}

.theme-admin .crm-status-list div,
.theme-admin .crm-leads div,
.theme-admin .crm-lead-link {
  padding: 8px 10px;
}

.theme-admin .crm-status-list div {
  min-height: 38px;
}

.theme-admin .crm-status-list strong {
  color: #15212f;
  font-size: 0.88rem;
}

.theme-admin .crm-lead-link {
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.theme-admin .crm-nova-identity,
.theme-admin .crm-cleanup-form,
.theme-admin .crm-admin-links {
  gap: 8px;
}

.theme-admin .crm-nova-card {
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 116px;
  padding: 10px;
  border-radius: 14px;
}

.theme-admin .crm-nova-card img {
  width: 104px;
  height: 78px;
}

.theme-admin .crm-nova-card strong {
  font-size: 1.05rem;
}

.theme-admin .crm-nova-card p {
  margin-top: 4px;
  font-size: 0.73rem;
  line-height: 1.34;
}

.theme-admin .crm-nova-selectors {
  gap: 6px;
}

.theme-admin .crm-widget-voice-form {
  display: grid;
  gap: 6px;
  align-content: start;
}

.theme-admin .crm-cleanup-form {
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(138px, 0.72fr) auto;
  gap: 8px;
}

.theme-admin .crm-cleanup-form .form-select,
.theme-admin .crm-cleanup-form .form-control,
.theme-admin .crm-nova-selectors .form-select {
  min-height: 34px;
  border-radius: 10px;
  font-size: 0.76rem;
}

.theme-admin .crm-note {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.theme-admin .crm-admin-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-admin .crm-admin-links a {
  min-height: 36px;
  border-radius: 11px;
  font-size: 0.78rem;
}

@media (max-width: 1180px) {
  .theme-admin .crm-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .theme-admin .crm-cleanup-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .theme-admin .crm-header,
  .theme-admin .crm-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-admin .crm-header {
    gap: 12px;
    padding: 16px !important;
  }

  .theme-admin .crm-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .theme-admin main.container {
    padding: 8px 8px 32px !important;
  }

  .theme-admin .crm-shell {
    gap: 10px;
  }

  .theme-admin .crm-header h1 {
    font-size: clamp(1.72rem, 9vw, 2.35rem);
  }

  .theme-admin .crm-header p {
    font-size: 0.86rem !important;
  }

  .theme-admin .crm-kpis,
  .theme-admin .crm-mini-grid,
  .theme-admin .crm-nova-selectors,
  .theme-admin .crm-cleanup-form,
  .theme-admin .crm-admin-links,
  .theme-admin .crm-nova-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-admin .crm-kpi {
    min-height: 82px;
    padding: 12px 13px 12px 15px;
  }

  .theme-admin .crm-panel {
    padding: 11px;
  }

  .theme-admin .crm-panel-title {
    display: grid;
    gap: 2px;
  }

  .theme-admin .table {
    min-width: 620px;
  }

  .theme-admin .crm-cleanup-form .btn {
    width: 100%;
  }
}

.theme-admin .dora-widget,
.theme-admin .companion-stage,
.theme-admin .companion-avatar {
  display: none !important;
}

@media (max-width: 760px) {
  .theme-admin .crm-nova-card {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
  }

  .theme-admin .crm-nova-card img {
    width: 86px;
    height: 66px;
  }
}

/* 2026-06 premium portal shell pass: final cascade override for real portal visuals. */
body.portal-theme .portal-main-shell:not(.auth-main) {
  max-width: 1360px;
  padding: 20px 20px 40px;
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.9), rgba(255, 255, 255, 0.84)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.46), transparent 42%);
  box-shadow: 0 32px 70px rgba(22, 28, 40, 0.12);
}

body.portal-theme .portal-topbar--premium .portal-topbar__inner {
  min-height: 92px;
  padding: 18px 24px;
  border-radius: 30px;
  border: 1px solid rgba(193, 179, 161, 0.24);
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.92), rgba(255, 255, 255, 0.82));
  box-shadow: 0 24px 52px rgba(26, 32, 44, 0.1);
  backdrop-filter: blur(18px) saturate(135%);
}

body.portal-theme .portal-topbar--premium .portal-brand .editorial-brand__title {
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

body.portal-theme .portal-topbar--premium .portal-brand .editorial-brand__sub {
  margin-top: 6px;
  color: rgba(188, 73, 55, 0.92);
  letter-spacing: 0.42em;
}

body.portal-theme .portal-topbar--premium .portal-nav {
  gap: 10px;
}

body.portal-theme .portal-topbar--premium .portal-nav-link {
  min-height: 46px;
  padding: 0 16px !important;
  border-radius: 16px;
  border: 1px solid rgba(193, 179, 161, 0.12);
  background: rgba(255, 255, 255, 0.5);
  color: rgba(36, 44, 58, 0.76) !important;
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: -0.01em;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

body.portal-theme .portal-topbar--premium .portal-nav-link:hover,
body.portal-theme .portal-topbar--premium .portal-nav-link:focus-visible {
  color: #18202d !important;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(201, 74, 57, 0.16);
  box-shadow: 0 14px 28px rgba(24, 30, 40, 0.08);
  transform: translateY(-1px);
}

body.portal-theme .portal-topbar--premium .portal-nav-link.is-active {
  color: #8f3026 !important;
  background: linear-gradient(135deg, rgba(198, 81, 59, 0.13), rgba(103, 207, 196, 0.14)), rgba(255, 255, 255, 0.95);
  border-color: rgba(198, 81, 59, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

body.portal-theme .portal-topbar--premium .portal-nav-link.is-active::after {
  display: none;
}

body.portal-theme .portal-topbar--premium .portal-user-pill {
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: 20px;
  border: 1px solid rgba(193, 179, 161, 0.2);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 34px rgba(28, 31, 42, 0.06);
}

body.portal-theme .portal-page-shell,
body.portal-theme .crm-shell,
body.portal-theme .dashboard-reference-shell {
  gap: 20px;
}

body.portal-theme .page-hero,
body.portal-theme .crm-header {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 2.8vw, 34px);
  border: 1px solid rgba(193, 179, 161, 0.18);
  border-radius: 30px !important;
  background: linear-gradient(135deg, rgba(255, 252, 248, 0.94), rgba(255, 255, 255, 0.88));
  box-shadow: 0 24px 52px rgba(24, 30, 40, 0.08);
}

body.portal-theme .page-hero::before,
body.portal-theme .crm-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 24%, rgba(255, 255, 255, 0.66), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(202, 70, 56, 0.08), transparent 26%);
  pointer-events: none;
}

body.portal-theme .page-hero-main,
body.portal-theme .page-hero-actions,
body.portal-theme .crm-header > * {
  position: relative;
  z-index: 1;
}

body.portal-theme .page-hero-kicker,
body.portal-theme .crm-eyebrow {
  color: #c24d39;
  font-size: 0.76rem;
  font-weight: 840;
  letter-spacing: 0.16em;
}

body.portal-theme .page-hero h1,
body.portal-theme .crm-header h1 {
  font-size: clamp(2.35rem, 4vw, 3.3rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

body.portal-theme .page-hero p,
body.portal-theme .crm-header p,
body.portal-theme .section-header p,
body.portal-theme .dashboard-welcome p {
  color: rgba(63, 72, 85, 0.76) !important;
}

body.portal-theme .dashboard-welcome {
  align-items: end;
  padding: 6px 4px 0;
}

body.portal-theme .dashboard-welcome h1 {
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

body.portal-theme .dashboard-welcome time {
  padding: 14px 16px;
  border: 1px solid rgba(193, 179, 161, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 30px rgba(24, 30, 40, 0.05);
}

body.portal-theme .dashboard-kpi-grid {
  gap: 18px;
}

body.portal-theme .dashboard-kpi-card,
body.portal-theme .crm-kpi,
body.portal-theme .dashboard-panel,
body.portal-theme .dashboard-upload-panel,
body.portal-theme .dashboard-nova-mini,
body.portal-theme .soft-panel,
body.portal-theme .crm-panel {
  border: 1px solid rgba(193, 179, 161, 0.16);
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 246, 239, 0.84));
  box-shadow: 0 22px 48px rgba(24, 30, 40, 0.07);
}

body.portal-theme .dashboard-kpi-card {
  min-height: 116px;
  padding: 20px;
  gap: 14px;
}

body.portal-theme .dashboard-kpi-card p {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

body.portal-theme .dashboard-kpi-card strong {
  font-size: 1.86rem;
  letter-spacing: -0.06em;
}

body.portal-theme .dashboard-kpi-card small {
  max-width: none;
  white-space: normal;
  font-size: 0.68rem;
  line-height: 1.35;
}

body.portal-theme .dashboard-panel-head,
body.portal-theme .section-header {
  min-height: 70px;
  padding: 20px 22px 16px;
}

body.portal-theme .dashboard-panel h2,
body.portal-theme .dashboard-panel-head h2,
body.portal-theme .section-header h2 {
  font-size: 1.16rem;
  font-weight: 820;
  letter-spacing: -0.05em;
}

body.portal-theme .dashboard-panel-head a,
body.portal-theme .section-header a,
body.portal-theme .page-hero-actions .btn,
body.portal-theme .crm-actions .btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 760;
  box-shadow: none;
}

body.portal-theme .dashboard-table-wrap,
body.portal-theme .table-responsive {
  padding: 0 16px 16px;
}

body.portal-theme .dashboard-table,
body.portal-theme .table {
  border-color: rgba(193, 179, 161, 0.12);
  background: rgba(255, 255, 255, 0.68);
}

body.portal-theme .dashboard-table th,
body.portal-theme .table thead th {
  color: rgba(91, 99, 112, 0.74);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

body.portal-theme .dashboard-table td,
body.portal-theme .table tbody td {
  color: #253040;
  font-weight: 650;
}

body.portal-theme .dashboard-batch-row,
body.portal-theme .portal-record-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(193, 179, 161, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body.portal-theme a.dashboard-batch-row:hover,
body.portal-theme a.portal-record-card:hover,
body.portal-theme .dashboard-shortcuts a:hover,
body.portal-theme .dashboard-action-strip a:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(24, 30, 40, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

body.portal-theme .dashboard-upload-panel {
  gap: 16px;
  padding: 20px;
}

body.portal-theme .dashboard-upload-dropzone,
body.portal-theme .dashboard-action-strip a,
body.portal-theme .dashboard-shortcuts a {
  border-radius: 18px;
}

body.portal-theme .dashboard-bottom-grid {
  gap: 20px;
}

body.portal-theme .dashboard-nova-mini {
  min-height: 188px;
  padding: 28px 178px 24px 24px;
}

body.portal-theme .dashboard-nova-mini::before {
  right: 28px;
  bottom: 18px;
  width: 190px;
  height: 190px;
  background: rgba(235, 231, 223, 0.72);
}

body.portal-theme .dashboard-nova-mini strong {
  font-size: 1rem;
}

body.portal-theme .dashboard-nova-mini span,
body.portal-theme .dashboard-nova-mini small {
  font-size: 0.74rem;
  line-height: 1.5;
}

body.portal-theme .dashboard-nova-mini img {
  right: 10px;
  bottom: -1px;
  width: 190px;
}

body.portal-theme .status-pill {
  min-height: 28px;
  padding: 0 11px;
  font-size: 0.62rem;
}

body.portal-theme .view-toolbar {
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

body.portal-theme .view-toolbar button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.72rem;
}

@media (max-width: 1024px) {
  body.portal-theme .portal-main-shell:not(.auth-main) {
    padding: 16px 14px 32px;
    border-radius: 28px;
  }

  body.portal-theme .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.portal-theme .portal-main-shell:not(.auth-main) {
    padding: 10px 8px 30px;
    border-radius: 0;
    box-shadow: none;
  }

  body.portal-theme .portal-topbar--premium .portal-topbar__inner {
    padding: 12px 12px 10px !important;
    border-radius: 24px !important;
  }

  body.portal-theme .portal-topbar--premium .portal-brand .editorial-brand__title {
    font-size: 1.06rem !important;
  }

  body.portal-theme .portal-topbar--premium .portal-nav-link {
    min-height: 36px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    font-size: 0.66rem !important;
  }

  body.portal-theme .dashboard-welcome {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.portal-theme .dashboard-welcome h1 {
    font-size: clamp(1.8rem, 10vw, 2.4rem);
  }

  body.portal-theme .dashboard-kpi-grid,
  body.portal-theme .dashboard-main-grid,
  body.portal-theme .dashboard-bottom-grid,
  body.portal-theme .dashboard-upload-panel {
    grid-template-columns: 1fr;
  }

  body.portal-theme .page-hero,
  body.portal-theme .crm-header,
  body.portal-theme .dashboard-panel,
  body.portal-theme .dashboard-upload-panel,
  body.portal-theme .dashboard-nova-mini,
  body.portal-theme .soft-panel {
    border-radius: 22px !important;
  }

  body.portal-theme .dashboard-nova-mini {
    min-height: 160px;
    padding: 22px 118px 18px 18px;
  }

  body.portal-theme .dashboard-nova-mini::before,
  body.portal-theme .dashboard-nova-mini img {
    width: 126px;
    height: auto;
  }

  body.portal-theme .dashboard-panel-head,
  body.portal-theme .section-header {
    padding: 18px 18px 14px;
  }
}
