:root { 
    --bg-dark: #0f0f0f; 
    --bg-card: #181818; 
    --text-primary: #ffffff; 
    --text-secondary: #b0b0b0; 
    --accent-purple: #820ad1; 
    --accent-purple-light: #a33df2;
    --accent-purple-dark: #4c0677;
    --accent-green: #2ecc71; 
    --accent-red: #ff4757; 
    --border-color: #2a2a2a; 
    --radius: 16px; 
}
/* Login Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.login-card h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--accent-purple-light);
}
.login-card .brand {
    justify-content: center;
    margin-bottom: 2rem;
}
.login-card .brand i { font-size: 2.5rem; }
.login-card .brand h1 { font-size: 2rem; }

.trial-blocker {
    text-align: center;
}
.trial-blocker i {
    font-size: 4rem;
    color: var(--accent-red);
    margin-bottom: 1.5rem;
}
.trial-blocker h2 {
    color: var(--accent-red);
    margin-bottom: 1rem;
}
.trial-blocker p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.login-options .checkbox-container { margin-bottom: 0; }
.login-options .checkbox-container span { font-size: 0.85rem; }
.link-secondary {
    font-size: 0.85rem;
    color: var(--accent-purple-light);
    text-decoration: none;
}
.link-secondary:hover { text-decoration: underline; }
.login-msg { margin-top: 10px; text-align: center; font-size: 0.8rem; }
.login-switch {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.login-switch a {
    color: var(--accent-purple-light);
    text-decoration: none;
}
.login-switch a:hover { text-decoration: underline; }
.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}
.login-modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    max-width: 380px;
    width: 90%;
}
.login-modal h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-purple-light);
    font-size: 1.1rem;
}
.login-modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.btn-block { width: 100%; margin-top: 10px; }

.countdown-container {
    padding: 8px 15px;
    background: rgba(130, 10, 209, 0.1);
    border: 1px solid rgba(130, 10, 209, 0.2);
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--accent-purple-light);
}
.countdown-container i {
    font-size: 0.9rem;
}
.countdown-value {
    font-weight: 700;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; overflow: hidden; }
body { background-color: var(--bg-dark); color: var(--text-primary); font-family: 'Inter', sans-serif; height: 100%; min-height: 100vh; overflow: hidden; overflow-x: hidden; }
body.login-page { min-height: 100vh; overflow: auto; }
.app-container { display: flex; flex-direction: column; height: 100vh; max-height: 100vh; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; color: var(--accent-purple-light); }
.brand i { font-size: 1.5rem; }
.brand h1 { font-size: 1.2rem; font-weight: 700; color: white; }

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 10px 20px;
    padding-inline-end: 4px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.app-logo { height: 36px; width: auto; object-fit: contain; }
.app-logo.hidden { display: none !important; }
.brand-header { margin-bottom: 0; }
.brand-header h1 { font-size: 1.1rem; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.countdown-header { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--accent-purple-light); padding: 6px 12px; background: rgba(130, 10, 209, 0.1); border-radius: 8px; flex-shrink: 0; }
.header-user { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.header-user-label { font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; }
.header-profile-badge { font-size: 0.7rem; padding: 4px 8px; border-radius: 20px; background: rgba(130, 10, 209, 0.2); color: var(--accent-purple-light); white-space: nowrap; flex-shrink: 0; }
.header-logout-wrap {
    display: inline-block;
    padding-right: 10px;
}
.btn-logout {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 0.8rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-logout i { font-size: 0.85em; }

.main-and-sidebar { display: flex; flex: 1; min-height: 0; overflow: hidden; box-sizing: border-box; }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0.5rem; }
.nav-btn { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: transparent; border: 1px solid transparent; border-radius: 12px; color: var(--text-secondary); cursor: pointer; text-align: left; transition: all 0.3s; font-family: inherit; font-size: 0.9rem; }
.nav-btn:hover { background: rgba(130, 10, 209, 0.1); color: var(--accent-purple-light); }
.nav-btn.active { background: var(--accent-purple); color: white; border-color: var(--accent-purple-light); }

.sidebar-nav-secondary {
    margin-top: auto;
    margin-bottom: -1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 1rem 1.5rem 1.5rem calc(1.5rem + 14px);
    border-left: 2px solid var(--border-color);
    background-color: #0a0a0a;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-btn-secondary {
    padding: 6px 10px;
    font-size: 0.78rem;
    gap: 8px;
}
.nav-btn-secondary i { font-size: 0.75rem; }
.view-container { display: flex; flex-direction: column; gap: 1.5rem; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.hidden { display: none !important; }

.app-footer {
    flex-shrink: 0;
    padding: 12px 20px 12px 20px;
    padding-inline-end: 4px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.footer-logo-link { display: inline-block; }
.footer-logo { height: 28px; width: auto; }
.footer-copyright { font-size: 0.75rem; color: var(--text-secondary); }

.storage-progress-wrap { margin-top: 8px; }
.storage-progress-bar { height: 12px; background: var(--bg-dark); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); }
.storage-progress-fill { height: 100%; border-radius: 6px; transition: width 0.3s; }
.storage-progress-text { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

.config-page { width: 100%; max-width: none; }
.config-page-card { width: 100%; max-width: none; }
.config-page-card h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2rem;
    align-items: start;
}
@media (max-width: 900px) {
    .config-grid { grid-template-columns: 1fr; }
    .config-group-span { grid-column: 1 !important; }
}
.config-group-cell { min-width: 0; }
.config-group-span { grid-column: 1 / -1; }
.config-serial-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.config-serial-row input { flex: 1; min-width: 260px; }
.config-serial-row .btn-apply-serial { width: auto; flex-shrink: 0; padding: 6px 12px; font-size: 0.75rem; }
.config-logo-row { margin-top: 6px; }
.config-logo-row input { max-width: 100%; }
.data-actions-inline { display: flex; flex-wrap: wrap; gap: 8px; }

.profile-page { display: flex; flex-direction: column; gap: 1rem; }
.profile-current { margin-bottom: 1rem; }
.profile-info-block p { margin-bottom: 6px; font-size: 0.9rem; }
.profile-users-card h2 { margin-bottom: 1rem; font-size: 1.2rem; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.modal-content { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border-color); max-width: 500px; width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.help-modal { max-width: 560px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { font-size: 1.1rem; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--accent-red); }
.modal-body { padding: 1.25rem; overflow-y: auto; }
.modal-body h3 { font-size: 0.95rem; color: var(--accent-purple-light); margin: 1rem 0 0.4rem 0; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 0.5rem; }

.actions-cell { white-space: nowrap; }
.action-btn { background: none; border: none; cursor: pointer; padding: 4px 6px; color: var(--text-secondary); }
.action-btn:hover { color: var(--accent-purple-light); }
.action-btn.edit-btn { color: var(--accent-purple-light); }

/* Alert Banner Styles */
.alert-banner { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0.5rem; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 12px; font-size: 0.85rem; font-weight: 500; animation: slideIn 0.3s ease-out; }
.alert-item i { font-size: 1.1rem; }
.alert-item.overdue { background: rgba(255, 71, 87, 0.15); color: #ff4757; border: 1px solid rgba(255, 71, 87, 0.3); }
.alert-item.upcoming { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.alert-item .btn-pay-mini { margin-left: auto; background: var(--accent-purple); color: white; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 0.75rem; font-weight: 600; }

@keyframes slideIn { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Scheduled Styles */
.status-badge { padding: 4px 8px; border-radius: 20px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }
.status-pending { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-paid { background: rgba(46, 204, 113, 0.1); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.2); }
.status-overdue { background: rgba(255, 71, 87, 0.1); color: #ff4757; border: 1px solid rgba(255, 71, 87, 0.2); }
.btn-pay { background: var(--accent-purple); color: white; border: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 0.7rem; transition: background 0.3s; }
.btn-pay:hover { background: var(--accent-purple-light); }

/* Inline Form Styles */
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }
.inline-form .btn { width: auto; padding: 10px 20px; }

/* EULA Styles */
.eula-card {
    max-width: 600px;
}
.eula-text {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
}
.eula-text h3 {
    color: var(--accent-purple-light);
    font-size: 0.9rem;
    margin: 10px 0 5px 0;
}
.eula-text p {
    margin-bottom: 10px;
}
.eula-text ul {
    margin-left: 20px;
    margin-bottom: 10px;
}
.eula-text li {
    margin-bottom: 5px;
}
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-primary);
}
.checkbox-container input {
    width: auto;
    margin-top: 3px;
}
.eula-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(46, 204, 113, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.scheduled-header, .loans-header, .transfers-header { max-width: 100%; }
.scheduled-list-area, .loans-list-area { flex: 1; }
.config-section { 
    padding: 15px; 
    background: rgba(130, 10, 209, 0.05); 
    border-radius: var(--radius); 
    border: 1px dashed var(--accent-purple-dark); 
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.config-group { display: flex; flex-direction: column; gap: 5px; }
.mt-5 { margin-top: 5px; }
.mb-10 { margin-bottom: 10px; }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebar { width: 280px; min-width: 0; flex-shrink: 0; background-color: var(--bg-card); border-right: 1px solid var(--border-color); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; overflow-x: hidden; }
.mb-5 { margin-bottom: 5px; }
.dynamic-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.bank-item { background: rgba(255,255,255,0.03); padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); }
.dynamic-item { display: flex; gap: 5px; align-items: center; margin-bottom: 5px; }
.nested-list { margin-left: 15px; padding-left: 10px; border-left: 2px solid var(--accent-purple-dark); margin-top: 5px; display: flex; flex-direction: column; gap: 8px; }
.nested-item-wrapper { display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,0.02); padding: 5px; border-radius: 6px; }
.mini-select { width: 45px; padding: 2px; font-size: 0.65rem; background: var(--accent-purple-dark); border: none; }
.limit-input-group { display: flex; align-items: center; gap: 5px; margin-left: 45px; }
.limit-input-group label { font-size: 0.65rem; margin-bottom: 0; min-width: 80px; }
.limit-input-group input { padding: 4px 8px; font-size: 0.75rem; width: 100px; }

/* KPI Credit Styles */
.credit-card-kpi .credit-details { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; }
.credit-card-kpi .detail { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }
.credit-card-kpi .detail strong { color: var(--text-primary); }
.credit-card-kpi .detail.limit { border-top: 1px solid var(--border-color); margin-top: 4px; padding-top: 4px; font-size: 0.65rem; }
.text-red { color: var(--accent-red) !important; }
.text-green { color: var(--accent-green) !important; }

.btn-mini { padding: 2px 6px; font-size: 0.6rem; width: auto; }
.dynamic-item input { flex: 1; }
.btn-small { padding: 8px; font-size: 0.75rem; margin-top: 0; }
.remove-btn { color: var(--accent-red); background: none; border: none; cursor: pointer; padding: 0 5px; }
.help-text { font-size: 0.65rem; color: var(--text-secondary); margin-top: 5px; font-style: italic; }
.dashboard {
    box-sizing: border-box; flex: 1; min-height: 0; min-width: 0;
    padding: 1.5rem;
    overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column; gap: 1rem;
}
/* Scrollbar (Chrome/Safari/Edge) */
.dashboard::-webkit-scrollbar { width: 14px; }
.dashboard::-webkit-scrollbar-track { background: var(--bg-dark); }
.dashboard::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 7px; }
.dashboard::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
.dashboard { scrollbar-width: thin; scrollbar-color: var(--border-color) var(--bg-dark); }
.card { background-color: var(--bg-card); border-radius: var(--radius); padding: 1rem; border: 1px solid var(--border-color); }
.kpi-grid { display: flex; flex-direction: column; gap: 15px; }
.kpi-main-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.kpi-highlight.red { border-color: rgba(255, 71, 87, 0.3); background: linear-gradient(145deg, #181818, #251414); }
.kpi-highlight.red h3 { color: var(--accent-red); }
.kpi-highlight.purple { border-color: rgba(130, 10, 209, 0.3); background: linear-gradient(145deg, #181818, #1f1425); }
.kpi-highlight.purple h3 { color: var(--accent-purple-light); }
.kpi-highlight p { font-size: 1.2rem; }
.kpi-subgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi-grid h3 { font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; }
.kpi-grid p { font-size: 1rem; font-weight: 700; }
.charts-container { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.canvas-wrapper { position: relative; width: 100%; height: 220px; }
.transactions-area { display: grid; grid-template-columns: 1fr 1.8fr; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-group { margin-bottom: 0.8rem; }
label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 4px; }
input, select { width: 100%; padding: 10px; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); font-family: inherit; transition: border-color 0.3s, box-shadow 0.3s; }
input:focus, select:focus { outline: none; border-color: var(--accent-purple); box-shadow: 0 0 0 2px rgba(130, 10, 209, 0.2); }
/* Mes de Consulta — estilo moderno */
.controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0.5rem;
}
.controls label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0;
}
#dateSelector {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#dateSelector:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(130, 10, 209, 0.25);
}
#dateSelector:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(130, 10, 209, 0.15);
    background: rgba(255, 255, 255, 0.04);
}
#dateSelector::-webkit-calendar-picker-indicator {
    filter: brightness(0) saturate(100%) invert(58%) sepia(70%) saturate(1200%) hue-rotate(250deg);
    cursor: pointer;
    opacity: 0.9;
}
#dateSelector::-moz-focus-inner { outline: none; }
.btn { width: 100%; padding: 10px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-primary { background-color: var(--accent-purple); color: white; transition: background 0.3s; }
.btn-primary:hover { background-color: var(--accent-purple-light); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); margin-top: 5px; transition: all 0.3s; }
.btn-outline:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.table-responsive { overflow-x: hidden; min-width: 0; }
.transaction-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.transaction-table td, .transaction-table th { padding: 12px 10px; border-bottom: 1px solid var(--border-color); font-size: 0.75rem; }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.total-summary-group { display: flex; gap: 10px; }
.total-summary { font-size: 0.9rem; font-weight: 600; color: var(--accent-red); background: rgba(255, 71, 87, 0.1); padding: 5px 12px; border-radius: 8px; border: 1px solid rgba(255, 71, 87, 0.2); }
.total-summary.blue { color: var(--accent-purple-light); background: rgba(130, 10, 209, 0.1); border-color: rgba(130, 10, 209, 0.2); }
.badge-account { font-size: 0.6rem; padding: 2px 8px; border-radius: 20px; background: rgba(130, 10, 209, 0.1); color: var(--accent-purple-light); border: 1px solid rgba(130, 10, 209, 0.2); }
.badge-type { font-size: 0.65rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.badge-given { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.badge-taken { background: rgba(255, 71, 87, 0.15); color: #ff4757; }
.text-center { text-align: center; }
.delete-btn { color: var(--accent-red); background: none; border: none; cursor: pointer; }
.edit-btn { color: var(--accent-purple-light); background: none; border: none; cursor: pointer; margin-right: 5px; }
@media (max-width: 1100px) { .charts-container, .transactions-area { grid-template-columns: 1fr; } .sidebar { display: none; } body { overflow: auto; } }