@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900;1,14..32,300;1,14..32,400&display=swap');

:root {
    /* ─── Premium Color Palette ─── */
    --bg-color: #f0f7ff; /* Azul muy tenue */
    --panel-bg: rgba(255, 255, 255, 0.85);
    --panel-border: rgba(255, 255, 255, 0.6);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #eff6ff;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);

    --income-color: #10b981;
    --income-bg: rgba(16, 185, 129, 0.1);
    --expense-color: #ef4444;
    --expense-bg: rgba(239, 68, 68, 0.1);
    --transfer-color: #8b5cf6;
    --transfer-bg: rgba(139, 92, 246, 0.1);

    /* Sidebar with premium gradient */
    --sidebar-bg: #0a192f;
    --sidebar-gradient: linear-gradient(180deg, #0a192f 0%, #112240 100%);
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-border: rgba(255, 255, 255, 0.05);
    --sidebar-label: rgba(255, 255, 255, 0.4);
    --sidebar-accent: #60a5fa;

    --shadow-xs: 0 1px 2px rgba(59, 130, 246, 0.05);
    --shadow-sm: 0 4px 6px -1px rgba(59, 130, 246, 0.05), 0 2px 4px -1px rgba(59, 130, 246, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(59, 130, 246, 0.08), 0 4px 6px -2px rgba(59, 130, 246, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(59, 130, 246, 0.12), 0 10px 10px -5px rgba(59, 130, 246, 0.06);
    --border-radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== UNIFIED UI COMPONENTS ===== */
.status-pill {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.8px;
    border: 1px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.status-pendiente, .status-solicitada { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.status-gestionada, .status-estudio { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.status-completada, .status-aprobada, .status-terminada { background: #f0fdf4; color: #15803d; border-color: #dcfce7; }
.status-rechazada { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.status-ejecucion { background: #f5f3ff; color: #6d28d9; border-color: #ede9fe; }

.tx-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tx-badge.ingreso { background: #ecfdf5; color: #059669; }
.tx-badge.egreso { background: #fff1f2; color: #e11d48; }

.detail-tag {
    font-size: 10px;
    background: #f8fafc;
    color: #475569;
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}
.detail-tag:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* ===== MODERN TABLES ===== */
.modern-table-container {
    background: #fff;
    border-radius: var(--border-radius);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table th {
    background: #f8fafc;
    padding: 16px 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #f1f5f9;
    letter-spacing: 1px;
    text-align: left;
}

.modern-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
    font-size: 14px;
}

.modern-table tr:hover td {
    background: #fafbff;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

/* Accordion Effect for Informe de Dependencias */
.informe-row {
    cursor: default;
}

.informe-row.has-children {
    cursor: pointer;
}

.informe-row.has-children:hover {
    background-color: #f1f5f9 !important;
}

.informe-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    transition: all 0.2s;
    color: var(--text-muted);
}

.informe-row.has-children:hover .informe-toggle-btn {
    background-color: var(--panel-border);
    color: var(--accent-color);
}

.informe-toggle-icon {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.informe-row.collapsed .informe-toggle-icon {
    transform: rotate(-90deg);
}

.informe-row.child-hidden {
    display: none !important;
}

/* ===== CARDS OVERRIDE ===== */
.card {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--panel-border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.9);
}

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

.card-titles h3 {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
}

.card-titles .amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-breakdown {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-action-card {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    font-size: 13.5px;
}

/* === GRID LAYOUTS === */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* ===== BUTTONS UNIFIED ===== */
button, .btn {
    font-family: inherit;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger-outline {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}
.btn-danger-outline:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* ===== MODAL IMPROVEMENTS ===== */
.modal {
    border-radius: 24px;
    padding: 40px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.2);
    background: #fff;
}

.modal-type-header {
    border-bottom: 1px solid var(--panel-border);
}
.ingreso-header { color: var(--income-color); border-bottom-color: rgba(10,122,88,0.1); }
.egreso-header { color: var(--expense-color); border-bottom-color: rgba(192,57,43,0.1); }
.transferencia-header { color: var(--transfer-color); border-bottom-color: rgba(124,58,237,0.1); }

/* Buttons in Modals */
.btn-modal-ingreso { background: var(--income-color); color: #fff; box-shadow: 0 4px 12px rgba(10,122,88,0.25); }
.btn-modal-ingreso:hover { background: #0a6b4e; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(10,122,88,0.35); }

.btn-modal-egreso { background: var(--expense-color); color: #fff; box-shadow: 0 4px 12px rgba(192,57,43,0.25); }
.btn-modal-egreso:hover { background: #a93226; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(192,57,43,0.35); }

.btn-modal-transferencia { background: var(--transfer-color); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,0.25); }
.btn-modal-transferencia:hover { background: #6d28d9; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(124,58,237,0.35); }

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f8fafc;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* === LOGIN OVERLAY === */
.login-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0a192f;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    overflow: hidden;
}

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



.login-box {
    position: relative;
    z-index: 1;
    width: 440px;
    max-width: 92%;
    padding: 52px 48px;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 28px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
    animation: fadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === LEGACY WRAPPERS OR COMPATIBILITY === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 27, 62, 0.45);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal-lg { width: 850px; max-width: 95%; padding: 0; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26,58,143,0.10);
}

/* Dark login inputs */
.login-box .form-control::placeholder {
    color: rgba(255,255,255,0.3);
}
.login-box .form-control:focus {
    border-color: rgba(79,124,255,0.6);
    box-shadow: 0 0 0 3px rgba(79,124,255,0.15);
    background: rgba(255,255,255,0.09) !important;
}

/* ===== FORM ELEMENTS ===== */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 32px 40px;
}

.modal-full-width {
    grid-column: 1 / -1;
}

.form-section-title {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f1f5f9;
}

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: var(--sidebar-gradient);
    display: flex;
    flex-direction: column;
    z-index: 10;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255,255,255,0.05);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}
.nav-links { list-style: none; padding: 12px; }
.nav-links a {
    text-decoration: none;
    color: var(--sidebar-text);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.18s ease;
    letter-spacing: 0.1px;
}
.nav-links a:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.9);
    transform: translateX(2px);
}
.nav-links a.active {
    background: linear-gradient(135deg, rgba(79,124,255,0.22) 0%, rgba(79,124,255,0.10) 100%);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(79,124,255,0.25);
}
.nav-links a.active svg { color: var(--sidebar-accent); }

.main-content {
    flex: 1;
    padding: 44px 60px;
    background: transparent;
    min-height: 100vh;
}

/* === HEADER === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
}

.header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.6px;
    line-height: 1.2;
}

.header h1 span {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0;
    margin-top: 2px;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 5px 5px 5px 14px;
    border-radius: 40px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.profile-section:hover { box-shadow: var(--shadow-md); }

.profile-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent-color), #4f7cff);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* === USER INFO CARD === */
#userInfoCard {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius);
    padding: 24px 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    animation: slideInLeft 0.4s ease-out;
}

/* === GLOBAL TIME WINDOW === */
#globalTimeWindowContainer {
    margin-bottom: 24px;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

/* === DATE PRESET BUTTONS === */
.mov-preset-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    background: #fff;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.mov-preset-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-light);
}

.mov-preset-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* === SIDEBAR LOGO === */
.sidebar-brand-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 8px;
}

.logo-eafit-ctei {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-eafit {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.8px;
}

.logo-ctei-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 1px;
}

.logo-es {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
    font-style: italic;
}

.logo-ctei {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(90deg, #7ba4ff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.35);
    margin-top: 6px;
    font-weight: 700;
}

.nav-section-label {
    padding: 20px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--sidebar-label);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.login-brand-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.login-logo-eafit-ctei .logo-eafit {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}

.login-logo-eafit-ctei .logo-es {
    color: rgba(255,255,255,0.5) !important;
}

.login-logo-eafit-ctei .logo-ctei {
    background: linear-gradient(90deg, #7ba4ff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === TAGS SYSTEM === */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #fff;
    min-height: 48px;
    cursor: text;
}
.tags-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26,58,143,0.1);
}
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}
.tag-remove {
    margin-left: 6px;
    cursor: pointer;
    margin-right: -4px;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.chip-ingresos { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.chip-egresos { background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.chip-transferencias { background: rgba(139, 92, 246, 0.1); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.2); }

.tags-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    font-size: 13.5px;
    padding: 4px;
    background: transparent;
    color: var(--text-primary);
}

/* === CHAT SYSTEM (WHATSAPP STYLE) === */
.chat-sidebar {
    border-right: 1px solid var(--panel-border);
}

.contact-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.contact-item:hover {
    background: rgba(0,0,0,0.02);
}

.contact-item.active {
    background: #fff;
    border-left: 4px solid var(--accent-color);
    box-shadow: inset 4px 0 10px rgba(0,0,0,0.02);
}

.message-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
    animation: fadeIn 0.3s ease-out;
    display: inline-block;
}

.message-sent {
    align-self: flex-end;
    background: #dcf8c6;
    color: #111827;
    border-top-right-radius: 0;
}

.message-received {
    align-self: flex-start;
    background: #ffffff;
    color: #111827;
    border-top-left-radius: 0;
}

.message-time {
    font-size: 10px;
    color: rgba(0,0,0,0.45);
    margin-top: 4px;
    text-align: right;
    display: block;
    float: right;
    margin-left: 12px;
    position: relative;
    top: 2px;
}
.message-bubble::after {
    content: '';
    clear: both;
    display: table;
}

/* === CUSTOM CONFIRM MODAL === */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(13, 27, 62, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s;
}

.confirm-overlay.active {
    opacity: 1;
}

.confirm-modal {
    background: #fff;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-overlay.active .confirm-modal {
    transform: translateY(0);
}

/* === TAB SYSTEM === */
.tab-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.03);
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.5);
}

.tab-btn.active {
    background: #fff;
    color: var(--accent-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* === TOAST NOTIFICATIONS === */
.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #10b981;
    color: white;
    padding: 14px 24px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(16,185,129,0.3);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-msg.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error { background: #ef4444; box-shadow: 0 8px 24px rgba(239,68,68,0.3); }

/* === SPINNERS === */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    display: inline-block;
}

/* ==========================================
   ACCOUNTS TABLE & TOOLBAR
   ========================================== */
.accounts-section { animation: fadeIn 0.4s ease-out; }

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid var(--panel-border);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 10px 16px;
    flex: 1;
    max-width: 340px;
    transition: all 0.2s;
    color: var(--text-muted);
}
.search-box:focus-within {
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26,58,143,0.08);
}
.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-select {
    padding: 9px 14px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.filter-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26,58,143,0.08);
    background-color: #fff;
}

.row-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Table Header */
.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 12px 24px;
    background: #f8fafc;
    border-left: 1px solid var(--panel-border);
    border-right: 1px solid var(--panel-border);
    border-bottom: 1px solid var(--panel-border);
    gap: 16px;
}

.th-sortable {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.th-sortable:hover { color: var(--accent-color); }
.sort-icon { opacity: 0.4; font-size: 12px; }

/* Account Rows */
.accounts-list {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-top: none;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.account-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 8px 24px; /* More compact padding */
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px; /* Slightly smaller */
}
.account-row:nth-child(even) { background: #fafbfc; } /* Alternating colors */
.account-row:hover { background: #f0f4ff !important; }
.account-row:last-child { border-bottom: none; }

.account-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}
.account-email {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.account-tipo {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--accent-light);
    color: var(--accent-color);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.val-income { color: var(--income-color); font-weight: 700; font-size: 14px; }
.val-expense { color: var(--expense-color); font-weight: 700; font-size: 14px; }
.val-saldo { color: var(--text-primary); font-weight: 800; font-size: 15px; }

/* ==========================================
   MOVIMIENTOS / OPERACIONES TABLE
   ========================================== */
.movimientos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px; /* Slightly smaller base font */
}
.movimientos-table th {
    padding: 10px 14px; /* More compact */
    font-size: 10.5px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
    background: #f1f5f9; /* Slightly darker header background for contrast */
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}
.movimientos-table td {
    padding: 10px 14px; /* More compact */
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.movimientos-table tbody tr:nth-child(even) {
    background-color: #fafbfc; /* Alternating row colors for readability */
}
.movimientos-table tbody tr:hover td { background: #f0f4ff; } /* Clearer hover */
.movimientos-table tbody tr:last-child td { border-bottom: none; }
.mov-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.mov-th-sort:hover { color: var(--accent-color); }
.mov-sort-icon { font-size: 10px; opacity: 0.5; margin-left: 3px; }

/* ==========================================
   AMOUNT INPUT
   ========================================== */
.amount-input-wrap {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}
.amount-input-wrap:focus-within {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,58,143,0.08);
}
.currency-symbol {
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-muted);
    border-right: 2px solid var(--panel-border);
    background: #f1f5f9;
    flex-shrink: 0;
}
.amount-input-field {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    padding: 10px 16px !important;
    flex: 1;
    width: 100%;
    appearance: textfield;
    -moz-appearance: textfield;
}
.amount-input-field::-webkit-outer-spin-button,
.amount-input-field::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
}

/* ==========================================
   MODAL CLOSE BUTTON
   ========================================== */
.modal-close-x {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.modal-close-x:hover { background: #fee2e2; color: var(--expense-color); transform: none; }

/* ==========================================
   MODAL ACTIONS
   ========================================== */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}
.modal-msg {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-msg.error { background: var(--expense-bg); color: var(--expense-color); }
.modal-msg.success { background: var(--income-bg); color: var(--income-color); }

/* ==========================================
   SECTION HEADINGS
   ========================================== */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ==========================================
   EMPTY STATES
   ========================================== */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}
.empty-state svg { opacity: 0.25; display: block; margin: 0 auto 16px; }
.empty-state h4 { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ==========================================
   SIDEBAR NAV HOVER
   ========================================== */
.nav-links li a {
    transition: all 0.18s;
    font-size: 13.5px;
    font-weight: 600;
}
.nav-links li a:hover:not(.active) {
    background: var(--sidebar-hover);
    color: #fff;
}

/* ==========================================
   CHART CARDS
   ========================================== */
.chart-card { position: relative; }
.chart-card h3 {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.chart-subtitle { font-size: 12.5px; color: var(--text-muted); margin-bottom: 20px; }
.chart-container { position: relative; height: 240px; }

/* ==========================================
   PROGRESS BARS (card breakdown)
   ========================================== */
.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}
.breakdown-item span:last-child { font-weight: 700; color: var(--text-primary); }

/* ==========================================
   CHAT SECTION
   ========================================== */
#sectionChat .card { padding: 0; overflow: hidden; }
.chat-layout {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 500px;
}
.chat-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-sidebar h3 {
    padding: 20px 20px 12px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
#chatContactSearch {
    margin: 0 16px 12px;
    padding: 9px 14px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    color: var(--text-primary);
}
#chatContactSearch:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26,58,143,0.08);
}
#chatContactList { overflow-y: auto; flex: 1; }
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    gap: 10px;
    background: #fff;
    align-items: flex-end;
}
#chatMessageInput {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    transition: all 0.2s;
    max-height: 120px;
}
#chatMessageInput:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26,58,143,0.08);
}

