/* ═══════════════════════════════════════════════════════════════
   RENZO DASHBOARD v3 — Polestar / Control Tower Style
   Light background, vivid KPI banners, generous cards, warm shadows
   ═══════════════════════════════════════════════════════════════ */

.dh-hub {
    background: #EEEDF5;
    min-height: 100vh;
    overflow-y: auto;
}
[data-theme="dark"] .dh-hub { background: #111113; }

.dh-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 32px 60px;
}

/* ─── HEADER ─── */
.dh-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 44px;
    position: relative;
}
.dh-h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    background: linear-gradient(135deg, #4338CA, #7C3AED, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .dh-h1 { background: linear-gradient(135deg, #818CF8, #A78BFA, #F472B6); -webkit-background-clip: text; background-clip: text; }
.dh-sub {
    font-size: 14px;
    color: #8B7FA8;
    margin-top: 6px;
    font-weight: 400;
    letter-spacing: 0.02em;
}
.dh-back {
    position: absolute;
    top: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E2E0EC;
    color: #6B5B95;
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(107,91,149,0.06);
}
.dh-back:hover { background: #F8F7FC; border-color: #C4B5E3; color: #4C3D7A; }
[data-theme="dark"] .dh-back { background: #27272A; border-color: #3F3F46; color: #A1A1AA; }

/* ─── GRID ─── */
.dh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
@media (max-width: 1000px) { .dh-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dh-grid { grid-template-columns: 1fr; } }

/* ─── CARD ─── */
.dh-card {
    --dh-accent: #7C3AED;
    --dh-accent-bg: #F3EFFE;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E8E5F0;
    border-radius: 20px;
    padding: 24px;
    text-decoration: none;
    color: #18181B;
    overflow: hidden;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.02);
}
.dh-card::before { display: none; }
.dh-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
    border-color: #D4D4D8;
}
[data-theme="dark"] .dh-card { background: #18181B; border-color: #27272A; color: #FAFAFA; }
[data-theme="dark"] .dh-card:hover { background: #1F1F23; border-color: #3F3F46; box-shadow: 0 8px 30px rgba(0,0,0,0.3); }

/* Colors — vivid accent backgrounds */
.dh-card.dh-acc-indigo  { --dh-accent: #6366F1; --dh-accent-bg: #EEF2FF; }
.dh-card.dh-acc-amber   { --dh-accent: #F97316; --dh-accent-bg: #FFF7ED; }
.dh-card.dh-acc-cyan    { --dh-accent: #06B6D4; --dh-accent-bg: #ECFEFF; }
.dh-card.dh-acc-green   { --dh-accent: #10B981; --dh-accent-bg: #ECFDF5; }
.dh-card.dh-acc-purple  { --dh-accent: #8B5CF6; --dh-accent-bg: #F5F3FF; }
.dh-card.dh-acc-pink    { --dh-accent: #EC4899; --dh-accent-bg: #FDF2F8; }

/* ─── CARD HEADER ─── */
.dh-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.dh-card-badge {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--dh-accent-bg);
    color: var(--dh-accent);
    flex-shrink: 0;
}
[data-theme="dark"] .dh-card-badge { background: color-mix(in srgb, var(--dh-accent) 15%, #18181B); }
.dh-card-badge .lucide { width: 20px; height: 20px; }
.dh-card-head h3 {
    font-size: 15px;
    font-weight: 700;
    color: #2D2250;
    margin: 0;
    flex: 1;
}
[data-theme="dark"] .dh-card-head h3 { color: #F4F4F5; }

/* Live badge */
.dh-live {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: #10B981;
    background: #ECFDF5;
    padding: 3px 8px;
    border-radius: 10px;
}
[data-theme="dark"] .dh-live { background: rgba(16,185,129,0.12); }
.dh-live::before {
    content: ''; width: 5px; height: 5px; border-radius: 50%;
    background: #10B981;
    animation: dhPulse 2.5s ease-in-out infinite;
}
@keyframes dhPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── BODY ─── */
.dh-card-body { margin-bottom: 16px; }
.dh-card-body p {
    font-size: 13px; color: #71717A; line-height: 1.5; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ─── STATS ─── */
.dh-stats {
    display: flex;
    gap: 24px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #F4F4F5;
}
[data-theme="dark"] .dh-stats { border-top-color: #27272A; }
.dh-stat { display: flex; flex-direction: column; gap: 2px; }
.dh-stat-num {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #4338CA, #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .dh-stat-num { background: linear-gradient(135deg, #A78BFA, #C084FC); -webkit-background-clip: text; background-clip: text; }
.dh-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #A1A1AA;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ─── SPARKLINE ─── */
.dh-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
    margin-top: 12px;
}
.dh-spark i {
    flex: 1;
    border-radius: 3px 3px 0 0;
    background: var(--dh-accent-bg);
    border: 1px solid color-mix(in srgb, var(--dh-accent) 20%, transparent);
    transition: background 0.2s;
}
.dh-card:hover .dh-spark i {
    background: color-mix(in srgb, var(--dh-accent) 30%, white);
}
[data-theme="dark"] .dh-spark i { background: color-mix(in srgb, var(--dh-accent) 15%, #18181B); border-color: transparent; }

/* ─── FOOTER ─── */
.dh-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, #7C3AED, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #7C3AED;
}
.dh-card-foot .lucide { width: 14px; height: 14px; transition: transform 0.2s; }
.dh-card:hover .dh-card-foot .lucide { transform: translateX(4px); }

/* ─── ASK BAR ─── */
.dh-finder {
    max-width: 680px;
    margin: 0 auto 32px;
    background: #FFFFFF;
    border: 1px solid #E8E5F0;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(124,58,237,0.04);
}
.dh-finder::before { display: none; }
[data-theme="dark"] .dh-finder { background: #18181B; border-color: #27272A; }
.dh-finder-row { display: flex; align-items: center; gap: 12px; }
.dh-finder-icon { color: #A78BFA; }
.dh-finder-icon .lucide { width: 20px; height: 20px; }
.dh-finder-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: #18181B; font-size: 14px; padding: 6px 0;
}
[data-theme="dark"] .dh-finder-input { color: #FAFAFA; }
.dh-finder-input::placeholder { color: #A1A1AA; }
.dh-finder-btn {
    background: linear-gradient(135deg, #7C3AED, #EC4899);
    color: #FFFFFF; border: none;
    padding: 10px 20px; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: opacity 0.15s;
}
.dh-finder-btn:hover { opacity: 0.88; }

/* ─── CHAT MESSAGES ─── */
.dh-finder-msgs {
    margin-top: 14px; max-height: 280px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    padding-right: 4px; scroll-behavior: smooth;
}
.dh-finder-msgs:empty { display: none; margin-top: 0; }
.dh-finder-msgs::-webkit-scrollbar { width: 6px; }
.dh-finder-msgs::-webkit-scrollbar-thumb { background: #E8E5F0; border-radius: 3px; }
[data-theme="dark"] .dh-finder-msgs::-webkit-scrollbar-thumb { background: #3F3F46; }
.dhf-msg { display: flex; }
.dhf-user { justify-content: flex-end; }
.dhf-bot { justify-content: flex-start; }
.dhf-bubble {
    font-size: 13px; line-height: 1.6; padding: 9px 13px;
    border-radius: 14px; max-width: 88%; word-wrap: break-word;
}
.dhf-user .dhf-bubble {
    background: linear-gradient(135deg, #7C3AED, #EC4899);
    color: #FFFFFF; border-bottom-right-radius: 4px;
}
.dhf-bot .dhf-bubble {
    background: #F8F7FC; color: #334155; border-bottom-left-radius: 4px;
}
[data-theme="dark"] .dhf-bot .dhf-bubble { background: #27272A; color: #E4E4E7; }
.dhf-bot .dhf-bubble a { color: #7C3AED; font-weight: 600; text-decoration: none; }
.dhf-bot .dhf-bubble a:hover { text-decoration: underline; }
[data-theme="dark"] .dhf-bot .dhf-bubble a { color: #A78BFA; }
.dhf-typing { font-size: 12px; color: #A1A1AA; padding: 2px 2px; display: flex; align-items: center; gap: 7px; }
.dhf-dots { display: inline-flex; gap: 3px; }
.dhf-dots i { width: 5px; height: 5px; border-radius: 50%; background: #C4B5E3; animation: dhfblink 1.2s infinite both; }
.dhf-dots i:nth-child(2) { animation-delay: 0.2s; }
.dhf-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dhfblink { 0%,80%,100%{opacity:0.25} 40%{opacity:1} }
/* starter chips disappear once a conversation has started */
.dh-finder.dhf-active .dh-chips { display: none; }

/* Chips */
.dh-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.dash-finder-chip {
    background: #F8F7FC; border: 1px solid #E8E5F0;
    color: #6B5B95; padding: 6px 14px; border-radius: 8px;
    font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.dash-finder-chip:hover { background: #F3EFFE; border-color: #C4B5E3; color: #5B21B6; }
[data-theme="dark"] .dash-finder-chip { background: #27272A; border-color: #3F3F46; color: #A1A1AA; }
[data-theme="dark"] .dash-finder-chip:hover { background: #312E81; border-color: #6366F1; color: #E0E7FF; }

/* ─── FEEDBACK ─── */
.dh-feedback {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 13px; color: #A1A1AA;
}
.dh-feedback .lucide { display: none; }
.dh-feedback-link { color: #7C3AED; text-decoration: none; font-weight: 500; }
.dh-feedback-link:hover { color: #5B21B6; }

/* ─── ANIMATIONS ─── */
.dh-card { animation: dhFadeUp 0.35s ease-out both; }
.dh-card:nth-child(1) { animation-delay: 0s; }
.dh-card:nth-child(2) { animation-delay: 0.06s; }
.dh-card:nth-child(3) { animation-delay: 0.12s; }
.dh-card:nth-child(4) { animation-delay: 0.18s; }
.dh-card:nth-child(5) { animation-delay: 0.24s; }
@keyframes dhFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
