/* =========================================================
   ATHENA — INVESTMENT INTELLIGENCE
   v2.0 | Premium Financial Terminal UI
   ========================================================= */

/* ==============================
   DESIGN TOKENS
   ============================== */

:root {
    /* === BACKGROUNDS === */
    --bg-base:       #020817;
    --bg-surface:    #0b1120;
    --bg-elevated:   #111c34;
    --bg-card:       rgba(11, 17, 32, 0.70);
    --bg-card-hover: rgba(17, 30, 58, 0.90);
    --sidebar-bg:    #0b1120;

    /* === BORDERS === */
    --border-subtle:  rgba(148, 163, 184, 0.05);
    --border-default: rgba(148, 163, 184, 0.10);
    --border-strong:  rgba(148, 163, 184, 0.22);
    --border-accent:  rgba(56, 189, 248, 0.30);

    /* === CORE ACCENTS === */
    --accent-primary:       #38bdf8;   /* sky-400  */
    --accent-primary-dim:   #0ea5e9;   /* sky-500  */
    --accent-secondary:     #a78bfa;   /* violet-400 */
    --accent-secondary-dim: #7c3aed;   /* violet-600 */
    --accent-gold:          #fbbf24;   /* amber-400 */
    --accent-gold-dim:      #d97706;   /* amber-600 */

    /* === SEMANTIC === */
    --color-success:        #34d399;
    --color-success-bg:     rgba(52, 211, 153, 0.10);
    --color-success-border: rgba(52, 211, 153, 0.22);
    --color-warning:        #fbbf24;
    --color-warning-bg:     rgba(251, 191, 36, 0.10);
    --color-warning-border: rgba(251, 191, 36, 0.22);
    --color-danger:         #f87171;
    --color-danger-bg:      rgba(248, 113, 113, 0.10);
    --color-danger-border:  rgba(248, 113, 113, 0.22);
    --color-neutral:        #64748b;

    /* === TEXT === */
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary:  #6e7f96; /* WCAG AA: ~4.9:1 on #020817 */
    --text-accent:    #38bdf8;

    /* === BACKWARD COMPAT ALIASES === */
    --color-text-main:  var(--text-primary);
    --color-text-muted: var(--text-secondary);
    --bg-dark:          var(--bg-base);
    --bg-darker:        var(--bg-base);
    --card-bg:          var(--bg-card);
    --card-border:      var(--border-default);
    --card-hover:       var(--bg-card-hover);
    --accent-blue:      var(--accent-primary-dim);
    --accent-purple:    var(--accent-secondary-dim);
    --accent-glow:      rgba(14, 165, 233, 0.4);
    --accent-green:     var(--color-success);

    /* === GEOMETRY === */
    --radius-xs:   4px;
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-full: 9999px;

    /* === SHADOWS === */
    --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md:   0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg:   0 20px 60px rgba(0, 0, 0, 0.55);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.30), 0 1px 3px rgba(0, 0, 0, 0.40);

    /* === TRANSITIONS === */
    --ease-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-smooth: 260ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Legacy compat */
    --transition-fast:   var(--ease-fast);
    --transition-smooth: var(--ease-smooth);

    /* === SPACING SCALE (4px base unit) === */
    --space-0:    0px;
    --space-1:    4px;
    --space-2:    8px;
    --space-3:    12px;
    --space-4:    16px;
    --space-5:    20px;
    --space-6:    24px;
    --space-8:    32px;
    --space-10:   40px;
    --space-12:   48px;
    --space-16:   64px;
    --space-20:   80px;

    /* === TYPOGRAPHY SCALE === */
    --font-size-2xs:  9px;
    --font-size-xs:  11px;
    --font-size-sm:  12px;
    --font-size-md:  13px;   /* body default */
    --font-size-base: 14px;
    --font-size-lg:  15px;
    --font-size-xl:  16px;
    --font-size-2xl: 18px;
    --font-size-3xl: 20px;
    --font-size-4xl: 24px;
    --font-size-5xl: 28px;
    --font-size-6xl: 32px;
    --font-size-display: 48px;

    /* === FONT WEIGHTS === */
    --font-regular:   400;
    --font-medium:    500;
    --font-semibold:  600;
    --font-bold:      700;
    --font-extrabold: 800;
    --font-black:     900;

    /* === LINE HEIGHTS === */
    --leading-none:    1;
    --leading-tight:   1.25;
    --leading-snug:    1.375;
    --leading-normal:  1.5;
    --leading-relaxed: 1.625;

    /* === Z-INDEX SCALE === */
    --z-below:    -1;
    --z-base:      0;
    --z-raised:    1;
    --z-sidebar:  10;
    --z-overlay:  20;
    --z-dropdown: 40;
    --z-sticky:   50;
    --z-modal:   100;
    --z-toast:  1000;
    --z-alert:  9000;
    --z-supreme: 9999;

    /* === LAYOUT DIMENSIONS === */
    --sidebar-width:    300px;
    --topbar-height:     64px;
    --content-max-width: 1600px;

    /* === COMPONENT TOKENS — BUTTONS === */
    --btn-height-sm:   30px;
    --btn-height-md:   38px;
    --btn-height-lg:   44px;
    --btn-radius:      var(--radius-sm);
    --btn-font-size:   var(--font-size-md);
    --btn-font-weight: var(--font-semibold);

    /* === COMPONENT TOKENS — INPUTS === */
    --input-height:       38px;
    --input-padding:      10px 14px;
    --input-font-size:    var(--font-size-md);
    --input-radius:       var(--radius-sm);
    --input-border:       var(--border-default);
    --input-focus-ring:   rgba(56, 189, 248, 0.10);

    /* === COMPONENT TOKENS — BADGES === */
    --badge-height-sm:   20px;
    --badge-height-md:   24px;
    --badge-padding-sm:  0 6px;
    --badge-padding-md:  0 10px;
    --badge-font-size:   var(--font-size-xs);
    --badge-font-weight: var(--font-semibold);
    --badge-radius:      var(--radius-full);

    /* === COMPONENT TOKENS — CARDS === */
    --card-padding:  var(--space-4);
    --card-radius:   var(--radius-md);
    --card-bg:       var(--bg-card);
    --card-border:   var(--border-default);
}

/* ==============================
   RESET & BASE
   ============================== */

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

/* U04 — Accesibilidad: focus visible para navegación teclado */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--color-sky, #38bdf8);
    outline-offset: 2px;
    border-radius: 4px;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'cv01', 'cv02', 'ss01';
    background-color: var(--bg-base);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    background-image:
        radial-gradient(ellipse 70% 60% at 5%  70%, rgba(56, 189, 248, 0.055), transparent),
        radial-gradient(ellipse 55% 55% at 95% 15%, rgba(167, 139, 250, 0.065), transparent),
        radial-gradient(ellipse 40% 40% at 50% 100%, rgba(14, 165, 233, 0.035), transparent);
    background-attachment: fixed;
}

/* ── Monospace font for financial numbers ─────────────────── */
.font-mono,
.kpi-value, .metric-data, .score-cat-val,
.company-score-sub, .fg-value, .kpi-badge,
.wl-item-metric strong, .scr-td-num, .cmp-metric-val,
.lp-stat-num, .lp-number-val {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

/* ==============================
   SCROLLBAR
   ============================== */

::-webkit-scrollbar           { width: 5px; height: 5px; }
::-webkit-scrollbar-track     { background: transparent; }
::-webkit-scrollbar-thumb     { background: rgba(255,255,255,0.08); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,0.16); }

/* ==============================
   LAYOUT
   ============================== */

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ==============================
   SIDEBAR
   ============================== */

.sidebar {
    width: 300px;
    min-width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 1px 0 0 var(--border-subtle), 6px 0 28px rgba(0,0,0,0.3);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

/* --- Logo --- */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.logo i {
    font-size: 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.45));
}

.logo span {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Search --- */
.search-container {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 13px;
    pointer-events: none;
}

.search-container input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-default);
    padding: 10px 14px 10px 36px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--ease-smooth);
    font-family: inherit;
}

.search-container input::placeholder { color: var(--text-tertiary); }

.search-container input:focus {
    border-color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.04);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.10);
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(9, 14, 24, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.42);
    padding: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.search-suggestions.hidden {
    display: none;
}

.search-suggestion-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--ease-smooth), border-color var(--ease-smooth), transform var(--ease-smooth);
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.18);
    transform: translateY(-1px);
}

.search-suggestion-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.search-suggestion-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-suggestion-avatar span {
    display: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #e2e8f0;
    text-transform: uppercase;
}

.search-suggestion-avatar.fallback span {
    display: inline-flex;
}

.search-suggestion-body {
    min-width: 0;
    flex: 1;
}

.search-suggestion-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}

.search-suggestion-ticker {
    font-size: 12px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.06em;
}

.search-suggestion-name {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-meta {
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.search-suggestion-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.search-badge-supported {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.18);
}

.search-badge-restore {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.18);
}

.search-badge-onboard {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.18);
}

.search-badge-coming {
    background: rgba(167, 139, 250, 0.12);
    color: #c4b5fd;
    border: 1px solid rgba(167, 139, 250, 0.18);
}

.search-suggestion-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* --- Portfolio Tabs --- */
.portfolio-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
    margin-top: 0;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    padding: 7px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--ease-smooth);
    font-family: inherit;
    text-transform: uppercase;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent-primary-dim), var(--accent-secondary-dim));
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Sidebar Utility Buttons --- */
.sidebar-btn-db {
    width: 100% !important;
    margin-top: 12px !important;
    font-size: 11px !important;
    background: rgba(56, 189, 248, 0.07) !important;
    border-color: rgba(56, 189, 248, 0.18) !important;
    color: var(--accent-primary) !important;
    letter-spacing: 0.2px;
}

.sidebar-btn-bulk {
    width: 100% !important;
    margin-top: 6px !important;
    font-size: 11px !important;
}

/* --- Companies List --- */
.companies-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* --- Company Item --- */
.company-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 0;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--ease-smooth), border-color var(--ease-smooth), transform var(--ease-smooth), box-shadow var(--ease-smooth);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.company-item::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 0 2px 2px 0;
    transform: scaleY(0);
    transition: transform var(--ease-smooth);
    transform-origin: center;
}

.company-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-subtle);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.20);
}

.company-item:hover::before { transform: scaleY(0.5); opacity: 0.6; }

.company-item.active {
    background: rgba(56, 189, 248, 0.07);
    border-color: var(--border-accent);
}

.company-item.active::before { transform: scaleY(1); }

/* Stagger entry animation for sidebar items */
@keyframes itemFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}
.company-item {
    animation: itemFadeIn 0.22s ease both;
}
.company-item:nth-child(1)  { animation-delay: 0.00s; }
.company-item:nth-child(2)  { animation-delay: 0.03s; }
.company-item:nth-child(3)  { animation-delay: 0.06s; }
.company-item:nth-child(4)  { animation-delay: 0.09s; }
.company-item:nth-child(5)  { animation-delay: 0.12s; }
.company-item:nth-child(6)  { animation-delay: 0.15s; }
.company-item:nth-child(7)  { animation-delay: 0.18s; }
.company-item:nth-child(8)  { animation-delay: 0.21s; }
.company-item:nth-child(9)  { animation-delay: 0.24s; }
.company-item:nth-child(10) { animation-delay: 0.27s; }

.company-avatar {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    margin-top: 2px;
}

.company-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-avatar span {
    display: none;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #e2e8f0;
    text-transform: uppercase;
}

.company-avatar.fallback span {
    display: inline-flex;
}

.company-header {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.company-ticker {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Company type tags */
.company-tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-pilar   { background: rgba(56,189,248,0.12);  color: var(--accent-primary);  border: 1px solid rgba(56,189,248,0.22); }
.tag-fija    { background: rgba(52,211,153,0.12);  color: var(--color-success);   border: 1px solid rgba(52,211,153,0.22); }
.tag-default { background: rgba(100,116,139,0.10); color: var(--text-secondary);  border: 1px solid rgba(100,116,139,0.18); }

/* Score badge in sidebar */
.company-score-sub {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    background: rgba(56, 189, 248, 0.09);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.18);
    white-space: nowrap;
}

/* ── Semantic score color classes ─────────────────────────── */
.score-excellent {
    background: rgba(52, 211, 153, 0.10) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}
.score-good {
    background: rgba(251, 191, 36, 0.10) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.25) !important;
}
.score-poor {
    background: rgba(248, 113, 113, 0.10) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}
.score-null {
    background: rgba(100, 116, 139, 0.08) !important;
    color: var(--text-muted) !important;
    border-color: rgba(100, 116, 139, 0.18) !important;
}

.company-name {
    grid-column: 2;
    grid-row: 2;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.3;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.btn-refresh {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* ==============================
   MAIN CONTENT
   ============================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

/* ==============================
   TOPBAR
   ============================== */

.topbar {
    min-height: 64px;
    padding: 12px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(11, 17, 32, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 5;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 720px;
    flex-wrap: wrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

#header-company-name {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 320px;
    flex: 0 1 320px;
}

/* ==============================
   BADGES
   ============================== */

.badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-outline {
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    background: transparent;
}

/* ==============================
   FEAR & GREED WIDGET
   ============================== */

.market-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-default);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    transition: border-color var(--ease-smooth);
}

.market-widget:hover { border-color: var(--border-strong); }

.fg-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.fg-title {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
}

.fg-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.fg-dial-container i {
    font-size: 22px;
    color: var(--text-secondary);
}

.fg-details {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    padding: 16px;
    flex-direction: column;
    gap: 8px;
    width: 230px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.market-widget:hover .fg-details { display: flex; }

.fg-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.fg-detail-item:last-child { border-bottom: none; padding-bottom: 0; }
.fg-detail-label { color: var(--text-secondary); }

/* ==============================
   NOTIFICATION WIDGET
   ============================== */

.notification-widget {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--ease-fast);
    font-size: 14px;
}

.notification-widget:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.notif-badge {
    position: absolute;
    top: -3px; right: -3px;
    background: var(--color-danger);
    color: white;
    font-size: 9px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
    animation: pulse 2s infinite;
    z-index: 1;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(248, 113, 113, 0.8), 0 0 30px rgba(248, 113, 113, 0.4);
    }
    100% {
        box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
    }
}

.notif-badge.high-count {
    background: linear-gradient(135deg, #f87171, #ef4444);
    animation: pulse-high 1.5s infinite;
}

@keyframes pulse-high {
    0% {
        box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(248, 113, 113, 0.9), 0 0 40px rgba(248, 113, 113, 0.5);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
        transform: scale(1);
    }
}

.notification-widget.has-notifications {
    color: var(--accent-primary);
    border-color: rgba(56, 189, 248, 0.3);
}

.notification-widget.has-notifications:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.5);
}

.notification-widget.has-critical {
    color: var(--color-danger);
    border-color: rgba(248, 113, 113, 0.3);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-5deg); }
    80% { transform: rotate(5deg); }
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    backdrop-filter: blur(20px);
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

.notif-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-title {
    font-size: 12px;
    font-weight: 700;
}

.notif-header-actions {
    display: flex;
    gap: 8px;
}

