/* =========================================
   PROPTRACKER — ESTÉTICA JAPÓN ANTIGUO
   Paleta: sumi (tinta), lacado (rojo torii),
   washi (papel), bambú, oro envejecido
   ========================================= */

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

:root {
    /* Paleta principal — Navy & Coral */
    --ink:          #0d1424;
    --ink-light:    #162035;
    --lacquer:      #c94434;
    --vermillion:   #e85c4a;
    --vermillion-h: #d44a38;
    --gold:         #f5a020;
    --gold-light:   #f8c060;
    --bamboo:       #7890b0;
    --bamboo-light: #c0d0e8;
    --washi:        #f2f5fa;
    --cream:        #f8faff;
    --muted:        #5a6e88;
    --jade:         #12b878;
    --jade-light:   #c8f0e0;
    --crimson-light:#fde8e6;
    --storm:        #445566;
    --storm-light:  #edf2f8;
    --border:       #dae0ec;
    --border-dark:  #c4ccdc;
    --shadow:       rgba(13, 20, 36, 0.10);
    --shadow-deep:  rgba(13, 20, 36, 0.22);
}

/* ─── RESET Y BASE ─── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--washi);
    color: var(--ink);
    margin: 0; padding: 0;
    min-height: 100vh;
    display: flex;
    font-size: 14px;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Crimson Pro', Georgia, serif;
    color: var(--ink);
    margin-top: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}
h1 { font-size: 2rem; font-weight: 300; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 600; }

a { color: var(--vermillion); text-decoration: none; }
a:hover { color: var(--lacquer); }

/* ─── SIDEBAR ─── */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: 240px;
    background-color: var(--ink);
    color: #c0d0e8;
    transition: width 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
}

.sidebar.collapsed { width: 60px; }

.sidebar-header {
    padding: 22px 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(206, 191, 159, 0.15);
    position: relative;
}

/* Línea de acento roja bajo el header */
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 18px; right: 18px;
    height: 2px;
    background: linear-gradient(90deg, var(--vermillion), transparent);
}

.sidebar-brand {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--bamboo);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0.04em;
}

/* Punto decorativo rojo en el brand */
.sidebar-brand::after {
    content: '•';
    color: var(--vermillion);
    margin-left: 4px;
    font-size: 0.9rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--bamboo);
    cursor: pointer;
    padding: 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.sidebar-toggle:hover { opacity: 1; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

.sidebar-nav { padding: 16px 0; flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav-bottom { margin-top: auto; border-top: 1px solid rgba(120,144,176,0.1); padding-top: 4px; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: rgba(192, 208, 232, 0.7);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 400;
    border-left: 2px solid transparent;
    letter-spacing: 0.01em;
}

.sidebar-nav .nav-link i {
    width: 18px;
    margin-right: 12px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    color: var(--bamboo);
    background: rgba(206, 191, 159, 0.07);
    border-left-color: rgba(192, 57, 43, 0.4);
}

.sidebar-nav .nav-link.active {
    color: #fdf9f3;
    background: rgba(192, 57, 43, 0.15);
    border-left-color: var(--vermillion);
    font-weight: 500;
}

.sidebar.collapsed .nav-link span { display: none; }
.sidebar.collapsed .nav-link i { margin-right: 0; }

/* Separador de sección en nav */
.nav-separator {
    height: 1px;
    background: rgba(206, 191, 159, 0.1);
    margin: 8px 16px;
}

/* ── Selector de cuentas en sidebar ── */
.sidebar-accsec {
    padding: 12px 14px 10px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(206,191,159,0.12);
    margin-bottom: 4px;
}
.sidebar-accsec-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 4px;
}
.sidebar-accsec-icon {
    font-size: 0.7rem;
    color: var(--vermillion);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-accsec-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(192,208,232,0.45);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-accsec-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,144,176,0.2) transparent;
}
.sidebar-acc-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 6px;
    padding: 7px 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
    color: rgba(192,208,232,0.75);
}
.sidebar-acc-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(120,144,176,0.2);
    color: #c8d8ee;
}
.sidebar-acc-item.active {
    background: rgba(232,92,74,0.12);
    border-color: rgba(232,92,74,0.3);
    color: #f0f4fa;
}
.sidebar-acc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sidebar-acc-info {
    overflow: hidden;
    min-width: 0;
}
.sidebar-acc-name {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.sidebar-acc-sub {
    font-size: 0.7rem;
    color: rgba(192,208,232,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.sidebar-acc-loading,
.sidebar-acc-empty {
    font-size: 0.74rem;
    color: rgba(192,208,232,0.4);
    padding: 6px 8px;
    text-align: center;
    line-height: 1.5;
}
.sidebar-acc-empty a {
    color: var(--vermillion);
    text-decoration: none;
    font-size: 0.72rem;
}

/* Sidebar colapsado: ocultar sección de cuentas completamente */
.sidebar.collapsed .sidebar-accsec { display: none; }

/* Sidebar — ítem de Perfil personalizado */
.nav-link-profile,
.nav-link-academy {
    display: flex;
    align-items: center;
    gap: 0;
}
.sidebar-user-avatar,
.sidebar-academy-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(192, 208, 232, 0.3);
}
.sidebar-user-initial,
.sidebar-academy-initial {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
    letter-spacing: 0;
}
.sidebar-user-initial {
    background: var(--vermillion);
}
.sidebar-academy-initial {
    background: var(--bamboo);
    font-size: 0.72rem;
}
.sidebar-academy-initial i {
    font-size: 0.65rem;
    opacity: 0.9;
}
.sidebar.collapsed .sidebar-user-avatar,
.sidebar.collapsed .sidebar-academy-logo,
.sidebar.collapsed .sidebar-user-initial,
.sidebar.collapsed .sidebar-academy-initial {
    margin-right: 0;
}

/* Botón de descarga EA */
.btn-download-ea {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ink);
    color: var(--bamboo-light);
    border: 1px solid rgba(192,208,232,0.3);
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    cursor: pointer;
    white-space: nowrap;
}
.btn-download-ea:hover {
    background: var(--lacquer);
    border-color: var(--lacquer);
    color: #fff;
}
.btn-download-ea i {
    font-size: 0.8rem;
    color: var(--jade);
}
.btn-download-ea:hover i {
    color: #fff;
}

/* ─── MODAL TUTORIAL ─── */
.tut-tabs { display:flex; gap:4px; padding:10px 0 0; }
.tut-tab {
    display:flex; align-items:center; gap:6px;
    padding:8px 16px; border:none; background:none;
    color:var(--bamboo); font-size:0.82rem; font-weight:500;
    border-bottom:2px solid transparent; cursor:pointer;
    transition:color .18s, border-color .18s;
}
.tut-tab:hover { color:var(--ink-light); }
.tut-tab.active { color:var(--vermillion); border-bottom-color:var(--vermillion); }
.tut-panel { display:none; }
.tut-panel.active { display:block; }

.tut-hero {
    display:flex; align-items:flex-start; gap:16px;
    background:var(--washi); border-radius:12px;
    padding:18px 20px; margin-bottom:20px;
}
.tut-hero-icon {
    width:44px; height:44px; border-radius:10px;
    background:var(--ink); color:var(--vermillion);
    display:flex; align-items:center; justify-content:center;
    font-size:1.3rem; flex-shrink:0;
}
.tut-hero-title { font-weight:600; font-size:0.97rem; color:var(--ink); margin-bottom:4px; }
.tut-hero-sub   { font-size:0.84rem; color:var(--bamboo); line-height:1.5; }

.tut-req {
    display:flex; align-items:center; flex-wrap:wrap; gap:8px;
    margin-bottom:20px; padding:10px 14px;
    background:rgba(18,184,120,.08); border-radius:8px;
    border:1px solid rgba(18,184,120,.2);
}
.tut-req-label { font-size:0.75rem; font-weight:700; color:var(--jade); text-transform:uppercase; letter-spacing:.05em; margin-right:4px; }
.tut-req-item  { font-size:0.82rem; color:var(--bamboo); display:flex; align-items:center; gap:5px; }
.tut-req-item i { color:var(--jade); font-size:0.7rem; }

.tut-steps { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:16px; }
.tut-step  { display:flex; gap:14px; align-items:flex-start; }
.tut-step-num {
    width:26px; height:26px; border-radius:50%;
    background:var(--ink); color:var(--bamboo-light);
    display:flex; align-items:center; justify-content:center;
    font-size:0.75rem; font-weight:700; flex-shrink:0; margin-top:2px;
}
.tut-step-body { flex:1; }
.tut-step-title { font-weight:600; font-size:0.9rem; color:var(--ink); margin-bottom:5px; }
.tut-step-body p { margin:0 0 6px; font-size:0.84rem; color:var(--bamboo); line-height:1.5; }

.tut-code {
    font-family:monospace; font-size:0.78rem;
    background:var(--ink); color:var(--bamboo-light);
    padding:7px 12px; border-radius:7px; margin:6px 0;
    word-break:break-all; line-height:1.5;
}
.tut-params {
    width:100%; border-collapse:collapse; font-size:0.82rem; margin-top:6px;
}
.tut-params th { font-weight:600; color:var(--bamboo); text-align:left; padding:5px 8px; border-bottom:1px solid var(--border); }
.tut-params td { padding:5px 8px; color:var(--ink); border-bottom:1px solid var(--border); vertical-align:top; }
.tut-params td:first-child { white-space:nowrap; }
.tut-params code { font-size:0.78rem; background:rgba(120,144,176,.12); padding:1px 5px; border-radius:4px; }

.tut-tip {
    display:flex; align-items:flex-start; gap:8px;
    background:rgba(232,92,74,.07); border:1px solid rgba(232,92,74,.2);
    border-radius:8px; padding:10px 14px;
    font-size:0.82rem; color:var(--bamboo); margin-top:12px; line-height:1.5;
}
.tut-tip i { color:var(--vermillion); margin-top:2px; flex-shrink:0; }

.tut-section-title {
    font-weight:700; font-size:0.85rem; color:var(--ink);
    text-transform:uppercase; letter-spacing:.06em;
    margin:20px 0 8px; padding-bottom:6px;
    border-bottom:1px solid var(--border);
}

.tut-download-btn {
    display:inline-flex; align-items:center; gap:8px;
    padding:9px 18px; background:var(--jade); color:#fff;
    border-radius:10px; font-size:0.84rem; font-weight:600;
    text-decoration:none; transition:background .18s;
}
.tut-download-btn:hover { background:#0fa065; color:#fff; }
.tut-download-btn i { font-size:0.8rem; }

/* ─── CONTENIDO PRINCIPAL ─── */
.content {
    margin-left: 240px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.content-inner {
    padding: 32px 36px;
    flex: 1;
}

.content.expanded {
    margin-left: 60px;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .content,
    .content.expanded { margin-left: 0 !important; }
    .content-inner { padding: 16px; }
}

/* ─── BARRA SUPERIOR ─── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 36px;
    justify-content: space-between;
    box-shadow: 0 1px 4px var(--shadow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--muted);
}
.topbar-left .topbar-sep { color: var(--bamboo); }
.topbar-left .topbar-page {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

/* Mode toggle pill (Prop / Capital Real) */
.mode-toggle-pill {
    display: flex;
    align-items: center;
    background: var(--washi);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.mode-pill-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.mode-pill-btn i { font-size: 0.7rem; }
.mode-pill-btn:hover { background: var(--bamboo-light); color: var(--ink); }
.mode-pill-btn.active {
    background: var(--ink);
    color: #fff;
}
@media (max-width: 640px) {
    .mode-pill-btn span { display: none; }
    .mode-pill-btn { padding: 4px 7px; }
}

/* Account switcher en topbar */
.account-switcher {
    position: relative;
}
.account-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--washi);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s;
}
.account-switcher-btn:hover { background: var(--bamboo-light); }
.account-switcher-btn i { color: var(--muted); }

.account-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--cream);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px var(--shadow-deep);
    z-index: 600;
    display: none;
}
.account-dropdown.open { display: block; }
.account-dropdown-header {
    padding: 10px 14px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    border-bottom: 1px solid var(--bamboo-light);
}
.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 0.82rem;
    color: var(--ink);
    cursor: pointer;
    border-bottom: 1px solid var(--bamboo-light);
    transition: background 0.12s;
}
.account-dropdown-item:last-child { border-bottom: none; }
.account-dropdown-item:hover { background: var(--washi); }
.account-dropdown-item .acc-firm {
    font-weight: 600;
    font-size: 0.82rem;
}
.account-dropdown-item .acc-meta {
    font-size: 0.75rem;
    color: var(--muted);
}
.account-dropdown-item .acc-phase-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.account-dropdown-empty {
    padding: 14px;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}

