:root {
  --nmp-burgundy: #7a1230;
  --nmp-burgundy-dark: #5c0d24;
  --nmp-burgundy-soft: rgba(122, 18, 48, 0.08);
  --nmp-gold: #c9a227;
  --nmp-gold-light: #e8d48b;
  --nmp-gold-soft: rgba(201, 162, 39, 0.12);
  --nmp-slate: #1e293b;
  --nmp-slate-muted: #64748b;
  --nmp-bg: #f1f5f9;
  --nmp-card: #ffffff;
  --nmp-sidebar-width: 260px;
  --nmp-radius: 12px;
  --nmp-radius-lg: 16px;
  --nmp-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --nmp-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
  --nmp-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--nmp-bg);
  color: var(--nmp-slate);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* —— Login —— */
.auth-page {
  min-height: 100vh;
  display: flex;
}

.auth-brand {
  flex: 1;
  background: linear-gradient(145deg, var(--nmp-burgundy-dark) 0%, var(--nmp-burgundy) 45%, #9b1b3d 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-brand .tagline {
  opacity: 0.9;
  font-size: 1.05rem;
  max-width: 380px;
  line-height: 1.6;
}

.auth-brand .badge-module {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--nmp-gold-light);
}

.auth-form-panel {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--nmp-card);
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  font-weight: 700;
  color: var(--nmp-slate);
  margin-bottom: 0.25rem;
}

.auth-card .subtitle {
  color: var(--nmp-slate-muted);
  margin-bottom: 1.75rem;
}

.btn-nmp-primary {
  background: var(--nmp-burgundy);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  width: 100%;
}

.btn-nmp-primary:hover {
  background: var(--nmp-burgundy-dark);
  color: #fff;
}

.form-control-nmp {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0.65rem 0.85rem;
}

.form-control-nmp:focus {
  border-color: var(--nmp-burgundy);
  box-shadow: 0 0 0 3px rgba(122, 18, 48, 0.15);
}

.demo-users {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--nmp-radius);
  font-size: 0.8rem;
  color: var(--nmp-slate-muted);
}

.demo-users code {
  color: var(--nmp-burgundy);
}

/* —— App shell —— */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--nmp-sidebar-width);
  background: linear-gradient(180deg, var(--nmp-slate) 0%, #0f172a 100%);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.35rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-brand small {
  display: block;
  color: var(--nmp-gold-light);
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 0.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.sidebar-nav .nav-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-nav .nav-link {
  color: #cbd5e1;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: var(--nmp-burgundy);
  color: #fff;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

.app-main {
  flex: 1;
  margin-left: var(--nmp-sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  background: var(--nmp-card);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-topbar h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--nmp-slate);
  letter-spacing: -0.02em;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nmp-burgundy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-chip .role-badge {
  font-size: 0.7rem;
  color: var(--nmp-slate-muted);
}

.app-content {
  padding: 1.75rem 2rem 2.5rem;
  flex: 1;
  background:
    radial-gradient(ellipse 80% 50% at 100% -20%, rgba(122, 18, 48, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(201, 162, 39, 0.05), transparent),
    var(--nmp-bg);
}

/* —— Components —— */
.stat-card {
  background: var(--nmp-card);
  border-radius: var(--nmp-radius);
  box-shadow: var(--nmp-shadow);
  padding: 1.25rem 1.35rem;
  border: 1px solid #e2e8f0;
}

.row [class*="col-"] > .stat-card {
  height: 100%;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--nmp-slate-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--nmp-slate);
  line-height: 1.2;
}

.stat-card .stat-meta {
  font-size: 0.8rem;
  color: var(--nmp-slate-muted);
  margin-top: 0.35rem;
}

.stat-card.accent-gold {
  border-left: 4px solid var(--nmp-gold);
}

.stat-card.accent-burgundy {
  border-left: 4px solid var(--nmp-burgundy);
}

.panel-card {
  background: var(--nmp-card);
  border-radius: var(--nmp-radius);
  box-shadow: var(--nmp-shadow);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.panel-card .panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.panel-card .panel-header h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.table-nmp {
  margin: 0;
}

.table-nmp thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--nmp-slate-muted);
  font-weight: 600;
  border-bottom-width: 1px;
  background: #f8fafc;
}

.btn-nmp {
  background: var(--nmp-burgundy);
  border-color: var(--nmp-burgundy);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
}

.btn-nmp:hover {
  background: var(--nmp-burgundy-dark);
  border-color: var(--nmp-burgundy-dark);
  color: #fff;
}

.btn-outline-nmp {
  border: 1px solid var(--nmp-burgundy);
  color: var(--nmp-burgundy);
  border-radius: 8px;
  font-weight: 600;
}

.btn-outline-nmp:hover {
  background: var(--nmp-burgundy);
  color: #fff;
}

.page-lead {
  color: var(--nmp-slate-muted);
  margin-bottom: 1.5rem;
}

.alert-nmp {
  border-radius: var(--nmp-radius);
  border: none;
  background: #fef3f2;
  color: var(--nmp-burgundy-dark);
}

/* —— Module pages (Testigos, etc.) —— */
.module-hero {
  position: relative;
  border-radius: var(--nmp-radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 55%, #fff5f7 100%);
  border: 1px solid #e2e8f0;
  box-shadow: var(--nmp-shadow);
}

.module-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -5%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--nmp-burgundy-soft) 0%, transparent 70%);
  pointer-events: none;
}

