﻿/* ============================================================
   BILAN THEME - TITANIUM OBSIDIAN (MASTER)
   ============================================================ */

:root {
    /* --- FUENTES --- */
    --font-ui: 'DM Sans', sans-serif;
    --font-data: 'Space Grotesk', monospace;
    /* --- DIMENSIONES --- */
    --sidebar-w: 260px;
    --header-h: 72px;
    /* --- PALETA OBSIDIANA --- */
    --void-bg: #050b14; /* Fondo más oscuro */
    --panel-bg: #0f172a; /* Paneles laterales */
    --glass-bg: rgba(15, 23, 42, 0.85); /* Topbar semi-transparente */
    --card-bg: #1e293b;
    --border-subtle: rgba(255,255,255,0.08);
    --input-bg: #020617;
    /* --- ACENTOS --- */
    --accent: #3b82f6; /* Azul Eléctrico */
    --accent-glow: 0 0 15px rgba(59, 130, 246, 0.3);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    /* --- ESTADOS --- */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* RESET GLOBAL */
body, html {
    margin: 0;
    padding: 0;
    background-color: var(--void-bg);
    color: var(--text-main);
    font-family: var(--font-ui) !important;
    height: 100vh;
    overflow: hidden;
}

/* ============================================================
   LAYOUT SYSTEM
   ============================================================ */
.titanium-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at top right, #1e293b 0%, var(--void-bg) 40%);
    overflow: hidden;
}

/* SIDEBAR */
.sidebar-pillar {
    width: var(--sidebar-w);
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 50;
    flex-shrink: 0;
}

.brand-zone {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.logo-hexagon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--accent-glow);
}

.brand-text .app-name {
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    color: white;
}

.brand-text .app-tier {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-weight: 700;
}

.nav-zone {
    flex: 1;
    padding-top: 10px;
    overflow: hidden;
}

/* SYSTEM FOOTER */
.system-zone {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.connection-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

.pulse-ring {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* MAIN CONTENT */
.viewport-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.glass-cockpit {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
}

.content-canvas {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    padding-top: var(--header-h);
    scroll-behavior: smooth;
}

/* ============================================================
   UI COMPONENTS (BOTONES, INPUTS, TABLAS)
   ============================================================ */

/* --- BOTONES PREMIUM (SOLUCIÓN AL BOTÓN GRIS) --- */
.btn-titanium-primary {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--accent-glow);
    text-decoration: none; /* Vital para links <a> */
}

    .btn-titanium-primary:hover {
        background-color: #2563eb;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
        color: white;
    }

    .btn-titanium-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.btn-titanium-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: 0.2s;
    cursor: pointer;
}

    .btn-titanium-secondary:hover {
        border-color: white;
        color: white;
        background: rgba(255,255,255,0.05);
    }

.btn-titanium-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: 0.2s;
    cursor: pointer;
}

    .btn-titanium-ghost:hover {
        background: rgba(255,255,255,0.05);
        color: white;
    }

.btn-icon-action, .btn-icon-edit {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.03);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    cursor: pointer;
    text-decoration: none;
}

    .btn-icon-action:hover, .btn-icon-edit:hover {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }

.btn-icon-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    cursor: pointer;
}

    .btn-icon-delete:hover {
        background: var(--danger);
        color: white;
    }

/* --- INPUTS & SEARCH --- */
.titanium-input, .cyber-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-subtle);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-ui);
    transition: 0.2s;
}

    .titanium-input:focus, .cyber-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    }

.search-module {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0 12px;
    width: 320px;
}

    .search-module input {
        background: transparent;
        border: none;
        color: white;
        width: 100%;
        padding: 10px;
        outline: none;
    }

    .search-module i {
        color: var(--text-muted);
    }

/* --- TABLAS FINTECH --- */
.fintech-table {
    width: 100%;
    border-collapse: collapse;
}

    .fintech-table th {
        font-size: 0.65rem;
        color: var(--text-muted);
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        padding: 16px;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
    }

    .fintech-table td {
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-subtle);
        vertical-align: middle;
        font-size: 0.9rem;
    }

