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

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: 4px;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.flag-stripe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  display: flex;
  z-index: 1000;
}
.stripe-yellow { flex: 2; background-color: #FCD116; }
.stripe-blue { flex: 1; background-color: #003893; }
.stripe-red { flex: 1; background-color: #CE1126; }

.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.25rem 2rem;
  position: sticky;
  top: 4px;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #6a1d36;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.entity-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #6a1d36;
}

.portal-title {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.header-tag span {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.dashboard-intro {
  margin-bottom: 2rem;
}

.dashboard-intro h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.dashboard-intro p {
  color: #64748b;
  font-size: 1.1rem;
}

.control-panel {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.filters-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 1.5rem;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .filters-row {
    grid-template-columns: 1fr;
  }
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.input-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select::after {
  content: '▼';
  font-size: 0.65rem;
  color: #64748b;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.custom-select select {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1e293b;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
}

.custom-select select:focus {
  border-color: #6a1d36;
  outline: none;
  box-shadow: 0 0 0 3px rgba(106, 29, 54, 0.1);
}

.custom-select select:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.data-status-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.status-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.metric-visual {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.total-encuestas { background-color: rgba(106, 29, 54, 0.08); color: #6a1d36; }
.satisfaccion-general { background-color: rgba(197, 160, 89, 0.12); color: #b48a3c; }
.facilitacion { background-color: rgba(16, 185, 129, 0.08); color: #059669; }
.logistica { background-color: rgba(30, 58, 138, 0.08); color: #1e3a8a; }

.metric-data {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.metric-title {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.metric-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  margin: 0.1rem 0;
}

.metric-bar-bg {
  background-color: #f1f5f9;
  height: 4px;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.35rem;
  width: 100%;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 9999px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#kpi-satisfaction .metric-bar-fill { background-color: #c5a059; }
#kpi-instructor .metric-bar-fill { background-color: #10b981; }
#kpi-logistics .metric-bar-fill { background-color: #1e3a8a; }

.visualizations-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 992px) {
  .visualizations-grid {
    grid-template-columns: 1fr;
  }
}

.data-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.card-header {
  margin-bottom: 1.25rem;
}

.card-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.card-header p {
  font-size: 0.8rem;
  color: #64748b;
}

.chart-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
}

.side-charts-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feedback-panel {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  margin-bottom: 2.5rem;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.title-group h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.title-group p {
  font-size: 0.8rem;
  color: #64748b;
}

.filter-toggles {
  display: flex;
  gap: 0.4rem;
}

.toggle-btn {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.toggle-btn.active {
  background-color: rgba(106, 29, 54, 0.08);
  border-color: rgba(106, 29, 54, 0.2);
  color: #6a1d36;
}

.comments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.comment-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.comment-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.comment-card.sent-sug {
  border-left: 4px solid #ef4444;
}

.comment-card.sent-pos {
  border-left: 4px solid #10b981;
}

.comment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px dashed #f1f5f9;
  padding-bottom: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment-meta {
  font-weight: 500;
}

.comment-meta strong {
  color: #334155;
}

.comment-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.badge-cat {
  background-color: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.65rem;
}

.badge-sent {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.65rem;
}

.badge-sent.sent-sug {
  background-color: #fee2e2;
  color: #ef4444;
}

.badge-sent.sent-pos {
  background-color: #d1fae5;
  color: #069669;
}

.comment-card-body {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
}

.comment-card-body p {
  margin-bottom: 0.45rem;
}

.comment-card-body p:last-child {
  margin-bottom: 0;
}

.comment-card-body strong {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

.app-footer {
  text-align: center;
  padding: 2.5rem 0;
  border-top: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #64748b;
}

/* Logo header layouts */
.header-logos-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-logo-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crest-svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

.brand-logo-text-left {
  display: flex;
  flex-direction: column;
}

.entity-gov {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
}

.entity-min {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #6a1d36;
  line-height: 1.1;
}

.header-center-title {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.portal-main-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #0f172a;
}

.portal-sub-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.header-logo-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.oiss-svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

.brand-logo-text-right {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.entity-oiss-abbrev {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #6a1d36;
  line-height: 1.1;
}

.entity-oiss-full {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
}

/* Adjustments for responsiveness */
@media (max-width: 768px) {
  .header-logos-layout {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  .brand-logo-text-right {
    text-align: left;
  }
  .header-logo-right {
    flex-direction: row-reverse;
  }
}

/* Question filter checkboxes styling */
.question-filter-container {
  margin-top: 1.25rem;
  border-top: 1px dashed #e2e8f0;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
}

.question-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.action-btn-link {
  background: none;
  border: none;
  color: #6a1d36;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.action-btn-link:hover {
  color: #c5a059;
}

.divider {
  color: #cbd5e1;
}

.question-checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  user-select: none;
}

.checkbox-label:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #6a1d36;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.custom-checkbox-text {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Unified questions bar layout styles */
.unified-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1024px) {
  .unified-layout {
    grid-template-columns: 1fr;
  }
}

.main-chart-full {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.chart-wrapper-large {
  position: relative;
  height: 480px;
  width: 100%;
}

.doughnut-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.questions-analysis-panel {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  margin-bottom: 2.5rem;
}

.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.question-analysis-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.01);
  transition: box-shadow 0.2s, transform 0.2s;
}

.question-analysis-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.q-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.q-number {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #6a1d36;
}

.q-score-badge {
  background-color: rgba(106, 29, 54, 0.08);
  color: #6a1d36;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.q-text {
  font-size: 0.8rem;
  color: #334155;
  font-weight: 500;
  line-height: 1.4;
  height: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.q-progress-container {
  margin-top: 0.25rem;
}

.q-progress-bar-bg {
  background-color: #f1f5f9;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.q-progress-bar-fill {
  background-color: #6a1d36;
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.q-benchmark {
  font-size: 0.7rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
}

.q-finding-text {
  font-size: 0.75rem;
  color: #475569;
  font-style: italic;
  border-left: 2px solid #c5a059;
  padding-left: 0.5rem;
  margin-top: 0.4rem;
  line-height: 1.35;
}

.crest-placeholder, .oiss-placeholder {
  width: 40px;
  height: 40px;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  background-color: #f8fafc;
}

.logo-ministerio-img {
  height: 55px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
}

.logo-oiss-img {
  height: 45px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
}