.notif-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: var(--ease-fast);
}

.notif-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.notif-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.notif-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ease-fast);
    text-align: center;
    position: relative;
}

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

.notif-tab.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.notif-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
}

.notif-tab-badge {
    background: var(--color-danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 4px;
}

.notif-body {
    max-height: 400px;
    overflow-y: auto;
    min-height: 200px;
}

.notif-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.notif-empty-state i {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--text-tertiary);
}

.notif-empty-state p {
    font-size: 13px;
    margin-top: 8px;
}

/* Estilos para notificaciones individuales */
.notif-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--ease-fast);
    position: relative;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.notif-item.unread {
    background: rgba(56, 189, 248, 0.05);
    border-left: 3px solid var(--accent-primary);
}

.notif-item.critical {
    background: rgba(248, 113, 113, 0.05);
    border-left: 3px solid var(--color-danger);
}

.notif-item.warning {
    background: rgba(251, 191, 36, 0.05);
    border-left: 3px solid var(--color-warning);
}

.notif-item.info {
    background: rgba(56, 189, 248, 0.05);
    border-left: 3px solid var(--accent-primary);
}

.notif-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 6px;
}

.notif-title-row {
    flex: 1;
}

.notif-ticker {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.notif-type-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-severity {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.notif-severity.critical {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.notif-severity.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.notif-severity.info {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.notif-time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.notif-message {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.notif-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notif-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--ease-fast);
}

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

.notif-btn.primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.notif-btn.primary:hover {
    background: var(--accent-primary-dim);
}

.notif-btn.danger {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
}

.notif-btn.danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.notif-meta {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 6px;
    display: flex;
    gap: 12px;
}

.notif-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notif-meta-item i {
    font-size: 9px;
}

/* Estilos para grupos de notificaciones */
.notif-group-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-group-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.notif-group-header[data-type="critical"] .notif-group-icon {
    background: var(--color-danger);
}

.notif-group-header[data-type="financial_imbalance"] .notif-group-icon {
    background: var(--color-warning);
}

.notif-group-header[data-type="earnings"] .notif-group-icon {
    background: var(--accent-gold);
}

.notif-group-header[data-type="unmapped"] .notif-group-icon {
    background: #22c55e;
}

.notif-group-count {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ==============================
   DASHBOARD SCROLL AREA
   ============================== */

.dashboard-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 32px;
    position: relative;
}

.hidden { display: none !important; }

/* ==============================
   DASHBOARD GRID
   ============================== */

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==============================
   GLASS CARDS
   ============================== */

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    transition: border-color var(--ease-smooth), box-shadow var(--ease-smooth);
}

.glass-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.full-width-panel { width: 100%; }

/* ==============================
   GLOBAL DASHBOARD — ACCORDION
   ============================== */

.gd-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Cada sección accordion */
.gd-section {
    overflow: hidden;
    transition: border-color var(--ease-smooth);
}

/* Header clickeable */
.gd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    gap: 12px;
}

.gd-section-header:hover .gds-chevron {
    color: var(--accent-sky, #38bdf8);
}

.gds-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.gds-title > i {
    font-size: 14px;
    color: #38bdf8;
    width: 16px;
    flex-shrink: 0;
}

.gds-title > span:first-of-type {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.gds-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gds-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.gds-chevron {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.25s ease, color 0.15s;
    flex-shrink: 0;
}

/* Cuerpo colapsable */
.gd-section-body {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease;
    opacity: 1;
    margin-top: 16px;
}

/* Collapsed state */
.gd-section.gd-collapsed .gd-section-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.gd-section.gd-collapsed .gds-chevron {
    transform: rotate(-90deg);
}

/* Legacy — mantener para backward compat */
.global-dash-header {
    text-align: center;
    padding: 4px 0 20px;
}
.global-dash-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.global-dash-header h2 i { color: var(--accent-primary); }
.global-dash-header p { color: var(--text-secondary); margin-top: 6px; font-size: 13px; }

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card {
    height: 360px;
    display: flex;
    flex-direction: column;
}

.chart-card-inner {
    flex: 1;
    width: 100%;
    position: relative;
    min-height: 0;
}

.chart-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-title i { color: var(--accent-primary); font-size: 12px; }

/* ==============================
   KPI ROW
   ============================== */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
}

.kpi-header {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.kpi-subtext {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* 52-Week Range Sparkline */
.sparkline-52w {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}
.sparkline-52w-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.sparkline-52w-track {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: visible;
}
.sparkline-52w-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #7c3aed);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.sparkline-52w-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #38bdf8;
    box-shadow: 0 0 6px rgba(56,189,248,0.7);
    transition: left 0.4s ease;
}
.sparkline-52w-pct {
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: right;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* ── Projection Chart Card ───────────────────────────────────────────────── */
.proj-chart-card {
    padding: 20px 24px 16px;
    margin-bottom: 16px;
}
.proj-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}
.proj-chart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
.proj-chart-title i {
    color: #38bdf8;
    font-size: 14px;
}
.proj-chart-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-left: 4px;
}
.proj-chart-legend {
    display: flex;
    gap: 16px;
    align-items: center;
}
.proj-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}
.proj-legend-hist .proj-legend-dot   { background: #38bdf8; }
.proj-legend-future .proj-legend-dot { background: #22c55e; }
.proj-legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.proj-legend-future-hidden { display: none; }
.proj-chart-wrap {
    position: relative;
    height: 220px;
    min-height: 220px;
}
.proj-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px;
    color: var(--text-secondary);
    text-align: left;
    background: rgba(15, 23, 42, 0.58);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 8px;
}
.proj-chart-empty i {
    color: #f59e0b;
    font-size: 24px;
}
.proj-chart-empty strong {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 4px;
}
.proj-chart-empty span {
    display: block;
    max-width: 420px;
    font-size: 12px;
    line-height: 1.5;
}
.no-forecast-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(34,197,94,0.07);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 10px;
}
.nf-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(34,197,94,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    font-size: 14px;
}
.nf-body { flex: 1; min-width: 0; }
.nf-title {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}
.nf-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.proj-tos-notice {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 6px;
    line-height: 1.4;
    opacity: 0.7;
}
.btn-proj-sync {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.4);
    border-radius: 8px;
    color: #22c55e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
}
.btn-proj-sync:hover  { background: rgba(34,197,94,0.25); }
.btn-proj-sync:active { transform: scale(0.97); }
.btn-proj-sync:disabled { opacity: 0.5; cursor: not-allowed; }
.nf-ticker-badge {
    display: inline-block;
    background: rgba(34,197,94,0.2);
    color: #22c55e;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.nf-steps {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.nf-steps span {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.nf-step-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(34,197,94,0.2);
    color: #22c55e;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
}
.nf-steps code {
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10px;
    color: #94a3b8;
}

/* Mini 52-week bar for Master DB table */
.mini-52w {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 90px;
}
.mini-52w-bar {
    position: relative;
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    min-width: 50px;
}
.mini-52w-fill {
    position: absolute;
    left: 0; top: 0; height: 100%;
    background: linear-gradient(90deg, #38bdf8, #7c3aed);
    border-radius: 2px;
}
.mini-52w-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #38bdf8;
    box-shadow: 0 0 4px rgba(56,189,248,0.6);
}
.mini-52w-pct {
    font-size: 10px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kpi-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
}

/* Athena Score card */
.highlight-card {
    background: linear-gradient(
        135deg,
        rgba(56, 189, 248, 0.05) 0%,
        rgba(167, 139, 250, 0.08) 100%
    );
    border-color: rgba(167, 139, 250, 0.18);
}

.highlight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary-dim), var(--accent-secondary));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.score-value {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.28));
}

/* ==============================
   MAIN PANELS ROW
   ============================== */

.main-panels-row {
    display: flex;
    gap: 20px;
    min-height: 0;
}

.flex-2 { flex: 2; min-width: 0; }
.flex-1 { flex: 1.3; min-width: 0; }

.panel-left  {}
.panel-right {}

.panel-title {
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-secondary);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-title i {
    color: var(--accent-primary);
    font-size: 13px;
}

.panel-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* ==============================
   METRIC GRID (Diagnóstico)
   ============================== */

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-item {
    background: rgba(0, 0, 0, 0.20);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid transparent;
    transition: border-color var(--ease-fast);
}

.metric-item:hover { border-color: var(--border-subtle); }

.metric-item.full-width { grid-column: span 2; }

.metric-item.highlight-bg {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-subtle);
}

.metric-item.glow-border {
    border-color: rgba(56, 189, 248, 0.18);
    background: rgba(56, 189, 248, 0.03);
    box-shadow: inset 0 0 16px rgba(56, 189, 248, 0.03);
}

.metric-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-data {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-data.strong {
    font-size: 24px;
    font-weight: 800;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.semantic-text {
    font-size: 12px;
    font-weight: 600;
}

/* ==============================
   SCORE BREAKDOWN (Radiografía)
   ============================== */

.score-breakdown-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.score-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.score-cat-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-cat-val {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-secondary);
}

.score-bar-bg {
    height: 4px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary-dim), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

/* ==============================
   EXTENDED DATA PANEL
   ============================== */

.extended-data-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.horizontal-scroll-container {
    overflow-x: auto;
    padding-bottom: 8px;
    max-width: 100%;
}

.masonry-metrics-grid { min-width: max-content; }

.metrics-group-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    min-width: max-content;
}

.metrics-group-title {
    font-size: 10px;
    color: var(--accent-primary);
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    left: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.metric-row {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
}

.metric-row:hover { background: rgba(255, 255, 255, 0.02); }

.metric-cell {
    padding: 8px 14px;
    min-width: 140px;
    font-size: 12px;
    border-right: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

/* Sticky first column */
.metric-row .metric-cell:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-base);
    min-width: 240px;
    max-width: 300px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 2;
    border-right: 2px solid var(--border-default);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================
   MASTER DB VIEW
   ============================== */

#master-db-view {
    animation: fadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - 120px);
}

#master-db-view > .glass-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.master-db-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.master-db-header-row h2 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.master-db-header-row h2 i { color: var(--accent-primary); }

/* ── Master DB portfolio tabs ── */
.master-portfolio-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

/* ── Smart Filter Bar ── */
.smart-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    background: rgba(8, 14, 28, 0.6);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    min-height: 42px;
    position: relative;
}

.sfb-views-wrap { position: relative; flex-shrink: 0; }

.sfb-views-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--accent-primary);
    padding: 5px 11px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease-fast);
    white-space: nowrap;
    font-family: inherit;
}
.sfb-views-btn:hover { background: rgba(56, 189, 248, 0.15); }
.sfb-caret { font-size: 9px; opacity: 0.7; }

.sfb-views-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: #0d1525;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 100;
    overflow: hidden;
}

.sfb-view-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--ease-fast);
    gap: 8px;
}
.sfb-view-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sfb-view-item.active { color: var(--accent-primary); background: rgba(56,189,248,0.07); }

.sfb-view-del {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.5;
    transition: var(--ease-fast);
}
.sfb-view-del:hover { color: var(--color-danger); opacity: 1; }

.sfb-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    flex-shrink: 0;
}

.sfb-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.sfb-empty-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

.sfb-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.25);
    color: #c4b5fd;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.sfb-pill-remove {
    background: none;
    border: none;
    color: rgba(196, 181, 253, 0.6);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: var(--ease-fast);
}
.sfb-pill-remove:hover { color: var(--color-danger); }

.sfb-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.sfb-add-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    cursor: pointer;
    transition: var(--ease-fast);
    font-family: inherit;
}
.sfb-add-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); background: rgba(56,189,248,0.06); }

.sfb-save-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fbbf24;
    padding: 5px 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    cursor: pointer;
    transition: var(--ease-fast);
    font-family: inherit;
}
.sfb-save-btn:hover { background: rgba(251,191,36,0.18); }

.sfb-add-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: rgba(8, 14, 28, 0.8);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    animation: fadeIn 0.15s ease-out;
}

.sfb-select {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 6px 28px 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 13px;
    min-width: 160px;
    transition: var(--ease-fast);
}
.sfb-select:focus { border-color: var(--accent-primary); }
.sfb-select option { background: #0f172a; }

.sfb-apply-btn {
    background: var(--accent-primary-dim);
    border: 1px solid var(--accent-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--ease-fast);
}
.sfb-apply-btn:hover { background: var(--accent-primary); }

.sfb-cancel-btn {
    background: none;
    border: 1px solid var(--border-default);
    color: var(--text-tertiary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--ease-fast);
}
.sfb-cancel-btn:hover { border-color: var(--color-danger); color: var(--color-danger); }

.master-category-tabs {
    margin-bottom: 14px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
    margin-top: 0;
}

.master-table-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
}

/* F02: Master DB pagination */
.master-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px 4px;
    gap: 12px;
    flex-wrap: wrap;
}
.mpag-info { font-size: 12px; color: var(--text-muted); min-width: 100px; }
.mpag-controls { display: flex; align-items: center; gap: 4px; }
.mpag-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: all 0.15s;
}
.mpag-btn:hover:not(:disabled) { border-color: rgba(56,189,248,0.4); color: #38bdf8; }
.mpag-btn:disabled { opacity: 0.35; cursor: default; }
.mpag-pages { display: flex; align-items: center; gap: 3px; margin: 0 4px; }
.mpag-page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.mpag-page-btn:hover { border-color: rgba(56,189,248,0.3); color: #38bdf8; }
.mpag-page-btn.active { border-color: rgba(56,189,248,0.5); background: rgba(56,189,248,0.12); color: #38bdf8; font-weight: 700; }
.mpag-ellipsis { font-size: 12px; color: var(--text-muted); padding: 0 4px; }
.mpag-size { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.mpag-size-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

#master-table-head th {
    background: var(--bg-elevated) !important;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--border-default);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 12px 16px;
}

#master-table-body td {
    white-space: nowrap;
    vertical-align: middle;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-primary);
}

#master-db-view .bulk-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ==============================
   EMPTY STATE (Sin Datos)
   ============================== */

.empty-state-wrapper {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 48px;
    grid-column: 1 / -1;
}

.empty-state-wrapper h3 {
    font-size: 19px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state-wrapper p {
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.65;
    margin-bottom: 24px;
    font-size: 14px;
}

.empty-icon-wrapper {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.15);
    padding: 24px;
    border-radius: 50%;
    margin-bottom: 24px;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon-wrapper i {
    font-size: 2.8rem;
    color: var(--accent-primary);
}

.empty-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.scraper-progress-wrap {
    width: 100%;
    max-width: 420px;
    margin-top: 24px;
    text-align: left;
}

.scraper-timer-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: center;
}

.scraper-timer-row span:first-child {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-primary);
}

.scraper-timer-row span:last-child {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

#scraper-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary-dim), var(--accent-primary));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.scraper-progress-wrap .scraper-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 10px;
    font-style: italic;
}

/* ==============================
   PORTFOLIO METADATA
   ============================== */

#portfolio-metadata-panel { animation: fadeIn 0.3s ease-out; }

