@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: #0b1329;
  color: #f8fafc;
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-theme {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

body.light-theme .pro-navbar,
body.light-theme .view-selector-bar,
body.light-theme .cohort-summary-box,
body.light-theme .excel-table-container,
body.light-theme .indiv-card,
body.light-theme .gauge-container,
body.light-theme .cip-search-box,
body.light-theme .config-card {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-theme .matrix-table th {
  background-color: #e2e8f0 !important;
  color: #0369a1 !important;
}

body.light-theme .matrix-table td {
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-theme .matrix-table tr:nth-child(even) {
  background-color: #f8fafc !important;
}

body.light-theme .matrix-table tr:hover {
  background-color: #e2e8f0 !important;
}

body.light-theme .td-text-block {
  color: #334155 !important;
}

/* NAVBAR PRO */
.pro-navbar {
  background-color: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.pro-nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pro-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pro-logo {
  height: 38px;
  width: auto;
}

.pro-badge {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.pro-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-status {
  font-size: 0.82rem;
  color: #22c55e;
  font-weight: 600;
}

.btn-back-hub, .btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  color: #38bdf8 !important;
  border: 1px solid #334155;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back-hub:hover, .btn-theme-toggle:hover {
  background: #0284c7;
  color: #ffffff !important;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.pro-main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px;
}

.pro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.pro-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
}

.pro-subtitle {
  color: #94a3b8;
  font-size: 0.92rem;
  margin-top: 4px;
}

.btn-template-trigger {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #38bdf8;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-template-trigger:hover {
  background: #0369a1;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* PESTAÑAS PRINCIPALES */
.pro-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #cbd5e1;
}

.tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

.tab-content.hidden {
  display: none !important;
}

/* SELECTORES DE VISTA DE REPORTES Y CONMUTACIÓN */
.view-selector-bar {
  display: flex;
  gap: 12px;
  background: #0f172a;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  margin-bottom: 20px;
  overflow-x: auto;
}

.view-btn {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-indiv-special {
  background: #0f2b48;
  border-color: #0284c7;
  color: #38bdf8;
}

.view-btn:hover {
  border-color: #38bdf8;
  color: #f8fafc;
}

.view-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

.report-view-container {
  display: block;
  width: 100%;
  margin-top: 15px;
}

.report-view-container.hidden {
  display: none !important;
}

.cohort-summary-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.director-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.analytics-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
}

.excel-table-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 65vh;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0b1329;
  margin-top: 15px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: #cbd5e1;
  white-space: nowrap;
}

.matrix-table th {
  background: #1e293b;
  color: #38bdf8;
  padding: 12px 14px;
  text-align: center;
  border: 1px solid #334155;
  position: sticky;
  top: 0;
  z-index: 10;
  font-weight: 700;
  text-transform: uppercase;
}

.matrix-table td {
  padding: 10px 12px;
  border: 1px solid #1e293b;
  text-align: center;
  vertical-align: middle;
}

.matrix-table tr:nth-child(even) {
  background: #0f172a;
}

.matrix-table tr:hover {
  background: #1e293b;
}

.td-text-block {
  white-space: normal !important;
  min-width: 260px;
  max-width: 380px;
  text-align: left !important;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #94a3b8;
}

.pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.pro-table th {
  background: #1e293b;
  color: #94a3b8;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #334155;
}

.pro-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #1e293b;
}

/* COMPONENTES GRÁFICOS RECONSTRUIDOS: DONAS Y BARRAS */
.mini-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 65px;
  width: 85px;
  background: #0f172a;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #334155;
  margin: 0 auto;
}

.bar-col {
  flex: 1;
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.bar-col span {
  font-size: 0.6rem;
  font-weight: 800;
  color: #000;
  margin-bottom: 2px;
}

.c1 { background: #38bdf8; }
.c2 { background: #818cf8; }
.c3 { background: #fbbf24; }
.c4 { background: #a855f7; }

.mini-donut-escucha {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  background: conic-gradient(#22c55e var(--pct), #334155 0);
  margin: 0 auto;
}

.donut-indiv-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #1e293b;
}

.cip-search-box {
  background: #0f172a;
  border: 1px solid #38bdf8;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.select-test-view {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  outline: none;
}

.indiv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.indiv-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px;
}

.indiv-card-header {
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 6px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.interp-box {
  background: #1e293b;
  border-left: 3px solid #38bdf8;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin-top: 8px;
}

.gauge-container {
  text-align: center;
  padding: 20px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.config-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.config-card h3 {
  font-size: 1.1rem;
  color: #f8fafc;
  margin-bottom: 14px;
}

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

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  outline: none;
}

/* SUITES PRECONFIGURADAS EN PESTAÑA 1 */
.suites-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

.suite-card-btn {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  color: #f8fafc;
}

.suite-card-btn:hover {
  border-color: #38bdf8;
  background: #1e293b;
}

.suite-card-btn.active-suite {
  border-color: #38bdf8;
  background: #1e293b;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.suite-icon {
  font-size: 1.8rem;
}

.suite-btn-content strong {
  display: block;
  font-size: 0.95rem;
  color: #38bdf8;
  margin-bottom: 2px;
}

.suite-btn-content small {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.2;
}

.pro-tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 15px;
}

.test-select-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-select-card:hover {
  border-color: #38bdf8;
}

.test-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

@media print {
  .pro-navbar, .view-selector-bar, .pro-tabs, .pro-actions-top {
    display: none !important;
  }
  body, .pro-main-container {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .excel-table-container {
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
  }
}