/* ─── TOOLTIPS INFORMATIVOS ─── */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    margin-left: 6px;
}
.info-tooltip i {
    font-size: 0.72rem;
    color: var(--bamboo);
    transition: color 0.15s;
}
.info-tooltip:hover i { color: var(--vermillion); }
.info-tooltip .tooltip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--bamboo-light);
    font-size: 0.75rem;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 10px;
    width: 200px;
    text-align: left;
    box-shadow: 0 4px 14px var(--shadow-deep);
    z-index: 9999;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}
.info-tooltip .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ink);
}
.info-tooltip:hover .tooltip-text { display: block; }

/* ─── CABECERA DE PÁGINA ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

/* Línea de acento decorativa */
.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 60px; height: 2px;
    background: var(--vermillion);
}

.page-header h1 { margin: 0; color: var(--ink); }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }

/* ─── CARDS ─── */
.card {
    background: var(--cream);
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

/* Acento superior en cada card */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--vermillion);
    opacity: 0.6;
}

.card-header {
    background: var(--cream);
    color: var(--ink);
    padding: 16px 20px;
    border-bottom: 1px solid var(--bamboo-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.card-header h2 {
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.card-header h2 i { color: var(--vermillion); font-size: 0.9rem; }

.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

/* ─── KPI GRID ─── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-grid.kpi-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}
.kpi-grid.kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1300px) { .kpi-grid.kpi-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); }
                             .kpi-grid.kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
                             .kpi-grid.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .kpi-grid, .kpi-grid.kpi-grid-5, .kpi-grid.kpi-grid-3 { grid-template-columns: 1fr; } }

.kpi-card {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-deep);
}

/* Borde izquierdo de acento */
.kpi-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--vermillion);
}

/* Elemento decorativo en esquina */
.kpi-card::after {
    content: '';
    position: absolute;
    right: 12px; top: 12px;
    width: 20px; height: 20px;
    border-top: 1px solid var(--bamboo);
    border-right: 1px solid var(--bamboo);
    opacity: 0.5;
}

.kpi-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 1px solid;
}

