﻿:root {
  --bg: #f4f7f2;
  --bg-panel: #ffffff;
  --ink: #1c2a1c;
  --muted: #576757;
  --accent: #1f6f4a;
  --accent-soft: #d7eadf;
  --danger: #b12a2a;
  --border: #dbe4dc;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #e8f3ea, var(--bg) 45%);
}

.layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  margin-top: 6px;
}

.panel {
  margin-top: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(10, 35, 12, 0.08);
}

.intro-panel h2,
.faq-panel h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.intro-points {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.intro-point {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdfb;
  padding: 10px;
}

.intro-point h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.intro-point p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdfb;
  padding: 8px 10px;
  margin-top: 8px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-item p {
  margin: 8px 0 2px;
  color: var(--muted);
  line-height: 1.45;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestion-field {
  position: relative;
}

.input-loading {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid #d2ddd3;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.suggestions-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(10, 35, 12, 0.12);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}

.suggestion-item {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eef3ee;
  color: var(--ink);
  border-radius: 0;
  padding: 12px;
  font-size: 0.96rem;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item:focus {
  background: #f4faf6;
  outline: none;
}

.suggestion-item.active {
  background: #e9f5ed;
}

label {
  font-weight: 600;
}

input,
select,
button {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

button:focus-visible,
.suggestion-item:focus-visible,
.legend-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

button {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.secondary-btn {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
}

.danger-btn {
  background: #a52323;
  border-color: #8f1e1e;
  color: #fff;
}

button:hover {
  filter: brightness(0.96);
}

button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

button.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid #d2ddd3;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: text-bottom;
}

.status {
  margin: 14px 0 4px;
  min-height: 24px;
  color: var(--muted);
}

.status-error {
  color: var(--danger);
  font-weight: 600;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-token-group {
  margin-bottom: 10px;
  max-width: 420px;
}

.section-subtitle {
  margin: 18px 0 4px;
  font-size: 1.04rem;
}

.rules-wrapper {
  margin-top: 10px;
  overflow-x: auto;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.rules-table th,
.rules-table td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  font-size: 0.94rem;
}

.rules-table input[type="number"] {
  width: 130px;
}

.runtime-stats-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 8px;
}

.runtime-stats-action {
  justify-content: flex-end;
}

.runtime-stats-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.runtime-stats-wrapper {
  margin-top: 10px;
}

.runtime-purge-wrapper {
  margin-top: 6px;
}

.totp-panel {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdfb;
  padding: 10px;
}

.totp-panel h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.totp-secret-box {
  margin: 8px 0 10px;
}

.totp-enroll-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  align-items: center;
}

.totp-enroll-grid img {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.runtime-purge-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffef8;
  padding: 10px;
}

.runtime-purge-card h4 {
  margin: 0 0 8px;
  font-size: 0.94rem;
}

.reset-options {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.reset-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.reset-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.runtime-stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.runtime-stat-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdfb;
  padding: 10px;
}

.runtime-stat-card h4 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.runtime-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  margin: 4px 0;
}

.runtime-stat-row strong {
  font-size: 1rem;
}

.runtime-stats-meta {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.history-wrapper {
  margin-top: 10px;
}

.history-filters {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-bottom: 10px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.history-table-enhanced {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(10, 35, 12, 0.06);
}

.history-table-enhanced thead th {
  background: linear-gradient(180deg, #edf6f0 0%, #e5f1e8 100%);
  border-bottom: 1px solid #d4e3d8;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #375441;
}

.history-table th,
.history-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  font-size: 0.9rem;
}

.history-table .history-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.history-table .history-row:nth-child(4n + 1),
.history-table .history-row:nth-child(4n + 2) {
  background: #fcfefc;
}

.history-table .history-row:hover {
  background: #eff8f2;
}

.history-table .history-row:focus-within,
.history-table .history-row:focus {
  background: #eef8f1;
}

.history-table .details-row td {
  background: #fbfdfb;
  border-top: 0;
  padding: 10px;
}

.history-col-record {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #4b5f4d;
}

.history-col-location strong {
  color: #1f3726;
}

.history-col-target {
  white-space: nowrap;
}

.history-col-count {
  width: 90px;
  text-align: right;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #c8dccd;
  background: #eef7f1;
  color: #2a593f;
  font-size: 0.78rem;
  font-weight: 700;
}

.details-panel {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.details-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.details-card-enhanced {
  border-radius: 12px;
  border-color: #d6e4db;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfa 100%);
  box-shadow: 0 4px 12px rgba(10, 35, 12, 0.06);
}

.details-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.details-card h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.details-card-head h4 {
  margin: 0;
  font-size: 0.92rem;
}

.details-score {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.details-card p {
  margin: 0 0 4px;
  font-size: 0.88rem;
}

.details-card ul {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(10, 35, 12, 0.06);
}

.audit-table th,
.audit-table td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  font-size: 0.85rem;
  vertical-align: top;
}

.audit-table thead th {
  background: linear-gradient(180deg, #edf6f0 0%, #e5f1e8 100%);
  border-bottom: 1px solid #d4e3d8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #375441;
}

.audit-level-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.audit-level-badge.level-info,
.audit-level-badge.level-notice,
.audit-level-badge.level-debug {
  background: #edf8f1;
  border-color: #c8dccd;
  color: #2a593f;
}

.audit-level-badge.level-warning {
  background: #fff8e7;
  border-color: #e6d7a7;
  color: #7a5a16;
}

.audit-level-badge.level-error,
.audit-level-badge.level-critical,
.audit-level-badge.level-alert,
.audit-level-badge.level-emergency {
  background: #fff0f0;
  border-color: #e2b8b8;
  color: #8f1e1e;
}

.audit-context {
  margin: 0;
  padding: 10px;
  border: 1px solid #d6e4db;
  border-radius: 8px;
  background: #f9fcfa;
  color: #244333;
  font-size: 0.78rem;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-details td {
  background: #fbfdfb;
  border-top: 0;
}

.history-pagination {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.cards-enter .card-enter {
  opacity: 0;
  transform: translateY(8px);
  animation: cardIn 0.38s ease forwards;
  animation-delay: calc(var(--i) * 70ms);
}

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

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.day-badge {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.weather-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #3b6e56;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.weather-sun {
  stroke: #c47f12;
}

.weather-rain {
  stroke: #2f6ca8;
}

.weather-wind {
  stroke: #4d6f80;
}

.weather-humidity {
  stroke: #2e7f7f;
}

.weather-cloud,
.weather-mixed {
  stroke: #5b6d5b;
}

.score,
.label {
  margin: 5px 0;
}

.summary-panel {
  margin: 8px 0 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.summary-pill,
.summary-bestday {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdfb;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.summary-label {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.summary-pill strong,
.summary-bestday strong {
  font-size: 1.1rem;
}

.bestday-label-chip {
  display: none;
}

.tone-good {
  border-color: #b9dfc6;
  background: #edf8f1;
}

.tone-mid {
  border-color: #e6d7a7;
  background: #fff8e7;
}

.tone-bad {
  border-color: #e2b8b8;
  background: #fff0f0;
}

.location-meta {
  margin: 6px 0;
  font-size: 0.95rem;
}

.location-meta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

.location-panel {
  margin: 8px 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdfb;
  padding: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.location-panel-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-mini-map iframe {
  width: 100%;
  height: 170px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.results-loading {
  display: grid;
  gap: 12px;
}

.icon-legend {
  margin: 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdfb;
  padding: 8px 10px;
}

.icon-legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.legend-toggle-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.86rem;
}

.icon-legend-body {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.icon-legend.is-collapsed .icon-legend-body {
  display: none;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.88rem;
}

.legend-item em {
  font-style: normal;
  color: var(--muted);
}

.skeleton-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, #edf3ee 0%, #f7faf8 50%, #edf3ee 100%);
  background-size: 220% 100%;
  animation: shimmer 1.1s ease infinite;
}

.skeleton-title {
  height: 26px;
  width: min(56%, 320px);
  grid-column: 1 / -1;
}

.skeleton-card {
  height: 140px;
}

.card ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .intro-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr 180px 160px;
    align-items: end;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .skeleton-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-panel {
    grid-template-columns: 180px 1fr;
  }

  .icon-legend-body {
    grid-template-columns: repeat(3, 1fr);
  }

  .location-panel {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }

  .location-mini-map iframe {
    height: 190px;
  }

  .history-filters {
    grid-template-columns: repeat(4, 1fr);
  }

  .details-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .runtime-stats-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }

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

  .totp-enroll-grid {
    grid-template-columns: 180px 1fr;
  }
}

@media (max-width: 767px) {
  .history-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .history-table {
    min-width: 620px;
  }

  .audit-table {
    min-width: 900px;
  }

  .history-table th,
  .history-table td {
    font-size: 0.83rem;
    padding: 8px 7px;
  }

  .history-col-count {
    width: 76px;
    text-align: center;
  }

  .history-chip {
    min-width: 54px;
    padding: 2px 8px;
    font-size: 0.74rem;
  }

  .details-panel {
    grid-template-columns: 1fr;
  }

  .details-card-enhanced {
    padding: 10px;
  }

  .details-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .details-score {
    font-size: 0.86rem;
  }

  .summary-bestday {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .summary-bestday .summary-label {
    font-size: 0.82rem;
  }

  .summary-bestday strong {
    display: block;
    width: 100%;
    font-size: 0.98rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .summary-bestday .bestday-sep,
  .summary-bestday .bestday-label-text {
    display: none;
  }

  .summary-bestday .bestday-label-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Accesibilidad
   ========================================================================== */

/* Clase para ocultar visualmente pero mantener accesible para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mejoras de foco para navegación por teclado */
.history-table .history-row:focus {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  background: var(--accent-soft);
}

.history-table .history-row:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  background: var(--accent-soft);
}

/* Indicador visual de fila expandida */
.history-table .history-row[aria-expanded="true"] {
  background: #eef8f1;
  font-weight: 500;
}

/* ==========================================================================
   Electricity Price Indicator
   ========================================================================== */
.electricity-price-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8e0;
  background: #fff;
  font-size: 0.88rem;
}

button.electricity-price-indicator {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

button.electricity-price-indicator:hover {
  filter: brightness(0.98);
}

button.electricity-price-indicator:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.electricity-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: currentColor;
}

.price-low {
  border-color: #4caf50;
  background-color: #e8f5e9;
  color: #2e7d32;
}

.price-low .electricity-icon {
  stroke: #2e7d32;
}

.price-medium {
  border-color: #ff9800;
  background-color: #fff3e0;
  color: #ef6c00;
}

.price-medium .electricity-icon {
  stroke: #ef6c00;
}

.price-high {
  border-color: #f44336;
  background-color: #ffebee;
  color: #c62828;
}

.price-high .electricity-icon {
  stroke: #c62828;
}

.price-very-high {
  border-color: #9c27b0;
  background-color: #f3e5f5;
  color: #6a1b9a;
}

.price-very-high .electricity-icon {
  stroke: #6a1b9a;
}

.history-table .history-row[aria-expanded="true"]::after {
  content: " ▼";
  font-size: 0.75em;
  color: var(--accent);
}

.history-table .history-row[aria-expanded="false"]::after {
  content: " ▶";
  font-size: 0.75em;
  color: var(--muted);
}

/* Foco en botones de paginación */
.history-pagination button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link para navegación rápida (opcional, para uso futuro) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

/* Mejora de contraste para estados de error */
.status-error {
  color: var(--danger);
  font-weight: 500;
}

/* Indicador de carga accesible */
.is-loading {
  position: relative;
  pointer-events: none;
}

.is-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Mejora de foco para inputs de sugerencias */
.suggestion-field input:focus + .suggestions-box:not([hidden]) {
  border-color: var(--accent);
}

/* Foco visible en tarjetas de resultados */
.card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Foco en elementos del modal de confirmación */
.confirm-modal:focus {
  outline: none;
}

.confirm-modal button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Modal PVPC */
.pvpc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 18, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1200;
}

.pvpc-modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 36px rgba(8, 22, 11, 0.22);
  padding: 14px;
}

.pvpc-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pvpc-modal-head h3 {
  margin: 0;
  font-size: 1.04rem;
}

.pvpc-modal-subtitle {
  margin: 6px 0 10px;
}

.pvpc-hourly-table {
  width: 100%;
  border-collapse: collapse;
}

.pvpc-hourly-table th,
.pvpc-hourly-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  font-size: 0.9rem;
}