/* ==========================================
   NOTIFICATION BADGE (sidebar)
   ========================================== */
.notification-badge {
    background: var(--expense-color);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

/* ==========================================
   COTIZACIONES TABLE
   ========================================== */
.cot-table-wrap {
    background: #fff;
    border-radius: var(--border-radius);
    border: 1px solid var(--panel-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.cot-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.cot-table-wrap th {
    padding: 13px 18px;
    background: #f8fafc;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    border-bottom: 2px solid #f1f5f9;
    text-align: left;
}
.cot-table-wrap td {
    padding: 14px 18px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}
.cot-table-wrap tr:last-child td { border-bottom: none; }
.cot-table-wrap tr:hover td { background: #fafbff; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1100px) {
    .main-content { padding: 32px 32px; }
    .summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 24px 20px; }
    .modal-lg { width: 100% !important; }
    .modal-grid { grid-template-columns: 1fr !important; }
    .table-header { grid-template-columns: 1fr !important; }
    .account-row { grid-template-columns: 1fr !important; }
}

/* ==========================================
   BREAKDOWN ROWS (summary cards)
   ========================================== */
.breakdown-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid #f8fafc;
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-cat-name { flex: 1; }
.breakdown-value { font-weight: 700; color: var(--text-primary); font-size: 13.5px; text-align: right; }

/* Account row extra states */
.account-row.own-row {
    background: linear-gradient(90deg, rgba(26,58,143,0.03) 0%, transparent 100%);
    border-left: 3px solid var(--accent-color);
}

.amount-col {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

/* ==========================================
   BTN ACTION VARIANTS
   ========================================== */
.btn-income {
    background: var(--income-bg);
    color: var(--income-color);
    border: 1.5px solid rgba(10,122,88,0.2);
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
}
.btn-income:hover { background: #d1fae5; transform: translateY(-1px); }

.btn-expense {
    background: var(--expense-bg);
    color: var(--expense-color);
    border: 1.5px solid rgba(192,57,43,0.2);
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
}
.btn-expense:hover { background: #fee2e2; transform: translateY(-1px); }

.btn-transfer {
    background: var(--transfer-bg);
    color: var(--transfer-color);
    border: 1.5px solid rgba(124,58,237,0.2);
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
}
.btn-transfer:hover { background: #ede9fe; transform: translateY(-1px); }

/* ==========================================
   SECTION COTIZACIONES
   ========================================== */
#sectionCotizaciones { animation: fadeIn 0.4s ease-out; }
#sectionAprobaciones { animation: fadeIn 0.4s ease-out; }

/* ==========================================
   MODAL COTIZACION ESPECIFICA
   ========================================== */
.cotiza-detail-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--panel-border);
    grid-column: 1 / -1;
    margin-top: 8px;
}
.cotiza-detail-section h4 {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Conditional field groups inside cotizacion modal */
#detalleServicio, #detalleViaje, #detalleInsumos,
#detalleEquipo, #detalleOtros {
    display: none;
    grid-column: 1 / -1;
}

/* ==========================================
   PAGE TITLE AREA
   ========================================== */
.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ==========================================
   INFORME TABLE
   ========================================== */
.informe-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px; /* Slightly smaller base font */
}
.informe-table th {
    padding: 10px 14px; /* More compact */
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    background: #f1f5f9; /* Match header color */
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}
.informe-table td {
    padding: 10px 14px; /* More compact */
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.informe-table tbody tr:nth-child(even) {
    background-color: #fafbfc; /* Alternating rows */
}
.informe-table tr:hover td { background: #f0f4ff !important; } /* Clear hover */
.informe-table .group-header td {
    background: var(--accent-light);
    color: var(--accent-color);
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 16px;
}

/* ==========================================
   GESTIONAR CUENTAS SECTION
   ========================================== */
#sectionCuentas { animation: fadeIn 0.4s ease-out; }
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) {
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* ==========================================
   SCROLLBAR OVERRIDE for chat & modals
   ========================================== */
#chatMessages::-webkit-scrollbar,
#chatContactList::-webkit-scrollbar,
.modal-body-scrollable::-webkit-scrollbar { width: 5px; }
#chatMessages::-webkit-scrollbar-thumb,
#chatContactList::-webkit-scrollbar-thumb,
.modal-body-scrollable::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 10px;
}

/* ==========================================
   HERO BALANCE CARD
   ========================================== */
.card-saldo-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #3b82f6 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 32px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

/* Subtle background glow */
.card-saldo-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.card-saldo-hero::after {
    content: '';
    position: absolute;
    bottom: -40px; left: 30%;
    width: 300px; height: 150px;
    background: radial-gradient(ellipse, rgba(99,179,237,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.saldo-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.saldo-hero-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
}

.saldo-hero-amount {
    font-size: 38px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -1.5px;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.saldo-hero-icon {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.saldo-hero-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 24px 0 20px;
}

/* 2x2 button grid */
.saldo-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.saldo-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.saldo-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.saldo-action-btn:active { transform: translateY(0); }

.saldo-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
}

.saldo-btn-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.saldo-btn-label {
    font-size: 13px;
    font-weight: 700;
    display: block;
    white-space: nowrap;
}

.saldo-btn-sub {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.75;
    display: block;
}

/* Income button — emerald */
.saldo-btn-income {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}
.saldo-btn-income:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
    color: #a7f3d0;
}
.saldo-btn-income .saldo-btn-icon { background: rgba(16, 185, 129, 0.2); }

/* Expense button — rose */
.saldo-btn-expense {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.32);
    color: #fca5a5;
}
.saldo-btn-expense:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
}
.saldo-btn-expense .saldo-btn-icon { background: rgba(239, 68, 68, 0.2); }

/* Transfer button — violet */
.saldo-btn-transfer {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.32);
    color: #c4b5fd;
}
.saldo-btn-transfer:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.5);
    color: #ddd6fe;
}
.saldo-btn-transfer .saldo-btn-icon { background: rgba(139, 92, 246, 0.2); }

