/* ===== Advertiser Dashboard ===== */

.dash {
    padding-top: 8px;
}

/* --- Hero --- */
.dash-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    border-radius: 18px;
    margin-bottom: 20px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #4f5cc5 0%, #7e57c2 55%, #ec407a 100%);
    box-shadow: 0 10px 30px -12px rgba(79, 92, 197, 0.45);
}

.dash-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 20%, rgba(255,255,255,0.22) 0, transparent 40%),
        radial-gradient(circle at 15% 90%, rgba(255,255,255,0.14) 0, transparent 45%);
    pointer-events: none;
}

.dash-hero-content {
    position: relative;
    z-index: 1;
}

.dash-hero-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

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

.dash-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* --- Buttons --- */
.dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: 22px;
    font-size: 0.87rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.dash-btn-sm {
    height: 34px;
    padding: 0 14px;
    font-size: 0.82rem;
}

.dash-btn-primary {
    background: #fff;
    color: #4f5cc5;
}
.dash-btn-primary:hover {
    background: #f7f8ff;
    color: #3d49b5;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -4px rgba(0,0,0,0.18);
}

.dash-btn-ghost {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.32);
    backdrop-filter: blur(4px);
}
.dash-btn-ghost:hover {
    background: rgba(255,255,255,0.28);
    color: #fff;
}

/* --- Alerts --- */
.dash-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.dash-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.15s;
}
.dash-alert:hover { transform: translateX(2px); }

.dash-alert-danger {
    background: linear-gradient(90deg, #fff1f0 0%, #ffe5e3 100%);
    color: #c62828;
    border-left: 4px solid #ef5350;
}
.dash-alert-warning {
    background: linear-gradient(90deg, #fff7e6 0%, #fff0d0 100%);
    color: #b26a00;
    border-left: 4px solid #ffa726;
}
.dash-alert-arrow {
    margin-left: auto;
    opacity: 0.6;
}

/* --- KPI cards --- */
.dash-kpi {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.dash-kpi-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #eef0f5;
    transition: all 0.2s;
    overflow: hidden;
}

.dash-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent-grad);
}

.dash-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -12px rgba(30, 40, 80, 0.18);
}

