:root {
  --navy-950: #020a13;
  --navy-900: #051525;
  --navy-850: #071c31;
  --navy-800: #0a2944;
  --blue-700: #0369a1;
  --blue-600: #0284c7;
  --blue-500: #0ea5e9;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --teal-500: #14b8a6;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --orange-500: #f97316;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --purple-600: #7c3aed;
  --purple-500: #8b5cf6;
  --indigo-500: #6366f1;
  --pink-500: #ec4899;
  --slate-950: #0f172a;
  --slate-900: #172033;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --surface: #ffffff;
  --page: #f3f6fa;
  --border: #dce4ed;
  --border-soft: #e8edf3;
  --text: #172033;
  --muted: #667085;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, .07);
  --shadow-md: 0 14px 38px rgba(15, 23, 42, .10);
  --shadow-lg: 0 28px 70px rgba(2, 8, 22, .20);
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-width: 286px;
  --transition: 160ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 4%, rgba(14, 165, 233, .08), transparent 25rem),
    var(--page);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.sidebar-open {
  overflow: hidden;
}

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

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  color: var(--blue-600);
  text-decoration: underline;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid #d9e5ef;
  border-radius: 6px;
  color: #0c4a6e;
  background: #f0f9ff;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

h1,
h2,
h3,
strong {
  letter-spacing: -.01em;
}

h2 {
  margin-bottom: 5px;
  color: var(--slate-950);
  font-size: 18px;
  line-height: 1.3;
}

h3 {
  color: var(--slate-900);
  font-size: 15px;
}

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

.text-danger {
  color: var(--red-600) !important;
}

.text-success {
  color: var(--green-600) !important;
}

.required {
  color: var(--red-600);
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 20px 16px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 0%, rgba(34, 211, 238, .16), transparent 22rem),
    linear-gradient(180deg, var(--navy-850), var(--navy-950));
  border-right: 1px solid rgba(148, 163, 184, .12);
  box-shadow: 8px 0 28px rgba(2, 8, 23, .10);
  overflow-y: auto;
}

.brand,
.login-brand,
.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  position: relative;
  padding: 4px 5px 20px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  color: #03101d;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-400));
  box-shadow:
    0 12px 30px rgba(6, 182, 212, .26),
    inset 0 1px 0 rgba(255, 255, 255, .55);
  font-size: 22px;
  font-weight: 900;
}

.brand strong,
.login-brand strong,
.public-brand strong {
  display: block;
  color: inherit;
  font-size: 16px;
  line-height: 1.2;
}

.brand small,
.login-brand small,
.public-brand small {
  display: block;
  margin-top: 3px;
  color: #9ebbd0;
  font-size: 11px;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 2px;
  right: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-size: 24px;
}

.sidebar-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 16px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}

.sidebar-context span {
  color: #8eaec4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-context strong {
  color: #86efac;
  font-size: 11px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar nav a,
.privacy-center-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #b9ccdc;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.sidebar nav a:hover,
.privacy-center-link:hover {
  color: #fff;
  background: rgba(14, 165, 233, .11);
  border-color: rgba(34, 211, 238, .13);
  text-decoration: none;
  transform: translateX(2px);
}

.sidebar nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(14, 165, 233, .24), rgba(34, 211, 238, .11));
  border-color: rgba(34, 211, 238, .22);
  box-shadow: inset 3px 0 0 var(--cyan-400);
}

.nav-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--cyan-400);
  font-size: 16px;
  font-weight: 900;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.privacy-center-link {
  margin-bottom: 10px;
  padding-left: 10px;
  font-size: 12px;
}

.logout-form {
  margin: 0;
}

.sidebar-overlay {
  display: none;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  padding: 17px 28px;
  background: rgba(243, 246, 250, .92);
  border-bottom: 1px solid rgba(203, 213, 225, .65);
  backdrop-filter: blur(14px);
}

.topbar-title,
.topbar-actions,
.user-chip,
.system-chip {
  display: flex;
  align-items: center;
}

.topbar-title {
  min-width: 0;
  gap: 12px;
}

.topbar-title h1 {
  margin: 0;
  color: var(--slate-950);
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.15;
}

.topbar-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.mobile-menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--slate-700);
  background: #fff;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  font-size: 20px;
}

.system-chip,
.user-chip {
  gap: 9px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-xs);
}

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

.system-chip strong,
.user-chip strong {
  color: var(--slate-800);
  font-size: 12px;
}

.system-chip small,
.user-chip small {
  margin-top: 3px;
  color: var(--slate-500);
  font-size: 10px;
}

.status-pulse {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .12);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
  font-size: 12px;
  font-weight: 900;
}

.content {
  width: min(100%, 1760px);
  margin: 0 auto;
  padding: 22px 28px 46px;
}

.main-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px 28px;
  color: var(--slate-500);
  font-size: 11px;
}