/* Cotizacion button — sky blue */
.saldo-btn-cotiza {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}
.saldo-btn-cotiza:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.5);
    color: #bae6fd;
}
.saldo-btn-cotiza .saldo-btn-icon { background: rgba(56, 189, 248, 0.2); }

/* ==========================================
   INCOME / EXPENSE CARDS (right 2 cards)
   ========================================== */
/* Income card accent */
.card:has(#totalIngresos) {
    border-top: 3px solid #10b981;
}
/* Expense card accent */
.card:has(#totalEgresos) {
    border-top: 3px solid #ef4444;
}

/* ==========================================
   UNIFIED MODAL HERO SYSTEM
   Matches "Nueva Solicitud de Cotización" style
   ========================================== */

/* Hero header base */
.modal-hero-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 36px;
    border-radius: 24px 24px 0 0;
    position: relative;
}

/* Close button for dark headers */
.modal-close-white {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
    transition: all 0.2s;
}
.modal-close-white:hover {
    background: rgba(255,255,255,0.25);
    transform: none;
}

/* Income — gradient teal/green */
.modal-hero-income {
    background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
}

/* Expense — gradient red/rose */
.modal-hero-expense {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 50%, #dc2626 100%);
}

/* Transfer — gradient indigo/violet */
.modal-hero-transfer {
    background: linear-gradient(135deg, #3730a3 0%, #4338ca 50%, #6366f1 100%);
}

/* Cotización — gradient blue (already exists, reinforce) */
.modal-hero-cotiza {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
}

.modal-hero-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.modal-hero-title {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.2;
}

.modal-hero-subtitle {
    font-size: 12.5px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
    font-weight: 400;
}

/* Modal body: section columns keep existing .modal-grid */
.modal-lg .modal-grid {
    padding: 28px 36px;
    gap: 28px;
}

/* Section titles inside modals */
.modal-lg .form-section-title {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

/* Footer action bar */
.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 20px 36px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    border-radius: 0 0 24px 24px;
}

/* Cancel button */
.modal-btn-cancel {
    padding: 12px 24px;
    background: #fff;
    color: var(--text-secondary);
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

/* Confirm button base */
.modal-btn-confirm {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
}
.modal-btn-confirm:hover { transform: translateY(-1px); }
.modal-btn-confirm:active { transform: translateY(0); }

/* Confirm button variants */
.modal-btn-income {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 4px 14px rgba(5,150,105,0.35);
}
.modal-btn-income:hover { box-shadow: 0 8px 20px rgba(5,150,105,0.45); }

.modal-btn-expense {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    box-shadow: 0 4px 14px rgba(220,38,38,0.35);
}
.modal-btn-expense:hover { box-shadow: 0 8px 20px rgba(220,38,38,0.45); }

.modal-btn-transfer {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.modal-btn-transfer:hover { box-shadow: 0 8px 20px rgba(99,102,241,0.45); }

.modal-btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.modal-btn-primary:hover { box-shadow: 0 8px 20px rgba(37,99,235,0.45); }

/* Form controls inside modals — slightly softer */
.modal-lg .form-control {
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    border-color: #e2e8f0;
    background: #fafbfc;
}
.modal-lg .form-control:focus {
    background: #fff;
    border-color: var(--accent-color);
}

/* Section label with number badge (like cotización) */
.modal-section-num {
    width: 22px;
    height: 22px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* "¿No conoces el monto?" hint button */
#egresoSwitchToCotiza button {
    background: #eff6ff !important;
    border: 1.5px solid #dbeafe !important;
    color: var(--accent-color) !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}
#egresoSwitchToCotiza button:hover {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
}

/* ==========================================
   BTN-COTIZA-HINT — alto contraste
   ========================================== */
.btn-cotiza-hint {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Alto contraste: fondo azul navy sólido */
    background: var(--accent-color);
    color: #fff;
    border: none;
    box-shadow: 0 3px 10px rgba(26,58,143,0.30);
}

.btn-cotiza-hint:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,58,143,0.40);
}

