:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --color-yape: #7c3aed;
    --color-yape-light: #a78bfa;
    --color-plin: #0284c7;
    --color-plin-light: #38bdf8;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a 60%);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    padding: 1.5rem;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #7c3aed, #0284c7);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.navbar h1 {
    font-size: 1.35rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-yape { background: rgba(124, 58, 237, 0.25); color: var(--color-yape-light); border: 1px solid var(--color-yape); }
.badge-plin { background: rgba(2, 132, 199, 0.25); color: var(--color-plin-light); border: 1px solid var(--color-plin); }
.badge-today { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid #10b981; }
.badge-general { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid #f59e0b; }

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.metric-footer {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.25rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}

.filter-group {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.25rem;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: #334155;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary { background: linear-gradient(135deg, #7c3aed, #6366f1); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary { background: #334155; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: #475569; }

.btn-icon { padding: 0.6rem; border-radius: 10px; background: #334155; border: 1px solid var(--border-color); color: white; cursor: pointer; }

/* Table */
.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: rgba(15, 23, 42, 0.8);
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.loading-cell { text-align: center; color: var(--text-secondary); padding: 3rem !important; }
.monto-highlight { font-size: 1.05rem; font-weight: 700; color: #4ade80; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-control {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