.module-hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: 20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--nmp-gold-soft) 0%, transparent 70%);
  pointer-events: none;
}

.module-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.module-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--nmp-burgundy) 0%, #9b1b3d 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 8px 20px rgba(122, 18, 48, 0.25);
  flex-shrink: 0;
}

.module-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nmp-burgundy);
  background: var(--nmp-burgundy-soft);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

.module-hero h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.module-hero .module-hero-desc {
  color: var(--nmp-slate-muted);
  font-size: 0.92rem;
  margin: 0;
  max-width: 520px;
  line-height: 1.55;
}

.module-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.btn-nmp-lg {
  padding: 0.65rem 1.35rem;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(122, 18, 48, 0.2);
}

.btn-ghost-nmp {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--nmp-slate);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color var(--nmp-transition), box-shadow var(--nmp-transition);
}

.btn-ghost-nmp:hover {
  border-color: #cbd5e1;
  box-shadow: var(--nmp-shadow);
  color: var(--nmp-slate);
}

/* KPI cards */
.kpi-grid {
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--nmp-card);
  border-radius: var(--nmp-radius-lg);
  border: 1px solid #e2e8f0;
  padding: 1.25rem 1.35rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform var(--nmp-transition), box-shadow var(--nmp-transition);
  box-shadow: var(--nmp-shadow);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--nmp-shadow-lg);
}

.kpi-card-featured {
  background: linear-gradient(160deg, #fff 0%, #fffbeb 100%);
  border-color: rgba(201, 162, 39, 0.35);
}

.kpi-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.kpi-icon.gold { background: var(--nmp-gold-soft); color: #92680a; }
.kpi-icon.burgundy { background: var(--nmp-burgundy-soft); color: var(--nmp-burgundy); }
.kpi-icon.slate { background: #f1f5f9; color: var(--nmp-slate-muted); }
.kpi-icon.teal { background: rgba(13, 148, 136, 0.12); color: #0d9488; }

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--nmp-slate-muted);
  margin-bottom: 0.2rem;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--nmp-slate);
}

.kpi-meta {
  font-size: 0.8rem;
  color: var(--nmp-slate-muted);
  margin-top: auto;
  padding-top: 0.65rem;
}

.kpi-ring {
  --pct: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--nmp-gold) calc(var(--pct) * 1%), #e8ecf1 0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-ring-inner {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--nmp-slate);
  box-shadow: inset 0 0 0 1px #f1f5f9;
}