.kpi-icon-blue   { background: #e8edfc; color: #3456c8; border-color: #b0c4f0; }
.kpi-icon-green  { background: var(--jade-light); color: var(--jade); border-color: #88d8b8; }
.kpi-icon-orange { background: #fff3e0; color: #c07800; border-color: #f5c880; }
.kpi-icon-salmon { background: var(--crimson-light); color: var(--lacquer); border-color: #f0b0a8; }

.kpi-label {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kpi-label i {
    margin-left: 4px;
    margin-right: 2px;
    opacity: 0.7;
}

.kpi-value {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.02em;
}
.kpi-profit-negative { color: var(--vermillion) !important; }
.kpi-profit-positive { color: var(--jade) !important; }

/* ─── BOTONES ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--vermillion);
    color: #fdf9f3;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(201, 68, 52, 0.3);
    white-space: nowrap;
}

.btn:hover {
    background: var(--vermillion-h);
    color: #fdf9f3;
    box-shadow: 0 3px 8px rgba(201, 68, 52, 0.35);
    transform: translateY(-1px);
}

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

.btn-primary { background: var(--vermillion); }
.btn-primary:hover { background: var(--vermillion-h); }

.btn-secondary {
    background: var(--ink-light);
    color: var(--bamboo);
    box-shadow: 0 1px 3px var(--shadow);
}
.btn-secondary:hover { background: var(--ink); color: var(--cream); }

.btn-success {
    background: var(--jade);
    box-shadow: 0 1px 3px rgba(46, 125, 92, 0.3);
}
.btn-success:hover { background: #246649; }

.btn-danger {
    background: var(--lacquer);
    box-shadow: 0 1px 3px rgba(201, 68, 52, 0.3);
}
.btn-danger:hover { background: #6e1009; }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }

.btn-outline {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border-dark);
    box-shadow: none;
}
.btn-outline:hover { background: var(--bamboo-light); color: var(--ink); box-shadow: none; }

/* ─── FORMULARIOS ─── */
.form-group { margin-bottom: 18px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group-full { grid-column: 1 / -1; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--ink);
    background: var(--cream);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--vermillion);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
    background: #fff;
}

.form-control::placeholder { color: var(--bamboo); }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a6a58'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

textarea.form-control { min-height: 80px; resize: vertical; }

/* ─── TABLAS ─── */
.table-container { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table thead { background: var(--washi); }

.table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bamboo-light);
    vertical-align: middle;
}

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

.table tbody tr:hover { background: rgba(212, 196, 168, 0.12); }

.table.mb-0 { margin-bottom: 0; }

/* ─── MODALES ─── */
.modal-background {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 20, 36, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-container {
    background: var(--cream);
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(13, 20, 36, 0.4);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Marco decorativo estilo japonés en el modal */
.modal-container::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 1px solid rgba(192, 57, 43, 0.15);
    pointer-events: none;
    z-index: 0;
}

.modal-header {
    background: var(--ink);
    color: var(--bamboo);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Franja de color torii */
.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--vermillion);
}

.modal-header h3 {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--bamboo);
}

.modal-title { margin: 0; color: var(--bamboo); font-size: 1.1rem; }

.modal-close {
    background: none;
    border: none;
    color: var(--bamboo);
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
    padding: 0;
    transition: opacity 0.2s;
}
.modal-close:hover { opacity: 1; }

.modal-body { padding: 24px; position: relative; z-index: 1; }

.modal-footer {
    padding: 16px 24px;
    background: var(--washi);
    border-top: 1px solid var(--bamboo-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ─── ALERTAS ─── */
.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    border-left: 3px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success  { background: var(--jade-light); color: #1a5c3a; border-color: var(--jade); }
.alert-danger   { background: var(--crimson-light); color: var(--lacquer); border-color: var(--vermillion); }
.alert-warning  { background: #fef5e4; color: #7a4f10; border-color: var(--gold); }
.alert-info     { background: #eef3fb; color: #2c4a8a; border-color: #5c82c8; }

/* ─── BADGES DE FASE ─── */
.phase-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid;
}

/* ─── FILTROS DE FASE ─── */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.phase-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ─── YEAR NAVIGATOR ─── */
.year-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.year-nav-btn {
    padding: 5px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-dark);
    background: var(--cream);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
}

.year-nav-btn:hover { border-color: var(--vermillion); color: var(--vermillion); }
.year-nav-btn.active { background: var(--ink); border-color: var(--ink); color: var(--bamboo); }

.year-nav-arrows {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    overflow: hidden;
    background: var(--cream);
    transition: opacity 0.2s;
}

.year-arrow {
    background: none;
    border: none;
    padding: 5px 9px;
    font-size: 1rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.12s, color 0.12s;
}

.year-arrow:hover { background: var(--washi); color: var(--ink); }

.year-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0 8px;
    min-width: 38px;
    text-align: center;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.03em;
    transition: color 0.15s;
}

.year-display.year-display-active {
    color: var(--ink);
    font-weight: 700;
}

/* ─── FIRM FILTER SELECT ─── */
.firm-filter-select {
    padding: 5px 28px 5px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-dark);
    background: var(--cream);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6e88'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    transition: border-color 0.15s;
}
.firm-filter-select:focus {
    outline: none;
    border-color: var(--bamboo);
}
.firm-filter-select:hover { border-color: var(--bamboo); }

/* ─── BARRA INFERIOR DE PAGINACIÓN ─── */
.accounts-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}

.accounts-count-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

.phase-filter-btn {
    padding: 5px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-dark);
    background: var(--cream);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.15s;
    color: var(--muted);
    font-family: 'Inter', sans-serif;
}

.phase-filter-btn:hover {
    border-color: var(--vermillion);
    color: var(--vermillion);
}

.phase-filter-btn.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bamboo);
}

/* ─── PAYOUT CARDS ─── */
.payouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.payout-card {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px var(--shadow);
}

.payout-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--jade);
}

.payout-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-deep);
}

.payout-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.payout-firm {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.payout-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--bamboo);
    font-size: 0.8rem;
    transition: color 0.15s;
    padding: 0;
    line-height: 1;
}
.payout-delete:hover { color: var(--vermillion); }

.payout-amount {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--jade);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.payout-date {
    font-size: 0.75rem;
    color: var(--bamboo);
    letter-spacing: 0.02em;
}

.payout-notes {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 10px;
    font-style: italic;
    border-top: 1px solid var(--bamboo-light);
    padding-top: 8px;
}

.payout-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.payout-status-badge {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
}

.payout-status-accepted {
    background: rgba(18,184,120,0.12);
    color: var(--jade);
    border: 1px solid rgba(18,184,120,0.25);
}

.payout-status-rejected {
    background: rgba(232,92,74,0.12);
    color: var(--vermillion);
    border: 1px solid rgba(232,92,74,0.25);
}

.payout-status-pending {
    background: rgba(245,160,32,0.12);
    color: #c07800;
    border: 1px solid rgba(245,160,32,0.3);
}

.payout-status-actions {
    display: flex;
    gap: 4px;
}

.payout-status-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--bamboo);
    transition: all 0.15s;
}

.payout-accept-btn:hover {
    background: rgba(18,184,120,0.1);
    border-color: var(--jade);
    color: var(--jade);
}

.payout-pending-btn:hover {
    background: rgba(245,160,32,0.1);
    border-color: #c07800;
    color: #c07800;
}

.payout-reject-btn:hover {
    background: rgba(232,92,74,0.1);
    border-color: var(--vermillion);
    color: var(--vermillion);
}

.payout-card-rejected {
    opacity: 0.72;
    border-color: rgba(232,92,74,0.3);
}

.payout-card-rejected .payout-card::before,
.payout-card-rejected::before {
    background: var(--vermillion);
}

.payout-card-pending {
    border-color: rgba(245,160,32,0.3);
}

.payout-amount-rejected {
    color: var(--bamboo) !important;
    text-decoration: line-through;
}

/* ─── LAYOUT ─── */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) { .two-column-layout { grid-template-columns: 1fr; } }

/* ─── ESTADÍSTICAS (legacy) ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 1px 4px var(--shadow);
    position: relative;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--vermillion);
    opacity: 0.5;
}

.stat-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-value {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ─── VALORES POSITIVOS/NEGATIVOS ─── */
.positive-value { color: var(--jade); }
.negative-value { color: var(--lacquer); }
.profit-positive { color: var(--jade); font-weight: 600; }
.profit-negative { color: var(--lacquer); font-weight: 600; }

/* ─── CALENDARIO ─── */
.calendar-container { margin-bottom: 24px; }

/*
 * Calendar: thead and tbody rows use CSS Grid so that row height
 * is controlled purely by CSS and never grows with cell content.
 */
.calendar {
    width: 100%;
    border-collapse: collapse;
    background: var(--cream);
    border: 1px solid var(--border);
    table-layout: fixed;
}

