/* =============================================================================
   DeQrypto Dashboard — logged-in homepage styles
   Inherits variables and base resets from shared-styles.css
   ============================================================================= */

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.dashboard-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 60px;
    position: relative;
    z-index: 1;
}

.dashboard-greeting {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.dashboard-greeting-text h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dashboard-greeting-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-go-terminal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--accent);
    color: #000;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.btn-go-terminal:hover {
    opacity: 0.88;
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.db-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px 20px;
}

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

.db-card-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.db-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.db-card-link {
    font-size: 12px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

.db-card-link:hover {
    text-decoration: underline;
}

/* ── Two-column grid ─────────────────────────────────────────────────────────── */
.db-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── Weekly briefing ─────────────────────────────────────────────────────────── */
.db-briefing {
    background: rgba(240, 185, 11, 0.06);
    border: 1px solid rgba(240, 185, 11, 0.22);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 14px;
}

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

.db-briefing-header-left .db-card-label {
    color: rgba(240, 185, 11, 0.7);
}

.db-briefing-header-left .db-card-title {
    color: var(--text-primary);
}

.db-live-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    background: rgba(14, 203, 129, 0.12);
    color: var(--green);
    border: 1px solid rgba(14, 203, 129, 0.25);
    letter-spacing: 0.04em;
}

.db-briefing-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.db-bstat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 5px;
}

.db-bstat-value {
    font-size: 22px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-primary);
    line-height: 1.1;
}

.db-bstat-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.db-bstat-pos {
    color: var(--green);
}

/* ── Signal rows ─────────────────────────────────────────────────────────────── */
.db-signal-list {
    display: flex;
    flex-direction: column;
}

.db-signal-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.db-signal-row:first-child {
    padding-top: 0;
}

.db-signal-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.db-signal-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.db-signal-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.db-signal-alloc {
    font-size: 11px;
    color: var(--text-secondary);
}

.db-signal-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 5px;
}

.db-chip {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.db-chip + .db-chip::before {
    content: ' · ';
    color: var(--text-tertiary);
    margin: 0 4px;
}

.db-signal-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.db-signal-conf {
    font-size: 10px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Signal badges */
.db-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    letter-spacing: 0.04em;
}

.db-badge-buy  { background: rgba(14, 203, 129, 0.15); color: var(--green); }
.db-badge-sell { background: rgba(246, 70, 93, 0.15);  color: var(--red); }
.db-badge-hold { background: rgba(240, 185, 11, 0.15); color: var(--accent); }

/* ── Signal quality / win rate ───────────────────────────────────────────────── */
.db-wr-row {
    margin-bottom: 14px;
}

.db-wr-row:last-of-type {
    margin-bottom: 0;
}

.db-wr-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.db-wr-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.db-wr-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
}

.db-wr-bar-track {
    height: 4px;
    background: var(--border-color);
    border-radius: 99px;
    overflow: hidden;
}

.db-wr-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--accent);
    transition: width 0.4s ease;
}

/* Weekly win rate bar chart */
.db-weekly-chart {
    margin-top: 16px;
}

.db-weekly-chart-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.db-weekly-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 56px;
}

.db-weekly-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 3px;
    cursor: default;
    position: relative;
}

.db-weekly-bar {
    width: 100%;
    border-radius: 2px 2px 0 0;
    background: rgba(240, 185, 11, 0.35);
    transition: background 0.2s;
    min-height: 3px;
}

.db-weekly-bar.is-current {
    background: var(--accent);
}

.db-weekly-bar-wrap:hover .db-weekly-bar {
    background: var(--accent);
}

.db-weekly-bar-wrap .db-bar-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 10px;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.db-weekly-bar-wrap:hover .db-bar-tooltip {
    display: block;
}

.db-weekly-dates {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.db-weekly-date {
    font-size: 9px;
    color: var(--text-tertiary);
    flex: 1;
    text-align: center;
}

/* ── Watchlist ───────────────────────────────────────────────────────────────── */
.db-watchlist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.db-watch-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.db-watch-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.db-watch-symbol {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.db-watch-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.db-watch-note {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ── Account nudges ──────────────────────────────────────────────────────────── */
.db-nudge-list {
    display: flex;
    flex-direction: column;
}

.db-nudge {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-color);
}

.db-nudge:first-child { padding-top: 0; }
.db-nudge:last-child  { border-bottom: none; padding-bottom: 0; }

.db-nudge-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-nudge-icon svg {
    width: 16px;
    height: 16px;
}

.db-nudge-icon-danger { background: rgba(246, 70, 93, 0.12); color: var(--red); }
.db-nudge-icon-warn   { background: rgba(240, 185, 11, 0.12); color: var(--accent); }
.db-nudge-icon-info   { background: rgba(41, 98, 255, 0.12);  color: var(--blue); }

.db-nudge-body {
    flex: 1;
    min-width: 0;
}

.db-nudge-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.db-nudge-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.db-nudge-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.db-nudge-action {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
}

.db-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
}

.db-pill-danger { background: rgba(246, 70, 93, 0.15);  color: var(--red); }
.db-pill-warn   { background: rgba(240, 185, 11, 0.15); color: var(--accent); }
.db-pill-info   { background: rgba(41, 98, 255, 0.15);  color: var(--blue); }

.db-btn-sm {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.db-btn-sm:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* ── Spacing between sections ────────────────────────────────────────────────── */
.db-section {
    margin-bottom: 14px;
}

.db-section:last-child {
    margin-bottom: 0;
}

/* ── Skeleton loading ────────────────────────────────────────────────────────── */
.db-skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-color) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: db-shimmer 1.5s infinite;
    border-radius: 4px;
}

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

/* ── Empty states ────────────────────────────────────────────────────────────── */
.db-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .db-watchlist-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .dashboard-page {
        padding: 16px 14px 80px;
    }

    .db-two-col {
        grid-template-columns: 1fr;
    }

    .db-briefing-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .db-bstat-value {
        font-size: 18px;
    }

    .dashboard-greeting {
        flex-direction: column;
        gap: 12px;
    }

    .btn-go-terminal {
        width: 100%;
        justify-content: center;
    }

    .db-watchlist-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .db-weekly-bars {
        height: 44px;
    }
}

@media (max-width: 400px) {
    .db-briefing-stats {
        grid-template-columns: 1fr 1fr;
    }

    .db-watchlist-grid {
        grid-template-columns: 1fr 1fr;
    }
}