.kpi-ring-inner small {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--nmp-slate-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.kpi-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #e8ecf1;
  overflow: hidden;
  margin-top: 0.75rem;
}

.kpi-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--nmp-gold) 0%, #ddb84a 100%);
  transition: width 0.6s ease;
}

/* Evidence list */
.evidence-panel {
  border-radius: var(--nmp-radius-lg);
}

.evidence-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.evidence-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.evidence-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nmp-slate-muted);
  font-size: 0.9rem;
}

.evidence-search input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  background: #fff;
  transition: border-color var(--nmp-transition), box-shadow var(--nmp-transition);
}

.evidence-search input:focus {
  outline: none;
  border-color: var(--nmp-burgundy);
  box-shadow: 0 0 0 3px rgba(122, 18, 48, 0.1);
}

.evidence-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.evidence-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--nmp-slate-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--nmp-transition);
}

.evidence-chip:hover,
.evidence-chip.active {
  border-color: var(--nmp-burgundy);
  background: var(--nmp-burgundy-soft);
  color: var(--nmp-burgundy);
}

.evidence-list {
  padding: 0.5rem;
}

.evidence-item {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--nmp-radius);
  border: 1px solid transparent;
  transition: background var(--nmp-transition), border-color var(--nmp-transition), box-shadow var(--nmp-transition);
  margin-bottom: 0.35rem;
}

.evidence-item:hover {
  background: #f8fafc;
  border-color: #e8ecf1;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.evidence-type-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.evidence-type-icon.photo { background: #eff6ff; color: #2563eb; }
.evidence-type-icon.url { background: #f0fdf4; color: #16a34a; }
.evidence-type-icon.pdf { background: #fef2f2; color: #dc2626; }
.evidence-type-icon.other { background: #f5f3ff; color: #7c3aed; }

.evidence-body {
  flex: 1;
  min-width: 0;
}

.evidence-title {
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0 0 0.35rem;
  color: var(--nmp-slate);
}

.evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.evidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--nmp-slate-muted);
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.evidence-pill i {
  font-size: 0.75rem;
  opacity: 0.85;
}

.evidence-pill.verified {
  background: #ecfdf5;
  color: #047857;
}

.evidence-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  text-align: right;
}

.evidence-date {
  font-size: 0.78rem;
  color: var(--nmp-slate-muted);
  white-space: nowrap;
}

.evidence-geo {
  font-size: 0.72rem;
  font-weight: 600;
  color: #0d9488;
  background: rgba(13, 148, 136, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.evidence-geo.missing {
  color: var(--nmp-slate-muted);
  background: #f1f5f9;
}

.evidence-empty {
  text-align: center;
  padding: 3.5rem 2rem;
}

.evidence-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--nmp-burgundy-soft) 0%, var(--nmp-gold-soft) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--nmp-burgundy);
}

.insight-card {
  background: var(--nmp-card);
  border-radius: var(--nmp-radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: var(--nmp-shadow);
  padding: 1.25rem;
  height: 100%;
}

.insight-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nmp-slate-muted);
  margin: 0 0 1rem;
}

.insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.insight-row:last-child {
  border-bottom: none;
}

.insight-row .insight-bar {
  flex: 1;
  max-width: 100px;
  height: 5px;
  background: #e8ecf1;
  border-radius: 999px;
  margin: 0 0.75rem;
  overflow: hidden;
}

.insight-row .insight-bar span {
  display: block;
  height: 100%;
  background: var(--nmp-burgundy);
  border-radius: 999px;
}

/* Form module */
.form-module {
  max-width: 720px;
}

.form-module-header {
  margin-bottom: 1.5rem;
}

.form-module-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.form-section {
  background: var(--nmp-card);
  border: 1px solid #e2e8f0;
  border-radius: var(--nmp-radius-lg);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--nmp-shadow);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--nmp-slate-muted);
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.form-section-title i {
  color: var(--nmp-burgundy);
  font-size: 1rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--nmp-slate-muted);
  margin-top: 0.25rem;
}