/* Grid rows — this is what guarantees equal, fixed-height cells */
.calendar thead tr,
.calendar tbody tr {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar th {
    padding: 10px;
    background: var(--ink);
    color: var(--bamboo);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar td {
    height: 86px;
    max-height: 86px;
    padding: 0;
    border: 1px solid var(--border);
    vertical-align: top;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: filter 0.12s;
}
.calendar td:hover { filter: brightness(0.94); }

/* Inner wrapper — overflow clips any content beyond 86px */
.cal-cell-inner {
    height: 86px;
    max-height: 86px;
    padding: 7px 8px 6px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.calendar .date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bamboo);
    line-height: 1;
    flex-shrink: 0;
}

/* ─── Day states ─── */
.calendar .today         { background: rgba(232,92,74,.05); }
.calendar .today .date   { color: var(--vermillion); font-weight: 700; }
.calendar .other-month   { background: var(--washi); opacity: 0.45; cursor: default; }
.calendar .selected .cal-cell-inner {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
    border-radius: 2px;
}

/* Profit day */
.calendar .day-profit          { background: rgba(18,184,120,.08); }
.calendar .day-profit.today    { background: rgba(18,184,120,.14); }
/* Loss day */
.calendar .day-loss            { background: rgba(232,92,74,.08); }
.calendar .day-loss.today      { background: rgba(232,92,74,.14); }

/* Colored accent bar at bottom of day cells with trades */
.calendar .day-profit .cal-cell-inner::after,
.calendar .day-loss   .cal-cell-inner::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 0;
}
.calendar .day-profit .cal-cell-inner::after { background: rgba(18,184,120,.5); }
.calendar .day-loss   .cal-cell-inner::after { background: rgba(232,92,74,.5); }

/* ─── Trade count badge (top-right) ─── */
.cal-count-badge {
    position: absolute;
    top: 6px;
    right: 7px;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    background: rgba(120,144,176,0.15);
    color: var(--bamboo);
    border-radius: 8px;
    padding: 2px 5px;
    letter-spacing: 0.02em;
}

/* ─── P&L value — centered in remaining cell space ─── */
.cal-pnl {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    padding-bottom: 6px;
}
.cal-pnl-pos { color: var(--jade); }
.cal-pnl-neg { color: var(--vermillion); }

/* ─── GRÁFICAS ─── */
.chart-container {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px var(--shadow);
}

.chart-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 16px;
}

/* ─── AUTENTICACIÓN ─── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--washi);
    position: relative;
}

/* Elemento decorativo de fondo */
.auth-container::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--vermillion), var(--gold), var(--vermillion));
}

.auth-card {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 40px var(--shadow-deep);
    width: 100%;
    max-width: 400px;
    padding: 40px 36px;
    position: relative;
}

/* Marco decorativo */
.auth-card::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 1px solid rgba(192, 57, 43, 0.12);
    pointer-events: none;
}

.auth-title {
    text-align: center;
    margin-bottom: 8px;
    color: var(--ink);
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    font-size: 1.8rem;
    letter-spacing: 0.02em;
}

.auth-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 28px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Divisor de sección en auth */
.auth-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bamboo), transparent);
    margin: 20px 0;
    position: relative;
}

.auth-form .form-group { margin-bottom: 16px; }
.form-actions { margin-top: 24px; }
.btn-block { width: 100%; justify-content: center; margin-bottom: 10px; }

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    gap: 12px;
    color: var(--bamboo);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.separator::before, .separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bamboo-light);
}

.btn-google {
    background: var(--cream);
    color: var(--ink);
    border: 1px solid var(--border-dark);
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
    gap: 10px;
}
.btn-google:hover { background: var(--washi); color: var(--ink); }

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ─── SECCIÓN HEADER ─── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bamboo-light);
}
.section-header h2 { margin: 0; font-size: 1.05rem; }

/* ─── BOTONES DE ACCIÓN EN TABLA ─── */
.action-btns { display: flex; gap: 6px; }
.table tr.account-row { cursor: pointer; }

/* ─── ANIMACIONES ─── */
.fade-in { animation: fadeIn 0.25s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-in { animation: slideIn 0.25s ease-out; }
@keyframes slideIn {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ─── UTILIDADES ─── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.text-muted   { color: var(--muted) !important; }
.d-none       { display: none !important; }
.d-block      { display: block !important; }
.d-flex       { display: flex !important; }
.flex-column  { flex-direction: column !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.w-100        { width: 100% !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ml-auto { margin-left: auto !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.p-3  { padding: 1rem !important; }
.is-invalid { border-color: var(--vermillion) !important; }

/* ─── FORM CHECK ─── */
.form-check { display: flex; align-items: center; margin-bottom: 12px; gap: 8px; }
.form-check-input { width: 16px; height: 16px; accent-color: var(--vermillion); }

/* ─── SCROLLBAR PERSONALIZADA ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--washi); }
::-webkit-scrollbar-thumb { background: var(--bamboo); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bamboo-dark, #b8a68a); }

/* ═══════════════════════════════════════
   MEJORAS UX — RESPONSIVE & VISUAL
   ═══════════════════════════════════════ */

/* ─── HAMBURGER BUTTON ─── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 10px;
    transition: background 0.15s;
}
.hamburger-btn:hover { background: var(--washi); }
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 6px;
    transition: all 0.2s;
}
@media (max-width: 768px) {
    .hamburger-btn { display: flex; }
}

/* ─── MARCA MOBILE EN TOPBAR ─── */
.topbar-brand-mobile {
    font-family: 'Crimson Pro', serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    letter-spacing: 0.04em;
    display: none;
}
@media (max-width: 768px) {
    .topbar-brand-mobile { display: inline; }
    .topbar-sep { display: none; }
    .topbar-page { display: none; }
}

/* ─── SIDEBAR MÓVIL ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28,18,8,0.55);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; animation: fadeIn 0.2s ease; }

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }
    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 24px rgba(28,18,8,0.35);
    }
    /* collapsed no tiene efecto en móvil — se controla solo con mobile-open */
    .sidebar.collapsed { width: 240px; }
}

/* ─── TOPBAR AVATAR ─── */
.topbar-avatar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 10px;
    transition: background 0.15s;
}
.topbar-avatar-link:hover {
    background: var(--washi);
    color: var(--ink);
}
.topbar-avatar-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--vermillion);
    flex-shrink: 0;
}
.topbar-avatar-initial {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bamboo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    border: 2px solid var(--vermillion);
    flex-shrink: 0;
    font-family: 'Crimson Pro', serif;
}
.topbar-avatar-name {
    font-weight: 500;
    font-size: 0.8rem;
}
@media (max-width: 560px) {
    .topbar-avatar-name { display: none; }
    .account-switcher-btn span { display: none; }
}

/* ─── TABLA RESPONSIVE ─── */
@media (max-width: 768px) {
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .content-inner { padding: 16px; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .two-column-layout { grid-template-columns: 1fr !important; }
    .topbar { padding: 0 16px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-card { padding: 16px 14px; }
}

/* ─── AVATAR CON CÁMARA (perfil + academia) ─── */
.profile-avatar-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto;
    flex-shrink: 0;
}
.profile-avatar-wrap.avatar-sm {
    width: 72px;
    height: 72px;
}
.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--vermillion);
    display: block;
}
.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bamboo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Crimson Pro', serif;
    font-size: 2.2rem;
    font-weight: 600;
    border: 3px solid var(--vermillion);
}
.profile-avatar-wrap.avatar-sm .profile-avatar-placeholder {
    font-size: 1.6rem;
}
.profile-avatar-edit {
    position: absolute;
    bottom: 0; right: 0;
    width: 28px; height: 28px;
    background: var(--vermillion);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    cursor: pointer;
    border: 2px solid var(--cream);
    transition: background 0.2s;
    z-index: 2;
}
.profile-avatar-edit:hover { background: var(--lacquer); }

/* ─── CARD HOVER ─── */
.card {
    transition: box-shadow 0.2s;
}
.card:hover {
    box-shadow: 0 3px 12px var(--shadow);
}

/* ─── MEJOR BOTÓN BTN-SM ─── */
.btn-sm {
    padding: 5px 12px;
    font-size: 0.75rem;
}

/* ─── BADGE MEJORADO ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 10px;
}

/* ─── TABLA HOVER MEJORADO ─── */
.table tbody tr {
    transition: background 0.12s;
}
.table tbody tr:hover {
    background: rgba(206,191,159,0.15);
}

/* ─── INPUT FOCUS SUAVE ─── */
.form-control {
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--vermillion);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.08);
}

/* ─── BTN TRANSITION ─── */
.btn {
    transition: background 0.18s, color 0.18s, transform 0.1s, box-shadow 0.18s;
}
.btn:active { transform: translateY(1px); }