.alert {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  margin: 16px 28px 0;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

.alert > span:first-child {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  font-weight: 900;
}

.alert-success {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.alert-success > span:first-child {
  color: #fff;
  background: var(--green-600);
}

.alert-danger,
.alert-error {
  color: #991b1b;
  background: #fff1f2;
  border-color: #fecdd3;
}

.alert-danger > span:first-child,
.alert-error > span:first-child {
  color: #fff;
  background: var(--red-600);
}

.alert-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.card,
.stat-card,
.filter-panel,
.guide-card,
.notice {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: var(--radius);
}

.card-header,
.toolbar,
.form-actions,
.filter-panel-header,
.filter-actions,
.toolbar-actions,
.row-actions,
.form-inline-actions,
.field-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header,
.toolbar,
.filter-panel-header {
  justify-content: space-between;
}

.card-header {
  gap: 16px;
  margin-bottom: 16px;
}

.card-header h2,
.card-header h3,
.toolbar h2,
.toolbar h3 {
  margin-bottom: 3px;
}

.card-header p,
.toolbar p,
.filter-panel-header small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  margin-bottom: 17px;
}

.toolbar-wrap {
  flex-wrap: wrap;
}

.toolbar-actions,
.filter-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #cfe8f6;
  border-radius: 999px;
  color: #075985;
  background: #f0f9ff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.page-link:focus-visible {
  outline: 3px solid rgba(14, 165, 233, .22);
  outline-offset: 2px;
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: .58;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: #02111d;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-400));
  box-shadow: 0 7px 16px rgba(14, 165, 233, .20);
}

.button-primary:hover {
  color: #02111d;
  box-shadow: 0 9px 22px rgba(14, 165, 233, .28);
}

.button-secondary,
.button-outline {
  color: var(--slate-700);
  background: #fff;
  border-color: var(--slate-300);
}

.button-secondary:hover,
.button-outline:hover {
  color: #075985;
  background: #f8fcff;
  border-color: #8ecfec;
}

.button-success {
  color: #fff;
  background: linear-gradient(135deg, #15803d, #22c55e);
  box-shadow: 0 7px 16px rgba(34, 197, 94, .18);
}

.button-ghost {
  width: 100%;
  color: #d7e5ef;
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .13);
}

.button-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, .09);
}

.button-small {
  min-height: 31px;
  padding: 6px 9px;
  border-color: #cfe2ef;
  color: #075985;
  background: #f4fbff;
  font-size: 11px;
}

.button-block {
  width: 100%;
}

.copy-link {
  padding: 2px 0;
  border: 0;
  color: var(--blue-700);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.copy-link.is-copied {
  color: var(--green-600);
}

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

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

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 120px;
  padding: 17px;
  border-radius: 15px;
  overflow: hidden;
}

.stat-card::before {
  position: absolute;
  right: -26px;
  bottom: -36px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: .055;
}

.stat-card > div:last-child {
  min-width: 0;
}

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

.stat-card span {
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.stat-card strong {
  display: block;
  margin: 6px 0 2px;
  color: var(--slate-950);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
}

.stat-card small {
  font-size: 10px;
  line-height: 1.25;
}

.stat-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: currentColor;
  background: currentColor;
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, .87);
  font-size: 19px;
  font-weight: 900;
}

.stat-blue { color: var(--blue-500); border-top: 3px solid var(--blue-500); }
.stat-cyan { color: var(--cyan-500); border-top: 3px solid var(--cyan-500); }
.stat-purple { color: var(--purple-500); border-top: 3px solid var(--purple-500); }
.stat-green { color: var(--green-500); border-top: 3px solid var(--green-500); }
.stat-indigo { color: var(--indigo-500); border-top: 3px solid var(--indigo-500); }
.stat-red { color: var(--red-500); border-top: 3px solid var(--red-500); }

.notice {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 13px;
}

.notice-info {
  color: #0c4a6e;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  border-color: #bae6fd;
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #fff;
  background: var(--blue-600);
  font-weight: 900;
}

.notice strong {
  display: block;
  margin-bottom: 3px;
}

.notice p {
  margin: 0;
  font-size: 12px;
}

.filter-panel {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 15px;
}

.filter-panel-header {
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border-soft);
}

.filter-panel-header strong {
  display: block;
  color: var(--slate-900);
  font-size: 14px;
}

.filter-grid,
.form-grid {
  display: grid;
  gap: 13px;
}

.filter-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.filter-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.compact-filter {
  padding: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 750;
}

label small {
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #cdd8e3;
  border-radius: 10px;
  color: var(--slate-900);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .025);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input,
select {
  min-height: 41px;
}

textarea {
  min-height: 120px;
  line-height: 1.5;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebdcc;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12);
  outline: 0;
}

input[readonly],
textarea[readonly],
select:disabled {
  color: var(--slate-500);
  background: var(--slate-50);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

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

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

.form-card {
  height: 100%;
}

.section-title {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-bottom: 17px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border-soft);
}

.section-title h3 {
  margin: 1px 0 3px;
}

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

.section-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #075985;
  background: #e0f2fe;
  font-size: 13px;
  font-weight: 900;
}

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

.sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  padding: 12px;
  border: 1px solid rgba(203, 213, 225, .92);
  border-radius: 13px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.input-action,
.field-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

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

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

.toggle,
.permission-toggle {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.toggle:hover,
.permission-toggle:hover {
  border-color: #9fd6ee;
  background: #f5fbff;
  transform: translateY(-1px);
}

.toggle input,
.permission-toggle input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 2px 0 0;
  accent-color: var(--blue-600);
}

.toggle span,
.permission-toggle span {
  min-width: 0;
}

.toggle span strong,
.toggle span small,
.permission-toggle span strong,
.permission-toggle span small {
  display: block;
}

.toggle span strong,
.permission-toggle span strong {
  color: var(--slate-800);
  font-size: 12px;
}

.toggle span small,
.permission-toggle span small {
  margin-top: 3px;
  font-weight: 500;
  line-height: 1.35;
}

.permission-module-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 2px 7px;
  border-bottom: 1px solid var(--border);
}

.permission-module-header h3 {
  margin: 0;
  text-transform: capitalize;
}

.guide-card {
  margin-bottom: 18px;
  border-radius: 15px;
  overflow: hidden;
}

.guide-card summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 13px 16px;
  color: var(--slate-800);
  background: linear-gradient(135deg, #f8fcff, #f6f5ff);
  cursor: pointer;
  list-style: none;
}

.guide-card summary::-webkit-details-marker {
  display: none;
}

.guide-card summary:hover {
  background: linear-gradient(135deg, #f0f9ff, #f5f3ff);
}

.guide-card summary strong,
.guide-card summary small {
  display: block;
}

.guide-card summary strong {
  font-size: 14px;
}

.guide-card summary small {
  margin-top: 3px;
  color: var(--slate-500);
  font-size: 10px;
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
  box-shadow: 0 7px 16px rgba(99, 102, 241, .20);
  font-size: 16px;
  font-weight: 900;
}

.guide-toggle-label {
  padding: 5px 9px;
  border: 1px solid #c7d9e7;
  border-radius: 999px;
  color: var(--blue-700);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.guide-card[open] .guide-toggle-label::after {
  content: " abierta";
}

.guide-body {
  padding: 17px;
  border-top: 1px solid var(--border-soft);
}

.guide-intro {
  max-width: 1100px;
  margin-bottom: 16px;
  color: var(--slate-600);
}

.guide-section + .guide-section {
  margin-top: 17px;
}

.guide-section h3 {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  margin: 0;
  padding-left: 22px;
}

.guide-steps li,
.guide-tip-section li {
  padding-left: 2px;
  color: var(--slate-600);
  font-size: 12px;
}

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

.guide-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--slate-50);
}

.guide-legend-item strong,
.guide-legend-item small {
  display: block;
}

.guide-legend-item strong {
  color: var(--slate-800);
  font-size: 11px;
}

.guide-legend-item small {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.35;
}

.guide-tip-section {
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 11px;
  background: #fffbeb;
}

.guide-tip-section ul {
  margin: 0;
  padding-left: 19px;
}

.legend-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border-radius: 4px;
  background: var(--slate-400);
}

.legend-dot-green { background: var(--green-500); }
.legend-dot-amber { background: var(--amber-500); }
.legend-dot-red { background: var(--red-500); }
.legend-dot-blue,
.legend-dot-info { background: var(--blue-500); }
.legend-dot-purple { background: var(--purple-500); }
.legend-dot-cyan { background: var(--cyan-500); }

.chart-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.chart-card {
  min-width: 0;
  margin-bottom: 0;
  padding: 18px;
  overflow: hidden;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-wrapper {
  position: relative;
  min-height: 285px;
  border: 1px solid #edf1f5;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  overflow: hidden;
}

.chart-wrapper-lg {
  min-height: 330px;
}

.chart-wrapper canvas {
  display: block;
  width: 100%;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: #fff;
}

.data-table,
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--slate-600);
  background: #f7f9fc;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

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

td strong,
td small {
  display: block;
}

td strong {
  color: var(--slate-800);
}

td small {
  margin-top: 3px;
  line-height: 1.35;
}

.row-actions,
.url-actions {
  flex-wrap: wrap;
  align-items: center;
}

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

