/* Dashboard specific tweaks on top of lessenergy.css */
.dashboard-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-title-block h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--lessenergy-navy);
}

.dashboard-title-block p {
  margin: 0.15rem 0 0;
  color: #64748b;
  font-weight: 500;
}

.table-actions {
  display: grid;
  grid-template-columns: 1.1fr 1fr 180px;
  gap: 0.75rem;
  align-items: center;
  padding: 1.25rem 1.5rem 1rem;
  background: #fff;
  border-bottom: 2px solid #f1f5f9;
}

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

.analysis-overlay,
.modal-overlay-new {
  position: fixed;
  inset: 0;
  background: rgba(34, 48, 93, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.analysis-overlay.open,
.modal-overlay-new.open {
  display: flex;
}

.analysis-root .modal-container {
  background: white;
  border-radius: 16px;
  width: min(1600px, 95vw);
  max-width: 1600px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.analysis-root .modal-header {
  background: linear-gradient(135deg, var(--lessenergy-cyan) 0%, var(--lessenergy-navy) 100%);
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.analysis-root .modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
}

.analysis-root .modal-header .btn-close {
  flex-shrink: 0;
  opacity: 1;
}

.analysis-root .modal-body {
  padding: 2rem;
  max-height: 75vh;
  overflow-y: auto;
}

.analysis-root .selector-card {
  background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
  border: 2px solid #d1d5db;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.analysis-root .selector-card h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 1rem;
}

.analysis-root .selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.analysis-root .form-group {
  display: flex;
  flex-direction: column;
}

.analysis-root .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.analysis-root .card-unified-data {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.analysis-root .unified-data-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}

.analysis-root .unified-data-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.analysis-root .unified-data-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.analysis-root .unified-data-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--lessenergy-navy);
}

.analysis-root .unified-data-value.cups-value {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Courier New", monospace;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

.analysis-root .comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.analysis-root .column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analysis-root .card {
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid;
}

.analysis-root .card-gray {
  background: #f9fafb;
  border-color: #d1d5db;
}

.analysis-root .card-green {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

.analysis-root .card h4 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.analysis-root .card h5 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 0.75rem 0;
}

.analysis-root .card-gray h4 {
  color: var(--lessenergy-navy);
}

.analysis-root .card-green h4 {
  color: #166534;
}

.analysis-root dl {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}

.analysis-root .data-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  gap: 1rem;
}

.analysis-root .data-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.analysis-root dt {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.875rem;
}

.analysis-root dd {
  color: #111827;
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
  margin: 0;
  text-align: right;
}

.analysis-root table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.analysis-root thead tr {
  border-bottom: 2px solid #9ca3af;
}

.analysis-root .card-green thead tr {
  border-bottom-color: #4ade80;
}

.analysis-root th {
  text-align: left;
  padding: 0.5rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.analysis-root .card-gray th {
  color: var(--lessenergy-navy);
}

.analysis-root .card-green th {
  color: #166534;
}

.analysis-root th:last-child {
  text-align: right;
}

.analysis-root tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.analysis-root tbody tr:last-child {
  border-bottom: none;
}

.analysis-root td {
  padding: 0.625rem 0.5rem;
  color: #374151;
}

.analysis-root td:last-child {
  text-align: right;
  font-weight: 600;
}

.analysis-root .card-green td:last-child {
  color: #166534;
}

.analysis-root .total-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #9ca3af;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.analysis-root .card-green .total-section {
  border-top-color: #4ade80;
}

.analysis-root .total-amount {
  color: #6b7280;
  font-size: 0.875rem;
}

.analysis-root .total-value {
  font-size: 1.125rem;
  font-weight: 700;
}

.analysis-root .card-gray .total-value {
  color: var(--lessenergy-navy);
}

.analysis-root .card-green .total-value {
  color: #166534;
}

.analysis-root .summary-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  border-radius: 12px;
  padding: 1.5rem;
}

.analysis-root .summary-card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--lessenergy-navy);
  margin: 0 0 1rem 0;
}