/* ─── TWO COLUMN RESPONSIVE ─── */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) {
    .two-column-layout { grid-template-columns: 1fr; }
}

/* ─── MODAL RESPONSIVE ─── */
@media (max-width: 600px) {
    .modal-container {
        margin: 12px;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }
}

/* ─── PAGE SUBTITLE ─── */
.page-subtitle {
    color: var(--muted);
    font-size: 0.82rem;
    margin: 0;
    margin-top: 4px;
}

/* ─── ALERT MEJORADO ─── */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid;
    margin-bottom: 16px;
}
.alert-success {
    background: var(--jade-light);
    color: var(--jade);
    border-color: var(--jade);
}
.alert-danger {
    background: var(--crimson-light);
    color: var(--lacquer);
    border-color: var(--lacquer);
}
.alert-warning {
    background: #fef5e4;
    color: #8a5a10;
    border-color: #c9a84c;
}
.alert-info {
    background: var(--storm-light);
    color: var(--storm);
    border-color: var(--storm);
}

/* ─── SIDEBAR COLLAPSED: solo iconos ─── */
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-separator {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s, width 0.3s;
}
.sidebar.collapsed .sidebar-brand {
    display: none;
}
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}
.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 22px 12px 18px;
}

/* Sidebar expandido: mostrar texto */
.sidebar:not(.collapsed) .nav-link span {
    opacity: 1;
    width: auto;
    transition: opacity 0.2s 0.1s;
}

/* ═══════════════════════════════════════════════════════════
   DISEÑO MODERNO — BORDES REDONDEADOS, SUAVIDAD, SMOOTHNESS
   ═══════════════════════════════════════════════════════════ */

/* ─── TARJETAS ─── */
.card,
.kpi-card,
.modal-container,
.card-header ~ * {
    border-radius: 14px !important;
}
.card::before { border-radius: 14px 14px 0 0 !important; }
.kpi-card::before { border-radius: 14px 0 0 14px !important; }

/* ─── BOTONES ─── */
.btn {
    border-radius: 8px !important;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.1s !important;
}
.btn:hover { box-shadow: 0 3px 10px var(--shadow); }
.btn:active { transform: translateY(1px) !important; }
.btn-primary {
    background: var(--vermillion) !important;
    box-shadow: 0 2px 8px rgba(192,57,43,0.25) !important;
}
.btn-primary:hover {
    background: var(--lacquer) !important;
    box-shadow: 0 4px 14px rgba(192,57,43,0.35) !important;
}
.btn-outline { border-radius: 8px !important; }
.btn-sm { border-radius: 7px !important; }

/* ─── INPUTS ─── */
.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
textarea, select {
    border-radius: 8px !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}
.form-control:focus,
input:focus, textarea:focus, select:focus {
    border-color: var(--vermillion) !important;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1) !important;
    outline: none !important;
}

/* ─── MODAL ─── */
.modal-container { border-radius: 18px !important; box-shadow: 0 20px 60px rgba(28,18,8,0.3) !important; }
.modal-header { border-radius: 18px 18px 0 0 !important; }
.modal-footer { border-radius: 0 0 18px 18px !important; }

/* ─── BADGES (píldora) ─── */
.badge { border-radius: 100px !important; font-size: 0.68rem !important; }
.badge-funded  { background: var(--jade-light); color: var(--jade); }
.badge-p1      { background: #fef5e4; color: #8a5a10; }
.badge-p2      { background: var(--storm-light); color: var(--storm); }
.badge-failed  { background: var(--crimson-light); color: var(--lacquer); }
.badge-suspended { background: #f0ece4; color: var(--muted); }

/* ─── DROPDOWN CUENTAS ─── */
.account-dropdown {
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(28,18,8,0.18) !important;
    border: 1px solid var(--bamboo-light) !important;
    overflow: hidden;
}
.account-dropdown-item { border-radius: 8px !important; margin: 2px 6px; }

/* ─── NAV LINKS SIDEBAR ─── */
.nav-link {
    border-radius: 8px !important;
    margin: 1px 8px !important;
    transition: background 0.15s, color 0.15s !important;
}
.nav-link:hover { background: rgba(206,191,159,0.12) !important; }
.nav-link.active {
    background: rgba(192,57,43,0.18) !important;
    border-radius: 8px !important;
}
.nav-link-admin.active,
.nav-link-admin:hover {
    background: rgba(192,57,43,0.22) !important;
    color: var(--bamboo-light) !important;
}

/* ─── TABLA MODERNA ─── */
.table { border-collapse: separate; border-spacing: 0; }
.table thead th {
    background: var(--washi);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--bamboo-light);
    padding: 10px 14px;
    color: var(--muted);
    font-weight: 600;
}
.table tbody td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--bamboo-light); font-size: 0.84rem; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgba(206,191,159,0.13); }

/* ─── ALERT MEJORADAS ─── */
.alert { border-radius: 10px !important; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar-thumb { border-radius: 10px; }

/* ─── TOPBAR ─── */
.topbar {
    border-radius: 0 0 0 0;
    background: rgba(253,249,243,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bamboo-light);
}
.topbar-avatar-link { border-radius: 10px !important; }
.topbar-avatar-img  { border-radius: 50% !important; }
.topbar-avatar-initial { border-radius: 50% !important; }
.account-switcher-btn { border-radius: 8px !important; }

/* ─── KPI-CARD: sin overflow:hidden para que el tooltip se vea ─── */
.kpi-card { overflow: visible !important; }

/* ─── TOOLTIP PORTAL (JS creará este elemento en el body) ─── */
.tooltip-portal {
    position: fixed;
    z-index: 999999;
    background: var(--ink);
    color: var(--bamboo-light);
    font-size: 0.76rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    padding: 9px 13px;
    border-radius: 10px;
    max-width: 220px;
    text-align: left;
    box-shadow: 0 6px 24px rgba(28,18,8,0.28);
    pointer-events: none;
    animation: fadeIn 0.15s ease;
}
.tooltip-portal::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ink);
}

/* Ocultar tooltip CSS (se usa el portal JS) */
.info-tooltip:hover .tooltip-text { display: none !important; }

/* ─── SECTION-HEADER ─── */
.section-header { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--bamboo-light); }

/* ─── SOMBRAS SUAVES EN HOVER de cards ─── */
.card { transition: box-shadow 0.22s, transform 0.15s; }
.card:hover { box-shadow: 0 6px 24px var(--shadow) !important; }

/* ─── PAGE TITLE ─── */
.page-title { font-size: 1.7rem; font-weight: 300; margin-bottom: 0; letter-spacing: -0.02em; }
.page-subtitle { color: var(--muted); font-size: 0.82rem; margin: 4px 0 0; }

/* ─── BREADCRUMB ─── */
.topbar-sep { color: var(--bamboo); margin: 0 4px; opacity: 0.7; }
.topbar-page { color: var(--muted); font-size: 0.82rem; font-weight: 500; }

/* ─── ICON SPACING GLOBAL ─── */
.sidebar-nav .nav-link {
    padding: 11px 20px 11px 22px;
    gap: 0;
}
.sidebar-nav .nav-link i {
    width: 22px;
    margin-right: 14px;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-align: center;
}
.btn i, .btn-sm i, .btn-xs i {
    margin-right: 6px;
}
.account-switcher-btn i:first-child {
    margin-right: 8px;
}

/* ─── ACCOUNT CARDS GRID ─── */
.accounts-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 8px;
}

.acc-card {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px 16px;
    cursor: default;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.acc-card:hover {
    box-shadow: 0 8px 28px var(--shadow-deep);
    transform: translateY(-2px);
}

.acc-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.acc-card-firm {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
}

.acc-card-login {
    font-size: 0.72rem;
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    margin-top: 2px;
}

.acc-card-phase-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid;
    white-space: nowrap;
    flex-shrink: 0;
}

.acc-card-type-label {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bamboo);
    font-weight: 500;
    margin-top: 2px;
    margin-bottom: 4px;
}

.acc-card-size {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
}