.url-preview,
.truncate-code {
  display: block;
  max-width: 300px;
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.badge,
.version-pill,
.metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.badge {
  color: var(--slate-600);
  background: var(--slate-100);
  border-color: var(--slate-200);
}

.badge-active,
.badge-activo,
.badge-ok,
.badge-published {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.badge-inactive,
.badge-inactivo,
.badge-archived,
.badge-unknown {
  color: var(--slate-600);
  background: var(--slate-100);
  border-color: var(--slate-200);
}

.badge-maintenance,
.badge-mantenimiento,
.badge-warning,
.badge-draft,
.badge-update_required {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.badge-error,
.badge-denied,
.badge-locked,
.badge-not_found {
  color: #991b1b;
  background: #fff1f2;
  border-color: #fecdd3;
}

.badge-info {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.version-pill {
  color: #5b21b6;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.metric-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.metric-blue {
  color: #075985;
  background: #f0f9ff;
  border-color: #bae6fd;
}

.metric-purple {
  color: #6b21a8;
  background: #faf5ff;
  border-color: #e9d5ff;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 10px 1px 0;
}

.pagination-summary {
  color: var(--slate-500);
  font-size: 11px;
}

.pagination-controls,
.pagination-pages,
.page-size-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-size-label {
  flex-direction: row;
  color: var(--slate-500);
  font-size: 10px;
}

.page-size-label select {
  width: 68px;
  min-height: 32px;
  padding: 5px 8px;
}

.pagination-pages {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--slate-600);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.page-link:hover {
  color: #075985;
  border-color: #9fd6ee;
  background: #f0f9ff;
  text-decoration: none;
}

.page-link.active {
  color: #fff;
  background: var(--blue-600);
  border-color: var(--blue-600);
}

.page-link.disabled {
  opacity: .42;
  pointer-events: none;
}

.page-ellipsis {
  color: var(--slate-400);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 30px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border-radius: 18px;
  color: var(--blue-600);
  background: #e0f2fe;
  font-size: 26px;
  font-weight: 900;
}

.empty-state h3 {
  margin-bottom: 5px;
}

.empty-state p {
  max-width: 540px;
  margin-bottom: 0;
  color: var(--muted);
}

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

.tenant-check-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fbfdff;
}

.tenant-check-header,
.tenant-check-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.tenant-check-card p {
  margin: 9px 0;
  color: var(--slate-500);
  font-size: 11px;
}

.tenant-check-meta {
  color: var(--slate-500);
  font-size: 10px;
}

.privacy-url-explainer,
.legal-url-grid,
.legal-status-grid {
  display: grid;
  gap: 12px;
}

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

.legal-card,
.legal-status-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdff;
}

.legal-card h3,
.legal-status-card h3 {
  margin-bottom: 5px;
}

.legal-card p,
.legal-status-card p {
  margin: 0;
  color: var(--slate-500);
  font-size: 11px;
}

.legal-type {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: 9px;
  font-weight: 850;
}

.privacy-editor-grid {
  align-items: stretch;
}

.public-url-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .09), transparent 16rem),
    #fff;
}

.public-url-preview {
  padding: 14px;
  border: 1px dashed #9ccfe6;
  border-radius: 12px;
  background: #f5fbff;
}

.public-url-preview > span,
.public-url-preview code {
  display: block;
}

.public-url-preview > span {
  margin-bottom: 7px;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.public-url-preview code {
  margin-bottom: 10px;
  padding: 9px;
  border-radius: 8px;
  line-height: 1.4;
}

.publication-rules {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.publication-rules > div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: #fff;
}

.publication-rules p {
  margin: 0;
}

.publication-rules strong,
.publication-rules small {
  display: block;
}

.publication-rules strong {
  font-size: 10px;
}

.publication-rules small {
  margin-top: 2px;
  font-size: 10px;
}

.editor-card textarea {
  min-height: 420px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

.editor-counter {
  text-align: right;
}

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

.document-type-card {
  position: relative;
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--slate-400);
  border-radius: 12px;
  background: #fff;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.document-type-card.is-selected {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .10), var(--shadow-sm);
  transform: translateY(-2px);
}

.document-type-card > span {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--slate-600);
  background: var(--slate-100);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
}

.document-type-card strong,
.document-type-card small {
  display: block;
}

.document-type-card p {
  margin: 5px 0 8px;
  color: var(--slate-500);
  font-size: 11px;
  line-height: 1.4;
}

.document-type-card small {
  font-size: 10px;
}

.document-tone-blue { border-top-color: var(--blue-500); }
.document-tone-green { border-top-color: var(--green-500); }
.document-tone-amber { border-top-color: var(--amber-500); }
.document-tone-red { border-top-color: var(--red-500); }
.document-tone-purple { border-top-color: var(--purple-500); }
.document-tone-cyan { border-top-color: var(--cyan-500); }

/* Login */
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(14, 165, 233, .33), transparent 25rem),
    radial-gradient(circle at 82% 70%, rgba(139, 92, 246, .21), transparent 27rem),
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
}

.login-card {
  width: min(440px, 100%);
  padding: 29px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 22px;
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--shadow-lg);
}

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

.login-brand small {
  color: #56758c;
}

.login-card h1 {
  margin: 23px 0 5px;
  font-size: 27px;
}

.login-card > p {
  margin-bottom: 19px;
  color: var(--muted);
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.error-card {
  max-width: 760px;
  margin-inline: auto;
}

/* Public privacy */
.public-document-page,
.public-center-page {
  min-height: 100vh;
  color: var(--slate-800);
  background:
    radial-gradient(circle at 5% 0%, rgba(14, 165, 233, .10), transparent 25rem),
    var(--slate-50);
}

.public-document-shell,
.public-center-shell {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.public-document-header,
.public-center-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-sm);
}