/* ==============================
   ACTION BUTTONS
   ============================== */

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ease-smooth);
    border: none;
    outline: none;
    font-family: inherit;
    white-space: nowrap;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary-dim), var(--accent-secondary-dim));
    color: white;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.primary-btn:hover {
    box-shadow: 0 6px 22px rgba(56, 189, 248, 0.38);
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.primary-btn:active { transform: translateY(0); filter: brightness(0.95); }

.secondary-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

/* Specific button overrides */
.btn-back-dashboard {
    margin-right: 2px;
    font-size: 12px !important;
    padding: 7px 12px !important;
}

.btn-delete {
    margin-left: 6px;
    padding: 5px 11px !important;
    background: rgba(248, 113, 113, 0.08) !important;
    color: var(--color-danger) !important;
    border: 1px solid rgba(248, 113, 113, 0.20) !important;
    font-size: 11px !important;
}

.btn-delete:hover {
    background: rgba(248, 113, 113, 0.14) !important;
    border-color: rgba(248, 113, 113, 0.32) !important;
    transform: none !important;
}

/* ==============================
   MODAL
   ============================== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(2, 8, 23, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
}

.modal-content {
    width: 400px;
    padding: 0;
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-dialog {
    width: min(540px, calc(100vw - 32px));
    max-height: min(88vh, 760px);
    background: rgba(11, 17, 32, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease-out;
}

.modal-new-signal-dialog {
    max-width: 540px;
}

/* Alias unificado para modales nuevos */
.modal-container {
    background: rgba(11, 17, 32, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    width: 480px;
    animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-container.modal-sm { width: 440px; }
.modal-container.modal-lg { width: min(860px, 94vw); }

.modal-bulk {
    max-width: 1420px !important;
    width: 98% !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-manual { max-width: 500px !important; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i { color: var(--accent-primary); }

.close-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--ease-fast);
    touch-action: manipulation;
}

.close-btn:hover {
    color: var(--color-danger);
    background: rgba(248, 113, 113, 0.10);
}

.modal-body {
    padding: 24px;
}

.modal-body-overflow {
    overflow-y: auto;
    flex: 1;
    padding: 20px 24px;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
}

.modal-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    transition: var(--ease-fast);
    outline: none;
}

.form-group input::placeholder { color: var(--text-tertiary); }

.form-group input:focus {
    border-color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.04);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.10);
}

.form-actions { margin-top: 24px; }

/* U03 — inline field validation */
.field-error { display: none; font-size: 11px; color: #ef4444; margin-top: 4px; }
.field-error.visible { display: block; }
.form-group input.input-invalid,
.form-group select.input-invalid,
.form-group textarea.input-invalid {
    border-color: rgba(239, 68, 68, 0.6) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.10);
}

.submit-btn { width: 100%; padding: 12px; justify-content: center; }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-new-signal-dialog .form-group {
    margin-bottom: 0;
}

.modal-new-signal-dialog input,
.modal-new-signal-dialog select,
.modal-new-signal-dialog textarea {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.72);
    color: var(--text-primary);
}

.modal-new-signal-dialog textarea {
    min-height: 92px;
    resize: vertical;
}

/* ==============================
   BULK TABLE
   ============================== */

.bulk-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

/* Anchos de columna: Empresa, En Cartera, Tipo, Convicción, Broker, País, Shares, Precio Local, Moneda, Valor USD, Acción */
.bulk-table th:nth-child(1), .bulk-table td:nth-child(1)  { min-width: 160px; }
.bulk-table th:nth-child(2), .bulk-table td:nth-child(2)  { min-width: 72px;  width: 72px; text-align: center; }
.bulk-table th:nth-child(3), .bulk-table td:nth-child(3)  { min-width: 140px; }
.bulk-table th:nth-child(4), .bulk-table td:nth-child(4)  { min-width: 148px; }
.bulk-table th:nth-child(5), .bulk-table td:nth-child(5)  { min-width: 110px; }
.bulk-table th:nth-child(6), .bulk-table td:nth-child(6)  { min-width: 178px; }
.bulk-table th:nth-child(7), .bulk-table td:nth-child(7)  { min-width: 90px;  }
.bulk-table th:nth-child(8), .bulk-table td:nth-child(8)  { min-width: 100px; }
.bulk-table th:nth-child(9), .bulk-table td:nth-child(9)  { min-width: 100px; }
.bulk-table th:nth-child(10),.bulk-table td:nth-child(10) { min-width: 68px;  width: 68px; }
.bulk-table th:nth-child(11),.bulk-table td:nth-child(11) { min-width: 105px; }
.bulk-table th:nth-child(12),.bulk-table td:nth-child(12) { min-width: 105px; }
.bulk-table th:nth-child(13),.bulk-table td:nth-child(13) { min-width: 58px;  width: 58px; }

.bulk-table th {
    background: rgba(8, 14, 28, 0.95);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 9px 8px;
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.bulk-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.bulk-table tr:hover td { background: rgba(255, 255, 255, 0.025); }

/* Row zebra for readability */
.bulk-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.012);
}

.bulk-table select,
.bulk-table input[type="text"],
.bulk-table input[type="number"] {
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* Kill browser autofill white background */
.bulk-table input:-webkit-autofill,
.bulk-table input:-webkit-autofill:hover,
.bulk-table input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

/* Remove number input spinner arrows */
.bulk-table input[type="number"]::-webkit-inner-spin-button,
.bulk-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.bulk-table input[type="number"] { -moz-appearance: textfield; }

.bulk-table select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 13px;
    padding-right: 28px;
}

.bulk-table select:focus,
.bulk-table input[type="text"]:focus,
.bulk-table input[type="number"]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
    background: rgba(15, 23, 42, 0.95);
}

.bulk-table select option {
    background: #0f172a;
    color: var(--text-primary);
}

.bulk-table input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--ease-fast);
    vertical-align: middle;
}

.bulk-table input[type="checkbox"]:checked {
    background: var(--accent-primary-dim);
    border-color: var(--accent-primary-dim);
}

.bulk-table input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 10px;
}

.bulk-table select:disabled,
.bulk-table input[type="text"]:disabled,
.bulk-table input[type="number"]:disabled {
    opacity: 0.18;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.4);
}

.bulk-broker-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bulk-broker-manage {
    align-self: flex-start;
    padding: 5px 9px;
    font-size: 11px;
    line-height: 1.2;
}

.bulk-broker-summary {
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-secondary);
}

/* ── Bulk Table: Broker Sub-Rows (Multi-Broker Support) ── */

.broker-sub-row td {
    background: rgba(124, 58, 237, 0.04) !important;
    border-top: 1px dashed rgba(167, 139, 250, 0.18);
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.broker-sub-row:last-of-type td {
    border-bottom: 1px dashed rgba(167, 139, 250, 0.18);
}

.broker-sub-row .bp-shares,
.broker-sub-row .bp-price-local {
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-primary);
    border: 1px solid rgba(167, 139, 250, 0.25);
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    width: 100%;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    -moz-appearance: textfield;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.broker-sub-row .bp-shares:focus,
.broker-sub-row .bp-price-local:focus {
    border-color: var(--accent-violet, #a78bfa);
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.15);
    background: rgba(15, 23, 42, 0.95);
}

.broker-sub-row .bp-shares::-webkit-inner-spin-button,
.broker-sub-row .bp-shares::-webkit-outer-spin-button,
.broker-sub-row .bp-price-local::-webkit-inner-spin-button,
.broker-sub-row .bp-price-local::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.broker-sub-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.broker-add-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.broker-add-hint {
    font-size: 11px;
    color: var(--text-secondary);
}

.broker-add-select {
    min-width: 180px;
}

.bp-remove-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(248, 113, 113, 0.25);
    background: rgba(127, 29, 29, 0.18);
    color: #fca5a5;
    cursor: pointer;
    transition: var(--ease-fast);
}

.bp-remove-btn:hover {
    background: rgba(127, 29, 29, 0.32);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fecaca;
}

/* ── Bulk Table: Fila Totals (Contador Convicción) ── */

#bulk-totals-row td {
    background: rgba(8, 14, 28, 0.97);
    border-top: 2px solid var(--border-default);
    padding: 12px 8px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.bulk-totals-label {
    text-align: right !important;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.bulk-totals-label i {
    margin-right: 6px;
    font-size: 13px;
}

.bulk-totals-value {
    font-weight: 800;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    padding: 6px 12px !important;
    border-radius: 6px;
}

#bulk-totals-row.conviccion-ok .bulk-totals-value {
    color: var(--color-success);
    background: var(--color-success-bg);
}
#bulk-totals-row.conviccion-ok .bulk-totals-label,
#bulk-totals-row.conviccion-ok .bulk-totals-label i {
    color: var(--color-success);
}

#bulk-totals-row.conviccion-over .bulk-totals-value {
    color: var(--color-danger);
    background: var(--color-danger-bg);
    animation: pulse-danger 1.5s ease-in-out infinite;
}
#bulk-totals-row.conviccion-over .bulk-totals-label,
#bulk-totals-row.conviccion-over .bulk-totals-label i {
    color: var(--color-danger);
}

#bulk-totals-row.conviccion-under .bulk-totals-value {
    color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.10);
}
#bulk-totals-row.conviccion-under .bulk-totals-label i {
    color: var(--accent-gold);
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==============================
   SEMANTIC COLOR UTILITIES
   ============================== */

.text-green  { color: var(--color-success); }
.text-yellow { color: var(--color-warning); }
.text-red    { color: var(--color-danger);  }

.bg-green  { background: var(--color-success-bg);  color: var(--color-success); border: 1px solid var(--color-success-border); }
.bg-yellow { background: var(--color-warning-bg);  color: var(--color-warning); border: 1px solid var(--color-warning-border); }
.bg-red    { background: var(--color-danger-bg);   color: var(--color-danger);  border: 1px solid var(--color-danger-border);  }

/* ==============================
   EMPTY STATE (old class compat)
   ============================== */

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-neutral);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.45;
    background: linear-gradient(135deg, var(--text-secondary), var(--text-tertiary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==============================
   LOADING OVERLAY
   ============================== */

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 8, 23, 0.88);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    animation: fadeIn 0.15s ease-out;
}

.loading-overlay p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.75s linear infinite;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.28);
}

/* ==============================
   SKELETON LOADERS
   ============================== */

.company-list-skeleton {
    height: 62px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.02) 25%,
        rgba(255,255,255,0.04) 50%,
        rgba(255,255,255,0.02) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

/* ==============================
   ANIMATIONS
   ============================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==============================
   PORTFOLIO ANALYTICS VIEW
   ============================== */

.analytics-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.analytics-header h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.analytics-header h2 i { color: var(--accent-primary); }

.analytics-subtitle {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 0;
}

.analytics-header .action-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.analytics-chart-card {
    height: 340px;
    display: flex;
    flex-direction: column;
    padding: 16px 14px !important;
}

.analytics-chart-card .chart-title {
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.analytics-chart-card .chart-card-inner {
    flex: 1;
    min-height: 0;
    position: relative;
}

.analytics-bar-card {
    padding: 20px 24px !important;
}

.analytics-bar-inner {
    height: 420px;
    position: relative;
}

.rebalanceo-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 12px;
}
.rebalanceo-sort-label {
    font-size: 11px;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.rebalanceo-sort-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(148,163,184,0.15);
    background: rgba(148,163,184,0.06);
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.rebalanceo-sort-btn:hover {
    background: rgba(56,189,248,0.1);
    border-color: rgba(56,189,248,0.3);
    color: #e2e8f0;
}
.rebalanceo-sort-btn.active {
    background: rgba(56,189,248,0.15);
    border-color: rgba(56,189,248,0.4);
    color: #38bdf8;
}

.rebalanceo-chart-wrap {
    height: 420px;
    position: relative;
}

/* Responsive: 2 cols on medium screens */
@media (max-width: 1400px) {
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .analytics-chart-card {
        height: 360px;
    }
}

/* =========================================================
   DCA INTELIGENTE (Task 23)
   ========================================================= */

.dca-planner-controls {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.dca-input-group { flex: 1; min-width: 200px; }
.dca-simulate-group { flex: 1; min-width: 180px; }

.dca-input-group label,
.dca-simulate-group label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 500;
}

.dca-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dca-currency {
    font-size: 16px;
    font-weight: 600;
    color: #38bdf8;
}

.dca-input-row input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    background: rgba(30,41,59,0.8);
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    max-width: 160px;
}

.dca-input-row input:focus {
    outline: none;
    border-color: rgba(56,189,248,0.5);
}

.dca-simulate-group input[type="range"] {
    width: 100%;
    accent-color: #a78bfa;
    cursor: pointer;
}

.dca-summary-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(30,41,59,0.4);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
}

.dca-summary-item {
    text-align: center;
    min-width: 100px;
}