.form-actions-sticky {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.5rem;
}

@media (max-width: 767px) {
  .evidence-item {
    flex-wrap: wrap;
  }
  .evidence-side {
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
}

.nav-tabs-campaign {
  border-bottom: none;
  gap: 0.35rem;
  padding: 0.2rem;
  background: #e8ecf1;
  border-radius: 10px;
  display: inline-flex;
  flex-wrap: wrap;
}

.nav-tabs-campaign .nav-link {
  border: none;
  color: var(--nmp-slate-muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: transparent;
}

.nav-tabs-campaign .nav-link:hover {
  color: var(--nmp-slate);
  background: rgba(255, 255, 255, 0.65);
}

.nav-tabs-campaign .nav-link.active {
  color: var(--nmp-burgundy);
  background: var(--nmp-card);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.tab-panel-card.panel-card .panel-header {
  border-bottom: 1px solid #e2e8f0;
}

.tab-panel-header {
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  padding: 1rem 1.35rem;
}

.tab-panel-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--nmp-slate);
}

.tab-panel-title .bi {
  color: var(--nmp-burgundy);
}

.tab-panel-action {
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  white-space: nowrap;
}

.tab-panel-empty {
  padding: 1.35rem 1.35rem 1.5rem;
  color: var(--nmp-slate-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.tab-panel-empty a {
  font-weight: 600;
}

.tab-panel-list-item {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid #f1f5f9;
}

.tab-panel-list-item:last-child {
  border-bottom: none;
}

.tab-panel-list-item:hover {
  background: #fafbfc;
}

.tab-content > .tab-pane > .panel-card {
  margin-top: 0.65rem;
}

.help-topic-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--nmp-slate);
  margin-bottom: 0.35rem;
}

.help-topic-body {
  font-size: 0.88rem;
  color: var(--nmp-slate-muted);
  line-height: 1.55;
}

/* —— Organigrama de roles —— */
.role-org-panel {
  overflow: hidden;
}

.role-org-wrap {
  padding: 1.5rem 1rem 2rem;
  overflow-x: auto;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.role-org-tree,
.role-org-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.role-org-tree {
  display: flex;
  justify-content: center;
}

.role-org-tree--regions {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2.5rem 1.5rem;
  justify-content: center;
}

.role-org-tree--regions > .role-org-item {
  padding-top: 0;
  flex: 0 1 auto;
}

.role-org-tree--regions > .role-org-item::before {
  display: none;
}

.role-org-tree > .role-org-item {
  padding-top: 0;
}

.role-org-tree > .role-org-item::before,
.role-org-tree > .role-org-item::after {
  display: none;
}

.role-org-children {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding-top: 1.75rem;
  position: relative;
}

.role-org-children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 2px;
  background: #cbd5e1;
}

.role-org-item {
  position: relative;
  padding: 0 0.65rem 1rem;
  text-align: center;
}

.role-org-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 1.75rem;
  background: #cbd5e1;
  transform: translateX(-50%);
}

.role-org-children > .role-org-item::after {
  content: "";
  position: absolute;
  top: 0;
  height: 2px;
  background: #cbd5e1;
}

.role-org-children > .role-org-item:first-child::after {
  left: 50%;
  right: 0;
}

.role-org-children > .role-org-item:last-child::after {
  left: 0;
  right: 50%;
}

.role-org-children > .role-org-item:only-child::after {
  display: none;
}

.role-org-children > .role-org-item:not(:first-child):not(:last-child)::after {
  left: 0;
  right: 0;
}

.role-org-item--leaf .role-org-children::before {
  left: 15%;
  right: 15%;
}

.role-node {
  display: inline-flex;
  min-width: 210px;
  max-width: 240px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--nmp-card);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
  border: 1px solid #e2e8f0;
  cursor: default;
  transition: box-shadow var(--nmp-transition), transform var(--nmp-transition);
  text-align: left;
  vertical-align: top;
}

