/* calculator.css - Rediseño idéntico a la imagen */

/* Animación shake para campos inválidos */
@keyframes shakeField {
  0% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }

  100% {
    transform: translateX(0);
  }
}

/* Overrides para el contenedor principal de la calculadora */
#calculator-view.db-card:hover {
  transform: none;
  /* Evitar que salte */
  border-color: #6b7280;
  /* Gris oscuro para modo oscuro */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  /* Sin resplandor azul */
  background-color: var(--db-card-bg);
  /* Mantener fondo original */
}

body.light-theme #calculator-view.db-card:hover {
  border-color: #9ca3af;
  /* Gris claro para modo claro */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background-color: var(--db-card-bg);
}

.calc-redesign {
  background-color: #212130;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  margin: 0 auto;
}

body.light-theme .calc-redesign {
  background-color: #f1f5f9;
}

.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 8px;
  background-color: transparent;
}

body.light-theme .calc-header {
  background-color: transparent;
}

/* Simple title label */
.calc-title-label {
  display: block;
  text-align: center;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.light-theme .calc-title-label {
  color: #94a3b8;
  border-bottom-color: rgba(0, 0, 0, 0.07);
}

.calc-header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.btn-calc-logout {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.btn-calc-logout:hover {
  color: #f87171;
}

.calc-user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

/* Botón trigger del menú de usuario */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  transition: background 0.2s;
  color: inherit;
  font-family: inherit;
}

.user-menu-trigger:hover {
  background: transparent;
  opacity: 0.95;
}

body.light-theme .user-menu-trigger:hover {
  background: transparent;
}

.user-menu-chevron {
  color: var(--db-text-muted, #71717a);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Dropdown Menu */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #1e1e2d;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 9000;
  animation: fadeInDown 0.18s ease;
}

body.light-theme .user-dropdown {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

body.light-theme .user-dropdown-item {
  color: #374151;
}

body.light-theme .user-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}

.user-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 5px 4px;
}

body.light-theme .user-dropdown-divider {
  background: rgba(0, 0, 0, 0.07);
}

.user-dropdown-logout {
  color: #f87171 !important;
}

.user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.10) !important;
  color: #ef4444 !important;
}

/* ---- Modal Factor Dólar ---- */
.dolar-modal {
  max-width: 340px;
}

.dolar-modal-icon {
  font-size: 40px;
  margin-bottom: 6px;
}

.dolar-modal h4 {
  font-size: 20px;
}

.dolar-modal-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0 14px;
  margin-top: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dolar-modal-input-wrapper:focus-within {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

body.light-theme .dolar-modal-input-wrapper {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
}

.dolar-modal-prefix {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary, #6366f1);
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  margin-right: 10px;
  line-height: 50px;
}

body.light-theme .dolar-modal-prefix {
  border-right-color: rgba(0, 0, 0, 0.10);
}

.dolar-modal-input {
  flex: 1;
  background: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: inherit;
  font-size: 22px;
  font-weight: 700;
  font-family: monospace;
  padding: 12px 0;
  width: 100%;
  text-align: left;
}

.dolar-modal-input::placeholder {
  color: rgba(148, 163, 184, 0.4);
  font-size: 18px;
}

/* Ocultar flechas del input numérico en el modal */
.dolar-modal-input::-webkit-inner-spin-button,
.dolar-modal-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.dolar-modal-input { -moz-appearance: textfield; appearance: textfield; }

.calc-user-info .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  color: #0f172a;
}

.calc-user-info h2 {
  margin: 0;
  font-size: 15px;
  color: #ffffff;
  font-weight: 700;
}

body.light-theme .calc-user-info h2 {
  color: #0f172a;
}

/* Stats Bar */
.calc-stats-bar {
  display: flex;
  padding: 0 0 12px;
  align-items: center;
  justify-content: flex-start;
  border-bottom: none;
}

.calc-stats-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--db-text-muted, #94a3b8);
  font-weight: 500;
  background: transparent;
  padding: 0;
  border: none;
}

