/* =========================================================
   BRAVO CRM — DASHBOARD PAGE
   ========================================================= */

/* -------------------------------------------------------
   PAGE LAYOUT
-------------------------------------------------------- */

.dashboard {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Explicit vertical spacing between dashboard sections.
   We intentionally use margin-top on adjacent siblings instead of
   the flex `gap` so the rule is impossible to miss in DevTools and
   guaranteed to apply even if a parent stylesheet resets gap. */
.dashboard > * + * {
    margin-top: 32px;
}


/* -------------------------------------------------------
   BALANCE CARD
-------------------------------------------------------- */

.balance-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(15,23,42,.13);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(15,23,42,.07), 0 1px 4px rgba(15,23,42,.04);
    background:
        radial-gradient(900px 360px at 0% 0%,   rgba(99,102,241,.13) 0%, rgba(99,102,241,0) 60%),
        radial-gradient(700px 300px at 100% 0%,  rgba(237,192,22,.18) 0%, rgba(242,135,57,0) 55%),
        radial-gradient(600px 250px at 60% 100%, rgba(34,197,94,.08)  0%, rgba(34,197,94,0)  60%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    transition:
        transform .4s cubic-bezier(.22,.61,.36,1),
        box-shadow .4s cubic-bezier(.22,.61,.36,1);
}

.balance-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 50px rgba(15,23,42,.14),
        0 8px 20px rgba(15,23,42,.08);
}

/* top row: label + amount + link */
.balance-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 32px 36px 24px;
}

.balance-card__label {
    font-size: 12px;
    color: #7b8798;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.balance-card__amount {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg,#0f172a 0%,#1e293b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.balance-card__amount-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 24h change badge */
.balance-card__change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    margin-top: 0;
}

.balance-card__change--up {
    background: rgba(34,197,94,.12);
    color: #15803d;
    border: 1px solid rgba(34,197,94,.22);
}

.balance-card__change--down {
    background: rgba(239,68,68,.10);
    color: #b91c1c;
    border: 1px solid rgba(239,68,68,.20);
}

.balance-card__change-label {
    font-size: 10px;
    font-weight: 500;
    opacity: .7;
    margin-left: 2px;
}

.balance-card__sub {
    font-size: 14px;
    color: #64748b;
    margin-top: 8px;
}

.balance-card__link {
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.balance-card__link:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .balance-card__top {
        flex-direction: column;
        gap: 16px;
        padding: 22px 20px 16px;
    }
    .balance-card__amount { font-size: 30px; }
}


/* -------------------------------------------------------
   BALANCE CARD — SPARKLINE STRIP
-------------------------------------------------------- */

/* Sparkline section: bleeds full width, sits below the top row */
.balance-card__spark {
    border-top: 1px solid rgba(15,23,42,.06);
    background: rgba(99,102,241,.03); /* subtle tint default (up) */
}

.balance-card__spark--down {
    background: rgba(239,68,68,.03);
}

/* label row: from-date │ 7D badge + % │ to-date */
.balance-card__spark-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 4px;
}