.acc-card-stats {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.acc-card-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 6px;
    border-right: 1px solid var(--bamboo-light);
}
.acc-card-stat:first-child { padding-left: 0; }
.acc-card-stat:last-child { border-right: none; }

.acc-card-stat-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 500;
}

.acc-card-stat-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}
.acc-card-stat-green { color: var(--jade) !important; }
.acc-card-stat-red   { color: var(--vermillion) !important; }

.acc-card-date {
    font-size: 0.72rem;
    color: var(--muted);
}

.acc-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.acc-card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--washi);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
}
.acc-card-btn:hover {
    background: var(--bamboo-light);
    border-color: var(--bamboo);
    color: var(--ink);
}
.acc-card-btn-payout {
    background: var(--jade-light);
    border-color: #b4d9c8;
    color: var(--jade);
}
.acc-card-btn-payout:hover {
    background: var(--jade);
    border-color: var(--jade);
    color: #fff;
}
.acc-card-btn-burn {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 0.88rem;
    opacity: 0.45;
    transition: opacity 0.18s, background 0.18s;
}
.acc-card-btn-burn:hover {
    opacity: 1;
    background: #fff0ee;
    border-color: #f5a0a0;
    color: var(--ink);
}
.acc-card-btn-burn.burn-btn-active {
    opacity: 1;
    background: #fff0ee;
    border-color: #f5a0a0;
}
.acc-card-btn-advance {
    background: #eef3ff;
    border-color: #c0cdee;
    color: #3b52a5;
    font-weight: 600;
}
.acc-card-btn-advance:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.advance-section {
    background: #fbfcfd;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.advance-section-label {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bamboo);
    font-weight: 600;
    margin-bottom: 10px;
}
.advance-firm-row {
    font-size: 0.85rem;
    color: var(--ink);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.advance-arrow-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 16px;
}
.advance-arrow-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}
.advance-arrow-badge {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3b52a5;
    background: #eef3ff;
    border: 1px solid #c0cdee;
    border-radius: 100px;
    padding: 4px 14px;
    white-space: nowrap;
}
.form-optional {
    font-size: 0.68rem;
    color: var(--bamboo);
    font-weight: 400;
    margin-left: 4px;
}

.acc-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* ─── TRADES STATS BANNER ─── */
.trades-stats-banner {
    background: var(--ink);
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    position: relative;
    overflow: hidden;
}
.trades-stats-banner::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--vermillion), transparent);
}

.trades-banner-account {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--bamboo-light);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    min-width: 140px;
}
.trades-banner-account i {
    color: var(--vermillion);
    font-size: 0.9rem;
}

.trades-banner-kpis {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    flex: 1;
}

.tbkpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 18px;
}

.tbkpi-divider {
    width: 1px;
    height: 32px;
    background: rgba(206,191,159,0.15);
    flex-shrink: 0;
}

.tbkpi-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(206,191,159,0.5);
    font-weight: 500;
}

.tbkpi-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bamboo-light);
}
.tbkpi-green { color: #4ade80 !important; }
.tbkpi-red   { color: #f87171 !important; }

/* ─── LANDING STATS ROW updates ─── */
.stat-item-wide {
    flex: 2 !important;
}
.stat-value-sm {
    font-size: 1rem !important;
    font-weight: 600;
    line-height: 1.3;
}

/* ─── PAYOUTS EMPTY STATE — forzar centrado dentro del grid ─── */
.payouts-grid > p,
.payouts-grid > .text-center {
    grid-column: 1 / -1;
    text-align: center !important;
    width: 100%;
}

/* ─── APP FOOTER ─── */
.app-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    background: var(--cream);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: auto;
}
.app-footer strong {
    color: var(--vermillion);
    font-weight: 600;
}
.app-footer-sep {
    opacity: 0.35;
}
.app-footer-copy {
    margin-left: auto;
    opacity: 0.6;
}

/* ─── MT5 EA INTEGRATION ─── */

/* Badge en la tabla de trades */
.trade-source-badge {
    display: inline-block;
    background: #1a3a5c;
    color: #7ab4e8;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #2a5080;
    vertical-align: middle;
    margin-left: 4px;
    font-family: 'Inter', sans-serif;
}

/* Panel de conexión MT5 en el modal */
.mt5-panel {
    border: 1px solid var(--jade-light);
    border-radius: 10px;
    background: linear-gradient(135deg, #f0fdf8 0%, #f8faff 100%);
    overflow: hidden;
}

.mt5-panel-header {
    background: linear-gradient(90deg, #0d2d1e, #0a2640);
    color: #7ab4e8;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    letter-spacing: 0.04em;
}

.mt5-panel-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mt5-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.mt5-step-num {
    width: 22px;
    height: 22px;
    background: var(--jade);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.mt5-step-content {
    flex: 1;
    min-width: 0;
}

.mt5-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mt5-key-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 4px;
}

.mt5-key-value {
    flex: 1;
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mt5-key-id {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--jade);
}

.mt5-btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 0.75rem;
    color: var(--bamboo);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.mt5-btn-icon:hover { background: var(--washi); color: var(--ink); border-color: var(--bamboo); }
.mt5-btn-regen { color: var(--vermillion); border-color: var(--crimson-light); }
.mt5-btn-regen:hover { background: var(--crimson-light); color: var(--lacquer); }

.mt5-hint {
    font-size: 0.72rem;
    color: var(--muted);
    font-style: italic;
}

.mt5-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--jade);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    margin-bottom: 8px;
}
.mt5-download-btn:hover { background: #0fa36a; color: white; }
.mt5-download-btn i { font-size: 0.75rem; }

.mt5-instructions-toggle {
    background: none;
    border: 1px solid var(--bamboo-light);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.68rem;
    color: var(--bamboo);
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}
.mt5-instructions-toggle:hover {
    background: var(--washi);
    color: var(--jade);
    border-color: var(--jade-light);
}

.mt5-setup-steps {
    margin-top: 8px;
    font-size: 0.74rem;
    color: var(--muted);
    line-height: 1.6;
    background: var(--washi);
    border: 1px solid var(--bamboo-light);
    border-radius: 6px;
    padding: 10px 12px;
}
.mt5-setup-steps p { margin: 3px 0; }
.mt5-setup-steps code {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.72rem;
    color: var(--vermillion);
}

/* ── Welcome Banner ─────────────────────────────────────────────────── */
.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(120deg, var(--ink) 0%, #1a2740 100%);
    border-radius: 16px;
    padding: 22px 28px;
    color: #fff;
    box-shadow: 0 4px 24px rgba(13,20,36,0.18);
}
.welcome-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.welcome-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: rgba(255,255,255,0.9);
    flex-shrink: 0;
}
.welcome-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #fff;
    line-height: 1.2;
}
.welcome-name {
    color: #fa8072;
}
.welcome-date {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    margin: 0;
    text-transform: capitalize;
}
.welcome-banner .btn-primary {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    flex-shrink: 0;
}
.welcome-banner .btn-primary:hover {
    background: rgba(255,255,255,0.22);
}
@media (max-width: 600px) {
    .welcome-banner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ── Weekly Performance ─────────────────────────────────────────────── */
.badge-week-range {
    font-size: 0.72rem;
    color: var(--bamboo);
    font-weight: 500;
    background: #f0f4fa;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px 10px;
}
.weekly-stats-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 14px;
}
.weekly-day-stat {
    text-align: center;
    padding: 8px 4px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.weekly-day-name {
    font-size: 0.66rem;
    color: var(--bamboo);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 4px;
}
.weekly-day-pnl {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--bamboo);
    margin-bottom: 3px;
}
.weekly-day-pnl.pos { color: var(--jade); }
.weekly-day-pnl.neg { color: var(--vermillion); }
.weekly-day-ops {
    font-size: 0.62rem;
    color: #aab4c4;
}