.dca-summary-item .dca-s-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dca-summary-item .dca-s-value {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.dca-summary-item .dca-s-value.text-green { color: #34d399; }
.dca-summary-item .dca-s-value.text-red { color: #f87171; }

.dca-suggestions-table {
    margin-bottom: 16px;
    overflow-x: auto;
}

.dca-suggestions-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dca-suggestions-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dca-suggestions-table td {
    padding: 8px 10px;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-variant-numeric: tabular-nums;
}

.dca-suggestions-table tr:hover td {
    background: rgba(56,189,248,0.04);
}

.dca-suggestions-table .dca-amount {
    font-weight: 600;
    color: #38bdf8;
}

.dca-suggestions-table .dca-rank {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(167,139,250,0.15);
    color: #a78bfa;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

.dca-chart-wrap {
    height: 220px;
    position: relative;
    margin-bottom: 16px;
}

.dca-sim-title {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 12px;
    font-weight: 500;
}

.dca-sim-chart-wrap {
    height: 200px;
    position: relative;
}

/* =========================================================
   DCA EXECUTIONS — Historial de Aportes (Task 23)
   ========================================================= */

.dca-history-section {
    margin-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 20px;
}

.dca-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.dca-history-title {
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dca-history-title i { color: #38bdf8; }

.dca-add-btn {
    font-size: 12px;
    padding: 6px 14px;
}

.dca-history-empty {
    color: #475569;
    font-size: 13px;
    text-align: center;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Stats bar del historial */
.dca-exec-stats {
    display: flex;
    gap: 0;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.dca-exec-stat {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border-right: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}
.dca-exec-stat:last-child { border-right: none; }
.dca-exec-stat .dca-s-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.dca-exec-stat .dca-s-value {
    font-size: 15px;
    font-weight: 700;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
}

/* Tabla historial */
.dca-exec-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}

.dca-exec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dca-exec-table th {
    background: rgba(15,23,42,0.6);
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

.dca-exec-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #94a3b8;
    vertical-align: middle;
}

.dca-exec-table tr:last-child td { border-bottom: none; }
.dca-exec-table tr:hover td { background: rgba(255,255,255,0.02); }

.dca-exec-date { color: #cbd5e1 !important; white-space: nowrap; }
.dca-exec-num { font-variant-numeric: tabular-nums; color: #cbd5e1 !important; text-align: right; }
.dca-exec-total-cell { color: #34d399 !important; font-weight: 600; }
.dca-exec-muted { color: var(--text-tertiary) !important; }
.dca-exec-notes-cell { max-width: 180px; color: var(--text-secondary) !important; }

.dca-exec-del-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    font-size: 12px;
}
.dca-exec-del-btn:hover { color: #f87171; background: rgba(248,113,113,0.1); }

/* Total preview en modal */
.dca-exec-total {
    font-size: 20px;
    font-weight: 700;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
    padding: 8px 0;
}

/* =========================================================
   STRATEGY AGENT — Motor de reglas (Task 18)
   ========================================================= */

/* Botón Evaluar en topbar */
.strategy-consult-btn {
    background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(56,189,248,0.10));
    border: 1px solid rgba(167,139,250,0.4);
    color: #a78bfa;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.strategy-consult-btn:hover { background: rgba(167,139,250,0.25); border-color: #a78bfa; }

/* Botón "Crear Señal" — tono gold del Execution Gateway */
.btn-create-signal {
    background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.08));
    border: 1px solid rgba(251,191,36,0.4);
    color: #fbbf24;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-create-signal:hover { background: rgba(251,191,36,0.22); border-color: #fbbf24; }

/* Tabs internas de la sección */
.strategy-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(15,23,42,0.4);
    border-radius: 10px;
    padding: 4px;
}
.strategy-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}
.strategy-tab.active { background: rgba(167,139,250,0.15); color: #a78bfa; }
.strategy-tab:hover:not(.active) { color: #94a3b8; background: rgba(255,255,255,0.03); }

.strategy-tab-content.hidden { display: none; }

/* Toolbar de reglas */
.strategy-rules-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.strategy-add-rule-btn { font-size: 12px; padding: 7px 14px; }
.strategy-rules-count { font-size: 12px; color: var(--text-secondary); }

.strategy-empty {
    color: #475569;
    font-size: 13px;
    text-align: center;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.strategy-loading {
    text-align: center;
    padding: 28px;
    color: #64748b;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Tabla de reglas */
.strategy-rules-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); }
.strategy-rules-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.strategy-rules-table th {
    background: rgba(15,23,42,0.6);
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}
.strategy-rules-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #94a3b8; vertical-align: middle; }
.strategy-rules-table tr:last-child td { border-bottom: none; }
.strategy-rules-table tr:hover td { background: rgba(255,255,255,0.02); }

.sr-rule-name { color: #e2e8f0 !important; font-weight: 500; }
.sr-metric-label { color: #94a3b8 !important; }
.sr-condition { font-variant-numeric: tabular-nums; color: #cbd5e1 !important; }
.sr-op { font-weight: 700; color: #38bdf8; margin-right: 4px; }

.sr-profile-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Toggle switch */
.sr-toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.sr-toggle input { opacity: 0; width: 0; height: 0; }
.sr-toggle-slider {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    cursor: pointer;
    transition: 0.2s;
}
.sr-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    left: 3px; top: 3px;
    background: #64748b;
    border-radius: 50%;
    transition: 0.2s;
}
.sr-toggle input:checked + .sr-toggle-slider { background: rgba(167,139,250,0.25); }
.sr-toggle input:checked + .sr-toggle-slider::before { transform: translateX(16px); background: #a78bfa; }

.sr-del-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    font-size: 12px;
}
.sr-del-btn:hover { color: #f87171; background: rgba(248,113,113,0.1); }

/* Perfiles */
.strategy-profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.strategy-profile-card {
    background: rgba(15,23,42,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.2s;
    min-height: 210px;
}
.strategy-profile-card:hover { border-color: var(--profile-color, rgba(255,255,255,0.15)); }
.sp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.sp-name { font-weight: 600; font-size: 13px; color: #e2e8f0; flex: 1; }
.sp-description {
    margin: -4px 0 12px;
    color: #8b9ab0;
    font-size: 11px;
    line-height: 1.45;
}
.sp-load-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.sp-load-btn:hover { border-color: var(--profile-color); color: var(--profile-color); }
.sp-rules { display: flex; flex-direction: column; gap: 7px; }
.sp-rule { font-size: 11px; line-height: 1.35; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 6px; }
.sp-rule i { margin-top: 2px; }

/* Historial */
.strategy-history-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); }
.strategy-history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.strategy-history-table th {
    background: rgba(15,23,42,0.6);
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    text-align: left;
}
.strategy-history-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #94a3b8; vertical-align: middle; }
.strategy-history-table tr:last-child td { border-bottom: none; }
.sh-date { color: #cbd5e1 !important; white-space: nowrap; }
.sh-score { font-variant-numeric: tabular-nums; }
.sh-detail-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}
.sh-detail-btn:hover { border-color: #a78bfa; color: #a78bfa; }

/* Veredicto badge */
.strategy-verdict {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 99px;
    border: 1px solid;
}
.verdict-buy { color: #34d399; border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.08); }
.verdict-watch { color: #fbbf24; border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.08); }
.verdict-review { color: #f87171; border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.08); }

/* Modal resultado de consulta */
.sr-verdict-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 700;
}
.sr-verdict-banner.verdict-buy { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: #34d399; }
.sr-verdict-banner.verdict-watch { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3); color: #fbbf24; }
.sr-verdict-banner.verdict-review { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: #f87171; }
.sr-verdict-label { font-size: 18px; }
.sr-verdict-score { font-size: 12px; font-weight: 400; margin-left: auto; color: inherit; opacity: 0.8; }

.sr-rules-eval-wrap { overflow-x: auto; }
.sr-rules-eval-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sr-rules-eval-table th {
    background: rgba(15,23,42,0.6);
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    text-align: left;
}
.sr-rules-eval-table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.sr-rules-eval-table tr:last-child td { border-bottom: none; }
.sr-pass td { color: #94a3b8; }
.sr-pass td:first-child { color: #34d399; }
.sr-fail td { color: #94a3b8; }
.sr-fail td:first-child { color: #f87171; }
.sr-na td { color: var(--text-tertiary); }
.sr-metric-col { color: var(--text-secondary) !important; }
.sr-condition-col { font-variant-numeric: tabular-nums; color: #a78bfa !important; }
.sr-value-col { font-weight: 600; font-variant-numeric: tabular-nums; color: #e2e8f0 !important; }

/* Hint de formato */
.strategy-threshold-hint {
    font-size: 11px;
    color: #fbbf24;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 4px;
    display: none;
}

/* =========================================================
   HEALTH MONITOR — Salud del Portfolio (Task 22)
   ========================================================= */

/* Summary bar */
.health-summary-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.health-pill {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.health-pill.green { background: rgba(34,197,94,0.12); color: #22c55e; }
.health-pill.yellow { background: rgba(251,191,36,0.12); color: #fbbf24; }
.health-pill.red { background: rgba(239,68,68,0.12); color: #ef4444; }
.health-summary-avg {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}
.health-summary-avg strong {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Health grid */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.health-card {
    padding: 14px;
    border-radius: var(--radius-sm);
    border-left: 3px solid;
    cursor: pointer;
    background: rgba(255,255,255,0.02);
    transition: background 0.15s ease, transform 0.15s ease;
}
.health-card:hover {
    background: rgba(255,255,255,0.05);
    transform: translateY(-1px);
}
.health-card.semaforo-green { border-left-color: #22c55e; }
.health-card.semaforo-yellow { border-left-color: #fbbf24; }
.health-card.semaforo-red { border-left-color: #ef4444; }

.health-card-ticker {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}
.health-card-name {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}
.health-card-score {
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1;
}
.health-card-cambio {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}
.health-card-cambio.positive { color: #22c55e; }
.health-card-cambio.negative { color: #ef4444; }
.health-card-cambio.neutral { color: var(--text-tertiary); }

.health-card-peso {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* Scan button spinning */
.health-scan-spinning {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Empty state */
.health-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
    font-size: 13px;
}
.health-empty i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    opacity: 0.4;
}

/* =========================================================
   AUTOCOMPLETE — País selector
   ========================================================= */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 200;
    background: #0f1929;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.autocomplete-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.autocomplete-option:hover,
.autocomplete-option.focused {
    background: rgba(56, 189, 248, 0.1);
}

.autocomplete-code {
    font-weight: 700;
    font-size: 11px;
    color: var(--accent-sky, #38bdf8);
    min-width: 36px;
    letter-spacing: 0.05em;
}

.autocomplete-name {
    font-size: 12px;
    color: var(--color-text-muted, #94a3b8);
}

/* ==============================
   EARNINGS WATCH CARD
   ============================== */

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

.ew-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ew-header h2 i { color: #38bdf8; }
.ew-header p { font-size: 12px; color: var(--text-secondary); }

.ew-filter-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.ew-filter-btn {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.ew-filter-btn:hover {
    border-color: rgba(56,189,248,0.40);
    color: #38bdf8;
}

.ew-filter-btn.active {
    background: rgba(56,189,248,0.12);
    border-color: rgba(56,189,248,0.40);
    color: #38bdf8;
}

.ew-loading, .ew-empty {
    text-align: center;
    padding: 28px;
    color: var(--text-secondary);
    font-size: 13px;
}

.ew-groups { display: flex; flex-direction: column; gap: 20px; }

.ew-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 0 8px 0;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ew-group-count { font-size: 10px; font-weight: 600; opacity: 0.6; }

.ew-group.grp-urgent   .ew-group-title { color: #f87171; }
.ew-group.grp-soon     .ew-group-title { color: #fbbf24; }
.ew-group.grp-month    .ew-group-title { color: #38bdf8; }
.ew-group.grp-future   .ew-group-title { color: #94a3b8; }
.ew-group.grp-reported .ew-group-title { color: #a78bfa; }

.ew-items { display: flex; flex-direction: column; gap: 4px; }

.ew-item {
    display: grid;
    grid-template-columns: 68px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.ew-item:hover { background: rgba(255,255,255,0.04); }

.ew-item-ticker {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ew-item-name {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ew-item-date {
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    white-space: nowrap;
}

.ew-item-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.ew-item-tag.tag-portfolio {
    background: rgba(56,189,248,0.12);
    border: 1px solid rgba(56,189,248,0.30);
    color: #38bdf8;
}

.ew-item-tag.tag-radar {
    background: transparent;
    border: 1px solid rgba(148,163,184,0.20);
    color: var(--text-secondary);
}

.ew-spinning { animation: ew-spin 0.7s linear infinite; }

@keyframes ew-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ==============================
   EARNINGS BADGE
   ============================== */

.earnings-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid currentColor;
    white-space: nowrap;
    cursor: default;
    transition: opacity 0.2s;
}

/* 🔥 ≤7 días — rojo urgente */
.earnings-badge.eb-urgent {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    animation: eb-pulse 2s ease-in-out infinite;
}

/* ⏰ ≤30 días — amarillo ámbar */
.earnings-badge.eb-soon {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.10);
    border-color: rgba(251, 191, 36, 0.35);
}

/* 🗓️ >30 días — azul sky */
.earnings-badge.eb-future {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.10);
    border-color: rgba(56, 189, 248, 0.30);
}

/* 📣 Reportado recientemente */
.earnings-badge.eb-reported {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.10);
    border-color: rgba(167, 139, 250, 0.30);
}

/* ⚪ Sin datos */
.earnings-badge.eb-none {
    color: var(--text-secondary);
    background: transparent;
    border-color: var(--border-default);
    opacity: 0.6;
}

@keyframes eb-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4); }
    50%       { box-shadow: 0 0 0 4px rgba(248, 113, 113, 0); }
}

/* =========================================================
   FRESHNESS BADGE — topbar (analysis view) + Master DB cell
   ========================================================= */

.freshness-badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    cursor: default;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.05);
    transition: opacity 0.2s;
}

.freshness-badge .freshness-src {
    font-weight: 700;
    text-transform: uppercase;
}

.freshness-badge .freshness-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    margin: 0 5px;
    opacity: 0.5;
}

.freshness-badge .freshness-age {
    opacity: 0.85;
}

/* fresh ≤7d — verde */
.freshness-badge.freshness-fresh {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
}
.freshness-badge.freshness-fresh .freshness-age { color: #22c55e; }

/* stale 8-30d — ámbar */
.freshness-badge.freshness-stale {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    color: #fde68a;
}
.freshness-badge.freshness-stale .freshness-age { color: #f59e0b; }

/* old >30d — rojo */
.freshness-badge.freshness-old {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
}
.freshness-badge.freshness-old .freshness-age { color: #ef4444; }

/* unknown — muted */
.freshness-badge.freshness-unknown {
    border-color: var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Provenance confidence badge (D10) */
.provenance-confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid;
    white-space: nowrap;
    cursor: default;
}
.provenance-confidence-badge.provenance-high    { color: #22c55e; border-color: rgba(34,197,94,0.3);  background: rgba(34,197,94,0.08); }
.provenance-confidence-badge.provenance-medium  { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.provenance-confidence-badge.provenance-low     { color: #ef4444; border-color: rgba(239,68,68,0.3);  background: rgba(239,68,68,0.08); }
.provenance-confidence-badge.provenance-unknown { color: var(--text-muted); border-color: var(--border-default); background: transparent; opacity: 0.6; }

/* Inline cell variant (Master DB table) */
.freshness-cell {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* =========================================================
   EXECUTION GATEWAY — Decision Board
   ========================================================= */

.execution-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 16px;
}
.execution-header-row h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.exec-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.sidebar-exec-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.45);
    margin-left: 6px;
    vertical-align: middle;
}

.execution-info-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(56, 189, 248, 0.07);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 16px;
}

.exec-export-group {
    display: flex;
    gap: 4px;
}
.exec-export-group .action-btn {
    font-size: 11px;
    padding: 5px 10px;
}

.exec-filter-tabs {
    display: flex;
    gap: 4px;
}
.exec-filter-btn {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.exec-filter-btn:hover  { border-color: var(--accent-primary); color: var(--accent-primary); }
.exec-filter-btn.active { background: rgba(56, 189, 248, 0.12); border-color: var(--accent-primary); color: var(--accent-primary); }

.exec-table-wrap {
    overflow-x: auto;
}
.exec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.exec-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}
.exec-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
    color: var(--text-primary);
}
.exec-row:hover td { background: rgba(255,255,255,0.025); }
.exec-row.exec-status-approved td { opacity: 0.75; }
.exec-row.exec-status-rejected td { opacity: 0.55; }
.exec-row.exec-status-expired  td { opacity: 0.45; }

.exec-reason {
    max-width: 260px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.exec-reason-summary {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 6px;
}

.exec-reason-list {
    margin: 0;
    padding-left: 16px;
    color: var(--text-secondary);
}

.exec-reason-list li {
    margin-bottom: 4px;
}

.exec-reason-meta {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--accent-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.exec-type-badge, .exec-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
}

.exec-action-btns {
    display: flex;
    gap: 6px;
}
.exec-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
}
.exec-approve { border-color: rgba(34,197,94,0.4); color: #22c55e; }
.exec-approve:hover { background: rgba(34,197,94,0.15); }
.exec-reject  { border-color: rgba(239,68,68,0.4);  color: #ef4444; }
.exec-reject:hover  { background: rgba(239,68,68,0.15); }

.exec-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* =========================================================
   PRICE MARKS OVERLAY STYLES
   ========================================================= */

.price-marks-overlay {
    transition: all 0.2s;
}

.price-marks-overlay:hover {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.1);
}

.price-mark {
    position: absolute;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 20;
}

.price-mark:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 30;
}

.price-mark-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(11,17,32,0.95);
    border: 1px solid rgba(56,189,248,0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 40;
}

.price-mark:hover .price-mark-label {
    opacity: 1;
}

.proj-mark-hint {
    position: absolute;
    right: 16px;
    top: 12px;
    z-index: 18;
    padding: 6px 10px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 4px;
    background: rgba(11, 17, 32, 0.86);
    color: #bae6fd;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

.proj-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(11,17,32,0.5);
}

.proj-toolbar-btn {
    padding: 6px 12px;
    background: rgba(56,189,248,0.1);
    border: 1px solid rgba(56,189,248,0.3);
    color: #38bdf8;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.proj-toolbar-btn:hover {
    background: rgba(56,189,248,0.2);
    border-color: rgba(56,189,248,0.4);
}

.proj-toolbar-btn.active {
    background: rgba(56,189,248,0.3);
    color: #f1f5f9;
}

.price-mark-modal {
    position: fixed;
    background: rgba(11,17,32,0.98);
    border: 1px solid rgba(56,189,248,0.3);
    border-radius: 8px;
    padding: 16px;
    z-index: 1000;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: modal-fade-in 0.2s ease;
}

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

.price-mark-modal h4 {
    margin: 0 0 12px 0;
    color: #f1f5f9;
    font-size: 14px;
}

.price-mark-modal label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.price-mark-modal select,
.price-mark-modal input,
.price-mark-modal textarea {
    width: 100%;
    padding: 6px;
    background: rgba(30,41,59,0.8);
    border: 1px solid rgba(148,163,184,0.3);
    border-radius: 4px;
    color: #f1f5f9;
    font-size: 12px;
    margin-bottom: 12px;
}

.price-mark-modal select:focus,
.price-mark-modal input:focus,
.price-mark-modal textarea:focus {
    outline: none;
    border-color: rgba(56,189,248,0.5);
}

.price-mark-modal button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
}

.price-mark-modal button:hover {
    transform: translateY(-1px);
}

#cancelMark {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

#saveMark {
    background: rgba(34,197,94,0.15);
    border-color: rgba(34,197,94,0.3);
    color: #22c55e;
}

/* ── Price Marks Management Panel (Task 9b Phase 5) ── */

.price-marks-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    max-width: 95vw;
    height: 100vh;
    background: rgba(11,17,32,0.98);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(56,189,248,0.15);
    z-index: 998;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.4);
}

.price-marks-panel.open {
    transform: translateX(0);
}

.price-marks-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.price-marks-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #f1f5f9;
}

.price-marks-panel-header .panel-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.price-marks-panel-header .panel-close-btn:hover {
    background: rgba(239,68,68,0.25);
}

.price-marks-controls {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}

.price-marks-controls select {
    flex: 1;
    padding: 6px 8px;
    background: rgba(30,41,59,0.8);
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 4px;
    color: #f1f5f9;
    font-size: 11px;
}

.price-marks-controls select:focus {
    outline: none;
    border-color: rgba(56,189,248,0.4);
}

.price-marks-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.price-marks-list::-webkit-scrollbar { width: 4px; }
.price-marks-list::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.2); border-radius: 2px; }

.price-mark-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
}

.price-mark-row:hover {
    background: rgba(56,189,248,0.04);
}

.price-mark-row.inactive {
    opacity: 0.45;
}

.price-mark-row .mark-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.price-mark-row .mark-info {
    flex: 1;
    min-width: 0;
}

.price-mark-row .mark-price {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
}

.price-mark-row .mark-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.price-mark-row .mark-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.price-mark-row .mark-actions button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148,163,184,0.15);
    background: transparent;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.price-mark-row .mark-actions button:hover {
    background: rgba(56,189,248,0.1);
    color: #38bdf8;
    border-color: rgba(56,189,248,0.3);
}

.price-mark-row.mark-approaching {
    border-left: 2px solid rgba(245,158,11,0.6);
    background: rgba(245,158,11,0.03);
}

.mark-thesis-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 4px 6px;
    background: rgba(56,189,248,0.05);
    border-radius: 4px;
    border-left: 2px solid rgba(56,189,248,0.25);
}

.mark-thesis-text {
    font-size: 10px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.price-mark-row .mark-actions button.btn-delete:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
}

/* Toggle switch CSS-only */
.mark-toggle {
    position: relative;
    width: 32px;
    height: 18px;
    flex-shrink: 0;
}

.mark-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mark-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(148,163,184,0.2);
    border-radius: 9px;
    transition: all 0.2s;
}

.mark-toggle .toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: #94a3b8;
    border-radius: 50%;
    transition: all 0.2s;
}

.mark-toggle input:checked + .toggle-slider {
    background: rgba(56,189,248,0.3);
}

.mark-toggle input:checked + .toggle-slider::before {
    transform: translateX(14px);
    background: #38bdf8;
}

.price-marks-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.price-marks-panel-footer .btn-thesis-review-all:hover {
    background: rgba(167,139,250,0.15);
}

.price-marks-panel-footer .mark-count {
    font-size: 11px;
    color: var(--text-secondary);
}

.price-marks-panel-footer .btn-add-mark {
    padding: 6px 14px;
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.price-marks-panel-footer .btn-add-mark:hover {
    background: rgba(34,197,94,0.25);
}

/* Edit modal reutiliza .price-mark-modal con extras */
.price-mark-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.price-mark-modal .form-row > div { min-width: 0; }

.price-mark-modal .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.price-marks-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-tertiary);
    text-align: center;
}

.price-marks-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.price-marks-empty p {
    font-size: 13px;
    margin: 0;
}

/* Confirm delete inline */
.mark-confirm-delete {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #ef4444;
    animation: modal-fade-in 0.15s ease;
}

.mark-confirm-delete button {
    padding: 3px 8px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.15s;
}

.mark-confirm-delete .btn-confirm-yes {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

.mark-confirm-delete .btn-confirm-no {
    background: rgba(148,163,184,0.1);
    border-color: rgba(148,163,184,0.2);
    color: #94a3b8;
}

/* ==============================
   LOGIN SCREEN (Task 13)
   ============================== */

#login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(56, 189, 248, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(167, 139, 250, 0.05) 0%, transparent 60%),
        var(--bg-base);
}

#login-screen.hidden {
    display: none;
}

.login-card {
    width: 380px;
    padding: 48px 40px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    margin-bottom: 8px;
}

.login-logo i {
    font-size: 48px;
    color: var(--accent-primary);
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.3));
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.login-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-strong) 50%, transparent 100%);
    margin: 28px 0;
}

.login-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px auto 16px;
    padding: 12px 32px;
    min-height: 44px;
    width: 280px;
    background: #fff;
    color: #1f1f1f;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease-fast);
}

.login-google-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-footer {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* U11: trust chips in login card */
.login-trust-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border-default);
    background: rgba(255,255,255,0.03);
    letter-spacing: 0.02em;
}

.login-disclaimer {
    margin-top: 20px;
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    text-align: left;
}
.login-disclaimer i {
    color: #fbbf24;
    font-size: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.login-legal {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
}
.login-legal a {
    color: #38bdf8;
    text-decoration: none;
    border-bottom: 1px dashed rgba(56, 189, 248, 0.4);
}
.login-legal a:hover {
    color: #7dd3fc;
    border-bottom-color: #7dd3fc;
}

.sidebar-disclaimer {
    margin-top: 14px;
    padding: 8px 10px;
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--text-tertiary);
    background: rgba(251, 191, 36, 0.04);
    border: 1px solid rgba(251, 191, 36, 0.14);
    border-radius: 6px;
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: help;
    letter-spacing: 0.2px;
}
.sidebar-disclaimer i {
    color: #fbbf24;
    font-size: 10px;
}

.execution-legal-bar {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.execution-legal-bar i {
    color: #ef4444;
    font-size: 13px;
    margin-top: 2px;
    flex-shrink: 0;
}
.execution-legal-bar strong {
    color: var(--text-primary);
}

/* ── Modal GDPR Consent (L06) ── */
.gdpr-overlay {
    z-index: 9999;
    background: rgba(2, 8, 23, 0.92);
    backdrop-filter: blur(8px);
}

.gdpr-modal {
    max-width: 540px;
    width: 94%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.gdpr-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.gdpr-icon {
    font-size: 32px;
    color: #38bdf8;
    flex-shrink: 0;
}

.gdpr-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.gdpr-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.gdpr-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.gdpr-intro {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}

.gdpr-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}

.gdpr-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
}

.gdpr-item i {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.gdpr-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-size: 13px;
}

.gdpr-item span {
    color: var(--text-secondary);
    line-height: 1.5;
}

.gdpr-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.gdpr-check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
}

.gdpr-check-row:hover {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.04);
}

.gdpr-check-row:has(.gdpr-checkbox:checked) {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.06);
}

.gdpr-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #38bdf8;
    cursor: pointer;
}

.gdpr-check-row span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.gdpr-check-row span a {
    color: #38bdf8;
    text-decoration: none;
    border-bottom: 1px dashed rgba(56,189,248,0.4);
}

.gdpr-check-row span strong {
    color: var(--text-primary);
}

.gdpr-rights {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    padding: 12px;
    background: rgba(251,191,36,0.04);
    border: 1px solid rgba(251,191,36,0.12);
    border-radius: 8px;
}

.gdpr-rights i { color: #fbbf24; flex-shrink: 0; margin-top: 2px; }
.gdpr-rights strong { color: var(--text-secondary); }

.gdpr-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- User Badge (sidebar) --- */

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-top: 1px solid var(--border-subtle);
}

.user-badge.hidden {
    display: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-default);
    flex-shrink: 0;
}

.user-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--ease-fast);
    font-size: 14px;
    flex-shrink: 0;
}

.btn-logout:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

/* --- App container auth toggle --- */

#app-container.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PORTFOLIO SUMMARY DASHBOARD — Landing Page
   ═══════════════════════════════════════════════════════════════════════════ */

.portfolio-summary-section {
    margin-bottom: 16px;
}

.ps-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.ps-kpi-card {
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.ps-kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
}

.ps-kpi-header {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ps-kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.ps-kpi-sub {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pnl-positive { color: #4ade80 !important; }
.pnl-negative { color: #f87171 !important; }

.ps-broker-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.ps-broker-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ps-broker-item .broker-name {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Positions Table */
.ps-table-card {
    padding: 16px 20px 8px;
}

.ps-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ps-table-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.ps-table-title > i { color: var(--accent-primary); }

.ps-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 900px;
}

.ps-table thead th {
    text-align: left;
    padding: 8px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-tertiary);
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.ps-table thead th:hover { color: var(--accent-primary); }

.ps-table thead th .sort-arrow {
    margin-left: 3px;
    font-size: 9px;
    opacity: 0.3;
}

.ps-table thead th.sorted .sort-arrow {
    opacity: 1;
    color: var(--accent-primary);
}

.ps-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.ps-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.06);
}

.ps-table tbody td {
    padding: 9px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    white-space: nowrap;
}

.ps-table tbody td.ticker-cell {
    font-weight: 700;
    color: var(--accent-primary);
}

.ps-table tbody td.name-cell {
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sub-filas de broker (mismo ticker, posición secundaria) */
.ps-table tbody tr.broker-subrow {
    border-left: 2px solid var(--accent-secondary, #a78bfa);
    background: rgba(167, 139, 250, 0.025);
}
.ps-table tbody tr.broker-subrow td {
    border-bottom: 1px solid rgba(167, 139, 250, 0.08);
    color: var(--text-secondary);
}

.ps-multi-broker-badge,
.ps-broker-chip,
.ps-etf-score {
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.ps-multi-broker-badge {
    margin-left: 6px;
    padding: 3px 6px;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.11);
    border: 1px solid rgba(167, 139, 250, 0.24);
}

.ps-rollup-line {
    margin-top: 3px;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-subrow-ticker {
    color: #c4b5fd;
    font-weight: 700;
}

.ps-subrow-name {
    color: var(--text-tertiary);
}

.ps-broker-chip {
    padding: 4px 7px;
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.18);
}

.ps-etf-score {
    padding: 4px 7px;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.18);
}

.ps-table tfoot td {
    padding: 10px 8px;
    font-weight: 700;
    border-top: 2px solid rgba(255,255,255,0.08);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ps-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TASK 8 — DASHBOARD TABS (Análisis Cuantitativo / Tesis / Multimedia)
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
    margin-bottom: 20px;
}

.dash-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--ease-smooth);
    font-family: inherit;
    text-transform: uppercase;
}

.dash-tab:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.dash-tab.active {
    background: linear-gradient(135deg, var(--accent-primary-dim), var(--accent-secondary-dim));
    color: white;
    box-shadow: var(--shadow-sm);
}

.dash-tab i {
    font-size: 13px;
}

.dash-tab-content {
    display: none;
}

.dash-tab-content.active {
    display: block;
}

/* ── Tesis Panel ── */

.thesis-panel {
    padding: 24px;
}

.thesis-panel .panel-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.thesis-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thesis-source-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 99px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.thesis-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.thesis-row {
    display: flex;
    gap: 16px;
}

.thesis-row .thesis-field {
    flex: 1;
}

.thesis-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.thesis-field textarea,
.thesis-field input,
.thesis-field select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 10px 12px;
    transition: var(--ease-fast);
    resize: vertical;
}

.thesis-field textarea:focus,
.thesis-field input:focus,
.thesis-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.thesis-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.thesis-field select option {
    background: var(--bg-base);
    color: var(--text-primary);
}

/* ── Multimedia Panel ── */

.multimedia-panel {
    padding: 24px;
}

.multimedia-panel .panel-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.media-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notebooklm-hub {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(56,189,248,0.08), rgba(251,191,36,0.05));
    border: 1px solid rgba(56,189,248,0.18);
}

.notebooklm-hub-copy {
    margin-bottom: 12px;
}

.notebooklm-hub-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notebooklm-hub-subtitle {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.notebooklm-action-row,
.notebooklm-output-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notebooklm-action-row {
    margin-bottom: 10px;
}

.notebooklm-workspace-row {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.notebooklm-workspace-input {
    flex: 1 1 320px;
    min-width: 220px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,23,42,0.42);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 12px;
}

.notebooklm-workspace-input::placeholder {
    color: var(--text-tertiary);
}

.notebooklm-output-btn {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,23,42,0.45);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease-fast);
}

.notebooklm-output-btn:hover,
.notebooklm-output-btn.active {
    border-color: rgba(56,189,248,0.4);
    background: rgba(56,189,248,0.12);
    color: var(--accent-primary);
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.media-empty-state .empty-icon-wrapper {
    margin-bottom: 12px;
}

.media-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: var(--ease-fast);
}

.media-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.25);
}

.media-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 18px;
    flex-shrink: 0;
}

.media-item-icon.type-markdown {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-primary);
}

.media-item-icon.type-audio {
    background: rgba(167, 139, 250, 0.12);
    color: var(--accent-secondary);
}

.media-item-icon.type-video {
    background: rgba(251, 191, 36, 0.12);
    color: var(--color-gold);
}

.media-item-icon.type-pdf {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
}

.media-item-info {
    flex: 1;
    min-width: 0;
}

.media-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-item-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.media-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.media-item-actions button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: var(--ease-fast);
}

.media-item-actions button:hover {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-primary);
    border-color: rgba(56, 189, 248, 0.3);
}

.media-item-actions button.btn-delete-media:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ── Inline media player ── */

.media-player-inline {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.media-player-inline audio,
.media-player-inline video {
    width: 100%;
    border-radius: 4px;
}

.media-player-inline .markdown-render {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.media-player-inline .markdown-render h1,
.media-player-inline .markdown-render h2,
.media-player-inline .markdown-render h3 {
    color: var(--text-primary);
    margin: 16px 0 8px;
}

.media-player-inline .markdown-render h1 { font-size: 18px; }
.media-player-inline .markdown-render h2 { font-size: 16px; }
.media-player-inline .markdown-render h3 { font-size: 14px; }

.media-player-inline .markdown-render p {
    margin: 8px 0;
}

.media-player-inline .markdown-render code {
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.media-player-inline .markdown-render pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.media-player-inline .markdown-render ul,
.media-player-inline .markdown-render ol {
    padding-left: 20px;
    margin: 8px 0;
}

/* ── Thesis save toast ── */

.thesis-toast,
.athena-toast {
    position: fixed;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-success);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    animation: toastIn 0.28s cubic-bezier(.34,1.56,.64,1), toastOut 0.25s ease 2.7s forwards;
    transition: bottom 0.25s ease;
}

.athena-toast i { flex-shrink: 0; font-size: 14px; }
.athena-toast span { line-height: 1.35; }

@keyframes toastIn {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}

/* =========================================================
   DIVIDEND INTELLIGENCE (Task 30)
   ========================================================= */

.div-company-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.div-select-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.div-ticker-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    padding: 7px 12px;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.div-ticker-select:focus { outline: none; border-color: var(--color-primary); }
.div-ticker-select option { background: #0f1928; }

/* KPI bar */
.div-kpi-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.div-kpi-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    flex: 1;
    min-width: 110px;
}
.div-kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.div-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.div-kpi-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Retrospective badge */
.div-retro-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.div-retro-badge i { color: #fbbf24; font-size: 16px; }
.div-retro-badge strong { color: #fbbf24; font-size: 16px; margin-left: 4px; }

/* Tabs */
.div-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 10px;
}
.div-tab {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.div-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.div-tab.active {
    background: rgba(56,189,248,0.12);
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

/* Tab content */
.div-tab-content { animation: fadeIn 0.2s ease; }
.div-chart-wrap { position: relative; height: 240px; margin-bottom: 8px; }
.div-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* Future & retro tables */
.div-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.div-data-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.div-data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.div-data-table tr:hover td { background: rgba(255,255,255,0.03); }
.div-data-table .div-future-row td { color: var(--text-primary); }
.div-data-table .div-amount { color: #4ade80; font-weight: 600; }
.div-data-table .div-yield { color: #38bdf8; }
.div-data-table .div-total-row td {
    font-weight: 700;
    color: #fbbf24;
    border-top: 1px solid rgba(251,191,36,0.2);
}

/* Empty / loading states */
.div-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    color: var(--text-muted);
    font-size: 14px;
}
.div-empty i { font-size: 20px; }
.div-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE VIEW (A3)
   ═══════════════════════════════════════════════════════════════ */

.profile-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}
.profile-view-header h2 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}
.profile-view-header h2 i { color: var(--color-primary); }

/* Grid: 2 columnas */
.profile-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}
.profile-col { display: flex; flex-direction: column; gap: 16px; }

/* Cards genéricas */
.profile-card {
    background: rgba(11,17,32,0.70);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    backdrop-filter: blur(12px);
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.profile-card-header i { color: var(--color-primary); font-size: 16px; }
.profile-card-header h4 { font-size: 15px; font-weight: 700; color: var(--text-primary); }

/* Tarjeta de identidad */
.profile-identity-card {
    text-align: center;
    background: linear-gradient(160deg, rgba(14,165,233,0.07), rgba(167,139,250,0.05));
    border-color: rgba(56,189,248,0.18);
}
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}
.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(56,189,248,0.35);
    display: block;
}
.profile-avatar-glow {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56,189,248,0.15), transparent 70%);
    pointer-events: none;
}
.profile-identity-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.profile-email-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.profile-meta-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.profile-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.profile-form-field span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.profile-form-field select,
.profile-form-field textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 10px 12px;
    transition: var(--ease-fast);
}

.profile-form-field select:focus,
.profile-form-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.profile-inline-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.profile-form-msg {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-form-msg.success {
    color: #34d399;
}

.profile-form-msg.error {
    color: #f87171;
}

/* Plan */
.profile-plan-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.profile-plan-badge {
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.profile-plan-free {
    background: rgba(100,116,139,0.18);
    border: 1px solid rgba(100,116,139,0.35);
    color: #94a3b8;
}
.profile-plan-pro {
    background: rgba(56,189,248,0.15);
    border: 1px solid rgba(56,189,248,0.35);
    color: #38bdf8;
}
.profile-plan-global {
    background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(167,139,250,0.18));
    border: 1px solid rgba(251,191,36,0.45);
    color: #fbbf24;
}
.profile-plan-desc { font-size: 13px; color: var(--text-muted); }
.profile-plan-expires {
    margin: -8px 0 14px 0;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.profile-plan-expires i { font-size: 10px; color: #38bdf8; }

.profile-plan-limits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.profile-plan-limits li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.profile-plan-limits li i.fa-check { color: #34d399; font-size: 11px; }
.profile-plan-limits li.profile-plan-locked { color: var(--text-muted); }
.profile-plan-limits li.profile-plan-locked i.fa-lock { color: var(--text-muted); font-size: 11px; }
.profile-locked-tag {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(56,189,248,0.1);
    border: 1px solid rgba(56,189,248,0.2);
    color: #38bdf8;
    font-size: 10px;
    font-weight: 700;
}

.profile-upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(14,165,233,0.18), rgba(167,139,250,0.12));
    border: 1px solid rgba(56,189,248,0.3);
    color: #38bdf8;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.profile-upgrade-btn:hover {
    background: linear-gradient(135deg, rgba(14,165,233,0.28), rgba(167,139,250,0.2));
    border-color: rgba(56,189,248,0.5);
}
/* When rendered as <button>, strip UA defaults */
button.profile-upgrade-btn {
    cursor: pointer;
    font-family: inherit;
    outline: none;
}
button.profile-upgrade-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* P04: Cancel plan button */
/* P05: tax notices */
.profile-tax-note {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin: 4px 0 0;
    opacity: 0.7;
}
.lp-plan-tax-note {
    display: block;
    font-size: 10px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
    opacity: 0.8;
}
.lp-tax-disclaimer {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
    opacity: 0.75;
}

.profile-cancel-plan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(239,68,68,0.25);
    color: rgba(239,68,68,0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    margin-top: 6px;
}
.profile-cancel-plan-btn:hover { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.45); color: #ef4444; }
.profile-cancel-plan-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* P04: Cancel plan modal */
.csp-panel {
    max-width: 420px;
    width: 90%;
}
.csp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0;
}
.csp-icon {
    font-size: 22px;
    color: #ef4444;
}
.csp-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.csp-body {
    padding: 16px 24px;
}
.csp-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.csp-policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.csp-policy-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.csp-policy-list li i { color: #38bdf8; flex-shrink: 0; margin-top: 2px; }
.csp-btn-confirm {
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid rgba(239,68,68,0.4);
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s;
}
.csp-btn-confirm:hover { background: rgba(239,68,68,0.18); }
.csp-btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

/* T03: Feedback FAB */
.feedback-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(167,139,250,0.14));
    border: 1px solid rgba(56,189,248,0.35);
    color: #38bdf8;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    transition: all 0.2s;
    font-family: inherit;
}
.feedback-fab:hover { background: linear-gradient(135deg, rgba(56,189,248,0.28), rgba(167,139,250,0.22)); transform: scale(1.07); }

/* T03: Feedback panel */
.feedback-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 1100;
    width: 320px;
    background: var(--bg-surface, #0b1120);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.feedback-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}
.feedback-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-default);
}
.feedback-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 7px;
}
.feedback-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: inherit;
}
.feedback-panel-close:hover { color: var(--text-primary); }
.feedback-panel-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.feedback-type-row { display: flex; gap: 6px; }
.feedback-type-btn {
    flex: 1;
    padding: 6px 4px;
    border-radius: 7px;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s;
}
.feedback-type-btn:hover { border-color: rgba(56,189,248,0.3); color: #38bdf8; }
.feedback-type-btn.active { border-color: rgba(56,189,248,0.5); background: rgba(56,189,248,0.1); color: #38bdf8; }
.feedback-textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    padding: 8px 10px;
    resize: vertical;
    box-sizing: border-box;
    min-height: 80px;
}
.feedback-textarea:focus { outline: none; border-color: rgba(56,189,248,0.4); }
.feedback-meta { display: flex; justify-content: space-between; align-items: center; }
.feedback-screen { font-size: 10px; color: var(--text-muted); }
.feedback-char-count { font-size: 10px; color: var(--text-muted); }
.feedback-panel-footer { padding: 8px 14px 12px; border-top: 1px solid var(--border-default); display: flex; flex-direction: column; gap: 8px; }
.feedback-msg { font-size: 12px; padding: 6px 10px; border-radius: 6px; }
.feedback-msg-ok  { color: #22c55e; background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2); }
.feedback-msg-err { color: #ef4444; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); }
.feedback-submit { width: 100%; justify-content: center; font-size: 13px; padding: 9px; }

@media (max-width: 480px) {
    .feedback-panel { width: calc(100vw - 32px); right: 16px; }
    .feedback-fab   { right: 16px; bottom: 16px; }
}

/* Sessions card (S14) */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.session-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-default);
    transition: background 0.15s;
}
.session-row.session-current {
    border-color: rgba(56,189,248,0.3);
    background: rgba(56,189,248,0.05);
}
.session-device-icon {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.session-current .session-device-icon { color: #38bdf8; }
.session-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.session-device {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.session-location,
.session-since {
    font-size: 11px;
    color: var(--text-muted);
}
.session-current-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #38bdf8;
    flex-shrink: 0;
}
.session-revoke-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.07);
    color: #ef4444;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.session-revoke-btn:hover { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.5); }
.session-revoke-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sessions-loading,
.sessions-empty,
.sessions-error {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.sessions-error { color: #ef4444; }

/* Stats */
.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.profile-stat {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.profile-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Preferencias */
.profile-prefs-list { display: flex; flex-direction: column; gap: 10px; }
.profile-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.profile-pref-row:last-child { border-bottom: none; }
.profile-pref-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--text-secondary);
}
.profile-pref-label i { color: var(--text-muted); width: 14px; text-align: center; }
.profile-pref-coming {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.2);
    color: #fbbf24;
    font-weight: 600;
    white-space: nowrap;
}

/* GDPR */
.profile-gdpr-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}
.profile-gdpr-actions { display: flex; flex-direction: column; gap: 10px; }
.profile-gdpr-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.profile-gdpr-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
    color: var(--text-primary);
}
.profile-gdpr-danger {
    border-color: rgba(239,68,68,0.25);
    color: #f87171;
}
.profile-gdpr-danger:hover {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.45);
}