.btn-cotiza-hint:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26,58,143,0.25);
}

/* ==========================================
   CUENTA DESTINO SELECT LIST — legible
   ========================================== */
select[size].form-control {
    /* Override: estilo para selects multi-línea */
    padding: 0;
    border-radius: 12px;
    border: 1.5px solid var(--panel-border);
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    overflow-y: auto;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
}

select[size].form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26,58,143,0.08);
}

select[size].form-control option {
    padding: 9px 14px;
    line-height: 1.5;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

select[size].form-control option:checked {
    background: var(--accent-color);
    color: #fff;
    font-weight: 700;
}

select[size].form-control option:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

/* Optgroup label — separador de grupo */
select[size].form-control optgroup {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 6px 14px 4px;
}

/* Cuentas destino wrappers */
#cuentaDestinoWrapper,
#cuentaDestinoIngresoWrapper {
    background: #f8fafc;
    border: 1.5px solid var(--panel-border);
    border-radius: 14px;
    padding: 14px;
}

#cuentaDestinoWrapper label,
#cuentaDestinoIngresoWrapper label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

/* Search inside cuentas wrapper */
#cuentaDestinoSearch,
#cuentaDestinoIngresoSearch {
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 13px;
    padding: 9px 12px 9px 34px !important;
    margin-bottom: 8px;
}
#cuentaDestinoSearch:focus,
#cuentaDestinoIngresoSearch:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(26,58,143,0.08) !important;
}