/* ── Actividad Reciente ─────────────────────────────────────────────── */
.actividad-list {
    max-height: 380px;
    overflow-y: auto;
}
.actividad-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.13s;
}
.actividad-item:last-child { border-bottom: none; }
.actividad-item:hover { background: #f7f9fc; }
.actividad-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.actividad-icon-pos {
    background: #e6faf2;
    color: var(--jade);
}
.actividad-icon-neg {
    background: #fff0ee;
    color: var(--vermillion);
}
.actividad-info {
    flex: 1;
    min-width: 0;
}
.actividad-asset {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.actividad-date {
    font-size: 0.72rem;
    color: var(--bamboo);
    margin-top: 2px;
}
.actividad-pnl {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}
.actividad-pnl.pos { color: var(--jade); }
.actividad-pnl.neg { color: var(--vermillion); }

/* ─── ESTADÍSTICAS: sesión win rate row ─── */
.session-wr-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 0 4px;
}
.session-wr-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    background: var(--washi);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
}
.session-wr-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.session-wr-label {
    font-weight: 500;
    color: var(--ink);
}
.session-wr-val {
    font-weight: 700;
    font-size: 0.78rem;
}
.session-wr-val.pos { color: var(--jade); }
.session-wr-val.neg { color: var(--vermillion); }

/* kpi-grid-4 explicit override */
.kpi-grid.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .kpi-grid.kpi-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .kpi-grid.kpi-grid-4 { grid-template-columns: 1fr; } }

/* ─── FIRMA SUMMARY TABLE ─── */
.firm-summary-table th,
.firm-summary-table td {
    font-size: 0.82rem;
    padding: 10px 14px;
    vertical-align: middle;
}
.firm-summary-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: var(--washi);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.firm-summary-table td { border-bottom: 1px solid var(--border); }
.firm-summary-table tbody tr:last-child td { border-bottom: none; }
.firm-summary-table tbody tr:hover { background: var(--washi); }
.firm-summary-name {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.85rem;
}
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* Badge de tasa P1 */
.p1-rate-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.p1-badge-green  { background: var(--jade-light);    color: var(--jade);      border: 1px solid #88d8b8; }
.p1-badge-orange { background: #fff3e0;              color: #c07800;          border: 1px solid #f5c880; }
.p1-badge-gray   { background: var(--storm-light);   color: var(--muted);     border: 1px solid var(--border); }

/* ─── CSV IMPORT MODAL ─── */
.import-format-list {
    list-style: none;
    padding: 0;
    margin: 0 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.import-format-list li {
    font-size: 0.82rem;
    color: var(--ink);
    padding: 7px 12px;
    background: var(--washi);
    border: 1px solid var(--border);
    border-radius: 8px;
    border-left: 3px solid var(--vermillion);
}
.csv-drop-zone {
    border: 2px dashed var(--border-dark);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--washi);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.csv-drop-zone:hover,
.csv-drop-zone.drop-active {
    border-color: var(--vermillion);
    background: var(--crimson-light);
}
.import-result {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.83rem;
    line-height: 1.5;
    margin-top: 4px;
}
.import-result-ok  { background: var(--jade-light);    border: 1px solid #88d8b8;       color: var(--ink); }
.import-result-err { background: var(--crimson-light); border: 1px solid #f0b0a8;       color: var(--ink); }

/* ──────────────────────────────────────────────────────
   BOTÓN FLOTANTE DE HISTORIAL DE ACCIONES
   ────────────────────────────────────────────────────── */
.history-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--ink);
    border: 1.5px solid rgba(192,208,232,0.25);
    color: var(--bamboo);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    box-shadow: 0 4px 16px rgba(13,20,36,0.35);
    transition: background 0.18s, border-color 0.18s, transform 0.15s;
    font-size: 1rem;
}
.history-fab:hover {
    background: var(--lacquer);
    border-color: var(--vermillion);
    color: #fff;
    transform: scale(1.08);
}

/* Popup del historial */
.history-popup {
    position: fixed;
    bottom: 84px;
    right: 28px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: var(--ink);
    border: 1px solid rgba(192,208,232,0.18);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(13,20,36,0.55);
    z-index: 901;
    overflow: hidden;
    display: none;
    animation: historySlideIn 0.22s cubic-bezier(0.34,1.18,0.64,1) both;
}
.history-popup.open { display: block; }

@keyframes historySlideIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.history-popup-header {
    padding: 14px 18px 12px;
    border-bottom: 1px solid rgba(192,208,232,0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.history-popup-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bamboo-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.history-popup-close {
    background: none;
    border: none;
    color: var(--bamboo);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    line-height: 1;
    padding: 2px 4px;
    transition: opacity 0.15s;
}
.history-popup-close:hover { opacity: 1; }

.history-popup-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 6px 0;
}
.history-popup-list::-webkit-scrollbar { width: 4px; }
.history-popup-list::-webkit-scrollbar-track { background: transparent; }
.history-popup-list::-webkit-scrollbar-thumb { background: rgba(192,208,232,0.2); border-radius: 4px; }

.history-item {
    padding: 11px 18px;
    border-bottom: 1px solid rgba(192,208,232,0.07);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.history-item:last-child { border-bottom: none; }

.history-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.history-icon-create { background: rgba(18,184,120,0.15); color: var(--jade); }
.history-icon-update { background: rgba(120,144,176,0.15); color: var(--bamboo); }
.history-icon-delete { background: rgba(232,92,74,0.15);  color: var(--vermillion); }

.history-item-body { flex: 1; min-width: 0; }
.history-item-desc {
    font-size: 0.82rem;
    color: var(--bamboo-light);
    line-height: 1.4;
    word-break: break-word;
}
.history-item-time {
    font-size: 0.7rem;
    color: var(--bamboo);
    opacity: 0.6;
    margin-top: 2px;
}
.history-undo-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(232,92,74,0.4);
    color: var(--vermillion);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    margin-top: 2px;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.history-undo-btn:hover {
    background: rgba(232,92,74,0.12);
    border-color: var(--vermillion);
}
.history-undo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.history-empty {
    padding: 28px 18px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--bamboo);
    opacity: 0.55;
}
.history-loading {
    padding: 24px 18px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--bamboo);
    opacity: 0.5;
}

@media (max-width: 480px) {
    .history-popup { width: calc(100vw - 24px); right: 12px; }
    .history-fab   { bottom: 18px; right: 18px; }
}

/* ── Selección en lote de trades ── */
.col-check {
    width: 36px;
    padding: 0 8px !important;
    text-align: center;
    vertical-align: middle;
}
.trade-check {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--vermillion);
}
tr.row-selected {
    background: rgba(232,92,74,0.06) !important;
}
tr.row-selected td {
    border-color: rgba(232,92,74,0.15);
}

/* Barra de acciones en lote */
.batch-action-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: var(--ink);
    color: #e8f0fa;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(13,20,36,0.45);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: bottom 0.28s cubic-bezier(0.34,1.56,0.64,1);
    white-space: nowrap;
    font-size: 0.88rem;
    min-width: 360px;
}
.batch-action-bar.visible {
    bottom: 28px;
}
.batch-bar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    flex: 1;
}
.batch-bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.batch-bar-actions .btn {
    font-size: 0.82rem;
    padding: 6px 14px;
}
@media (max-width: 600px) {
    .batch-action-bar {
        min-width: calc(100vw - 32px);
        border-radius: 8px;
        padding: 10px 14px;
    }
    .batch-action-bar.visible { bottom: 16px; }
}

/* ══════════════════════════════════════════════════
   STATISTICS PAGE — redesign
   ══════════════════════════════════════════════════ */

/* 2-column layout for sessions + scatter */
.stats-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 860px) {
    .stats-two-col { grid-template-columns: 1fr; }
}

/* Equity card header badges */
.stat-eq-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.eq-badge-label {
    font-size: 0.7rem;
    color: var(--bamboo);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.eq-badge-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}

/* Win Rate bar inside KPI card */
.stat-winbar-wrap {
    background: var(--border);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
    margin-top: 4px;
    width: 100%;
}
.stat-winbar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s;
}

