:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #10b981;
    --secondary-hover: #059669;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --border-color: rgba(148, 163, 184, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 2rem 0;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    z-index: -1;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
    z-index: 1;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.8s ease-out;
}

.dashboard-header .header-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.dual-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
}

#recaudacion-section {
    animation: slideLeft 0.6s ease-out;
}

#new-machine-section {
    animation: slideRight 0.6s ease-out;
}

.card-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-header h2 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.card-header h2 i {
    color: var(--primary);
    margin-right: 8px;
}

#new-machine-section .card-header h2 i {
    color: var(--secondary);
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 20px;
}

.location-tag {
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 6px;
    font-weight: 500;
    min-height: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.location-tag:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

label i {
    width: 18px;
    margin-right: 4px;
    color: var(--primary);
}

#new-machine-section label i {
    color: var(--secondary);
}

input,
select {
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#new-machine-section input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

input[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.75rem;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 35px;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: white;
    margin-top: auto;
}

.btn-primary {
    background: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

.loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.loading .loader {
    display: block;
}

.loading .btn-text,
.loading i {
    display: none;
}

.status-message {
    margin-top: 30px;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    display: none;
}

.status-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.btn-delete-small {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-delete-small:hover {
    color: var(--error);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 850px) {
    .dual-cards {
        grid-template-columns: 1fr;
    }
}

/* TOTAL COLLECTION CARD STYLES */
.total-collection-card {
    margin-bottom: 30px;
    padding: 24px 32px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    animation: slideDown 0.6s ease-out;
}

.total-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.total-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.total-info {
    flex-grow: 1;
}

.total-info h3 {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 600;
}

.total-amount-wrapper {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.currency-symbol {
    font-size: 1.8rem;
    margin-top: 8px;
    color: var(--secondary);
    opacity: 0.8;
}

.refresh-total-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-total-btn:hover {
    color: var(--primary);
    transform: rotate(180deg);
}

.total-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-style: italic;
    opacity: 0.7;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .total-content {
        flex-direction: column;
        text-align: center;
    }

    .total-amount-wrapper {
        justify-content: center;
    }
}