/* ==========================================================================
 * 10-secciones.css · parte 10/11 — Secciones: alertas de precio, valoración, accionariado, foro y novedades
 * Orden de carga obligatorio (reproduce la cascada del styles.css original).
 * No reordenar los <link> ni mover reglas entre partes sin revisar la cascada.
 * ========================================================================== */


.price-alerts-page-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.pa-dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft2);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pa-company-panel {
  padding: 24px !important;
  background: var(--surface) !important;
}

.pa-company-title-row {
  margin-bottom: 20px;
}

.pa-form {
  background: var(--surface-2);
  border: 1px solid var(--line-soft2);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.pa-form-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
}

.pa-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.pa-ticker-wrap {
  position: relative;
  width: 100%;
}

.pa-ticker-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1.5px solid var(--line-mid);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 240px;
  overflow-y: auto;
}

.pa-ticker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--surface-3);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.pa-ticker-option:hover {
  background: var(--green-bg);
}

.pa-ticker-option:last-child {
  border-bottom: 0;
}

.pa-option-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line-soft2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.pa-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
}

.pa-option-ticker {
  color: var(--green-text-2);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.pa-ticker-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.pa-ref-divider {
  color: var(--muted-2);
  margin: 0 4px;
}

.pa-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-strong);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pa-field input,
.pa-field select {
  height: 40px;
  background: var(--surface) !important;
  border: 1.5px solid var(--line-mid) !important;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink) !important;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.pa-field input::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

.pa-field input:focus,
.pa-field select:focus {
  border-color: var(--green-text) !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.pa-ref-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: 6px;
  font-size: 12.5px;
  color: #166534;
}

.pa-ref-label {
  color: var(--green-text-2);
  font-weight: 600;
}

.pa-ref-price {
  color: #166534;
  font-size: 14px;
  font-weight: 800;
}

.pa-ref-company {
  color: #4b5563;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.pa-form-error {
  margin: 0;
  font-size: 12px;
  color: #ef4444;
  font-weight: 600;
  margin-right: auto;
}

.pa-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #16a34a;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pa-submit-btn:hover {
  background: #15803d;
}

.pa-list-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 180px;
}

.pa-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.pa-list-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.pa-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line-soft2);
}

.pa-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pa-tab:hover {
  color: var(--ink);
}

.pa-tab.active {
  background: var(--surface);
  color: var(--green-text);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pa-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.pa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.pa-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-soft2);
  background: var(--surface);
  transition: all 0.15s ease;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pa-item:hover {
  border-color: var(--line-mid);
  background: var(--surface-2);
}

.pa-item.pending {
  border-left: 4px solid var(--info-solid);
}

.pa-item.triggered {
  border-left: 4px solid #16a34a;
  background: var(--surface-2);
}