#cuentaDestino,
#cuentaDestinoIngreso {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    height: 170px !important;
    background: #fff !important;
}

/* ==========================================
   CUSTOM CUENTA DESTINO LIST
   ========================================== */
.cuenta-custom-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    margin-top: 6px;
}

.cuenta-list-group-label {
    padding: 6px 14px 4px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1;
}

.cuenta-list-item {
    display: flex;
    flex-direction: column;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.12s;
}

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

.cuenta-list-item:hover {
    background: var(--accent-light);
}

.cuenta-list-item.selected {
    background: var(--accent-color);
}
.cuenta-list-item.selected .cuenta-item-name { color: #fff; }
.cuenta-list-item.selected .cuenta-item-email { color: rgba(255,255,255,0.75); }

.cuenta-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.cuenta-item-email {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
    font-weight: 400;
}

/* Scrollbar for custom list */
.cuenta-custom-list::-webkit-scrollbar { width: 4px; }
.cuenta-custom-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Wrapper for cuenta destino */
#cuentaDestinoWrapper {
    background: #f8fafc;
    border: 1.5px solid var(--panel-border);
    border-radius: 14px;
    padding: 14px;
}
#cuentaDestinoWrapper label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

/* ==========================================
   SIDEBAR LOGO — "EAFIT es CTeI"
   Dos colores, jerarquía clara
   ========================================== */
