/* ============ DASHBOARD SHELL ============ */
/* --color-success is the cyan brand accent here, so the "good" green used by
   verification steps is declared locally. */
:root {
    --dash-ok: #198754;
    --dash-ok-soft: rgba(25, 135, 84, 0.15);
}

.dash-hero {
    background: linear-gradient(135deg, var(--color-primary), #0a8fb3);
    border-radius: var(--radius-md);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.dash-hero-body {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    flex-wrap: wrap;
}

.dash-hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.dash-hero-title .badge {
    font-size: 0.7rem;
    vertical-align: middle;
}

.dash-hero-sub {
    font-size: 0.85rem;
    opacity: 0.9;
}

.dash-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dash-hero-actions .btn-primary {
    background: #fff;
    border-color: #fff;
    color: var(--color-primary);
}

.dash-hero-actions .btn-primary:hover {
    background: #f1f7f9;
    border-color: #f1f7f9;
}

.dash-hero-actions .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

.dash-hero-actions .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.shop-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.7rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.45);
}

.min-w-0 {
    min-width: 0;
}

/* ============ KPI TILES ============ */
.kpi-tile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    padding: 1rem 1.1rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius-md);
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a.kpi-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.kpi-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.kpi-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.kpi-value-sm {
    font-size: 1.15rem;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.kpi-all { border-left-color: var(--color-primary); }
.kpi-all .kpi-icon { color: var(--color-primary); }
.kpi-available { border-left-color: var(--color-success); }
.kpi-available .kpi-icon { color: var(--color-success); }
.kpi-boosted { border-left-color: var(--color-warning); }
.kpi-boosted .kpi-icon { color: var(--color-warning); }
.kpi-sold { border-left-color: var(--color-danger); }
.kpi-sold .kpi-icon { color: var(--color-danger); }
.kpi-spend { border-left-color: var(--color-text-muted); }
.kpi-spend .kpi-icon { color: var(--color-text-muted); }

.kpi-tile.is-active {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.18);
    background: #f7fcfd;
}

.kpi-boosted.is-active { box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.22); }
.kpi-sold.is-active { box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18); }
.kpi-available.is-active { box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.25); }

/* ============ STATUS PILLS ============ */
.status-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.status-pill {
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.status-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}

.status-pill.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ============ PRODUCT CARDS ============ */
.dash-product {
    transition: var(--transition);
    overflow: hidden;
}

.dash-product:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover) !important;
}

.dash-product-boosted {
    border: 1px solid var(--color-warning) !important;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.14) !important;
}

.dash-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    z-index: 2;
}

.dash-badges .badge {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.dash-product .card-body {
    padding: 0.9rem 1rem 0.5rem;
}

/* ============ SIDEBAR ============ */
.dash-sidebar {
    position: sticky;
    top: 5.5rem;
}

.side-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 0.7rem;
    flex-shrink: 0;
}

.side-icon-primary { background: var(--color-primary); }
.side-icon-success { background: var(--dash-ok); }

.verify-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.verify-steps li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    position: relative;
}

.verify-steps li + li::before {
    content: "";
    position: absolute;
    left: 13px;
    top: -0.75rem;
    height: 1.5rem;
    border-left: 2px dashed var(--color-border);
}

.verify-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: transparent;
    background: #fff;
    flex-shrink: 0;
    z-index: 1;
}

.verify-steps li.is-done {
    color: var(--dash-ok);
    font-weight: 600;
}

.verify-steps li.is-done .verify-dot {
    background: var(--dash-ok);
    border-color: var(--dash-ok);
    color: #fff;
}

.verify-steps li.is-pending {
    color: var(--color-warning);
    font-weight: 600;
}

.verify-steps li.is-pending .verify-dot {
    border-color: var(--color-warning);
    background: var(--color-warning);
    color: #fff;
}

/* ============ MESSAGES ============ */
.msg-list,
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.msg-item {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--color-border);
}

.msg-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.msg-item.is-unread {
    border-left: 3px solid var(--color-warning);
    padding-left: 0.6rem;
}