.calc-stats-inline .stat-num {
  font-weight: 700;
}

.calc-stats-inline .stat-label {
  color: var(--db-text-muted, #94a3b8);
}

.calc-stats-inline .stat-dot {
  margin: 0 4px;
  color: var(--db-text-muted, #475569);
  opacity: 0.8;
}

body.light-theme .calc-stats-bar {
  background-color: transparent;
  border-bottom-color: transparent;
}

body.light-theme .box-dollar input {
  color: #0f172a;
}

.money-icon {
  font-size: 16px;
}

.stat-num {
  font-size: 16px;
  /* Reduced from 20px */
  font-weight: 700;
}

.text-orange {
  color: #f59e0b;
}

.stat-label {
  color: #9ca3af;
  font-size: 12px;
  /* Reduced from 14px */
  font-weight: 600;
}

body.light-theme .stat-label {
  color: #475569;
}

/* Form Container */
.calc-form-container {
  padding: 5px;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.form-cols-2>div {
  flex: 1;
}

.form-cols-3>div {
  flex: 1;
}

.align-center {
  align-items: center;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
  font-weight: 700;
}

body.light-theme .form-group label {
  color: #475569;
}

.calc-form-container .form-group input,
.calc-form-container .form-group select {
  background-color: #1b1b20;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  width: 100%;
}

.calc-form-container .form-group input::placeholder {
  color: rgba(148, 163, 184, 0.45);
}

/* Hide number input spinners (arrows) */
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-group input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Also hide on dollar input */
.box-dollar input[type="number"]::-webkit-inner-spin-button,
.box-dollar input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.box-dollar input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Also hide on gasto inputs */
.gasto-input::-webkit-inner-spin-button,
.gasto-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.gasto-input {
  appearance: textfield;
  -moz-appearance: textfield;
}


body.light-theme .calc-form-container .form-group input,
body.light-theme .calc-form-container .form-group select {
  background-color: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

/* Forzar colores en los dropdowns de opciones en navegadores */
.calc-form-container .form-group select option {
  background-color: #1b1b20;
  color: #fff;
}

body.light-theme .calc-form-container .form-group select option {
  background-color: #fff;
  color: #0f172a;
}

.calc-form-container .form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 35px;
}

/* Toggles (iOS style) */
.toggle-group {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-size: 14px !important;
  color: #94a3b8 !important;
  text-transform: none !important;
  font-weight: 600 !important;
  margin: 0 !important;
}

.calc-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.switch-ios {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch-ios input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-ios.small {
  width: 40px;
  height: 22px;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: .3s;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

body.light-theme .slider {
  background-color: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.1);
}

.slider .icon-sun,
.slider .icon-moon {
  font-size: 11px;
  z-index: 1;
  opacity: 0.7;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: .3s;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.light-theme .slider:before {
  background-color: #fff;
  border-color: #cbd5e1;
}

.switch-ios.small .slider:before {
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
}

input:checked+.slider {
  background-color: #4f46e5;
}

body.light-theme input:checked+.slider {
  background-color: #4f46e5;
}

input:checked+.slider:before {
  transform: translateX(24px);
}

.switch-ios.small input:checked+.slider:before {
  transform: translateX(18px);
}

/* Section Divider */
.section-divider {
  margin: 10px 0 5px 0;
}

.section-title {
  color: #8b5cf6 !important;
  /* Purple color from image */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Gastos Aduaneros */
.superior-container,
.central-container,
.gastos-aduaneros-container {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px;
}

body.light-theme .superior-container,
body.light-theme .central-container,
body.light-theme .gastos-aduaneros-container {
  background-color: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.gastos-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .gastos-header {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.gastos-title {
  color: #8b5cf6;
  font-weight: 700;
  font-size: 13px;
}

.gastos-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: 0.3s opacity;
}

.gastos-body.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.gasto-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.btn-delete-gasto {
  background: none;
  border: none;
  color: #f87171;
  font-size: 15px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
  flex-shrink: 0;
}

.btn-delete-gasto:hover {
  opacity: 1;
  color: #ef4444;
}

/* Gastos Aduaneros Table Styles */
.gasto-tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gasto-tr:nth-child(odd) {
  background-color: transparent;
}

.gasto-tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

.gasto-td-border {
  border-color: rgba(255, 255, 255, 0.1);
}

body.light-theme .gasto-tr {
  border-bottom: 1px solid #e5e7eb;
  /* Gris claro */
}

body.light-theme .gasto-tr:nth-child(odd) {
  background-color: #ffffff;
  /* Celdas Excel blanco */
}

body.light-theme .gasto-tr:nth-child(even) {
  background-color: #f9fafb;
  /* Celdas Excel gris muy claro */
}

body.light-theme .gasto-td-border {
  border-color: #e5e7eb;
}

.gasto-name,
.gasto-name-input {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  outline: none;
  width: 120px;
}

/* Focus styles for all calculator inputs and Gastos (Significant border/glow) */
.gasto-name-input:focus,
.gasto-input:focus,
.form-group input:focus,
.form-group select:focus,
#edt_dolar:focus {
  outline: none !important;
  background-color: #1b1b20 !important;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35) !important;
  border-radius: 4px;
}

body.light-theme .gasto-name-input:focus,
body.light-theme .gasto-input:focus,
body.light-theme .form-group input:focus,
body.light-theme .form-group select:focus,
body.light-theme #edt_dolar:focus {
  background-color: #eff6ff !important;
  box-shadow: inset 0 0 0 2px #2563eb !important;
}

/* Encabezado de tabla de gastos (Gris temático) */
.gasto-th {
  background-color: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

body.light-theme .gasto-th {
  background-color: #f3f4f6;
  color: #4b5563;
}


body.light-theme .gasto-name,
body.light-theme .gasto-name-input {
  color: #0f172a;
}

.gasto-amount-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-weight: 600;
  font-family: monospace;
  font-size: 14px;
}

body.light-theme .gasto-amount-wrapper {
  color: #0f172a;
}

.gasto-input {
  background: transparent;
  border: none;
  color: #fff;
  text-align: right;
  width: 70px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

body.light-theme .gasto-input {
  color: #0f172a;
}


.gastos-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .gastos-footer {
  border-top-color: rgba(0, 0, 0, 0.05);
}

.total-label {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

body.light-theme .total-label {
  color: #0f172a;
}

.total-value {
  color: #fff;
  font-weight: 800;
  font-family: monospace;
  font-size: 15px;
}

body.light-theme .total-value {
  color: #0f172a;
}

/* Actions Row */
.calc-action-buttons {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 15px;
}

.btn-calc-action,
.btn-calc-action-footer {
  flex: 1;
  background: #333345;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-calc-action:hover,
.btn-calc-action-footer:hover {
  background: #3f3f5a;
}

body.light-theme .btn-calc-action,
body.light-theme .btn-calc-action-footer {
  background: #fff;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .btn-calc-action:hover,
body.light-theme .btn-calc-action-footer:hover {
  background: #f1f5f9;
}

.btn-actions-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}

.btn-calc,
.btn-new {
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-calc {
  background-color: #333345;
  color: #fff;
  padding: 15px 40px;
}

.btn-new {
  background-color: #333345;
  color: #fff;
  padding: 15px 20px;
}

.btn-calc:hover,
.btn-new:hover {
  background-color: #3f3f5a;
}

body.light-theme .btn-calc,
body.light-theme .btn-new {
  background-color: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

body.light-theme .btn-calc:hover,
body.light-theme .btn-new:hover {
  background-color: #f1f5f9;
}

/* Results Table */
.results-panel {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin-top: 10px;
  overflow: hidden;
}

body.light-theme .results-panel {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.05);
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.calc-table th {
  text-align: left;
  padding: 4px 4px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.calc-table th:last-child {
  text-align: right;
}

body.light-theme .calc-table th {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

.calc-table td {
  padding: 4px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .calc-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.calc-table .lempiras,
.calc-table .dolares {
  text-align: right;
  font-family: monospace;
  font-size: 14px;
}

.calc-table .detalle-dolares,
.calc-table .derechos-aduaneros,
.calc-table .gastos-aduaneros {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--primary);
  padding-top: 8px;
}

body.light-theme .calc-table .detalle-dolares,
body.light-theme .calc-table .derechos-aduaneros,
body.light-theme .calc-table .gastos-aduaneros {
  background: rgba(0, 0, 0, 0.02);
}

.calc-table .highlight-row td {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

body.light-theme .calc-table .highlight-row td {
  background: rgba(0, 0, 0, 0.02);
  border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .calc-table .final-row td {
  padding-top: 16px;
  padding-bottom: 16px;
  border-top: 2px solid var(--primary);
  border-bottom: none;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }
}

/* Modal styles for CAFTA and Alertas */
.calc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.calc-overlay.hidden {
  display: none;
}

.calc-modal {
  background: #1e1e2d;
  padding: 25px;
  border-radius: 16px;
  text-align: center;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.modal-btn-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.modal-btn-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.light-theme .modal-btn-close {
  color: #64748b;
}

body.light-theme .modal-btn-close:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.08);
}

body.light-theme .calc-modal {
  background: #fff;
  color: #0f172a;
}

.calc-modal h4 {
  margin-top: 0;
  font-size: 18px;
  color: #fff;
}

body.light-theme .calc-modal h4 {
  color: #0f172a;
}

.calc-modal p {
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 20px;
}

.modal-btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Logout Button */
.logout-top-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.logout-top-btn:hover {
  background: rgba(255, 0, 0, 0.3);
}

body.light-theme .logout-top-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   ESTILOS DE ADICIONALES (EXPANSIÓN)
   ============================================================ */
.calc-flex-wrapper {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  transition: all 0.3s ease;
}

#calculator-view.show-adicionales {
  max-width: 900px !important;
}

body.dashboard-mode #calculator-view.show-adicionales {
  max-width: none !important;
}

#adicionales-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
  animation: fadeIn 0.3s ease-in-out;
}

#adicionales-section.hidden {
  display: none !important;
}

.adicionales-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 15px;
}

body.light-theme .adicionales-card {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.05);
}

.adicionales-header {
  font-size: 14px;
  font-weight: 700;
  color: #a855f7;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* Badges de enlace RTN */
.badge-pay-yes,
.badge-pay-no {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-pay-yes {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-pay-no {
  background: rgba(239, 68, 68, 0.13);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Botón rojo: RTN encontrado en ip.gob.hn pero NO registrado en SARAH */
.badge-btn-enlazar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  background: #ef4444;
  color: #fff;
  border: 1px solid #dc2626;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.35);
  transition: background 0.2s, box-shadow 0.2s;
}

.badge-btn-enlazar:hover {
  background: #dc2626;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.55);
}

body.light-theme .badge-btn-enlazar {
  background: #dc2626;
  border-color: #b91c1c;
}

body.light-theme .badge-pay-yes {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

body.light-theme .badge-pay-no {
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
}


.form-group.mb-2 {
  margin-bottom: 8px;
}

.adicionales-card label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 4px;
  font-weight: 600;
}

body.light-theme .adicionales-card label {
  color: #64748b;
}

.adicionales-card .form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}

.calc-input-icon-wrapper {
  position: relative;
}

.adicionales-card .form-control.calc-input-with-icons {
  padding-right: 38px;
}

.calc-input-icon {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a855f7;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transform: translateY(-50%);
}

.calc-input-icon-right {
  right: 12px;
}

body.light-theme .adicionales-card .form-control {
  background: #fff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body:not(.light-theme) #calculator-view input,
body:not(.light-theme) #calculator-view select,
body:not(.light-theme) #calculator-view .form-control {
  background-color: #1b1b20 !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: #fff !important;
}

body:not(.light-theme) #calculator-view select option {
  background-color: #1b1b20;
  color: #fff;
}

body:not(.light-theme) #calculator-view input::placeholder {
  color: rgba(148, 163, 184, 0.45);
}

.adicionales-card .form-control:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.adicionales-toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.adicionales-label {
  font-size: 13px;
  font-weight: 600;
  color: #a855f7;
}

@media (max-width: 768px) {
  .pc-only {
    display: none !important;
  }

  .calc-flex-wrapper {
    flex-direction: column;
  }
}

/* ============================================================
   ESTILOS DE IMPRESIÓN
   ============================================================ */

/* Dashboard chrome for calculator */
body.dashboard-mode #calculator-view {
  max-width: none !important;
  width: 100% !important;
  min-height: 100%;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

#calc-header-stats {
  min-width: auto;
}

#calc-header-stats .calc-stats-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 0;
  width: auto;
}

#calc-header-stats .stat-pill {
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 8px;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  flex: 0 0 auto;
  white-space: nowrap;
}

#calc-header-stats .box-dollar {
  position: relative;
  width: auto;
  min-width: 80px;
  padding: 0;
  background: transparent !important;
  border-color: transparent !important;
}

body.light-theme #calc-header-stats .stat-pill {
  background: transparent !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
}

#calc-header-stats .box-dollar input {
  width: 72px;
  height: 24px;
  padding-right: 22px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--db-text-main) !important;
  cursor: default;
  caret-color: transparent;
  user-select: none;
  font-size: 13px;
}