.pa-item-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.pa-item-ticker-wrap {
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.pa-item-ticker {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.pa-item-ticker:hover {
  color: var(--info-text);
  text-decoration: underline;
}

.pa-item-company {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.pa-item-cond {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pa-cond-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.pa-cond-pill.gte {
  background: var(--green-bg);
  color: var(--green-text-2);
  border: 1px solid var(--green-border);
}

.pa-cond-pill.lte {
  background: var(--red-bg);
  color: var(--red-text);
  border: 1px solid var(--red-border);
}

.pa-current-wrap {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
}

.pa-current-wrap strong {
  color: var(--ink);
}

.pa-item-diff {
  font-size: 11px;
  font-weight: 600;
  color: var(--info-text);
}

.pa-item-aside {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pa-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.pa-status-badge.pending {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}

.pa-status-badge.triggered {
  background: var(--green-bg);
  color: #166534;
  border: 1px solid var(--green-border);
}

.pa-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--muted-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pa-delete-btn:hover {
  background: var(--red-bg);
  color: var(--red-text);
}

@media (max-width: 600px) {
  .pa-form-grid {
    grid-template-columns: 1fr;
  }
  .pa-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .pa-item-aside {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Pestaña Valoración ──────────────────────────────────────── */

.val-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.val-hero-panel {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.val-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.val-hero-heading h2 {
  margin: 4px 0 2px;
  font-size: 20px;
  color: var(--ink-2);
}

.val-hero-heading .section-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.val-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.val-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted-strong);
}

.val-badge-label {
  color: var(--muted-2);
  font-size: 11px;
}

.val-badge-item strong {
  color: var(--ink);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.val-summary-block {
  padding: 14px 0 4px;
}

.val-chart-block {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px 12px;
}

.val-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.val-chart-head-left h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
}

.val-chart-head-left .metrics-chart-hint {
  display: block;
  margin-top: 2px;
}

.val-chart-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.val-chart-metrics {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.val-chart-metrics button {
  min-height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.val-chart-metrics button.active {
  background: var(--accent);
  color: #fff;
}

.val-chart-metrics button:not(.active):hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.val-chart-ranges {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.val-chart-ranges button {
  min-width: 30px;
  min-height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.val-chart-ranges button.active {
  background: #333;
  color: #fff;
}

.val-chart-ranges button:not(.active):hover {
  background: #e9e9e9;
  color: var(--ink-3);
}

.val-chart-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft2);
  border-radius: 6px;
}

.val-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

.val-stat-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.val-stat-pill strong {
  color: var(--ink);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.val-chart-body {
  position: relative;
  min-height: 380px;
  background: var(--surface);
  border-radius: 4px;
}

#val-chart {
  display: block;
  width: 100%;
  height: 380px;
}

.val-bar-rect {
  transition: opacity 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.val-bar-group:hover .val-bar-rect {
  opacity: 1;
  filter: brightness(1.1);
}

.val-adjust-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 3px 8px;
  background: var(--surface-3);
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.val-adjust-checkbox-label:hover {
  background: var(--line-soft2);
  border-color: var(--muted-2);
}

.val-adjust-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 13px;
  height: 13px;
  margin: 0;
}

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

.val-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.val-card:hover {
  border-color: var(--line-mid);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.val-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.val-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.val-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.val-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-faint);
  border: 1px solid var(--accent-soft);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.val-tag-dashed {
  background: var(--surface-2);
  border: 1px dashed var(--line-mid);
  color: var(--muted);
}

.val-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.val-metric-display {
  margin-bottom: 10px;
}

.val-main-val {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
  display: inline-block;
}

.val-placeholder-empty {
  color: var(--muted-2);
  font-size: 26px;
}

.val-breakdown-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 9px;
  background: var(--surface-2);
  border: 1px solid #edf2f7;
  border-radius: 5px;
  margin-bottom: 10px;
}

.val-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.val-pill-label {
  color: var(--muted);
}

.val-pill-val {
  color: var(--ink-2);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.val-card-desc {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.val-card-placeholder {
  background: var(--surface-2);
  border: 1.5px dashed var(--line-mid);
}

.val-card-placeholder:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.val-placeholder-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  background: var(--surface);
  border: 1px dashed var(--line-mid);
  border-radius: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  margin-bottom: 10px;
}

.val-placeholder-box svg {
  color: var(--accent);
  flex-shrink: 0;
}

.val-breakdown-table-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.val-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.val-table-header h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.val-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.val-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line-soft2);
  color: var(--muted);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
}

.val-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--surface-3);
  color: var(--ink-3);
  vertical-align: middle;
}

.val-table .val-num {
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--ink);
  white-space: nowrap;
}

.val-table .val-row-highlight td {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}

.val-table .val-row-highlight .val-num {
  color: var(--accent-dark);
  font-size: 12.5px;
}

.val-col-calc {
  color: var(--muted);
  font-size: 11.5px;
}

.val-detail-txt {
  color: var(--muted);
  font-size: 11px;
}

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

@media (max-width: 640px) {
  .val-grid {
    grid-template-columns: 1fr;
  }
  .val-hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Accionariado ────────────────────────────────────────────── */
.accionariado-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
}
.accionariado-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.accionariado-title-group h2 {
  margin: 4px 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.accionariado-notice {
  margin: 2px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft2);
  color: var(--muted-strong);
  font-size: 11.5px;
  line-height: 1.5;
}
.accionariado-notice em {
  font-style: italic;
}
.accionariado-notice strong {
  color: var(--ink);
}
.accionariado-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 2px;
}
.accionariado-kpi-card {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfbfc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.accionariado-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.accionariado-kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  font-family: monospace;
}
.accionariado-kpi-sub {
  font-size: 11px;
  color: var(--muted);
}
.accionariado-tabs {
  margin-top: 6px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
}
.accionariado-table {
  width: 100%;
  border-collapse: collapse;
}
.accionariado-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.accionariado-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.accionariado-table tbody tr:hover {
  background: var(--surface-2);
}
.accionariado-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

/* ── Foro de Empresa ─────────────────────────────────────────── */
.forum-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 24px;
}

.forum-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.forum-title-group h2 {
  margin: 4px 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.forum-composer-wrap {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.forum-login-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 4px;
}

.forum-login-prompt-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}

.forum-login-prompt-copy svg {
  color: var(--accent);
  flex-shrink: 0;
}

.forum-login-prompt-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.forum-login-prompt-copy p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.forum-login-prompt-btn {
  min-height: 36px;
}

.forum-composer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.forum-avatar-mini {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.forum-textarea-wrap textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
  min-height: 70px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.forum-textarea-wrap textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .2);
}

.forum-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.forum-form-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  margin-right: auto;
}

.forum-submit-btn {
  min-width: 140px;
  min-height: 35px;
  font-size: 12px;
}

.forum-messages-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.forum-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.forum-empty strong {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}

.forum-empty p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.forum-messages-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-thread-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forum-thread-card:hover {
  border-color: #ccd0d5;
}

.forum-message-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.forum-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #2b2f36;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.forum-avatar.small {
  width: 26px;
  height: 26px;
  font-size: 10px;
  background: var(--muted-strong);
}

.forum-message-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.forum-author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-date {
  font-size: 11px;
  color: var(--muted);
}

.forum-delete-btn {
  margin-left: auto;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--soft-muted);
  cursor: pointer;
  transition: color .15s, background .15s;
}