.dash-kpi-indigo { --accent-color: #5c6bc0; --accent-grad: linear-gradient(90deg, #5c6bc0, #7986cb); }
.dash-kpi-teal   { --accent-color: #26a69a; --accent-grad: linear-gradient(90deg, #26a69a, #4db6ac); }
.dash-kpi-red    { --accent-color: #ef5350; --accent-grad: linear-gradient(90deg, #ec407a, #ef5350); }
.dash-kpi-orange { --accent-color: #ffa726; --accent-grad: linear-gradient(90deg, #fb8c00, #ffa726); }

.dash-kpi-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.15rem;
    background: var(--accent-grad);
    box-shadow: 0 6px 14px -5px var(--accent-color);
}

.dash-kpi-body { flex: 1; min-width: 0; }

.dash-kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #8b8fa3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.dash-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3142;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}

.dash-kpi-delta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.dash-kpi-delta i { font-size: 0.72rem; }

.dash-kpi-delta-hint {
    font-weight: 400;
    color: #b0b5c3;
    margin-left: 2px;
}

.dash-delta-up      { color: #26a69a; }
.dash-delta-down    { color: #ef5350; }
.dash-delta-neutral { color: #b0b5c3; }

/* --- Rows --- */
.dash-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.dash-row-2 {
    grid-template-columns: 1fr 1fr;
}

/* --- Card base ---
   .dash-card, .dash-card-head, .dash-card-title вынесены в global.css
   (используются и на других страницах ЛК). Здесь только специфика дашборда. */

.dash-card-link {
    font-size: 0.82rem;
    color: #5c6bc0;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.dash-card-link:hover { color: #3d49b5; }
.dash-card-link i { margin-left: 2px; }

/* --- Chart --- */
.dash-card-chart { padding-bottom: 16px; }

.dash-card-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 0.8rem;
    color: #6b7280;
}

.dash-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #e8eaed;
    border-radius: 999px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, opacity .15s;
}

.dash-legend-item:hover {
    background: #f5f6f8;
    border-color: #d8dae0;
}

.dash-legend-item.is-off {
    opacity: 0.45;
}

.dash-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dash-chart-wrap {
    height: 260px;
    position: relative;
}

.dash-chart-wrap canvas {
    max-height: 260px !important;
}

/* --- Onboarding --- */
.dash-onboarding-progress {
    font-size: 0.82rem;
    font-weight: 700;
    color: #5c6bc0;
    background: #eef0ff;
    padding: 4px 10px;
    border-radius: 20px;
}

.dash-progress-bar {
    height: 6px;
    background: #f0f1f5;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.dash-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #5c6bc0, #ec407a);
    border-radius: 3px;
    transition: width 0.4s;
}

.dash-onboarding-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dash-onboarding-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f4f5f9;
    font-size: 0.9rem;
    color: #2d3142;
}
.dash-onboarding-item:last-child { border-bottom: none; }

.dash-onboarding-item.is-done .dash-onboarding-text {
    color: #b0b5c3;
    text-decoration: line-through;
}

.dash-onboarding-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #d5d8e0;
    background: #fff;
    display: grid;
    place-items: center;
    color: transparent;
    font-size: 0.72rem;
    transition: all 0.2s;
}

.dash-onboarding-item.is-done .dash-onboarding-check {
    background: linear-gradient(135deg, #26a69a, #66bb6a);
    border-color: transparent;
    color: #fff;
}

.dash-onboarding-text { flex: 1; }

.dash-onboarding-cta {
    font-size: 0.78rem;
    font-weight: 600;
    color: #5c6bc0;
    background: #eef0ff;
    padding: 5px 12px;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.15s;
}
.dash-onboarding-cta:hover {
    background: #5c6bc0;
    color: #fff;
}

/* --- Quick actions (шоу, когда онбординг пройден) --- */
.dash-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dash-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    border-radius: 12px;
    background: #f8f9fc;
    color: #2d3142;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.15s;
}
.dash-quick-link i {
    font-size: 1.3rem;
    color: #5c6bc0;
}
.dash-quick-link:hover {
    background: #eef0ff;
    color: #3d49b5;
    transform: translateY(-1px);
}

/* --- Top offers --- */
.dash-top-list {
    display: flex;
    flex-direction: column;
}

.dash-top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.dash-top-item:hover {
    background: #f8f9fc;
    color: inherit;
}

.dash-top-rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #8b8fa3;
    background: #f4f5f9;
}
.dash-top-item:first-child .dash-top-rank {
    background: linear-gradient(135deg, #ffa726, #ffb74d);
    color: #fff;
}

.dash-top-logo {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f5f9;
}
.dash-top-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dash-top-logo-ph {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #5c6bc0, #7986cb);
    font-size: 0.9rem;
}

.dash-top-body { flex: 1; min-width: 0; }

.dash-top-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2d3142;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.dash-top-meta {
    font-size: 0.78rem;
    color: #8b8fa3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-dot { color: #d5d8e0; }

.dash-top-leads {
    flex-shrink: 0;
    text-align: right;
    padding-left: 8px;
}

.dash-top-leads-num {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ef5350;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dash-top-leads-lbl {
    font-size: 0.7rem;
    color: #8b8fa3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 3px;
}

/* --- Leads list --- */
.dash-leads-list {
    display: flex;
    flex-direction: column;
}

.dash-lead {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f4f5f9;
}
.dash-lead:last-child { border-bottom: none; }

.dash-lead-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    background: linear-gradient(135deg, #26a69a, #5c6bc0);
}

.dash-lead-body { flex: 1; min-width: 0; }

.dash-lead-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    min-width: 0;
}

.dash-lead-top .dash-lead-time {
    margin-left: auto;
}

.dash-lead-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2d3142;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-lead-time {
    flex-shrink: 0;
    font-size: 0.76rem;
    color: #b0b5c3;
    white-space: nowrap;
}

.dash-lead-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    font-size: 0.78rem;
    color: #8b8fa3;
    min-width: 0;
}

.dash-lead-offer {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.dash-lead-status {
    flex-shrink: 0;
    margin-left: auto;
}

.dash-lead-phone { font-variant-numeric: tabular-nums; }

/* .dash-badge / .dash-badge-* перенесены в global.css */

/* --- Empty states --- */
.dash-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #b0b5c3;
    text-align: center;
    gap: 4px;
}

.dash-empty i {
    font-size: 2.2rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

.dash-empty p {
    margin: 0 0 6px;
    font-size: 0.92rem;
    color: #8b8fa3;
}

.dash-empty-hint {
    font-size: 0.8rem;
    color: #b0b5c3;
}

.dash-empty .dash-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, #5c6bc0, #7986cb);
    color: #fff;
}
.dash-empty .dash-btn:hover {
    background: linear-gradient(135deg, #4f5cc5, #5c6bc0);
    color: #fff;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .dash-kpi { grid-template-columns: repeat(2, 1fr); }
    .dash-row, .dash-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .dash-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 20px;
    }
    .dash-hero-title { font-size: 1.3rem; }
    .dash-kpi { grid-template-columns: 1fr; }
    .dash-quick-actions { grid-template-columns: 1fr; }
}