.public-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-project-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  color: #075985;
  background: #f0f9ff;
  font-size: 10px;
  font-weight: 850;
}

.public-document-card {
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.document-kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--blue-700);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.public-document-card h1,
.public-center-hero h1 {
  margin-bottom: 9px;
  color: var(--slate-950);
  font-size: clamp(27px, 5vw, 42px);
  line-height: 1.1;
}

.public-document-meta,
.public-meta-grid,
.public-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--slate-500);
  font-size: 11px;
}

.public-document-content {
  margin-top: 28px;
  color: var(--slate-700);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.public-document-footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  color: var(--slate-500);
  font-size: 11px;
}

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

.public-document-grid .public-document-card {
  padding: 20px;
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.public-document-grid h2 {
  margin-bottom: 7px;
}

.public-empty,
.public-not-found {
  padding: 35px;
  border: 1px dashed var(--slate-300);
  border-radius: 15px;
  background: #fff;
  text-align: center;
}

/* Audit */
.audit-table td:nth-child(5),
.audit-table td:nth-child(6) {
  max-width: 290px;
  overflow-wrap: anywhere;
}

/* Print */
@media print {
  body {
    color: #000;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .main-footer,
  .button,
  .filter-panel,
  .guide-card,
  .pagination-bar,
  .alert,
  .public-header-actions {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content,
  .public-document-shell,
  .public-center-shell {
    width: 100%;
    padding: 0;
  }

  .card,
  .public-document-card {
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 1480px) {
  .stats-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 250px;
  }

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

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

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

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

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    width: min(88vw, 300px);
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }

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

  .sidebar-close,
  .mobile-menu-button {
    display: grid;
    place-items: center;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    visibility: hidden;
    background: rgba(2, 8, 23, .54);
    opacity: 0;
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  body.sidebar-open .sidebar-overlay {
    visibility: visible;
    opacity: 1;
  }

  .topbar {
    padding-inline: 18px;
  }

  .content {
    padding-inline: 18px;
  }

  .alert {
    margin-inline: 18px;
  }

  .main-footer {
    padding-inline: 18px;
  }

  .grid-2,
  .chart-grid-2,
  .legal-url-grid,
  .legal-status-grid,
  .privacy-editor-grid {
    grid-template-columns: 1fr;
  }

  .chart-card-wide {
    grid-column: auto;
  }

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

  .topbar-title p,
  .system-chip {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    min-height: 70px;
    padding: 13px 14px;
  }

  .topbar-title h1 {
    font-size: 21px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .user-chip {
    min-height: 40px;
    padding: 6px 8px;
  }

  .user-chip div {
    display: none;
  }

  .content {
    padding: 16px 13px 34px;
  }

  .main-footer,
  .alert {
    margin-inline: 13px;
    padding-inline: 13px;
  }

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

  .card,
  .filter-panel {
    padding: 15px;
    border-radius: 13px;
  }

  .stats-grid,
  .stats-grid-6,
  .filter-grid-6,
  .filter-grid-5,
  .filter-grid-4,
  .filter-grid-3,
  .form-grid,
  .feature-grid,
  .permissions-grid,
  .guide-steps,
  .guide-legend,
  .document-type-grid,
  .tenant-check-grid,
  .public-document-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .permission-module-header {
    grid-column: auto;
  }

  .toolbar,
  .card-header,
  .filter-panel-header,
  .form-actions,
  .pagination-bar,
  .pagination-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .filter-actions,
  .row-actions,
  .form-inline-actions {
    justify-content: flex-start;
  }

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

  .pagination-pages {
    justify-content: flex-start;
  }

  .guide-card summary {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .guide-toggle-label {
    display: none;
  }

  .chart-wrapper,
  .chart-wrapper-lg {
    min-height: 290px;
  }

  .editor-card textarea {
    min-height: 340px;
  }

  .public-document-header,
  .public-center-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .sticky-actions {
    position: static;
  }
}

/* Ajustes finales de las vistas públicas */
.public-document-header {
  width: min(calc(100% - 32px), 1040px);
  margin: 28px auto 18px;
}

.public-center-hero {
  display: block;
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .12), transparent 22rem),
    #fff;
  box-shadow: var(--shadow-sm);
}

.public-center-hero p {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--slate-500);
}

.public-document-meta {
  display: block;
}

.public-document-meta > p {
  max-width: 760px;
  color: var(--slate-500);
}

.public-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.public-meta-grid > div {
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--slate-50);
}

.public-meta-grid span,
.public-meta-grid strong {
  display: block;
}

.public-meta-grid span {
  color: var(--slate-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.public-meta-grid strong {
  margin-top: 4px;
  color: var(--slate-800);
  font-size: 11px;
}

.public-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 12px 0 15px;
  color: var(--slate-500);
}

@media (max-width: 680px) {
  .public-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Uso móvil · Central profesional v230 */
.stat-date {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem) !important;
}

.break-code {
  display: block;
  max-width: 310px;
  margin-top: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 900px) {
  .break-code {
    max-width: none;
  }
}


/* =========================================================
   CENTRAL 2.4 · Dashboard bajo demanda y portal de privacidad
========================================================= */

.dashboard-waiting-state {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
  align-items: center;
  gap: 56px;
  padding: 58px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid #dbe7f1;
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 20%, rgba(14, 165, 233, .16), transparent 28%),
    radial-gradient(circle at 92% 80%, rgba(139, 92, 246, .14), transparent 30%),
    linear-gradient(145deg, #ffffff, #f7fbff);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .08);
}

.dashboard-waiting-visual {
  width: 290px;
  height: 290px;
  position: relative;
  display: grid;
  place-items: center;
  margin: auto;
}

.waiting-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(14, 165, 233, .28);
}

.waiting-ring-one {
  inset: 0;
  animation: privacyPulse 4.5s ease-in-out infinite;
}

.waiting-ring-two {
  inset: 42px;
  border-color: rgba(139, 92, 246, .35);
  animation: privacyPulse 4.5s ease-in-out 1s infinite;
}

.waiting-core {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  border-radius: 34px;
  color: #fff;
  font-size: 52px;
  font-weight: 900;
  background: linear-gradient(145deg, #0ea5e9, #6366f1);
  box-shadow: 0 24px 60px rgba(14, 165, 233, .32);
}

.dashboard-waiting-copy h2 {
  max-width: 720px;
  margin: 10px 0 16px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.dashboard-waiting-copy > p {
  max-width: 720px;
  color: #52657a;
  font-size: 17px;
  line-height: 1.75;
}

.waiting-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.waiting-feature-grid div {
  padding: 18px;
  border: 1px solid #dce8f2;
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
}

.waiting-feature-grid strong {
  display: block;
  color: #0ea5e9;
  font-size: 26px;
}

.waiting-feature-grid span {
  display: block;
  margin-top: 4px;
  color: #53677c;
  font-size: 13px;
}

.tenant-gateway-section {
  margin: 26px 0;
  padding: 26px;
  border: 1px solid #dbe7f1;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff, #f8fbff);
}

.tenant-gateway-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 20px;
}

.tenant-gateway-header h2 {
  margin: 5px 0 8px;
}

.tenant-gateway-header p {
  max-width: 820px;
  margin: 0;
  color: #64748b;
}

.gateway-status {
  white-space: nowrap;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.gateway-status.is-online {
  color: #047857;
  background: #d1fae5;
}

.gateway-status.is-warning {
  color: #92400e;
  background: #fef3c7;
}

.privacy-portal {
  min-height: 100vh;
  margin: 0;
  color: #102033;
  background: #f5f8fb;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.privacy-portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(22px, 5vw, 72px);
  border-bottom: 1px solid rgba(148, 163, 184, .22);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.privacy-portal-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.privacy-portal-brand img,
.privacy-brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: grid;
  place-items: center;
  border-radius: 15px;
}

.privacy-brand-mark {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--tenant-primary), #6366f1);
}

.privacy-portal-brand strong,
.privacy-portal-brand small {
  display: block;
}

.privacy-portal-brand strong {
  font-size: 18px;
}

.privacy-portal-brand small {
  margin-top: 2px;
  color: #65758b;
}

.privacy-header-project {
  text-align: right;
}

.privacy-header-project span,
.privacy-header-project strong {
  display: block;
}

.privacy-header-project span {
  color: #718096;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.privacy-header-project strong {
  margin-top: 3px;
}

.privacy-hero {
  padding: clamp(56px, 8vw, 110px) clamp(22px, 7vw, 110px);
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,255,255,.18), transparent 28%),
    radial-gradient(circle at 10% 90%, rgba(99,102,241,.38), transparent 30%),
    linear-gradient(135deg, #071b2b, var(--tenant-primary));
}

.privacy-hero-grid {
  max-width: 1320px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: clamp(42px, 7vw, 100px);
  align-items: center;
  margin: auto;
}

.privacy-eyebrow {
  color: var(--tenant-primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.privacy-hero .privacy-eyebrow {
  color: #9ee8ff;
}

.privacy-hero h1 {
  max-width: 850px;
  margin: 16px 0 22px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: .98;
  letter-spacing: -.045em;
}

.privacy-hero-copy > p {
  max-width: 760px;
  color: rgba(255,255,255,.8);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.privacy-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button-light {
  color: #13243a;
  border-color: rgba(255,255,255,.72);
  background: #fff;
}

.privacy-trust-panel {
  padding: 30px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 28px;
  background: rgba(255,255,255,.1);
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
  backdrop-filter: blur(16px);
}

.privacy-trust-score strong,
.privacy-trust-score span {
  display: block;
}

.privacy-trust-score strong {
  font-size: 62px;
  line-height: 1;
}

.privacy-trust-score span {
  margin-top: 6px;
  color: #c9eaf5;
}

.privacy-trust-panel ul {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.privacy-trust-panel li {
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(255,255,255,.9);
}

.privacy-trust-panel li span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #064e3b;
  background: #a7f3d0;
  font-weight: 900;
}

.privacy-principles {
  max-width: 1320px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: -38px auto 0;
  padding: 0 clamp(22px, 4vw, 42px);
  position: relative;
  z-index: 2;
}

.privacy-principles article {
  padding: 26px;
  border: 1px solid #e1e9f1;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15,23,42,.08);
}

.privacy-principle-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--tenant-primary);
  background: var(--tenant-soft);
  font-size: 22px;
}

.privacy-principles h2 {
  margin: 18px 0 8px;
  font-size: 17px;
}

.privacy-principles p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
  font-size: 14px;
}

.privacy-documents-section {
  max-width: 1320px;
  margin: auto;
  padding: 90px clamp(22px, 4vw, 42px);
}

.privacy-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 25px;
  margin-bottom: 30px;
}