/* Botón perfil en user-badge */
#btn-open-profile {
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
}
#btn-open-profile:hover { opacity: 1; color: #38bdf8; }

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

/* ═══════════════════════════════════════════════════════════════
   SUPPORT VIEW (A4)
   ═══════════════════════════════════════════════════════════════ */

.support-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    align-items: start;
}
.support-col-form,
.support-col-tickets { display: flex; flex-direction: column; gap: 16px; }

/* Tabs de tipo */
.support-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.support-type-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.support-type-tab:hover { border-color: rgba(255,255,255,0.15); color: var(--text-primary); }
.support-type-tab.active {
    background: rgba(56,189,248,0.1);
    border-color: rgba(56,189,248,0.35);
    color: #38bdf8;
}

/* Formulario */
.support-form .form-group { margin-bottom: 14px; }
.support-form .form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.support-form input,
.support-form select,
.support-form textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
    resize: vertical;
}
.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus {
    outline: none;
    border-color: rgba(56,189,248,0.4);
}
.support-form textarea { min-height: 100px; }

/* Mensaje de éxito/error */
.support-form-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}
.support-msg-success {
    background: rgba(52,211,153,0.1);
    border: 1px solid rgba(52,211,153,0.25);
    color: #34d399;
}
.support-msg-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: #f87171;
}