.fintech-row {
    transition: background 0.2s;
}

    .fintech-row:hover {
        background: rgba(255,255,255,0.02);
    }

/* --- CARDS & PANELS --- */
.titanium-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

/* --- BADGES & STATUS --- */
.badge, .status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-success, .bg-success-subtle {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-warning, .bg-warning-subtle {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-danger, .bg-danger-subtle {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-info, .bg-info-subtle {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

/* --- METRIC PILLS (KPIs Header) --- */
.metric-pill {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

    .metric-pill .label {
        font-size: 0.6rem;
        color: var(--text-muted);
        font-weight: 700;
        letter-spacing: 1px;
    }

    .metric-pill .value {
        font-family: var(--font-data);
        font-weight: 700;
        font-size: 1rem;
        line-height: 1.2;
    }

/* --- UTILIDADES --- */
.text-accent {
    color: var(--accent) !important;
}

.font-monospace {
    font-family: var(--font-data) !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* USER CAPSULE */
.user-capsule {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 4px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
}

    .user-capsule:hover {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.1);
    }

.user-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.user-role {
    font-size: 0.65rem;
    color: var(--accent);
    font-weight: 800;
    display: block;
    text-align: right;
}

.user-avatar-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(to bottom, var(--accent), transparent);
}

.avatar-content {
    width: 100%;
    height: 100%;
    background: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.8rem;
}

/* ANIMACIONES */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}
/* --- ESTILOS DE LA BARRA SUPERIOR (TOP BAR) --- */

:root {
    --bg-dark: #0f172a; /* Fondo oscuro base */
    --bg-input: #1e293b; /* Fondo del buscador */
    --border-color: #334155; /* Color de bordes sutiles */
    --text-main: #f8fafc; /* Blanco suave */
    --text-muted: #94a3b8; /* Gris texto secundario */
    --accent-blue: #3b82f6; /* Azul para el rol */
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    font-family: 'DM Sans', sans-serif; /* Asegura que use la fuente que arreglamos */
}

/* --- Buscador (Izquierda) --- */
.search-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 250px;
}

    .search-trigger:hover {
        border-color: var(--text-muted);
        color: var(--text-main);
    }

.cmd-icon {
    font-size: 1.2em;
}

.placeholder {
    flex-grow: 1;
    font-size: 0.9rem;
}

.shortcut {
    background-color: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    border: 1px solid rgba(255,255,255,0.1);
}

/* --- Perfil y Acciones (Derecha) --- */
.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex; /* Centra el icono SVG */
}

    .icon-btn:hover {
        color: var(--text-main);
    }

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.95rem;
}

.user-role {
    color: var(--accent-blue);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #1e293b;
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    border: 2px solid var(--border-color);
}
/* --- CALCULADORA FLOTANTE --- */
.calculator-widget {
    position: fixed; /* Fija en la pantalla */
    z-index: 1000; /* Siempre encima */
    background: rgba(15, 23, 42, 0.95); /* Color oscuro semi-transparente */
    backdrop-filter: blur(10px); /* Efecto vidrio */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    width: 320px; /* Ancho fijo elegante */
    transition: transform 0.1s ease-out; /* Suaviza ligeros movimientos */
}

/* La "manija" para arrastrar */
.calc-header {
    background: var(--bg-input);
    padding: 10px 15px;
    cursor: grab; /* Manita abierta */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    user-select: none; /* Evita que se seleccione el texto al arrastrar */
}

    .calc-header:active {
        cursor: grabbing; /* Manita cerrada al agarrar */
        background: #334155;
    }

.calc-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* Botón de cerrar estilo Mac/Windows */
.btn-close-calc {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
}

    .btn-close-calc:hover {
        color: #ef4444; /* Rojo al pasar el mouse */
    }

/* Overlay invisible para suavizar el arrastre (Truco PRO) */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    cursor: grabbing;
}