#calc-header-stats .box-dollar input:focus {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #ffffff !important;
  caret-color: #ffffff;
  cursor: text;
  user-select: text;
}

body.light-theme #calc-header-stats .box-dollar input:focus {
  background: transparent !important;
  color: #0f172a !important;
  caret-color: #0f172a;
}

#calc-header-stats .stat-pill:focus-within {
  border-color: rgba(99, 102, 241, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

#calc-header-stats .money-icon {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

#calc-dashboard-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  background-color: var(--db-sidebar-bg);
  border: 1px solid var(--db-sidebar-border);
  border-radius: 12px;
  flex-shrink: 0;
}

#calc-dashboard-footer.hidden {
  display: none !important;
}

#calc-footer-actions .btn-actions-row {
  margin: 0;
  width: 100%;
  align-items: center;
  justify-content: center;
}

#calc-footer-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

#calc-footer-actions .gastos-header {
  position: absolute;
  left: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 12px;
  background-color: #333345;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
}

#calc-footer-actions .gastos-title {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

#calc-footer-actions #add-gasto-btn {
  margin-left: 0 !important;
}

body.light-theme #calc-footer-actions .gastos-header {
  background-color: #fff;
  border-color: rgba(0, 0, 0, 0.10);
}

#calc-footer-actions .btn-calc,
#calc-footer-actions .btn-new {
  min-height: 32px;
  padding: 6px 18px;
  border-radius: 10px;
  font-size: 13px;
}