/* Lista de tickets */
.support-tickets-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.support-tickets-empty i { font-size: 28px; opacity: 0.4; }

.support-ticket-item {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    margin-bottom: 10px;
    transition: border-color 0.2s;
}
.support-ticket-item:last-child { margin-bottom: 0; }
.support-ticket-item:hover { border-color: rgba(255,255,255,0.1); }

.support-ticket-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.support-ticket-type,
.support-ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}
.support-ticket-prio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
}
.support-ticket-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}
.support-ticket-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.support-ticket-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.support-ticket-admin-note {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(56,189,248,0.07);
    border: 1px solid rgba(56,189,248,0.15);
    font-size: 12px;
    color: #7dd3fc;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.admin-support-filter {
    margin-left: auto;
    min-width: 120px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    padding: 6px 8px;
    font-size: 12px;
}

.admin-ticket-item {
    border-color: rgba(167, 139, 250, 0.22);
}

.admin-ticket-user {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.admin-ticket-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 10px;
}

.admin-ticket-actions textarea {
    min-height: 58px;
    resize: vertical;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 12px;
    font-family: inherit;
}

.admin-ticket-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-ticket-action-buttons button {
    min-width: 96px;
    justify-content: center;
    padding: 7px 10px;
    font-size: 12px;
}

/* FAQ de soporte */
.support-faq-list { display: flex; flex-direction: column; gap: 8px; }
.support-faq-item {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    overflow: hidden;
}
.support-faq-q {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    padding: 13px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: color 0.15s;
    font-family: inherit;
}
.support-faq-q:hover { color: var(--text-primary); }
.support-faq-q i { flex-shrink: 0; color: var(--text-muted); font-size: 11px; transition: transform 0.2s; }
.support-faq-item.open .support-faq-q { color: #38bdf8; }
.support-faq-item.open .support-faq-q i { transform: rotate(180deg); color: #38bdf8; }
.support-faq-a {
    display: none;
    padding: 0 16px 13px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
}
.support-faq-item.open .support-faq-a { display: block; }

/* Botón soporte en user-badge */
#btn-open-support {
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
}
#btn-open-support:hover { opacity: 1; color: #a78bfa; }

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

/* ═══════════════════════════════════════════════════════════════
   IMPACT SIMULATION MODAL (C2)
   ═══════════════════════════════════════════════════════════════ */

/* Cabecera de señal */
.impact-signal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px;
    background: rgba(56,189,248,0.05);
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: 10px;
    margin-bottom: 18px;
}
.impact-ticker-wrap { flex: 1; min-width: 100px; }
.impact-ticker {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.impact-company {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}
.impact-price-wrap,
.impact-fv-wrap {
    text-align: center;
}
.impact-price-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.impact-price-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.impact-fv-val {
    font-size: 16px;
    font-weight: 700;
    color: #34d399;
    font-variant-numeric: tabular-nums;
}
.impact-upside-wrap { text-align: center; }
.impact-upside {
    display: block;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.impact-upside-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Control de acciones */
.impact-shares-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.impact-shares-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}
.impact-shares-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.impact-shares-btn {
    width: 32px;
    height: 34px;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
}
.impact-shares-btn:hover { background: rgba(255,255,255,0.1); }
.impact-shares-input {
    width: 60px;
    height: 34px;
    background: rgba(255,255,255,0.04);
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.impact-shares-input:focus { outline: none; background: rgba(56,189,248,0.05); }
.impact-est-cost {
    font-size: 13px;
    color: #fbbf24;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Grilla de métricas */
.impact-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.impact-metric {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    position: relative;
}
.impact-metric-highlight {
    border-color: rgba(56,189,248,0.25);
    background: rgba(56,189,248,0.04);
}
.impact-metric-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 500;
}
.impact-metric-val {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.impact-metric-delta {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Disclaimer */
.impact-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: flex-start;
    line-height: 1.5;
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.impact-disclaimer i { color: #38bdf8; margin-top: 1px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE & TABLET (U05)
   Breakpoints: 768px (móvil), 1024px (tablet)
   ═══════════════════════════════════════════════════════════════ */

/* Botón hamburger — oculto en desktop */
.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}
.sidebar-toggle-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

/* Overlay oscuro detrás del drawer en móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 23, 0.7);
    z-index: 40;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
    .sidebar { width: 260px; min-width: 260px; }

    .topbar { padding: 10px 20px; }

    #header-company-name { font-size: 16px; }

    .dashboard-scroll { padding: 16px; }

    .charts-grid { grid-template-columns: 1fr; }

    .global-kpi-grid,
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }

    .all-metrics-grid { grid-template-columns: 1fr; }

    .support-grid { grid-template-columns: 1fr; }

    .profile-grid { grid-template-columns: 1fr; }

    .impact-metrics-grid { grid-template-columns: repeat(2, 1fr); }

    .exec-table-wrap { overflow-x: auto; }
}

/* ── Móvil (≤768px) ── */
@media (max-width: 768px) {
    /* Hamburger visible */
    .sidebar-toggle-btn { display: flex; align-items: center; justify-content: center; }

    /* Sidebar se convierte en drawer lateral */
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100%;
        width: 280px;
        min-width: 280px;
        z-index: 50;
        transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    .sidebar.sidebar-open {
        left: 0;
        box-shadow: 4px 0 32px rgba(0,0,0,0.5);
    }

    /* Main ocupa todo el ancho */
    .app-container { flex-direction: column; }
    .main-content { width: 100%; }

    /* Topbar */
    .topbar { padding: 10px 14px; min-height: 56px; }
    .topbar-left { flex: 1 1 auto; gap: 8px; }
    #header-company-name { font-size: 15px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* Dashboard scroll */
    .dashboard-scroll { padding: 12px; }

    /* Grillas → columna única */
    .charts-grid { grid-template-columns: 1fr; gap: 12px; }
    .global-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .all-metrics-grid { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .master-filters { flex-direction: column; gap: 8px; }

    /* Tablas — scroll horizontal */
    .exec-table-wrap,
    .master-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .exec-table { min-width: 600px; }

    /* Modales — full screen en móvil */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 16px 16px 0 0;
        margin-bottom: 0;
    }
    .modal-overlay { align-items: flex-end !important; }
    .gdpr-modal { border-radius: 16px 16px 0 0; }

    /* Score breakdown */
    .score-breakdown { grid-template-columns: 1fr; }
    .metrics-group-container { grid-template-columns: 1fr; }

    /* Sidebar footer disclaimer — más pequeño */
    .sidebar-disclaimer { font-size: 10px; }

    /* Ocultar textos largos en botones de sidebar */
    .sidebar-btn-db .fa-database ~ span,
    .sidebar-btn-bulk .fa-list-check ~ span { display: none; }

    /* Charts */
    .chart-card { min-height: 220px; }
    .chart-card-inner { height: 200px; }

    /* Login */
    .login-card { padding: 28px 20px; margin: 0 16px; }

    /* Support / Profile grids */
    .support-grid,
    .profile-grid { grid-template-columns: 1fr; }

    /* Impact modal */
    .impact-metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .impact-signal-header { flex-direction: column; align-items: flex-start; gap: 10px; }

    /* Execution header */
    .execution-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .exec-filter-tabs { flex-wrap: wrap; }

    /* Master DB header */
    .master-db-header-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .master-category-tabs { flex-wrap: wrap; }

    /* Global dash header */
    .global-dash-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Pequeño (≤480px) ── */
@media (max-width: 480px) {
    .global-kpi-grid,
    .kpi-grid { grid-template-columns: 1fr; }

    .impact-metrics-grid { grid-template-columns: 1fr; }

    #header-company-name { max-width: 130px; }

    .topbar-right { gap: 6px; }
    .topbar-right .action-btn span { display: none; }
    .topbar-right .action-btn i { margin: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   CONFIRM MODAL (U08)
   ═══════════════════════════════════════════════════════════════ */

.confirm-overlay {
    z-index: 9500;
    background: rgba(2, 8, 23, 0.80);
    backdrop-filter: blur(6px);
}

.confirm-modal {
    max-width: 420px;
    width: 92%;
    padding: 28px 28px 20px;
}

.confirm-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.confirm-icon-wrap { font-size: 24px; flex-shrink: 0; }

.confirm-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.confirm-message {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}

.danger-btn {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.danger-btn:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: #ef4444;
    color: #fca5a5;
}

/* ═══════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER (L04)
   ═══════════════════════════════════════════════════════════════ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 8000;
    background: rgba(11, 17, 32, 0.97);
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 24px;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
    animation: cookieBannerIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cookieBannerIn {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner-main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.cookie-banner-text {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 260px;
}

.cookie-banner-icon {
    color: #fbbf24;
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cookie-banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.cookie-banner-text span {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-btn-sm {
    padding: 7px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.cookie-btn-link {
    background: none;
    border: none;
    color: #38bdf8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 7px 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(56,189,248,0.4);
    transition: color 0.15s;
}
.cookie-btn-link:hover { color: #7dd3fc; }

/* Panel de configuración granular */
.cookie-config-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.cookie-config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.cookie-config-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
}

.cookie-config-info {
    flex: 1;
}

.cookie-config-info strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cookie-config-info span {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Toggle bloqueado (esenciales) */
.cookie-toggle-locked {
    color: var(--text-muted);
    font-size: 14px;
    padding: 4px;
    flex-shrink: 0;
}

/* Switch toggle */
.cookie-switch {
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.cookie-switch input { opacity: 0; width: 0; height: 0; }

.cookie-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 100px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    transition: background 0.2s, border-color 0.2s;
}

.cookie-switch-track::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: left 0.2s, background 0.2s;
}

.cookie-switch input:checked + .cookie-switch-track {
    background: rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.5);
}

.cookie-switch input:checked + .cookie-switch-track::after {
    left: calc(100% - 17px);
    background: #38bdf8;
}

.cookie-config-footer {
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 900px) {
    .cookie-config-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .cookie-banner { padding: 14px 16px; }
    .cookie-banner-main { gap: 12px; }
    .cookie-banner-actions { width: 100%; justify-content: flex-end; }
}

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADING SYSTEM (U01)
   ═══════════════════════════════════════════════════════════════ */

.sk {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.03) 25%,
        rgba(255,255,255,0.07) 50%,
        rgba(255,255,255,0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite linear;
    border-radius: 6px;
}

/* Líneas de texto */
.sk-line { height: 12px; margin-bottom: 8px; }
.sk-line.w-30 { width: 30%; }
.sk-line.w-50 { width: 50%; }
.sk-line.w-70 { width: 70%; }
.sk-line.w-90 { width: 90%; }
.sk-line.w-full { width: 100%; }

/* Bloques */
.sk-block { height: 100%; width: 100%; min-height: 40px; }
.sk-circle { border-radius: 50%; }
.sk-title { height: 20px; }
.sk-value { height: 32px; }
.sk-badge { height: 22px; width: 60px; border-radius: 100px; display: inline-block; }

/* Skeleton: panel de análisis de empresa */
.sk-analysis-wrap {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#skeleton-dashboard {
    padding: 24px 28px;
    width: 100%;
    box-sizing: border-box;
}

.sk-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.sk-kpi-card {
    padding: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sk-scores-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-top: 4px;
}

.sk-score-block {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sk-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sk-metric-card {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Skeleton: filas de tabla */
.sk-table-row {
    display: grid;
    gap: 0;
}

.sk-table-row td, .sk-table-cell {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

@media (max-width: 768px) {
    .sk-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .sk-scores-row { grid-template-columns: 1fr; }
    .sk-metrics-row { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   U07 — AUTOSAVE STATUS INDICATOR
   ═══════════════════════════════════════════════════════════════ */
.autosave-status {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    transition: opacity 0.3s;
}

.autosave-status.has-draft {
    color: #f59e0b;
}

.autosave-status.saved {
    color: #22c55e;
}

/* ═══════════════════════════════════════════════════════════════
   U06 — ONBOARDING / EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.onboarding-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 32px 40px;
    gap: 40px;
    max-width: 860px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.onboarding-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.onboarding-icon-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56,189,248,0.15) 0%, rgba(56,189,248,0.04) 70%);
    border: 1px solid rgba(56,189,248,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--color-sky);
    box-shadow: 0 0 32px rgba(56,189,248,0.12);
}

.onboarding-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.5px;
}

.onboarding-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.6;
    margin: 0;
}

/* ── Steps row ── */
.onboarding-steps {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.onboarding-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: 14px;
    background: rgba(11,17,32,0.60);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, background 0.2s;
}

.onboarding-step:hover {
    border-color: rgba(56,189,248,0.25);
    background: rgba(56,189,248,0.04);
}

.onboarding-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(56,189,248,0.15);
    border: 1px solid rgba(56,189,248,0.30);
    color: var(--color-sky);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-step-icon {
    font-size: 22px;
    color: var(--color-sky);
    opacity: 0.75;
}

.onboarding-step-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.onboarding-step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.onboarding-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.onboarding-step-arrow {
    padding-top: 52px;
    color: rgba(255,255,255,0.18);
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Actions ── */
.onboarding-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.onboarding-add-btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    gap: 8px;
}

.onboarding-docs-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.onboarding-docs-link:hover {
    color: var(--color-text);
    background: rgba(255,255,255,0.05);
}

/* ── Sidebar empty state ── */
.sidebar-empty-onboarding {
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar-empty-onboarding .seo-icon {
    font-size: 28px;
    color: rgba(56,189,248,0.40);
}

.sidebar-empty-onboarding p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.sidebar-empty-onboarding .seo-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.28);
}

/* U11: sidebar empty CTA button */
.seo-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    background: rgba(56,189,248,0.12);
    border: 1px solid rgba(56,189,248,0.3);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.seo-cta-btn:hover { background: rgba(56,189,248,0.2); }

/* U11: sidebar no-results text */
.sidebar-no-results {
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* U11: sidebar error state */
.sidebar-error-state {
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-size: 12px;
}
.sidebar-error-state i { font-size: 22px; opacity: 0.7; }
.sidebar-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08);
    color: #ef4444;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.sidebar-retry-btn:hover { background: rgba(239,68,68,0.16); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .onboarding-steps { flex-direction: column; }
    .onboarding-step-arrow { display: none; }
    .onboarding-panel { padding: 40px 16px 32px; }
    .onboarding-title { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════════════
   MODAL ELIMINAR CUENTA (L03 — RGPD art. 17)
   ═══════════════════════════════════════════════════════════════ */

/* D05: Modal Archivar / Eliminar empresa */
.dco-panel { max-width: 440px; width: 90%; }
.dco-header { padding: 20px 24px 0; }
.dco-header h3 { font-size: 16px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dco-ticker-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(56,189,248,0.12);
    border: 1px solid rgba(56,189,248,0.3);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 700;
    font-family: monospace;
}
.dco-body { padding: 14px 24px; }
.dco-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.dco-options { display: flex; flex-direction: column; gap: 10px; }
.dco-option-btn {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.15s;
}
.dco-option-btn > i { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.dco-option-body { display: flex; flex-direction: column; gap: 3px; }
.dco-option-title { font-size: 14px; font-weight: 600; }
.dco-option-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.dco-archive > i, .dco-archive .dco-option-title { color: #38bdf8; }
.dco-archive:hover { border-color: rgba(56,189,248,0.4); background: rgba(56,189,248,0.06); }

.dco-delete > i, .dco-delete .dco-option-title { color: #ef4444; }
.dco-delete:hover { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.06); }

.dac-panel {
    max-width: 480px;
    width: 100%;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.dac-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 24px 0;
}
.dac-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #f87171;
    flex-shrink: 0;
}
.dac-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.dac-body {
    padding: 16px 24px 8px;
}
.dac-warning {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.dac-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dac-list li {
    font-size: 13px;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dac-list li i { font-size: 11px; opacity: 0.8; }
.dac-note {
    font-size: 12px;
    color: var(--text-tertiary);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 16px;
}
.dac-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding-bottom: 8px;
}
.dac-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: #ef4444;
    flex-shrink: 0;
    cursor: pointer;
}
.dac-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* G05: Data attribution footer (company dashboard) */
.data-attribution-footer {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(7,12,24,0.6);
    border: 1px solid rgba(100,116,139,0.12);
    border-radius: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.data-attr-sources {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 8px;
    margin-bottom: 7px;
}
.data-attr-label { color: var(--text-secondary); font-weight: 500; }
.data-attr-item { color: rgba(100,116,139,0.8); }
.data-attr-sep { color: rgba(100,116,139,0.35); }
.data-attr-disclaimer {
    font-size: 10px;
    color: rgba(100,116,139,0.6);
    line-height: 1.55;
    margin: 0;
}

/* R01: Ticker search autocomplete */
.search-autocomplete-wrap {
    position: relative;
    width: 100%;
}

.ticker-search-input {
    width: 100%;
    background: rgba(7,12,24,0.8);
    border: 1px solid rgba(56,189,248,0.2);
    border-radius: 8px;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.ticker-search-input:focus {
    border-color: rgba(56,189,248,0.55);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}
.ticker-search-input::placeholder { color: rgba(148,163,184,0.5); }

.ticker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0b1120;
    border: 1px solid rgba(56,189,248,0.22);
    border-radius: 10px;
    z-index: 500;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    scrollbar-width: thin;
    scrollbar-color: rgba(56,189,248,0.2) transparent;
}
.ticker-dropdown::-webkit-scrollbar { width: 4px; }
.ticker-dropdown::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.2); border-radius: 2px; }

.ticker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background .15s;
}
.ticker-option:last-child { border-bottom: none; }
.ticker-option:first-child { border-radius: 10px 10px 0 0; }
.ticker-option:last-child:first-child { border-radius: 10px; }
.ticker-option:hover,
.ticker-option.focused { background: rgba(56,189,248,0.08); }

.ticker-opt-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    position: relative;
}
.ticker-opt-logo img {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.04);
}
.ticker-opt-initials {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #020817;
    letter-spacing: .02em;
}

.ticker-opt-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.ticker-opt-symbol {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
}
.ticker-opt-name {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-opt-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}
.ticker-opt-exchange {
    font-size: 10px;
    font-weight: 600;
    color: #38bdf8;
    letter-spacing: .03em;
}
.ticker-opt-type {
    font-size: 9px;
    color: rgba(148,163,184,0.5);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.ticker-opt-type.etf { color: rgba(167,139,250,0.7); }
.ticker-opt-type.index { color: rgba(251,191,36,0.7); }

.ticker-dropdown-empty {
    padding: 16px 14px;
    font-size: 13px;
    color: rgba(148,163,184,0.5);
    text-align: center;
}

.ticker-dropdown-loading {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(148,163,184,0.5);
    font-size: 12px;
}
.ticker-dropdown-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(56,189,248,0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: ticker-spin .6s linear infinite;
}
@keyframes ticker-spin { to { transform: rotate(360deg); } }

/* R01: Selected company card */
.selected-company-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(56,189,248,0.06);
    border: 1px solid rgba(56,189,248,0.25);
    border-radius: 10px;
    margin-bottom: 14px;
}
.selected-co-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.clear-selection-btn {
    background: none;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.clear-selection-btn:hover { border-color: rgba(56,189,248,0.4); color: #38bdf8; }

/* R01: Manual entry toggle */
.manual-entry-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 12px;
    flex-wrap: wrap;
}
.manual-entry-label {
    font-size: 12px;
    color: rgba(148,163,184,0.6);
}
.link-btn {
    background: none;
    border: none;
    color: #38bdf8;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(56,189,248,0.4);
}
.link-btn:hover { color: #7dd3fc; }
.data-attr-disclaimer i { color: rgba(251,191,36,0.55); margin-right: 4px; }

/* ═══════════════════════════════════════════════════════════
   VALUATION LAB — Laboratorio de Valoración Interactiva
   ═══════════════════════════════════════════════════════════ */

.vlab-tab-btn { position: relative; }
.vlab-tab-badge {
    position: absolute;
    top: -4px; right: -4px;
    font-size: 8px; font-weight: 700; letter-spacing: 0.04em;
    background: linear-gradient(135deg, #38bdf8, #7c3aed);
    color: #fff; padding: 1px 4px; border-radius: 4px; line-height: 1.4;
}

.vlab-state-wrap {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 48px 24px; color: var(--text-secondary); text-align: center;
}
.vlab-state-icon { font-size: 2.5rem; color: var(--accent-primary); opacity: 0.5; }
.vlab-state-wrap h3 { color: var(--text-primary); margin: 0; }
.vlab-state-wrap p  { margin: 0; max-width: 340px; line-height: 1.5; }

.vlab-price-bar {
    display: flex; align-items: center; gap: 0;
    padding: 18px 24px; margin-bottom: 16px; flex-wrap: wrap;
}
.vlab-price-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 0 24px; flex: 1; min-width: 120px;
}
.vlab-price-item:first-child { padding-left: 0; }
.vlab-price-divider { width: 1px; height: 40px; background: var(--border-default); flex-shrink: 0; }
.vlab-label {
    font-size: 11px; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-tertiary);
}
.vlab-price-main  { font-size: 1.7rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.vlab-price-target { font-size: 1.2rem; font-weight: 600; color: var(--accent-gold); font-variant-numeric: tabular-nums; }
.vlab-price-eps   { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }

.vlab-sliders-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px; margin-bottom: 16px;
}
.vlab-slider-card { padding: 20px 22px; }
.vlab-card-disabled { opacity: 0.4; pointer-events: none; }

.vlab-slider-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.vlab-method-badge {
    font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
    padding: 4px 10px; border-radius: 6px; white-space: nowrap;
}
.vlab-badge-sky    { background: rgba(56,189,248,0.15);  color: #38bdf8; border: 1px solid rgba(56,189,248,0.25); }
.vlab-badge-violet { background: rgba(167,139,250,0.15); color: #a78bfa; border: 1px solid rgba(167,139,250,0.25); }
.vlab-badge-gold   { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.22); }

.vlab-method-meta  { display: flex; flex-direction: column; gap: 2px; }
.vlab-method-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.vlab-current-multiple { font-size: 11px; color: var(--text-tertiary); }

.vlab-slider-wrap  { margin-bottom: 14px; }
.vlab-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 5px; border-radius: 3px; outline: none; cursor: pointer;
    background: linear-gradient(to right,
        #38bdf8 0%, #38bdf8 var(--slider-pct, 25%),
        rgba(148,163,184,0.12) var(--slider-pct, 25%), rgba(148,163,184,0.12) 100%
    );
}
.vlab-slider-violet {
    background: linear-gradient(to right,
        #a78bfa 0%, #a78bfa var(--slider-pct, 25%),
        rgba(148,163,184,0.12) var(--slider-pct, 25%), rgba(148,163,184,0.12) 100%
    );
}
.vlab-slider-gold {
    background: linear-gradient(to right,
        #fbbf24 0%, #fbbf24 var(--slider-pct, 25%),
        rgba(148,163,184,0.12) var(--slider-pct, 25%), rgba(148,163,184,0.12) 100%
    );
}
.vlab-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: #38bdf8; border: 3px solid var(--bg-surface); cursor: pointer;
    box-shadow: 0 0 10px rgba(56,189,248,0.4); transition: transform 0.1s;
}
.vlab-slider-violet::-webkit-slider-thumb { background: #a78bfa; box-shadow: 0 0 10px rgba(167,139,250,0.4); }
.vlab-slider-gold::-webkit-slider-thumb   { background: #fbbf24; box-shadow: 0 0 10px rgba(251,191,36,0.4); }
.vlab-slider:hover::-webkit-slider-thumb  { transform: scale(1.2); }
.vlab-slider::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: #38bdf8; border: 3px solid var(--bg-surface); cursor: pointer;
}

.vlab-slider-ticks {
    display: flex; justify-content: space-between;
    margin-top: 6px; font-size: 10px; color: var(--text-tertiary);
}

.vlab-implied-display {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-subtle);
}
.vlab-implied-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); display: block; margin-bottom: 2px; }
.vlab-implied-price { font-size: 1.6rem; font-weight: 700; color: #38bdf8; font-variant-numeric: tabular-nums; line-height: 1; }
.vlab-right-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.vlab-multiple-display { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.vlab-ev-big { font-size: 1.6rem; color: #fbbf24; }
.vlab-implied-delta { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.vlab-implied-delta.positive { color: var(--color-success); background: var(--color-success-bg); }
.vlab-implied-delta.negative { color: var(--color-danger);  background: var(--color-danger-bg);  }

.vlab-ev-note { margin: 12px 0 0; font-size: 11px; color: var(--text-tertiary); line-height: 1.4; padding-top: 10px; border-top: 1px solid var(--border-subtle); }

.vlab-scenarios { padding: 20px 24px; }
.vlab-scenarios-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.vlab-scenarios-header h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.vlab-scenarios-header h4 i { color: var(--accent-primary); }
.vlab-scenarios-sub { font-size: 11px; color: var(--text-tertiary); }

.vlab-scenarios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.vlab-scenario {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 12px; border-radius: 12px; border: 1px solid var(--border-default);
    background: var(--bg-elevated); text-align: center;
}
.vlab-scenario-bear { border-color: var(--color-danger-border);  background: var(--color-danger-bg);  }
.vlab-scenario-base { border-color: var(--border-accent);         background: rgba(56,189,248,0.05);   }
.vlab-scenario-bull { border-color: var(--color-success-border); background: var(--color-success-bg); }

.vlab-sc-label    { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.vlab-sc-multiple { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.vlab-sc-price    { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.vlab-sc-delta    { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.vlab-sc-delta.positive { color: var(--color-success); background: rgba(52,211,153,0.12); }
.vlab-sc-delta.negative { color: var(--color-danger);  background: rgba(248,113,113,0.12); }

/* Save row */
.vlab-save-row {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle);
}
.vlab-label-input {
    flex: 1; background: var(--bg-base); border: 1px solid var(--border-default);
    border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--text-primary);
    font-family: inherit; outline: none; transition: border-color 0.15s;
}
.vlab-label-input::placeholder { color: var(--text-tertiary); }
.vlab-label-input:focus { border-color: var(--accent-primary); }
.vlab-save-btn {
    flex-shrink: 0; background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.3);
    color: #38bdf8; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 5px; transition: background 0.15s;
    font-family: inherit;
}
.vlab-save-btn:hover { background: rgba(56,189,248,0.22); }
.vlab-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.vlab-save-btn-violet {
    background: rgba(167,139,250,0.12); border-color: rgba(167,139,250,0.3); color: #a78bfa;
}
.vlab-save-btn-violet:hover { background: rgba(167,139,250,0.22); }

/* Saved scenarios panel */
.vlab-saved-panel { padding: 20px 24px; margin-top: 0; }
.vlab-saved-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.vlab-saved-header h4 {
    margin: 0; font-size: 14px; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.vlab-saved-header h4 i { color: var(--accent-primary); }
.vlab-saved-count { font-size: 11px; color: var(--text-tertiary); }

.vlab-saved-list { display: flex; flex-direction: column; gap: 8px; }
.vlab-saved-empty {
    display: flex; align-items: center; gap: 10px; padding: 14px 0;
    font-size: 12px; color: var(--text-tertiary);
}

.vlab-saved-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 10px; background: var(--bg-elevated);
    border: 1px solid var(--border-default); transition: border-color 0.15s;
}
.vlab-saved-item:hover { border-color: var(--border-strong); }
.vlab-saved-method-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.vlab-saved-method-dot.pe     { background: #38bdf8; }
.vlab-saved-method-dot.ps     { background: #a78bfa; }
.vlab-saved-method-dot.ev_ebitda { background: #fbbf24; }
.vlab-saved-body { flex: 1; min-width: 0; }
.vlab-saved-label { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vlab-saved-meta  { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.vlab-saved-price { font-size: 1.1rem; font-weight: 700; color: var(--accent-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vlab-saved-delta { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 10px; white-space: nowrap; }
.vlab-saved-delta.positive { color: var(--color-success); background: var(--color-success-bg); }
.vlab-saved-delta.negative { color: var(--color-danger); background: var(--color-danger-bg); }
.vlab-saved-del {
    background: none; border: none; color: var(--text-tertiary); cursor: pointer;
    padding: 4px 6px; border-radius: 6px; font-size: 12px; flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.vlab-saved-del:hover { color: var(--color-danger); background: var(--color-danger-bg); }

/* Athena Score chip in price bar */
.vlab-score-item { align-items: flex-start; }
.vlab-score-chip {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 3px 14px; border-radius: 20px; line-height: 1;
    border: 1.5px solid var(--border-accent);
    background: rgba(56,189,248,0.08); color: var(--accent-primary);
}
.vlab-score-chip.score-green  { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success-border); }
.vlab-score-chip.score-yellow { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.vlab-score-chip.score-red    { color: var(--color-danger);  background: var(--color-danger-bg);  border-color: var(--color-danger-border); }

/* Price Alerts panel */
.vlab-alerts-panel { padding: 20px 24px; }
.vlab-alerts-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.vlab-alerts-header h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.vlab-alerts-header h4 i { color: var(--accent-gold); }
.vlab-alerts-count { font-size: 11px; color: var(--text-tertiary); }
.vlab-alert-form {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle);
}
.vlab-alert-select {
    background: var(--bg-base); border: 1px solid var(--border-default);
    border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--text-primary);
    font-family: inherit; outline: none; cursor: pointer;
}
.vlab-alert-input {
    width: 110px; background: var(--bg-base); border: 1px solid var(--border-default);
    border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--text-primary);
    font-family: inherit; outline: none;
}
.vlab-alert-input:focus, .vlab-alert-select:focus { border-color: var(--accent-gold); }
.vlab-alert-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px; background: var(--bg-elevated);
    border: 1px solid var(--border-default);
}
.vlab-alert-item.alert-triggered { opacity: 0.55; }
.vlab-alert-icon { font-size: 13px; }
.vlab-alert-icon.above { color: var(--color-success); }
.vlab-alert-icon.below { color: var(--color-danger);  }
.vlab-alert-body { flex: 1; min-width: 0; }
.vlab-alert-threshold { font-size: 13px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.vlab-alert-note { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.vlab-alert-toggle {
    background: none; border: 1px solid var(--border-default); border-radius: 6px;
    color: var(--text-tertiary); cursor: pointer; padding: 3px 7px; font-size: 11px;
    font-family: inherit; transition: all 0.15s;
}
.vlab-alert-toggle:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.vlab-alert-toggle.paused { color: var(--color-warning); border-color: rgba(251,191,36,0.3); }
.vlab-alert-delete {
    background: none; border: 1px solid transparent; border-radius: 6px;
    color: var(--text-tertiary); cursor: pointer; padding: 3px 7px; font-size: 13px;
    font-family: inherit; transition: all 0.15s; line-height: 1;
}
.vlab-alert-delete:hover { color: var(--color-danger); border-color: rgba(239,68,68,0.3); }

/* Score history */
.vlab-score-history { padding: 20px 24px; }
.vlab-score-history-header {
    display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px;
}
.vlab-score-history-header h4 {
    margin: 0; font-size: 14px; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.vlab-score-history-header h4 i { color: var(--accent-secondary); }
.vlab-score-history-sub { font-size: 11px; color: var(--text-tertiary); }
.vlab-score-chart-wrap { position: relative; }

@media (max-width: 600px) {
    .vlab-price-bar { gap: 12px; padding: 14px 16px; }
    .vlab-price-divider { display: none; }
    .vlab-price-item { padding: 0; min-width: 80px; }
    .vlab-sliders-grid { grid-template-columns: 1fr; }
    .vlab-scenarios-grid { grid-template-columns: 1fr; }
    .vlab-save-row { flex-wrap: wrap; }
    .vlab-saved-item { flex-wrap: wrap; gap: 8px; }
}

/* ── Paddle billing interval selector ──────────────────── */
.profile-upgrade-block { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.profile-interval-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.profile-interval-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
    line-height: 1.3;
    text-align: center;
}
.profile-interval-btn strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.profile-interval-btn strong span {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
}
.profile-interval-btn:hover {
    border-color: rgba(56,189,248,0.3);
    background: rgba(56,189,248,0.05);
    color: var(--text-secondary);
}
.profile-interval-btn.active {
    border-color: rgba(56,189,248,0.5);
    background: rgba(56,189,248,0.08);
    color: #38bdf8;
}
.profile-interval-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #22c55e;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    letter-spacing: 0.3px;
}