/* Session stat grid */
.session-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.session-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--washi);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}
.session-stat-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.session-stat-body {
    flex: 1;
    min-width: 0;
}
.session-stat-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.session-stat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--bamboo);
    margin: 2px 0;
}
.session-stat-pct {
    font-weight: 600;
    color: var(--ink);
}
.session-stat-wr-wrap {
    background: var(--border);
    border-radius: 4px;
    height: 3px;
    overflow: hidden;
    margin: 4px 0 2px;
}
.session-stat-wr-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.session-stat-wr-label {
    font-size: 0.7rem;
    color: var(--bamboo);
}
.session-stat-wr-label strong {
    color: var(--ink);
}

/* Trade scatter legend */
.dist-legend-row {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.dist-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--bamboo);
}
.dist-leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Asset performance table */
.asset-perf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.asset-perf-table thead tr {
    border-bottom: 1px solid var(--border);
}
.asset-perf-table th {
    padding: 10px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bamboo);
    white-space: nowrap;
}
.asset-perf-table td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(218,224,236,0.5);
    vertical-align: middle;
}
.asset-perf-table tbody tr:last-child td { border-bottom: none; }
.asset-perf-table tbody tr:hover td { background: rgba(242,245,250,0.6); }
.asset-name {
    font-size: 0.85rem;
    color: var(--ink);
    font-weight: 600;
}
.asset-count-badge {
    display: inline-block;
    background: var(--washi);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink);
}
.asset-wr-wrap {
    background: var(--border);
    border-radius: 4px;
    height: 5px;
    overflow: hidden;
    margin-bottom: 3px;
    min-width: 80px;
}
.asset-wr-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.asset-wr-label {
    font-size: 0.75rem;
    font-weight: 600;
}
.asset-pnl-bar-wrap {
    background: var(--border);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    min-width: 120px;
}
.asset-pnl-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.asset-pnl-bar.pos { background: #12b878; }
.asset-pnl-bar.neg { background: #e85c4a; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-600      { font-weight: 600; }

/* Empty state generic */
.stat-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--bamboo);
    font-size: 0.88rem;
}

/* ── Navegación del calendario ─────────────────────────────── */
.cal-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--washi);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
}
.cal-nav-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--ink);
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: background 0.14s, color 0.14s;
    flex-shrink: 0;
}
.cal-nav-btn:hover {
    background: var(--border);
    color: var(--ink);
}
.cal-nav-today {
    height: 30px;
    padding: 0 13px;
    border: none;
    background: transparent;
    color: var(--ink);
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.14s;
    white-space: nowrap;
}
.cal-nav-today:hover { background: var(--border); }

/* ══════════════════════════════════════════════════
   ADMIN NOTIFICATIONS + BETA APPROVE
   ══════════════════════════════════════════════════ */

/* Dot badge on sidebar admin nav link */
.admin-notif-dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: var(--vermillion);
    border-radius: 50%;
    margin-left: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(232,92,74,0.25);
    animation: notifPulse 2s infinite;
}
@keyframes notifPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(232,92,74,0.25); }
    50%       { box-shadow: 0 0 0 4px rgba(232,92,74,0.10); }
}

/* Notification bar inside admin panel */
.admin-notif-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(102,153,204,0.08), rgba(232,92,74,0.06));
    border: 1px solid rgba(102,153,204,0.2);
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 20px;
    transition: opacity 0.3s, transform 0.3s;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-notif-items {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.admin-notif-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83rem;
    color: var(--ink);
    padding: 0 16px;
}
.admin-notif-item:first-child { padding-left: 0; }
.admin-notif-sep {
    width: 1px; height: 18px;
    background: var(--border);
}
.admin-notif-dismiss {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bamboo);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s, color 0.14s;
}
.admin-notif-dismiss:hover { background: var(--washi); color: var(--ink); }

/* Toast notifications */
.admin-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(13,20,36,0.18);
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.admin-toast.visible {
    opacity: 1;
    transform: translateX(0);
}
.admin-toast-success {
    background: var(--ink);
    color: #e8f0fa;
    border: 1px solid rgba(120,144,176,0.2);
}
.admin-toast-error {
    background: #4a1515;
    color: #fdd;
    border: 1px solid rgba(232,92,74,0.3);
}

/* Status badges (shared admin use) */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-approved {
    background: rgba(18,184,120,0.1);
    color: var(--jade);
    border: 1px solid rgba(18,184,120,0.25);
}
.status-rejected {
    background: rgba(232,92,74,0.1);
    color: var(--vermillion);
    border: 1px solid rgba(232,92,74,0.2);
}
.status-pending {
    background: rgba(240,168,68,0.12);
    color: #b07800;
    border: 1px solid rgba(240,168,68,0.3);
}

/* Beta pending badge */
.beta-pending-badge {
    background: var(--vermillion);
    color: #fff;
    font-size: 0.76rem;
    padding: 4px 12px;
    border-radius: 50px;
}

/* Beta link cell */
.beta-link-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--washi);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px 4px 10px;
    max-width: 240px;
}
.beta-link-text {
    font-size: 0.7rem;
    color: var(--bamboo);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    cursor: text;
    user-select: all;
}
.beta-copy-btn {
    border: none;
    background: transparent;
    color: var(--bamboo);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.78rem;
    flex-shrink: 0;
    transition: color 0.2s;
}
.beta-copy-btn:hover { color: var(--ink); }

/* Approve button */
.btn-approve-beta {
    background: rgba(18,184,120,0.1);
    color: var(--jade);
    border: 1px solid rgba(18,184,120,0.3);
}
.btn-approve-beta:hover { background: rgba(18,184,120,0.18); }

/* Beta row exit animation */
.beta-row {
    transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease;
    max-height: 200px;
    overflow: hidden;
}
.beta-row-exit {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
}

/* ══════════════════════════════════════════════════
   CALENDAR REWORK
   ══════════════════════════════════════════════════ */

/* Card wrapper */
.cal-card { overflow: hidden; }

/* Header */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
}
.cal-header-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.cal-month-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}
.cal-month-year-sub {
    font-size: 0.85rem;
    color: var(--bamboo);
    font-weight: 400;
}

/* KPI strip */
.cal-kpi-strip {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--washi);
    border-bottom: 1px solid var(--border);
    gap: 0;
    flex-wrap: wrap;
}
.cal-kpi-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 18px;
    flex: 1;
    min-width: 100px;
}
.cal-kpi-item:first-child { padding-left: 4px; }
.cal-kpi-icon {
    font-size: 0.9rem;
    opacity: 0.8;
    flex-shrink: 0;
}
.cal-kpi-label {
    font-size: 0.68rem;
    color: var(--bamboo);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 2px;
}
.cal-kpi-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}
.cal-kpi-sep {
    width: 1px;
    height: 30px;
    background: var(--border);
    flex-shrink: 0;
}

/* Calendar table */
.calendar th.cal-weekend-head {
    color: rgba(120,144,176,0.6);
}
.calendar td.cal-weekend {
    background: rgba(120,144,176,0.03);
}
.calendar td.cal-weekend.other-month {
    background: rgba(120,144,176,0.06);
}

/* Today dot indicator */
.cal-today-dot {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--vermillion);
}

/* Today cell — coral date number */
.calendar .today .date { color: var(--vermillion); font-weight: 700; }

/* Day detail panel */
.cal-day-card {}
.cal-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
}
.cal-day-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.cal-day-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(13,20,36,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--ink);
    flex-shrink: 0;
}
.cal-day-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    text-transform: capitalize;
}
.cal-day-sub {
    font-size: 0.75rem;
    color: var(--bamboo);
    margin-top: 2px;
}
.cal-day-pnl-badge {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}
.cal-day-pnl-badge.pnl-pos {
    background: rgba(18,184,120,0.12);
    color: var(--jade);
    border: 1px solid rgba(18,184,120,0.3);
}
.cal-day-pnl-badge.pnl-neg {
    background: rgba(232,92,74,0.10);
    color: var(--vermillion);
    border: 1px solid rgba(232,92,74,0.25);
}

/* Day trades table */
.cal-day-table { margin: 0; }
.cal-day-table thead th {
    font-size: 0.72rem;
    padding: 10px 16px;
}
.cal-day-table tbody td { padding: 11px 16px; }

/* Session pill in calendar day table */
.session-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--washi);
    border: 1px solid var(--border);
    color: var(--bamboo);
}