#calc-footer-actions .gastos-header,
#calc-footer-actions .adicionales-toggle-container {
  max-width: 260px;
}

#calc-footer-actions .adicionales-toggle-container {
  position: absolute;
  right: 0;
  margin-left: 0;
  min-width: 170px;
  justify-content: flex-end;
}

/* Pill del dólar en el footer - posicionada a la derecha */
#footer-dollar-pill {
  position: absolute;
  right: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 8px;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.light-theme #footer-dollar-pill {
  border-color: rgba(0, 0, 0, 0.10) !important;
}

#footer-dollar-pill .stat-box.box-dollar {
  position: relative;
  width: auto;
  min-width: 80px;
  padding: 0;
  background: transparent !important;
  border-color: transparent !important;
}

#footer-dollar-pill .box-dollar input {
  width: 72px;
  height: 24px;
  padding-right: 22px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--db-text-main) !important;
  font-size: 13px;
  font-weight: 600;
  cursor: text;
  caret-color: currentColor;
}

#footer-dollar-pill .money-icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
}

body.calculator-module-active #dashboard-content-scroll {
  padding-bottom: 16px;
}

@media (max-width: 980px) {
  /* Mantener alineación y tamaño natural en móviles */
  #calc-header-stats {
    order: unset;
    width: auto;
    min-width: auto;
  }

  #calc-header-stats .calc-stats-bar {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  #calc-footer-actions {
    justify-content: center;
  }

  #calc-footer-actions .gastos-header,
  #calc-footer-actions .adicionales-toggle-container {
    position: static;
    max-width: none;
  }

  #calc-footer-actions .btn-actions-row {
    width: auto;
  }

  /* Pill del dólar en footer: posición estática en mobile */
  #footer-dollar-pill {
    position: static;
    margin-left: auto;
  }
}