.sidebar-brand-logo {
    padding: 28px 28px 20px;
}

.logo-lockup {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 0;
}

/* Línea 1: "EAFIT" — grande, blanco, peso máximo */
.logo-row-1 {
    font-size: 28px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1;
}

/* Línea 2: "es CTeI" */
.logo-row-2 {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 1px;
}

/* "es" — conector pequeño, opaco */
.logo-connector {
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1;
}

/* "CTeI" — mismo impacto visual que EAFIT pero en cian */
.logo-brand-ctei {
    font-size: 26px;
    font-weight: 900;
    color: #38bdf8;          /* sky-400 — cian brillante */
    letter-spacing: -0.5px;
    line-height: 1;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

/* Divisor */
.logo-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 14px 0 10px;
}

/* "Fondo CTeI" — etiqueta inferior */
.logo-fund-label {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.3);
}


/* ==========================================
   CHAT ENHANCEMENTS
   ========================================== */
.chat-contact-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s, border-left 0.2s;
    border-bottom: 1px solid #f1f5f9;
    border-left: 3px solid transparent;
}
.chat-contact-item:hover {
    background: #f8fafc;
}
.chat-contact-item.active {
    background: #eef2ff;
    border-left: 3px solid var(--accent-color);
}
.chat-contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}
.chat-contact-info {
    flex: 1;
    min-width: 0;
}
.chat-contact-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-contact-email {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}
.chat-contact-last {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.chat-contact-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 10px;
    flex-shrink: 0;
}
.chat-contact-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.chat-unread-count {
    background: var(--expense-color);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.chat-group-header {
    padding: 10px 16px;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}
.chat-group-header:hover {
    background: #e2e8f0;
}
.chat-chevron {
    transition: transform 0.2s;
}
.chat-chevron.expanded {
    transform: rotate(90deg);
}
.chat-input-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 16px 16px;
    background: white;
}
