body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
}

header {
    background-color: #0077cc;
    color: white;
    padding: 1rem;
    text-align: center;
}

nav {
    background-color: #005fa3;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.75rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffdd57;
}

.main-content {
    padding: 2rem;
    text-align: center;
}

.main-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.grid-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.option-tile {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.option-tile:hover {
    transform: scale(1.05);
    background-color: #e6f2ff;
}

.recharge-options {
    display: none;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.recharge-options::-webkit-scrollbar {
    width: 8px;
}

.recharge-options::-webkit-scrollbar-thumb {
    background-color: #0077cc;
    border-radius: 8px;
}

.recharge-tile h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0077cc;
}

.recharge-tile p {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: #333;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    width: 70%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.modal-content input {
    width: 90%;
    padding: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.company-list {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.company-list::-webkit-scrollbar {
    display: none;                /* Chrome, Safari, Opera */
}

.company-item {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    background-color: #e6e6e6;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.company-item:hover,
.company-item.selected {
    background-color: #0077cc;
    color: white;
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.modal-buttons button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.confirm-btn {
    background-color: #0077cc;
    color: white;
}

.cancel-btn {
    background-color: #ccc;
}

.btn-retroceder {
  margin: 10px 0 -30px 0;      
  padding: 10px 24px;         
  background-color: #1976d2;  
  color: #fff;                
  border: none;               
  border-radius: 8px;         
  font-size: 1rem;            
  cursor: pointer;            
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s;
}

.btn-retroceder:hover {
  background-color: #125ea2;  
}

.inputs-modal-2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inputs-modal-2 label {
    white-space: nowrap;
    font-size: 14px;
}

.contenido-del-historial {
    display: none;
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: left;
}

.contenido-del-historial h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #0077cc;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-thumb {
    background-color: #0077cc;
    border-radius: 8px;
}

.history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    background: #fbfbfb;
    border: 1px solid #eee;
}

.history-entry .entry-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-entry .entry-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.entry-phone {
    font-weight: bold;
}

.entry-company, .entry-type, .entry-datetime {
    font-size: 0.9rem;
    color: #555;
}

.entry-price {
    font-weight: bold;
    color: #222;
}

.entry-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: white;
}

.entry-status.sent {
    background: #28a745; /* verde */
}

.entry-status.failed {
    background: #dc3545; /* rojo */
}


@media (max-width: 480px) {
    .history-entry { flex-direction: column; align-items: flex-start; gap: 6px; }
    .history-entry .entry-right { align-items: flex-start; }
}


.recargaModal-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, ease, visibility 0.3s ease;
}

.recargaModal-bg.activate {
    visibility: visible;
    opacity: 1;
}

.recargaModal-container {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    text-align: center;
    font-family: "Segoe UI", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.recargaModal-title {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: #222;
}

.recargaModal-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0.7rem 0;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
}

.recargaModal-option input[type="radio"] {
    accent-color: #0078ff;
    width: 18px;
    height: 18px;
}

.recargaModal-btn {
    background: #0078ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    margin-top: 1rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.recargaModal-btn:hover {
    background: #005fcc;
}

.add-button {
    background-color: #4CAF50;
    color: white;
}

.add-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
}


.loading-spinner{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;z-index:9999}
.loading-spinner.hidden{display:none}
.spinner{width:50px;height:50px;border:4px solid rgba(255,255,255,0.2);border-top-color:#ffcb05;border-radius:50%;animation:spin 0.8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Estilo para el texto informativo del código USSD */
#texto-informativo-de-codigo-ussd {
    background-color: #e6f2ff;
    color: #0077cc;
    border: 1px solid #0077cc;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
    font-size: 0.95rem;
}