.analysis-root .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.analysis-root .summary-item {
  display: flex;
  flex-direction: column;
}

.analysis-root .summary-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.analysis-root .summary-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--lessenergy-navy);
}

.analysis-root .summary-highlight {
  font-size: 1.5rem;
  font-weight: 700;
  color: #16a34a;
}

.analysis-root .summary-subtext {
  font-size: 0.875rem;
  font-weight: 600;
  color: #16a34a;
  margin-top: 0.25rem;
}

.analysis-root .summary-footer {
  padding-top: 1rem;
  border-top: 1px solid #93c5fd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.analysis-root .summary-footer strong {
  color: var(--lessenergy-navy);
}

.analysis-root .annual-savings {
  font-size: 1.25rem;
  font-weight: 700;
  color: #16a34a;
}

.cups-result-container {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.cups-result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cups-energia-section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.cups-energia-section:last-child {
  margin-bottom: 0;
}

.cups-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  font-weight: 700;
  color: var(--lessenergy-navy);
  cursor: pointer;
}

.cups-section-header svg {
  transition: transform 0.2s ease;
}

.cups-energia-section.collapsed .cups-section-header svg {
  transform: rotate(-90deg);
}

.cups-section-content {
  padding: 0.75rem 1rem 1rem;
}

.cups-energia-section.collapsed .cups-section-content {
  display: none;
}

.cups-data-table {
  margin: 0;
  font-size: 0.875rem;
}

.cups-data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.cups-data-table td {
  color: #0f172a;
}

.analysis-root .modal-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e5e7eb;
  display: flex;
  justify-content: center;
}

.analysis-root .btn-download-pdf {
  background: linear-gradient(135deg, var(--lessenergy-cyan) 0%, var(--lessenergy-blue) 100%);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(16, 160, 203, 0.3);
  cursor: pointer;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.analysis-root .btn-download-pdf:hover {
  background: linear-gradient(135deg, var(--lessenergy-blue) 0%, var(--lessenergy-navy) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 160, 203, 0.4);
  color: white;
}

.analysis-root .btn-download-pdf:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 160, 203, 0.25);
}

.analysis-root .btn-download-pdf svg {
  flex-shrink: 0;
}

.analysis-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #e0f2fe;
  color: #0f172a;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.analysis-empty {
  padding: 1rem;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  width: min(520px, 100%);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-card.modal-card-xl {
  width: min(1200px, 100%);
}

.comparison-step {
  display: none;
}

.comparison-step.is-active {
  display: block;
}

.comparison-method-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.comparison-method-card:hover {
  border-color: var(--lessenergy-cyan);
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(16, 160, 203, 0.2);
}

.method-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.method-icon-ai {
  background: linear-gradient(135deg, var(--lessenergy-cyan) 0%, var(--lessenergy-blue) 100%);
  color: white;
}

.method-icon-manual {
  background: linear-gradient(135deg, var(--lessenergy-navy) 0%, var(--lessenergy-dark-blue) 100%);
  color: white;
}

.method-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--lessenergy-navy);
  margin: 0;
}