.role-org-item--role > .role-node {
  cursor: pointer;
  min-width: 220px;
}

.role-org-item--role > .role-node:hover {
  box-shadow: 0 6px 20px rgba(122, 18, 48, 0.15);
  transform: translateY(-2px);
}

.role-node--selected {
  outline: 3px solid var(--nmp-gold);
  outline-offset: 2px;
}

.role-node--sm {
  min-width: 175px;
  max-width: 200px;
}

.role-node__ribbon {
  width: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-node__ribbon span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  line-height: 1.2;
  max-height: 120px;
  overflow: hidden;
}

.role-node__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.role-node__title {
  padding: 0.55rem 0.75rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--nmp-slate);
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.25;
}

.role-node__subtitle {
  padding: 0.4rem 0.75rem 0.5rem;
  font-size: 0.72rem;
  color: var(--nmp-slate-muted);
  line-height: 1.35;
}

.role-accent-purple .role-node__ribbon { background: #6b4c9a; }
.role-accent-burgundy .role-node__ribbon { background: var(--nmp-burgundy); }
.role-accent-wine .role-node__ribbon { background: #9b1b3d; }
.role-accent-plum .role-node__ribbon { background: #7b3f9e; }
.role-accent-orange .role-node__ribbon { background: #d97706; }
.role-accent-coral .role-node__ribbon { background: #db5c73; }
.role-accent-rose .role-node__ribbon { background: #be185d; }
.role-accent-gold .role-node__ribbon { background: #a67c00; }

.role-org-tree > .role-org-item > .role-node {
  min-width: 240px;
  max-width: 280px;
}

.role-org-tree > .role-org-item > .role-node .role-node__title {
  font-size: 0.95rem;
}

#permissions-table.perm-matrix--focused .perm-row--dim {
  opacity: 0.35;
}

#permissions-table.perm-matrix--focused .perm-row--active {
  background: var(--nmp-burgundy-soft);
}

#permissions-table.perm-matrix--focused .perm-row--active td:first-child {
  color: var(--nmp-burgundy);
}

.branch-org-node__actions {
  padding: 0 0.75rem 0.45rem;
  border-top: 1px solid #f8fafc;
  text-align: right;
}

.branch-org-node .role-node__subtitle {
  font-size: 0.68rem;
}

.branch-org-node .role-node__subtitle code {
  color: var(--nmp-slate-muted);
}

#branches-table.branch-table--focused .branch-row--dim {
  opacity: 0.35;
}

#branches-table.branch-table--focused .branch-row--active {
  background: var(--nmp-burgundy-soft);
}

.branch-row--hidden {
  display: none;
}

.pop-view-tabs .nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--nmp-slate-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
}

.pop-view-tabs .nav-link.active {
  background: var(--nmp-burgundy-soft);
  color: var(--nmp-burgundy);
}

.pop-catalog-detail {
  margin: 0 1rem 1rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--nmp-burgundy-soft) 0%, #fff 70%);
  border: 1px solid #e2e8f0;
  transition: opacity 0.2s ease;
}

.pop-catalog-detail--hidden {
  display: none;
}

.pop-catalog-detail__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.pop-catalog-row {
  cursor: pointer;
}

.pop-catalog-row--selected {
  background: var(--nmp-burgundy-soft) !important;
}

.pop-order-row--hidden {
  display: none;
}

#pop-orders-table.pop-orders-table--focused .pop-order-row--dim {
  opacity: 0.35;
}

#pop-orders-table.pop-orders-table--focused .pop-order-row--active {
  background: var(--nmp-burgundy-soft);
}

@media (max-width: 991px) {
  .role-org-children {
    flex-direction: column;
    align-items: center;
  }

  .role-org-children::before,
  .role-org-item::before,
  .role-org-children > .role-org-item::after {
    display: none;
  }

  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-main {
    margin-left: 0;
  }
  .auth-brand {
    display: none;
  }
  .auth-form-panel {
    max-width: none;
  }
}