@media print {

  /* Ocultar elementos irrelevantes y fondos animados */
  .bg-animation,
  .theme-switch-container,
  .sidebar,
  #dashboard-grid-container,
  .calc-header,
  .calc-stats-bar,
  #calculos,
  .button-container,
  .calc-action-buttons,
  .toast-container,
  .logout-top-btn,
  .calc-overlay {
    display: none !important;
  }

  /* Ajustar el body y contenedores para que no impriman la tarjeta */
  body,
  html {
    background: white !important;
    color: black !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  main.glass-card,
  main.db-main {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: auto !important;
  }

  #calculator-view {
    display: block !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: black !important;
  }

  /* Ajustar los resultados para impresión */
  #results,
  .results-panel {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: black !important;
  }

  .calc-table {
    width: 100% !important;
  }

  .calc-table th,
  .calc-table td {
    color: black !important;
  }
}

/* ============================================================
   MODAL: SALDO AGOTADO / RECARGA TU CUENTA
   ============================================================ */
@keyframes recargaCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}
@keyframes recargaPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

.recarga-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 8, 20, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.recarga-modal-overlay.hidden { display: none; }

/* --- Tema oscuro (por defecto) --- */
.recarga-modal-card {
  position: relative;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  border: 1px solid rgba(99, 179, 237, 0.22);
  border-radius: 20px;
  padding: 40px 32px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  animation: recargaCardIn 0.35s cubic-bezier(.22,.68,0,1.2) both;
}