.method-description {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.manual-cups-row {
  margin-bottom: 1.25rem;
}

.manual-header-field-cups {
  max-width: 100%;
}

.cups-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.cups-input-group .manual-input {
  flex: 1;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Courier New", monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-calcular {
  height: 46px;
  padding: 0 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  background: linear-gradient(135deg, var(--lessenergy-cyan) 0%, var(--lessenergy-light-blue) 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-calcular:disabled {
  opacity: 0.75;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.btn-calcular-loader {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  animation: btn-calcular-spin 0.8s linear infinite;
}

@keyframes btn-calcular-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-calcular:hover {
  background: linear-gradient(135deg, var(--lessenergy-light-blue) 0%, var(--lessenergy-blue) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 160, 203, 0.3);
}

.btn-calcular:active {
  transform: translateY(0);
}

.manual-header-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.manual-header-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 150px;
}

.manual-header-field-periodo {
  flex: 2;
  min-width: 300px;
}

.manual-header-field label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--lessenergy-navy);
}

.manual-input {
  height: 46px;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s;
  width: 100%;
}

.manual-input:focus {
  border-color: var(--lessenergy-cyan);
  box-shadow: 0 0 0 3px rgba(16, 160, 203, 0.1);
  outline: none;
}

select.manual-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.periodo-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.periodo-inputs .manual-input {
  flex: 1;
}

.periodo-separator {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.875rem;
}

.manual-data-table {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.manual-table-header {
  display: grid;
  grid-template-columns: 45px 1fr 80px 1fr 80px;
  background: linear-gradient(135deg, var(--lessenergy-navy) 0%, var(--lessenergy-dark-blue) 100%);
  color: white;
}

.manual-table-cell {
  padding: 0.625rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manual-table-cell-header {
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
}

.manual-table-cell-period {
  font-weight: 700;
  background: #f8fafc;
  color: var(--lessenergy-navy);
  border-right: 1px solid #e2e8f0;
}

.manual-table-row {
  display: grid;
  grid-template-columns: 45px 1fr 80px 1fr 80px;
  border-bottom: 1px solid #e2e8f0;
}

.manual-table-row:last-child {
  border-bottom: none;
}

.manual-table-row .manual-table-cell {
  padding: 0.375rem 0.375rem;
}

.manual-table-row .form-control {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.8125rem;
  text-align: right;
  padding: 0.375rem 0.5rem;
  height: 34px;
}

.manual-table-row .form-control:focus {
  background: white;
  border-color: var(--lessenergy-cyan);
  box-shadow: 0 0 0 2px rgba(16, 160, 203, 0.1);
}

.manual-table-row .form-control.input-precio {
  background: #fefce8;
  border-color: #fde68a;
}

.manual-table-row .form-control.input-precio:focus {
  border-color: var(--lessenergy-cyan);
  background: #fffbeb;
}

.manual-summary-row {
  background: linear-gradient(135deg, var(--lessenergy-cyan) 0%, var(--lessenergy-light-blue) 100%);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.manual-summary-row-secondary {
  background: linear-gradient(135deg, var(--lessenergy-navy) 0%, var(--lessenergy-dark-blue) 100%);
}

.manual-summary-row .form-control {
  max-width: 150px;
  text-align: right;
  font-weight: 600;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-unit {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 40px;
}

.input-unit-small {
  color: var(--lessenergy-cyan);
  font-weight: 600;
  font-size: 0.75rem;
  min-width: 32px;
}

.otros-conceptos-grid {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.otros-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  gap: 1rem;
}

.otros-row:last-child {
  border-bottom: none;
}

.otros-row label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--lessenergy-navy);
  margin: 0;
  white-space: nowrap;
}

.otros-row .form-control {
  max-width: 100px;
  text-align: right;
  font-size: 0.875rem;
}

.modal-actions-new {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  background: #f8fafc;
}

.process-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  padding: 1rem;
}

.process-overlay.open {
  display: flex;
}

.process-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.process-header {
  background: linear-gradient(135deg, var(--lessenergy-cyan), var(--lessenergy-navy));
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.process-header h5 {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
  flex: 1;
}

.process-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.process-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.process-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.process-step .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.process-step.pending .dot {
  background: #fbbf24;
  animation: pulse 1s ease-in-out infinite;
}

.process-step.success .dot {
  background: #22c55e;
}

.process-step.error .dot {
  background: #ef4444;
}

.process-step strong {
  color: #0f172a;
  font-size: 0.95rem;
}

.process-step span {
  color: #475569;
}

.process-error {
  display: none;
}

.process-error.show {
  display: block;
}

.process-footer {
  padding: 1rem 1.5rem 1.25rem;
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 1200px) {
  .analysis-root .comparison-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .analysis-root .modal-body {
    padding: 1rem;
  }

  .analysis-root .selector-card {
    padding: 1rem;
  }

  .analysis-root .selector-grid {
    grid-template-columns: 1fr;
  }

  .analysis-root .summary-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}