.privacy-section-heading h2 {
  margin: 7px 0 8px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.035em;
}

.privacy-section-heading p {
  max-width: 720px;
  margin: 0;
  color: #64748b;
}

.privacy-project-pill {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--tenant-primary);
  background: var(--tenant-soft);
  font-size: 12px;
  font-weight: 900;
}

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

.privacy-document-card {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid #dde7ef;
  border-top: 5px solid var(--tenant-primary);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(15,23,42,.055);
  transition: transform .2s ease, box-shadow .2s ease;
}

.privacy-document-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 60px rgba(15,23,42,.11);
}

.privacy-document-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.privacy-document-type,
.privacy-document-version {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.privacy-document-card h3 {
  margin: 22px 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.privacy-document-card > p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.privacy-document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.privacy-document-meta span {
  padding: 6px 9px;
  border-radius: 8px;
  color: #52657b;
  background: #f1f5f9;
  font-size: 11px;
}

.privacy-document-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 24px;
  color: var(--tenant-primary);
  text-decoration: none;
  font-weight: 900;
}

.privacy-nondiagnostic {
  max-width: 1240px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin: 0 auto 90px;
  padding: 38px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
}

.privacy-nondiagnostic h2 {
  margin: 7px 0 10px;
  font-size: 30px;
}

.privacy-nondiagnostic p {
  max-width: 780px;
  margin: 0;
  color: #cbd5e1;
  line-height: 1.7;
}

.privacy-nondiagnostic-badge {
  max-width: 190px;
  padding: 17px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 15px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}

.privacy-portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 35px clamp(22px, 6vw, 90px);
  color: #cbd5e1;
  background: #07131f;
}