.balance-card__spark-date {
    font-size: 11px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

.balance-card__spark-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.balance-card__spark-period {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #94a3b8;
    background: rgba(15,23,42,.06);
    border-radius: 4px;
    padding: 2px 6px;
}

.balance-card__spark-pct {
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 7px;
}
.balance-card__spark-pct.up   { color: #15803d; background: rgba(34,197,94,.12); }
.balance-card__spark-pct.down { color: #b91c1c; background: rgba(239,68,68,.10); }

/* canvas wrapper — responsive height */
.balance-card__spark-canvas {
    position: relative;
    height: 72px;
    overflow: hidden;
}
.balance-card__spark-canvas canvas {
    display: block;
    width: 100% !important;
    height: 72px !important;
}

/* Dark theme */
:root.theme-dark .balance-card__spark {
    border-top-color: rgba(255,255,255,.07);
    background: rgba(99,102,241,.05);
}
:root.theme-dark .balance-card__spark--down { background: rgba(239,68,68,.05); }
:root.theme-dark .balance-card__spark-period {
    color: rgba(234,236,239,.45);
    background: rgba(255,255,255,.07);
}
:root.theme-dark .balance-card__spark-pct.up   { color: #0ecb81; background: rgba(14,203,129,.12); }
:root.theme-dark .balance-card__spark-pct.down { color: #f6465d; background: rgba(246,70,93,.12); }


/* -------------------------------------------------------
   DASH ROW-2  (Allocation donut + Market ticker)
-------------------------------------------------------- */

.dash-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .dash-row-2 { grid-template-columns: 1fr; }
}


/* -------------------------------------------------------
   PORTFOLIO ALLOCATION CARD (donut)
-------------------------------------------------------- */

.alloc-card__body {
    display: flex;
    align-items: center;
    gap: 28px;
}

.alloc-card__donut {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.alloc-card__donut canvas {
    width: 120px !important;
    height: 120px !important;
}

.alloc-card__total {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.alloc-card__total-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    line-height: 1;
}

.alloc-card__total-val {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
    margin-top: 3px;
    letter-spacing: -.02em;
}

.alloc-card__legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.alloc-legend__row {
    display: flex;
    align-items: center;
    gap: 8px;
    container-type: inline-size;
}

.alloc-legend__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alloc-legend__label {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, monospace;
    flex-shrink: 0;
    min-width: 42px;
}

.alloc-legend__bar-wrap {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: rgba(15,23,42,.07);
    overflow: hidden;
    min-width: 0;
}

.alloc-legend__bar {
    height: 100%;
    border-radius: 999px;
    transition: width .6s cubic-bezier(.22,.61,.36,1);
    min-width: 3px; /* small allocations still show a visible sliver */
}

.alloc-legend__pct {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

:root.theme-dark .alloc-card__total-val  { color: var(--text); }
:root.theme-dark .alloc-legend__label    { color: var(--text); }
:root.theme-dark .alloc-legend__pct      { color: var(--muted); }
:root.theme-dark .alloc-legend__bar-wrap { background: rgba(255,255,255,.08); }


/* -------------------------------------------------------
   MARKET TICKER CARD
-------------------------------------------------------- */

.ticker-list {
    display: flex;
    flex-direction: column;
}

.ticker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(15,23,42,.06);
    border-radius: 10px;
    margin: 0 -8px;
    transition:
        background .18s ease,
        box-shadow .18s ease,
        transform .25s cubic-bezier(.22,.61,.36,1);
}

.ticker-row:last-child { border-bottom: none; }
.ticker-row:hover {
    background: #f8fafc;
    box-shadow: 0 1px 4px rgba(15,23,42,.06);
    transform: translateX(4px);
}

.ticker-row__icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.ticker-row__icon img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.ticker-row__info { flex: 1; min-width: 0; }

.ticker-row__code {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, monospace;
}

.ticker-row__name {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}

.ticker-row__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.ticker-row__price {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, monospace;
}

.ticker-row__change {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    padding: 1px 6px;
    border-radius: 6px;
}

.ticker-row__change--up   { color: #15803d; background: rgba(34,197,94,.10); }
.ticker-row__change--down { color: #b91c1c; background: rgba(239,68,68,.08); }
.ticker-row__change--flat { color: #64748b; }

:root.theme-dark .ticker-row:hover {
    background: rgba(255,255,255,.04);
    box-shadow: 0 1px 6px rgba(0,0,0,.18);
    transform: translateX(4px);
}
:root.theme-dark .ticker-row       { border-bottom-color: var(--border-soft); }
:root.theme-dark .ticker-row__code  { color: var(--text); }
:root.theme-dark .ticker-row__price { color: var(--text); }
:root.theme-dark .ticker-row__change--up   { color: #0ecb81; background: rgba(14,203,129,.12); }
:root.theme-dark .ticker-row__change--down { color: #f6465d; background: rgba(246,70,93,.12); }


/* -------------------------------------------------------
   SECURITY — SCORE BADGE
-------------------------------------------------------- */

.security-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid rgba(34,197,94,.20);
    background: linear-gradient(135deg, rgba(34,197,94,.07) 0%, rgba(14,165,233,.05) 100%);
}

.security-score--warn {
    border-color: rgba(245,158,11,.25);
    background: linear-gradient(135deg, rgba(245,158,11,.07) 0%, rgba(239,68,68,.04) 100%);
}

.security-score--danger {
    border-color: rgba(239,68,68,.25);
    background: linear-gradient(135deg, rgba(239,68,68,.07) 0%, rgba(239,68,68,.04) 100%);
}

.security-score__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.security-score__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(34,197,94,.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.security-score--warn  .security-score__icon { background: rgba(245,158,11,.14); }
.security-score--danger .security-score__icon { background: rgba(239,68,68,.14); }

.security-score__icon svg { stroke: #16a34a; }
.security-score--warn  .security-score__icon svg { stroke: #d97706; }
.security-score--danger .security-score__icon svg { stroke: #dc2626; }

.security-score__title {
    font-size: 14px;
    font-weight: 700;
    color: #15803d;
}

.security-score--warn  .security-score__title  { color: #92400e; }
.security-score--danger .security-score__title { color: #991b1b; }

.security-score__sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 1px;
}

.security-score__badge {
    font-size: 22px;
    font-weight: 900;
    color: #16a34a;
    letter-spacing: -.04em;
    white-space: nowrap;
}

.security-score--warn  .security-score__badge  { color: #d97706; }
.security-score--danger .security-score__badge { color: #dc2626; }

:root.theme-dark .security-score {
    border-color: rgba(34,197,94,.22);
    background: rgba(34,197,94,.07);
}
:root.theme-dark .security-score--warn {
    border-color: rgba(245,158,11,.22);
    background: rgba(245,158,11,.07);
}
:root.theme-dark .security-score--danger {
    border-color: rgba(239,68,68,.22);
    background: rgba(239,68,68,.07);
}
:root.theme-dark .security-score__title  { color: #0ecb81; }
:root.theme-dark .security-score--warn  .security-score__title { color: #f0b90b; }
:root.theme-dark .security-score--danger .security-score__title { color: #f6465d; }
:root.theme-dark .security-score__sub    { color: var(--muted); }
:root.theme-dark .security-score__badge  { color: #0ecb81; }
:root.theme-dark .security-score--warn  .security-score__badge { color: #f0b90b; }
:root.theme-dark .security-score--danger .security-score__badge { color: #f6465d; }





/* -------------------------------------------------------
   QUICK ACTIONS — SPLIT CARD
-------------------------------------------------------- */

.quick-section__title {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    margin-bottom: 14px;
}

/* ── Outer card ── */
.quick-actions-card {
    background: var(--surface);
    border: 1px solid rgba(15,23,42,.09);
    border-radius: 28px;
    box-shadow: 0 4px 20px rgba(15,23,42,.05), 0 1px 4px rgba(15,23,42,.03);
    overflow: hidden;
}

/* ── Split row ── */
.quick-actions-split {
    display: flex;
    align-items: stretch;
}

/* ── Each half ── */
.quick-action-half {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px 36px;
    text-decoration: none !important;
    cursor: pointer;
    transition:
        background .2s ease,
        box-shadow .2s ease;
}

.quick-action-half--buy:hover  { background: rgba(34,197,94,.04); }
.quick-action-half--sell:hover { background: rgba(139,92,246,.04); }

/* ── Icon circles ── */
.quick-action-half__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow .2s ease;
}

.quick-action-half__icon-wrap--buy {
    background: rgba(34,197,94,.09);
    border: 1px solid rgba(34,197,94,.18);
}
.quick-action-half__icon-wrap--buy svg { stroke: #16a34a; }

.quick-action-half--buy:hover .quick-action-half__icon-wrap--buy {
    box-shadow: 0 4px 16px rgba(34,197,94,.18);
}

.quick-action-half__icon-wrap--sell {
    background: rgba(139,92,246,.09);
    border: 1px solid rgba(139,92,246,.18);
}
.quick-action-half__icon-wrap--sell svg { stroke: #7c3aed; }

.quick-action-half--sell:hover .quick-action-half__icon-wrap--sell {
    box-shadow: 0 4px 16px rgba(139,92,246,.18);
}

/* ── Text body ── */
.quick-action-half__body {
    display: flex;
    flex-direction: column;
}

.quick-action-half__name {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 4px;
}

.quick-action-half__desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
}

/* ── Badge pill ── */
.quick-action-half__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,.10);
    width: fit-content;
    white-space: nowrap;
}

/* ── Vertical divider ── */
.quick-actions-divider {
    width: 1px;
    background: rgba(15,23,42,.07);
    margin: 28px 0;
    flex-shrink: 0;
}

/* ── Responsive: stack on mobile ── */
@media (max-width: 640px) {
    .quick-actions-split {
        flex-direction: column;
    }
    .quick-actions-divider {
        width: auto;
        height: 1px;
        margin: 0 28px;
    }
    .quick-action-half {
        padding: 24px 24px;
    }
}


/* -------------------------------------------------------
   DASHBOARD GRID
-------------------------------------------------------- */

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

/* Single-column variant — used after the Portfolio snapshot card was
   dropped so that the Recent activity card spans the full grid width. */
.dash-grid--single {
    grid-template-columns: 1fr;
}

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


/* -------------------------------------------------------
   INFO CARD (generic)
-------------------------------------------------------- */

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(15,23,42,.07), 0 1px 4px rgba(15,23,42,.04);
}

.info-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.info-card__title {
    font-size: 16px;
    font-weight: 650;
    color: var(--text);
}

.info-card__more {
    font-size: 13px;
    color: var(--link);
    text-decoration: none;
}

.info-card__more:hover { text-decoration: underline; }


/* -------------------------------------------------------
   ASSET ROWS (dashboard portfolio snapshot)
-------------------------------------------------------- */

.asset-list { display: flex; flex-direction: column; }

.asset-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px dashed rgba(15,23,42,.09);
    border-radius: 10px;
    text-decoration: none;
    transition: background .15s ease, padding-left .15s ease;
    cursor: pointer;
    margin: 0 -10px;
}

.asset-row:last-child { border-bottom: none; }

.asset-row:hover {
    background: rgba(15,23,42,.03);
    padding-left: 14px;
    text-decoration: none;
}

:root.theme-dark .asset-row:hover { background: rgba(255,255,255,.04); }

.asset-row__left  { display: flex; flex-direction: column; }
.asset-row__right { display: flex; flex-direction: column; align-items: flex-end; }

.asset-row__code {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, monospace;
}

.asset-row__name { font-size: 12px; color: #64748b; }

.asset-row__amount {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    font-family: ui-monospace, monospace;
}

.asset-row__eur { font-size: 12px; color: #64748b; }


/* -------------------------------------------------------
   ACTIVITY ROWS (recent orders)
-------------------------------------------------------- */

.activity-list { display: flex; flex-direction: column; }

.activity-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(15,23,42,.06);
    border-radius: 10px;
    transition:
        background .18s ease,
        box-shadow .18s ease,
        transform .25s cubic-bezier(.22,.61,.36,1);
    margin: 0 -8px;
    cursor: pointer;
}

.activity-row:last-child { border-bottom: none; }
.activity-row:hover {
    background: #f8fafc;
    box-shadow: 0 1px 4px rgba(15,23,42,.06);
    transform: translateX(4px);
}

.activity-row__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f5f9;
}

.activity-row__icon svg { stroke: #64748b; }

.activity-row__icon--buy    { background: rgba(34,197,94,.10); }
.activity-row__icon--buy svg { stroke: #16a34a; }

.activity-row__icon--sell   { background: rgba(239,68,68,.10); }
.activity-row__icon--sell svg { stroke: #dc2626; }

.activity-row__icon--convert { background: rgba(99,102,241,.10); }
.activity-row__icon--convert svg { stroke: #6366f1; }

.activity-row__icon--send   { background: rgba(245,158,11,.10); }
.activity-row__icon--send svg { stroke: #d97706; }

.activity-row__icon--receive { background: rgba(14,165,233,.10); }
.activity-row__icon--receive svg { stroke: #0284c7; }

.activity-row__body { flex: 1; min-width: 0; }

.activity-row__type {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-row__date { font-size: 12px; color: #64748b; margin-top: 2px; }

.activity-row__right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }

.activity-row__amount {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    font-family: ui-monospace, monospace;
    white-space: nowrap;
}

.activity-row__status {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    position: relative;
}

.activity-row__status--completed  { color: #16a34a; }
.activity-row__status--processing { color: #f59e0b; }
.activity-row__status--failed     { color: #dc2626; }
.activity-row__status--cancelled  { color: #94a3b8; }
.activity-row__status--awaiting_payment { color: #d97706; }


@keyframes statusPulse {
    0%,100% { opacity: .2; }
    50%      { opacity: .6; }
}


/* -------------------------------------------------------
   SECURITY STATUS ITEMS
-------------------------------------------------------- */

.security-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.security-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.security-item--ok   { background: #f0fdf4; border-color: rgba(34,197,94,.18); }
.security-item--warn { background: #fffbeb; border-color: rgba(245,158,11,.22); }

.security-item__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.security-item__dot--ok   {
    background: #22c55e;
    animation: dotPulseGreen 3s ease-in-out infinite;
}

.security-item__dot--warn { background: #f59e0b; }

@keyframes dotPulseGreen {
    0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
    50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.security-item__label { font-size: 14px; font-weight: 600; color: #0f172a; }
.security-item__sub   { font-size: 12px; color: #64748b; margin-top: 2px; }
.security-item__sub a { color: #2563eb; text-decoration: none; }
.security-item__sub a:hover { text-decoration: underline; }


/* -------------------------------------------------------
   DARK THEME — DASHBOARD
-------------------------------------------------------- */

:root.theme-dark .quick-section__title { color: var(--muted); }

:root.theme-dark .quick-actions-card {
    border-color: var(--border);
}
:root.theme-dark .quick-action-half--buy:hover  { background: rgba(34,197,94,.06); }
:root.theme-dark .quick-action-half--sell:hover { background: rgba(139,92,246,.06); }
:root.theme-dark .quick-action-half__icon-wrap--buy  { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.22); }
:root.theme-dark .quick-action-half__icon-wrap--sell { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.22); }
:root.theme-dark .quick-action-half__name  { color: var(--text); }
:root.theme-dark .quick-action-half__desc  { color: var(--muted); }
:root.theme-dark .quick-action-half__badge {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--muted);
}
:root.theme-dark .quick-actions-divider { background: var(--border); }

:root.theme-dark .balance-card {
    background:
        radial-gradient(800px 300px at 0% 0%,   rgba(240,185,11,.10) 0%, transparent 55%),
        radial-gradient(600px 250px at 100% 0%,  rgba(240,185,11,.07) 0%, transparent 50%),
        radial-gradient(500px 200px at 60% 100%, rgba(14,203,129,.06)  0%, transparent 55%),
        linear-gradient(180deg, #1e2329 0%, #161a1e 100%);
    border-color: rgba(240,185,11,.12);
    box-shadow: 0 0 40px rgba(240,185,11,.06), 0 8px 32px rgba(0,0,0,.5);
}
:root.theme-dark .balance-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 50px rgba(240,185,11,.10),
        0 20px 50px rgba(0,0,0,.6),
        0 8px 20px rgba(0,0,0,.4);
}
:root.theme-dark .balance-card__label  { color: var(--muted); }
:root.theme-dark .balance-card__amount {
    background: linear-gradient(135deg, #f0b90b 0%, #fcd535 50%, #f0b90b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(240,185,11,.3));
}
:root.theme-dark .balance-card__sub    { color: var(--muted); }
:root.theme-dark .balance-card__link   { color: var(--link); }

:root.theme-dark .asset-row { border-bottom-color: rgba(255,255,255,.05); }
:root.theme-dark .asset-row__code   { color: var(--text); }
:root.theme-dark .asset-row__name   { color: var(--muted); }
:root.theme-dark .asset-row__amount { color: var(--text); }
:root.theme-dark .asset-row__eur    { color: var(--muted); }

:root.theme-dark .activity-row { border-bottom-color: var(--border-soft); }
:root.theme-dark .activity-row:hover {
    background: var(--surface-2);
    box-shadow: none;
}
:root.theme-dark .activity-row__icon    { background: var(--surface-3); }
:root.theme-dark .activity-row__type    { color: var(--text); }
:root.theme-dark .activity-row__date    { color: var(--muted); }
:root.theme-dark .activity-row__amount  { color: var(--text); }
:root.theme-dark .activity-row__status  { color: var(--muted); }

:root.theme-dark .security-item--ok   { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.22); }
:root.theme-dark .security-item--warn { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.22); }
:root.theme-dark .security-item__label { color: var(--text); }
:root.theme-dark .security-item__sub   { color: var(--muted); }

:root.theme-dark .info-card__title { color: var(--text); }
:root.theme-dark .info-card__more  { color: var(--link); }
:root.theme-dark .empty-state__text { color: var(--muted); }

:root.theme-dark .info-card:hover,
:root.theme-dark .settings-card:hover {
    border-color: rgba(240,185,11,.12);
    box-shadow: 0 4px 28px rgba(0,0,0,.5), 0 0 20px rgba(240,185,11,.05);
    transition: border-color .3s ease, box-shadow .3s ease;
}


/* -------------------------------------------------------
   ORDERS PAGE
-------------------------------------------------------- */

.orders-page {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.orders-page__header {
    display: flex;
    align-items: flex-start;
}

.orders-page__kicker {
    font-size: 12px;
    margin-bottom: 4px;
}

.orders-page__kicker-link {
    color: #7b8798;
    text-decoration: none;
}
.orders-page__kicker-link:hover { color: #0f172a; text-decoration: underline; }

.orders-page__kicker-sep { color: #cbd5e1; }

.orders-page__kicker-current {
    color: #0f172a;
    font-weight: 600;
}

.orders-page__title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.02em;
}

.orders-page__subtitle {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

:root.theme-dark .orders-page__kicker-link   { color: var(--muted); }
:root.theme-dark .orders-page__kicker-link:hover { color: var(--text); }
:root.theme-dark .orders-page__kicker-sep    { color: rgba(255,255,255,.25); }
:root.theme-dark .orders-page__kicker-current { color: var(--text); }
:root.theme-dark .orders-page__title         { color: var(--text); }
:root.theme-dark .orders-page__subtitle      { color: var(--muted); }


/* -------------------------------------------------------
   ADMIN IMPERSONATION (inline in header)
-------------------------------------------------------- */

.header-impersonation {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 5px;
    border-radius: 100px;
    background: #334155;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
    margin-left: auto;
    flex-shrink: 0;
}

.header-impersonation__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fbbf24;
    background: rgba(251,191,36,.12);
    border: 1px solid rgba(251,191,36,.18);
    padding: 3px 10px;
    border-radius: 100px;
    flex-shrink: 0;
}
.header-impersonation__badge svg {
    stroke: #fbbf24;
    flex-shrink: 0;
}

.header-impersonation__email {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.header-impersonation__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    padding: 5px 12px 5px 12px;
    border-radius: 100px;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    border: none;
    transition: background .15s, transform .12s, box-shadow .15s;
    flex-shrink: 0;
}

.header-impersonation__back:hover {
    background: linear-gradient(135deg, #818cf8 0%, #8b5cf6 100%);
    transform: translateX(2px);
    box-shadow: 0 0 12px rgba(99,102,241,.35);
}

.header-impersonation__back svg {
    flex-shrink: 0;
    stroke: currentColor;
    transition: transform .15s;
}
.header-impersonation__back:hover svg {
    transform: translateX(2px);
}

/* Dark theme */
:root.theme-dark .header-impersonation {
    background: rgba(17,24,39,.85);
    border-color: rgba(255,255,255,.06);
    box-shadow: 0 1px 6px rgba(0,0,0,.3);
}

/* Mobile */
@media (max-width: 768px) {
    .header-impersonation {
        padding: 4px 5px;
        gap: 8px;
    }
    .header-impersonation__email {
        max-width: 120px;
    }
    .header-impersonation__badge {
        display: none;
    }
}



/* -------------------------------------------------------
   TRADINGVIEW CARD
-------------------------------------------------------- */

.tv-card {
    padding: 0;
    overflow: hidden;
}

.tv-card__tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(15,23,42,.07);
}

.tv-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.tv-tab:hover {
    background: rgba(15,23,42,.05);
    color: #0f172a;
}

.tv-tab.active {
    background: rgba(41,98,255,.08);
    border-color: rgba(41,98,255,.25);
    color: #1d4ed8;
}

.tv-tab__icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tv-tab__slash {
    opacity: .45;
    font-weight: 400;
}

.tv-card__attribution {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #94a3b8;
    text-decoration: none;
    opacity: .7;
    transition: opacity .15s;
}
.tv-card__attribution:hover { opacity: 1; }

.tv-card__canvas {
    height: 420px;
    overflow: hidden;
}

/* Dark theme */
:root.theme-dark .tv-card__tabs {
    border-bottom-color: rgba(255,255,255,.07);
}
:root.theme-dark .tv-tab {
    color: rgba(234,236,239,.55);
}
:root.theme-dark .tv-tab:hover {
    background: rgba(255,255,255,.06);
    color: var(--text, #eaecef);
}
:root.theme-dark .tv-tab.active {
    background: rgba(41,98,255,.14);
    border-color: rgba(41,98,255,.35);
    color: #93c5fd;
}