.forum-delete-btn:hover {
  color: var(--red);
  background: var(--red-bg);
}

.forum-message-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: #24292f;
  word-break: break-word;
}

.forum-message-body p {
  margin: 0;
}

.forum-message-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.forum-reply-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.forum-reply-btn:hover {
  background: #f1f3f5;
  color: var(--accent-dark);
}

.forum-replies-badge {
  font-size: 11px;
  color: var(--soft-muted);
  font-weight: 600;
}

.forum-reply-form-wrap {
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.forum-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forum-reply-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.forum-reply-submit-btn {
  min-width: 100px;
  min-height: 30px;
  font-size: 11.5px;
  padding: 0 12px;
}

.forum-cancel-reply-btn {
  font-size: 11.5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.forum-cancel-reply-btn:hover {
  color: var(--ink);
}

.forum-replies-container {
  display: flex;
  flex-direction: column;
}

.forum-replies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--line-soft2);
}

.forum-reply-card {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forum-reply-card:hover {
  border-color: var(--line-mid);
}

/* ── Sección Novedades y Versiones ──────────────────────────── */
.novedades-page-section {
  padding-top: 14px;
}

.novedades-container {
  max-width: 980px;
  margin: 0;
}

.novedades-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.novedades-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.novedades-count {
  font-size: 13px;
  color: var(--muted);
}

.novedades-count strong {
  color: var(--ink);
  font-weight: 700;
}

.novedades-view-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.novedades-action-btn {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
}

.novedades-action-btn:hover {
  text-decoration: underline;
}

.novedades-dot {
  color: var(--line-mid);
  font-size: 12px;
}

.novedades-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.novedades-search-box svg {
  color: var(--muted);
  flex-shrink: 0;
}

.novedades-search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  width: 220px;
  color: var(--ink);
}

.novedades-search-box input::placeholder {
  color: var(--soft-muted);
}

.novedades-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.novedad-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.novedad-card:hover {
  border-color: var(--line-mid);
}

.novedad-card.is-open {
  border-color: #fbd38d;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.07);
}

.novedad-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--surface);
  transition: background-color 0.12s ease;
  outline: none;
}

.novedad-card-head:hover,
.novedad-card-head:focus-visible {
  background: var(--surface-2);
}

.novedad-card.is-open .novedad-card-head {
  border-bottom: 1px solid var(--surface-3);
}

.novedad-head-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.novedad-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.novedad-version-tag {
  display: inline-block;
  padding: 2px 7px;
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.novedad-status-badge.latest {
  display: inline-block;
  padding: 2px 8px;
  background: var(--green-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}

.novedad-date {
  font-size: 12px;
  color: var(--muted);
}

.novedad-title {
  margin: 2px 0 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.15s ease;
  line-height: 1.35;
}

.novedad-card-head:hover .novedad-title {
  color: var(--accent-dark);
}

.novedad-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 14px;
}

.novedad-toggle-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
}

.novedad-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.novedad-card.is-open .novedad-chevron {
  transform: rotate(180deg);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.novedad-card-body {
  padding: 16px 18px 20px 18px;
  background: var(--surface-2);
}

.novedad-body-content {
  display: flex;
  flex-direction: column;
}

.novedad-subheading {
  margin: 0 0 6px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.novedad-explicacion {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.novedad-cambios-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-soft2);
}

.novedad-cambios-title {
  margin: 0 0 8px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.novedad-cambios-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.novedad-cambio-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}

.novedad-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
}

.novedad-tag.tag-nuevo {
  background: var(--green-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.novedad-tag.tag-mejora {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}

.novedad-tag.tag-correccion {
  background: var(--amber-bg);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}

.novedad-subsectores-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-soft2);
}

.novedad-subsectores-intro {
  margin: 0 0 12px 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.novedad-subsectores-scroll {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.novedad-subsectores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.novedad-subsectores-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.novedad-subsectores-table thead th:last-child {
  width: 168px;
}

.novedad-subsector-sector th {
  position: sticky;
  top: 33px;
  z-index: 1;
  padding: 7px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.novedad-subsectores-table tbody tr:first-child th {
  border-top: 0;
}

.novedad-subsector-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.novedad-subsector-name {
  padding: 7px 14px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--surface-3);
}

.novedad-subsector-estado {
  padding: 7px 14px;
  border-bottom: 1px solid var(--surface-3);
  white-space: nowrap;
}

.novedad-estado-badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}

.novedad-estado-badge.estado-implementado {
  background: var(--green-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.novedad-estado-badge.estado-inicial {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}

.novedad-estado-badge.estado-pendiente {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.novedades-empty {
  padding: 36px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.novedades-empty svg {
  margin-bottom: 10px;
  color: var(--muted-2);
}

.novedades-empty p {
  margin: 0 0 14px 0;
  font-size: 13.5px;
}

@media (max-width: 640px) {
  .novedades-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .novedades-search-box {
    width: 100%;
  }
  .novedades-search-box input {
    width: 100%;
  }
  .novedad-toggle-hint {
    display: none;
  }
}