.privacy-portal-footer p {
  margin: 4px 0 0;
}

.privacy-portal-footer a {
  display: block;
  margin-top: 5px;
  color: #7dd3fc;
}

.privacy-document-layout {
  max-width: 1320px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  margin: auto;
  padding: 58px 30px 100px;
}

.privacy-document-sidebar {
  position: sticky;
  top: 112px;
  padding: 25px;
  border: 1px solid #dde7ef;
  border-radius: 22px;
  background: #fff;
}

.privacy-document-sidebar h2 {
  margin: 8px 0 20px;
}

.privacy-document-sidebar dl {
  margin: 0;
}

.privacy-document-sidebar dl div {
  padding: 13px 0;
  border-top: 1px solid #edf2f7;
}

.privacy-document-sidebar dt {
  color: #718096;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.privacy-document-sidebar dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.privacy-back-link {
  display: block;
  margin-top: 22px;
  color: var(--tenant-primary);
  text-decoration: none;
  font-weight: 800;
}

.privacy-document-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.privacy-document-actions > a {
  color: #334155;
  text-decoration: none;
  font-weight: 800;
}

.privacy-document-article {
  padding: clamp(28px, 5vw, 62px);
  border: 1px solid #dde7ef;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 25px 80px rgba(15,23,42,.07);
}

.privacy-document-article > header {
  padding-bottom: 28px;
  border-bottom: 1px solid #e5edf4;
}

.privacy-document-article > header h1 {
  margin: 12px 0 14px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.privacy-document-article > header p {
  max-width: 860px;
  margin: 0;
  color: #64748b;
  font-size: 17px;
  line-height: 1.7;
}

.privacy-legal-content {
  max-width: 900px;
  margin: 38px auto 0;
  color: #26384a;
  font-size: 16px;
  line-height: 1.85;
}

.privacy-legal-content h1,
.privacy-legal-content h2,
.privacy-legal-content h3 {
  color: #0f172a;
  letter-spacing: -.02em;
}

.privacy-legal-content h1 {
  margin: 42px 0 15px;
  font-size: 34px;
}

.privacy-legal-content h2 {
  margin: 38px 0 13px;
  font-size: 25px;
}

.privacy-legal-content h3 {
  margin: 30px 0 10px;
  font-size: 19px;
}

.privacy-legal-content ul {
  padding-left: 24px;
}

.privacy-legal-content li {
  margin: 8px 0;
}

.privacy-document-signature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 45px;
  padding-top: 25px;
  border-top: 1px solid #e5edf4;
}

