* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e0f2fe 0%, #e8f5e8 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* Indicador de conexión */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f59e0b;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background-color: #10b981;
}

.status-indicator.disconnected {
    background-color: #ef4444;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chargers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.charger-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e5e5e5;
    position: relative;
}

.charger-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.charger-card.updating {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

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

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
}

.status-price-container {
    text-align: right;
}

.card-price {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 6px;
}

.price-free { color: #3b82f6; } /* Azul */
.price-cost { color: #10b981; } /* Verde */


.status-available { background-color: #10b981; }
.status-busy { background-color: #ef4444; }
.status-maintenance { background-color: #6b7280; }
.status-app-restart { background-color: #f59e0b; }
.status-unavailable { background-color: #6b7280; }
.status-charging { background-color: #3b82f6; }
.status-faulted { background-color: #dc2626; }
.status-occupied { background-color: #f59e0b; }
.status-preparing { background-color: #8b5cf6; }
.status-reserved { background-color: #06b6d4; }
.status-finishing { background-color: #84cc16; }
.status-suspendedv { background-color: #f97316; }
.status-suspendedvse { background-color: #f97316; }
.status-statenotexist { background-color: #374151; }

.card-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #666;
    font-size: 0.9rem;
}

.icon {
    font-size: 1rem;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.stat-number.green { color: #10b981; }
.stat-number.blue { color: #3b82f6; }
.stat-number.purple { color: #8b5cf6; }

.stat-label {
    font-size: 0.8rem;
    color: #666;
}

.view-button {
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-button:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Estilos para la página de detalles */
.back-button {
    background: none;
    border: none;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 24px;
    transition: color 0.3s ease;
}

.back-button:hover {
    color: #3b82f6;
}

.charger-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.charger-header {
    margin-bottom: 40px;
}

.charger-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.charger-title h1 {
    font-size: 2rem;
    font-weight: bold;
}

.charger-title .icon {
    font-size: 1.5rem;
    color: #3b82f6;
}

.charger-info {
    display: flex;
    gap: 24px;
    color: #666;
    flex-wrap: wrap;
}

.mute-button {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #4b5563;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mute-button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.charger-visualization {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.visualization-container {
    display: flex;
    align-items: center;
    gap: 32px;
    width: 100%;
    max-width: 1000px;
}

.ports-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ports-column.left {
    align-items: flex-end;
}

.ports-column.right {
    align-items: flex-start;
}

.port-container {
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.port-container.updating {
    transform: scale(1.02);
}

/* TAMAÑO FIJO PARA LAS TARJETAS DE PUERTO */
.port-card {
    width: 280px;
    min-height: 180px;
    background: white;
    border: 2px solid;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.port-card.app-restart {
    border-color: #f59e0b;
    background-color: #fef3c7;
}

.port-card.available {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.port-card.unavailable {
    border-color: #6b7280;
    background-color: #f9fafb;
}

.port-card.charging {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.port-card.faulted {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.port-card.occupied {
    border-color: #f59e0b;
    background-color: #fef3c7;
}

.port-card.preparing {
    border-color: #8b5cf6;
    background-color: #f3e8ff;
}

.port-card.reserved {
    border-color: #06b6d4;
    background-color: #ecfeff;
}

.port-card.finishing {
    border-color: #84cc16;
    background-color: #f7fee7;
}

.port-card.suspendedv,
.port-card.suspendedvse {
    border-color: #f97316;
    background-color: #fff7ed;
}

.port-card.statenotexist {
    border-color: #374151;
    background-color: #f3f4f6;
}

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

.port-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.port-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.port-status.app-restart { background-color: #f59e0b; }
.port-status.available { background-color: #10b981; }
.port-status.unavailable { background-color: #6b7280; }
.port-status.charging { background-color: #3b82f6; }
.port-status.faulted { background-color: #dc2626; }
.port-status.occupied { background-color: #f59e0b; }
.port-status.preparing { background-color: #8b5cf6; }
.port-status.reserved { background-color: #06b6d4; }
.port-status.finishing { background-color: #84cc16; }
.port-status.suspendedv,
.port-status.suspendedvse { background-color: #f97316; }
.port-status.statenotexist { background-color: #374151; }

.port-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.port-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.port-detail.power {
    font-weight: 600;
    color: #3b82f6;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    width: 0%; /* El ancho por defecto es 0, se establece con JS */
    border-radius: 3px;
    transition: width 0.5s ease-in-out; /* Animación suave del cambio de ancho */
}

.connection-line {
    width: 64px;
    height: 4px;
    background-color: #d1d5db;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.connection-line.active {
    background: linear-gradient(90deg, #3b82f6, #10b981);
}

.connection-line.active::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: moveParticle 2s ease-in-out infinite;
}

.connection-line.left.active::after {
    animation: moveRight 2s ease-in-out infinite;
}

.connection-line.right.active::after {
    animation: moveLeft 2s ease-in-out infinite;
}

.charger-pole {
    width: 96px;
    background: linear-gradient(180deg, #374151, #1f2937);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 32px;
    flex-shrink: 0;
}

.pole-icon {
    width: 48px;
    height: 48px;
    background-color: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    margin-bottom: 16px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.pole-icon::before {
    content: '⚡';
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.pole-icon.offline {
    background-color: #6b7280;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.pole-icon.offline::before {
    color: #b0b0b0;
}

.pole-icon.pulsating {
    animation: pulse-blue 2s infinite;
}

.pole-power {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 48px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.port-status.charging,
.port-status.preparing,
.port-status.finishing,
.port-status.reserved {
    animation: pulse 2s infinite;
}

@keyframes moveRight {
    from { transform: translateX(-8px) translateY(-50%); } /* Empieza fuera, a la izquierda */
    to   { transform: translateX(64px) translateY(-50%); }  /* Termina fuera, a la derecha (ancho de la línea: 64px) */
}

@keyframes moveLeft {
    from { transform: translateX(64px) translateY(-50%); }  /* Empieza fuera, a la derecha */
    to   { transform: translateX(-8px) translateY(-50%); } /* Termina fuera, a la izquierda */
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Estilos para admin */
.admin-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 20px;
    margin: -20px -20px 40px -20px;
    border-radius: 0 0 12px 12px;
}

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

.admin-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-label {
    font-weight: 600;
    color: #374151;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.login-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-button:hover {
    background: #2563eb;
}

.login-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.error-message {
    color: #dc2626;
    font-size: 0.9rem;
    text-align: center;
    padding: 12px;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: #166534;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    margin-bottom: 20px;
    display: none;
}

.logout-button {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-button:hover {
    background: #dc2626;
}

.admin-controls {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.control-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.start-button {
    background: #10b981;
    color: white;
}

.start-button:hover {
    background: #059669;
}

.start-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.stop-button {
    background: #ef4444;
    color: white;
}

.stop-button:hover {
    background: #dc2626;
}

.stop-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.port-card.admin {
    position: relative;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.mini-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e3e3e3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Estilos para usuarios de Telegram */
.user-header {
    background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
    color: white;
    padding: 20px;
    margin: -20px -20px 40px -20px;
    border-radius: 0 0 12px 12px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-info h2 {
    margin: 0;
    font-size: 1.5rem;
}

.user-info p {
    margin: 4px 0 0 0;
    opacity: 0.9;
}

.balance-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.balance-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: bold;
}

.balance-amount.updating {
    transition: color 0.3s ease-in-out;
}

.balance-amount.positive {
    color: #10b981;
}

.balance-amount.negative {
    color: #ef4444;
}
.balance-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.add-balance-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-balance-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.add-balance-button.pulsating {
    animation: pulse-add-balance 2s infinite;
    border-color: rgba(255, 255, 255, 0.7);
}

@keyframes pulse-add-balance {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}
.history-button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Estilos específicos para el indicador de conexión en páginas de usuario */
.user-header .connection-status {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    font-weight: 500;
}

.user-header .status-indicator {
    background-color: #f59e0b;
    animation: pulse 2s infinite;
}

.user-header .status-indicator.connected {
    background-color: #10b981;
}

.user-header .status-indicator.disconnected {
    background-color: #ef4444;
}

.user-header #status-text {
    color: #1f2937;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .chargers-grid {
        grid-template-columns: 1fr;
    }
    
    .visualization-container {
        flex-direction: column;
        gap: 24px;
    }
    
    .ports-column {
        width: 100%;
        align-items: center !important;
    }
    
    .port-container {
        justify-content: center;
    }
    
    .connection-line {
        display: none;
    }
    
    .charger-info {
        flex-direction: column;
        gap: 12px;
    }
    
    .port-card {
        width: 100%;
        max-width: 300px;
    }
}

/* Estilos para mensajes de página (ej. redirección de Stripe) */
#page-message.success-message {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
#page-message.error-message {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
#page-message.info-message {
    background: #e0f2fe;
    color: #0c4a6e;
    border: 1px solid #bae6fd;
}

/* --- Payment Modal Styles --- */
.modal-overlay {
    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: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 450px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
}

.modal-close-button {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.modal-body .form-group input[type="number"],
.modal-body .form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

.amount-helper {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
    min-height: 1.2em; /* Evita que el layout salte */
}

.payment-methods-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.payment-method-button {
    flex-grow: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.payment-method-button:hover {
    border-color: #9ca3af;
}

.payment-method-button.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
    color: #1e40af;
}

.submit-button {
    width: 100%;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 16px;
}

.submit-button:hover {
    background: #059669;
}

.submit-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.payment-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
    text-align: center;
}

.payment-message.success {
    background: #dcfce7;
    color: #166534;
}

.payment-message.error {
    background: #fee2e2;
    color: #991b1b;
}

.payment-message.info {
    background: #e0f2fe;
    color: #0c4a6e;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Toast Notification Styles --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
    overflow: hidden;
    min-width: 250px;
}

.toast-content {
    flex-grow: 1;
    line-height: 1.4;
}

.toast strong {
    font-weight: 600;
    font-size: 1.1em;
}

.toast small {
    opacity: 0.9;
    font-size: 0.9em;
    display: block;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    opacity: 0.7;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: -5px -5px 0 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.5);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    background-color: #10b981; /* green */
}

.toast-error {
    background-color: #ef4444; /* red */
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* --- History Modal Styles --- */
.transaction-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid #f3f4f6;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-reason {
    font-weight: 500;
    color: #1f2937;
}

.transaction-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.transaction-amount {
    font-weight: 600;
    font-size: 1.1rem;
    text-align: right;
    white-space: nowrap;
    padding-left: 16px;
}

.transaction-amount.positive {
    color: #16a34a;
}

.transaction-amount.negative {
    color: #dc2626;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.pagination-button {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
}

/* --- Footer Styles --- */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #6b7280;
    font-size: 0.85rem;
    border-top: 1px solid #e5e7eb;
}

/* --- Session Timer Styles --- */
.session-timer {
    margin-left: auto; /* Pushes it to the right */
    text-align: right;
    color: white;
    padding-right: 16px;
}

#clock {
    font-size: 1.2rem;
    font-weight: 500;
}

#session-countdown {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Update Overlay Styles */
.update-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 50, 150, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    color: white;
    text-align: center;
}

.update-overlay.visible {
    opacity: 1;
}

.update-overlay h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.update-overlay p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.countdown-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.countdown-number {
    font-size: 80px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: bold;
}

.countdown-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    transform: rotate(-90deg); /* Start from the top */
}

.countdown-circle-progress {
    fill: none;
    stroke: white;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