/* --- Tema claro --- */
body.light-theme .recarga-modal-card {
  background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 60%, #dbeafe 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 16px 48px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
}
body.light-theme .recarga-modal-overlay {
  background: rgba(15, 23, 42, 0.55);
}

/* --- Boton X esquina superior derecha --- */
.recarga-modal-close-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.recarga-modal-close-x:hover {
  background: rgba(255,255,255,0.18);
  color: #f1f5f9;
  transform: scale(1.12);
}
body.light-theme .recarga-modal-close-x {
  background: rgba(0,0,0,0.06);
  color: #64748b;
}
body.light-theme .recarga-modal-close-x:hover {
  background: rgba(0,0,0,0.14);
  color: #1e293b;
}

/* --- Icono --- */
.recarga-modal-icon {
  font-size: 52px;
  margin-bottom: 12px;
  animation: recargaPulse 1.8s ease-in-out infinite;
  line-height: 1;
}

/* --- Titulo --- */
.recarga-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}
body.light-theme .recarga-modal-title {
  color: #1e293b;
}

/* --- Descripcion --- */
.recarga-modal-desc {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0 0 24px;
}
body.light-theme .recarga-modal-desc {
  color: #475569;
}

/* --- Boton WhatsApp --- */
.recarga-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 18px rgba(37,211,102,0.35);
}
.recarga-whatsapp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.5);
  color: #fff;
  text-decoration: none;
}
.recarga-whatsapp-btn:active { transform: translateY(0); }