.privacy-document-signature div {
  padding: 16px;
  border-radius: 14px;
  background: #f8fafc;
}

.privacy-document-signature strong,
.privacy-document-signature span {
  display: block;
}

.privacy-document-signature span {
  margin-top: 5px;
  color: #64748b;
}

@keyframes privacyPulse {
  0%, 100% { transform: scale(.96); opacity: .55; }
  50% { transform: scale(1.04); opacity: 1; }
}

@media (max-width: 1050px) {
  .privacy-principles,
  .privacy-document-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-waiting-state,
  .privacy-hero-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-waiting-visual {
    width: 230px;
    height: 230px;
  }

  .privacy-document-layout {
    grid-template-columns: 1fr;
  }

  .privacy-document-sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .privacy-portal-header,
  .privacy-section-heading,
  .privacy-nondiagnostic,
  .privacy-portal-footer,
  .tenant-gateway-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .privacy-header-project {
    text-align: left;
  }

  .privacy-principles,
  .privacy-document-grid,
  .waiting-feature-grid,
  .privacy-document-signature {
    grid-template-columns: 1fr;
  }

  .privacy-hero {
    padding-top: 54px;
  }

  .privacy-hero h1 {
    font-size: 44px;
  }

  .dashboard-waiting-state {
    padding: 30px 22px;
  }

  .privacy-document-actions {
    width: 100%;
    justify-content: space-between;
  }

  .privacy-document-layout {
    padding: 24px 14px 70px;
  }
}

@media print {
  .privacy-portal-header,
  .privacy-document-sidebar,
  .privacy-document-actions,
  .privacy-portal-footer {
    display: none !important;
  }

  .privacy-document-layout {
    display: block;
    max-width: none;
    padding: 0;
  }

  .privacy-document-article {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}


/* Cierre final v242 · contraste, filtros y dashboard */
.privacy-nondiagnostic .privacy-eyebrow {
  color: #7dd3fc;
}

.privacy-nondiagnostic h2 {
  color: #ffffff;
}

.privacy-nondiagnostic p {
  color: #cbd5e1;
}

.privacy-nondiagnostic-badge {
  color: #ffffff;
  background: rgba(255, 255, 255, .06);
}

.dashboard-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}

.dashboard-filter-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: 1px solid #dbe7f1;
  border-radius: 999px;
  color: #52657a;
  background: #ffffff;
  font-size: 12px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .04);
}

.dashboard-filter-summary strong {
  color: #0f172a;
}


/* ==================================================================
   ERPUS CENTRAL UI V3.2
   - Corrige section-title-small comprimido.
   - Mejora tarjetas de estado de proyectos.
   - Hace la grilla de funcionalidades más fluida y responsive.
   ================================================================== */

.feature-group {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.feature-group + .feature-group {
  margin-top: 14px;
}

/*
 * section-title normal usa 38px + contenido porque lleva section-number.
 * section-title-small NO lleva número, por eso debe usar una sola columna.
 */
.section-title.section-title-small {
  display: block;
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border-soft);
}

.section-title.section-title-small > div {
  width: 100%;
  min-width: 0;
}

.section-title.section-title-small h4 {
  margin: 0 0 5px;
  color: var(--slate-800);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.section-title.section-title-small p {
  margin: 0;
  max-width: 920px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.feature-grid .toggle {
  min-width: 0;
  min-height: 72px;
}

.feature-grid .toggle > span {
  min-width: 0;
}

.feature-grid .toggle strong,
.feature-grid .toggle small {
  display: block;
  overflow-wrap: anywhere;
}

.feature-grid .toggle strong {
  margin-bottom: 3px;
  line-height: 1.35;
}

.feature-grid .toggle small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

/* Estado actual de proyectos */
.tenant-check-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 17px;
}

.tenant-check-header {
  align-items: flex-start;
}

.tenant-check-identity,
.project-identity {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.tenant-check-code,
.project-identity strong {
  display: block;
  max-width: 100%;
  color: var(--slate-900);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}

.tenant-check-name,
.project-identity small {
  display: block;
  max-width: 100%;
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tenant-check-card > p {
  min-height: 32px;
  margin: 0;
  line-height: 1.45;
}

.tenant-check-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

.tenant-check-meta span,
.tenant-check-meta strong {
  min-width: 0;
}

.tenant-check-meta strong {
  text-align: right;
  overflow-wrap: anywhere;
}

@media (min-width: 1440px) {
  .tenant-check-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .feature-group {
    padding: 13px;
  }

  .section-title.section-title-small {
    margin-bottom: 12px;
  }

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

  .tenant-check-header {
    gap: 10px;
  }

  .tenant-check-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .tenant-check-meta strong {
    text-align: left;
  }
}