.msg-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============ ACTIVITY ============ */
.activity-list li {
    display: flex;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.87rem;
}

.activity-list li:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-border);
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.activity-dot.is-live {
    background: var(--color-warning);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

/* ============ LEGACY ============ */
.stats-card {
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card h2 {
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 0;
}

.stats-card h6 {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.78rem;
}

.stats-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.shop-card {
    border-left: 4px solid var(--color-success);
}

.shop-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.shop-details li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: var(--color-text-muted);
}

.shop-details li i {
    color: var(--color-primary);
    width: 1rem;
}

.boost-history {
    border-left: 4px solid var(--color-warning);
}

.product-sold {
    opacity: 0.75;
}

.product-sold .product-img {
    filter: grayscale(0.4);
}

.product-sold h4,
.product-sold h5 {
    text-decoration: line-through;
}

.search-bar {
    border-left: 4px solid var(--color-primary);
}

.welcome-card {
    border-left: 4px solid var(--color-primary);
}

.admin-messages-section {
    border-left: 4px solid var(--color-primary);
}

.message-card {
    border-left: 3px solid var(--color-primary);
    transition: var(--transition);
}

.message-card.unread {
    border-left-color: var(--color-warning);
    background: #fffde7;
}

.message-card:hover {
    transform: translateX(4px);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
    .dash-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .stats-card h2 {
        font-size: 1.6rem;
    }

    .stats-card .card-body {
        padding: 1rem;
    }

    .welcome-card h2 {
        font-size: 1.3rem;
    }

    .dash-hero-title {
        font-size: 1.25rem;
    }

    .dash-hero-body {
        padding: 1.1rem;
        gap: 1rem;
    }

    .dash-hero-actions {
        width: 100%;
    }

    .dash-hero-actions .btn {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .stats-card h6 {
        font-size: 0.7rem;
    }

    .kpi-value {
        font-size: 1.3rem;
    }

    .kpi-value-sm {
        font-size: 1rem;
    }

    .kpi-tile {
        padding: 0.75rem 0.8rem;
        gap: 0.6rem;
    }

    .kpi-icon {
        font-size: 1.15rem;
    }
}

/* ============ TRADER SIDEBAR LAYOUT ============ */
.trader-dashboard-layout {
    display: flex;
    min-height: calc(100vh - 70px);
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.trader-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.15);
}

.trader-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.1);
}

.trader-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.75rem;
}

.trader-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.7rem 0.9rem;
    border-radius: 0.6rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.trader-nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.trader-nav-link:hover {
    background: rgba(148, 163, 184, 0.15);
    color: #f8fafc;
    text-decoration: none;
}

.trader-nav-link.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%);
    color: #ffffff;
    box-shadow: inset 3px 0 0 #38bdf8;
}

/* The Service Balance is the trader's money, so it keeps its own gold accent
   instead of sharing the blue used by the rest of the dashboard. */
.trader-nav-link--balance i {
    color: #fbbf24;
}

.trader-nav-link--balance:hover {
    background: rgba(245, 158, 11, 0.16);
    color: #fef3c7;
    text-decoration: none;
}

.trader-nav-link--balance.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.32) 0%, rgba(217, 119, 6, 0.18) 100%);
    color: #fff7e6;
    box-shadow: inset 3px 0 0 #f59e0b;
}

.trader-nav-link--balance.active i {
    color: #fde68a;
}

.trader-badge {
    margin-left: auto;
    background: #ef4444;
    color: #ffffff;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.trader-dashboard-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.trader-sidebar-toggle {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1050;
    background: linear-gradient(135deg, #0f766e 0%, #0ea5e9 100%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.25rem;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.25);
    font-weight: 600;
    display: none;
}

.trader-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1040;
    display: none;
}

.trader-sidebar-overlay.active {
    display: block;
}

@media (max-width: 991.98px) {
    .trader-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
    }

    .trader-sidebar.active {
        left: 0;
    }

    .trader-dashboard-main {
        padding: 1.25rem;
    }

    .trader-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }
}
