@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

:root {
    --bg-primary:    #050505;
    --bg-secondary:  #0e0e0e;
    --bg-card:       #141414;
    --bg-card-hover: #1a1a1a;
    --border:        #242424;
    --border-gold:   rgba(201,169,110,0.2);

    --text-primary:   #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted:     #6b6b6b;

    --ux-gold:       #c9a96e;
    --ux-gold-light: #dfc291;
    --ux-gold-dark:  #a68845;

    --accent-green:  #4ade80;
    --accent-amber:  #fbbf24;
    --accent-red:    #f87171;

    --gradient-gold:  linear-gradient(135deg, #dfc291, #a68845);
    --gradient-green: linear-gradient(135deg, #4ade80, #22c55e);
    --gradient-amber: linear-gradient(135deg, #fbbf24, #d97706);

    --sidebar-width:  clamp(200px, 17vw, 260px);
    --topbar-height:  84px; /* mesma altura pro header e pro topo da sidebar, pra as bordas alinharem */
    --main-pad:      clamp(16px, 2.5vw, 36px);
    --card-pad:      clamp(14px, 1.6vw, 22px);
    --gap:           clamp(12px, 1.4vw, 18px);

    --shadow:      0 4px 24px rgba(0,0,0,0.5);
    --shadow-lg:   0 8px 40px rgba(0,0,0,0.6);
    --shadow-gold: 0 4px 20px rgba(201,169,110,0.15);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #0c0c0c 0%, #090909 60%, #080808 100%);
    border-right: 1px solid rgba(201,169,110,0.07);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 0 20px;
    min-height: var(--topbar-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo {
    width: 40px;
    height: 40px;
    background: var(--gradient-gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #0a0a0a;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(201,169,110,0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Nav sections */
.sidebar-section {
    padding: 20px 12px 8px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 8px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    font-family: 'Inter', sans-serif;
    text-align: left;
    margin-bottom: 2px;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    border-radius: 0 3px 3px 0;
    background: var(--gradient-gold);
    transition: height 0.18s;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.18s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.nav-item:hover svg { opacity: 1; }

.nav-item:hover::before { height: 32%; background: rgba(255,255,255,0.18); }

.nav-item.active {
    background: linear-gradient(90deg, rgba(201,169,110,0.14), rgba(201,169,110,0.02) 85%);
    color: var(--ux-gold);
    font-weight: 600;
}

.nav-item.active svg {
    opacity: 1;
    color: var(--ux-gold);
}

.nav-item.active::before { height: 60%; }

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}

/* Expert badge na sidebar */
.expert-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent);
    margin: 8px 12px;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding: 14px 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-date {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 0 8px 12px;
}

.sidebar-live {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--ux-gold);
    font-weight: 500;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--ux-gold);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* =============================================
   APP WRAPPER
   ============================================= */
.app-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =============================================
   HEADER
   ============================================= */
.header {
    background: rgba(8,8,8,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: clamp(12px, 1.4vw, 18px) var(--main-pad);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 700;
    color: var(--text-primary);
}

.header-title span { color: var(--ux-gold); }

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-date {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 7px 14px;
    border-radius: 7px;
    border: 1px solid var(--border);
}

/* =============================================
   MAIN
   ============================================= */
.main {
    padding: var(--main-pad) var(--main-pad) 60px;
    flex: 1;
    min-width: 0;
}

/* =============================================
   KPI GRID
   ============================================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--gap);
    margin-bottom: var(--gap);
}

/* =============================================
   KPI CARDS — Premium
   ============================================= */
.kpi-card {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: var(--card-pad);
    min-width: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.kpi-card:hover {
    background: rgba(255,255,255,.05);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 16px 32px -8px rgba(201,169,110,0.14);
    border-color: rgba(255,255,255,.14);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-gold);
    border-radius: 14px 14px 0 0;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: rgba(201,169,110,0.08);
}

.kpi-icon svg {
    width: 16px;
    height: 16px;
    color: var(--ux-gold);
}

.kpi-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: clamp(24px, 2.4vw, 34px);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--ux-gold-light);
    letter-spacing: -.02em;
}

.kpi-card:nth-child(2) .kpi-value { color: var(--accent-green); }
.kpi-card:nth-child(3) .kpi-value { color: var(--ux-gold); }
.kpi-card:nth-child(4) .kpi-value { color: var(--accent-amber); }

.kpi-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-delta {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    min-height: 14px;
}

/* =============================================
   CENTRAL DE ALERTAS
   ============================================= */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid;
    background: rgba(255,255,255,.03);
}

.alert-row-icon {
    font-size: 15px;
    line-height: 1.3;
    flex-shrink: 0;
}

.alert-row-text {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.4;
}

.alert-row-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

/* =============================================
   SECTION GRID / CARDS — Premium
   ============================================= */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: var(--gap);
    margin-bottom: var(--gap);
}

.section-grid.quad {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 16px;
    padding: var(--card-pad);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
    min-width: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.card:hover {
    background: rgba(255,255,255,.045);
    border-color: rgba(255,255,255,.13);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 16px 32px -8px rgba(201,169,110,0.1);
    transform: translateY(-1px);
}

.card.full-width { grid-column: 1 / -1; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
}

.card-title svg {
    width: 14px;
    height: 14px;
    color: var(--ux-gold);
    flex-shrink: 0;
}

.card-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold  { background: rgba(201,169,110,0.15); color: var(--ux-gold); }
.badge-green { background: rgba(74,222,128,0.12);  color: #4ade80; }
.badge-amber { background: rgba(251,191,36,0.12);  color: #fbbf24; }
.badge-white { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

.chart-container {
    position: relative;
    height: clamp(200px, 22vh, 280px);
}

/* =============================================
   EXPERT CARDS — Premium
   ============================================= */
.expert-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 16px;
    padding: var(--card-pad);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.expert-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--expert-color, var(--gradient-gold));
    border-radius: 16px 16px 0 0;
}

.expert-card:hover {
    background: rgba(255,255,255,.045);
    border-color: rgba(255,255,255,.14);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 16px 32px -8px rgba(201,169,110,0.1);
}

.expert-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.expert-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(201,169,110,0.1);
    border: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.expert-avatar svg {
    width: 18px;
    height: 18px;
    color: var(--ux-gold);
}

.expert-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.expert-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.expert-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.expert-stat { }

.expert-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.expert-stat-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

/* Faixa de alerta de ritmo — 1 linha, sempre visível (sinal acionável) */
.expert-alert {
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.expert-alert strong { font-weight: 700; }

.expert-alert-up   { background: rgba(74,222,128,.08);  border: 1px solid rgba(74,222,128,.22); }
.expert-alert-up strong   { color: #4ade80; }
.expert-alert-down { background: rgba(248,113,113,.06); border: 1px solid rgba(248,113,113,.18); }
.expert-alert-down strong { color: #f87171; }

/* Toggle de detalhes secundários (IA / conversões recentes) */
.expert-toggle {
    width: 100%;
    margin-top: 10px;
    padding: 7px 4px;
    background: none;
    border: none;
    border-top: 1px dashed rgba(255,255,255,.08);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.15s;
}

.expert-toggle:hover { color: var(--ux-gold-light); }

.expert-toggle svg { transition: transform 0.2s; flex-shrink: 0; }
.expert-toggle.expert-toggle-open svg { transform: rotate(180deg); }

.expert-detail {
    animation: expertDetailIn 0.15s ease-out;
}

@keyframes expertDetailIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   REVEAL — cards/seções entram suavemente quando
   aparecem na tela pela 1ª vez (não repete a cada scroll)
   ============================================= */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll { transition: none; opacity: 1; transform: none; }
}

/* =============================================
   RANKING TABLE — Premium
   ============================================= */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ranking-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-muted);
    background: rgba(255,255,255,.02);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.ranking-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    vertical-align: middle;
}

.ranking-table tr:last-child td { border-bottom: none; }

.ranking-table tbody tr {
    transition: background 0.15s;
    cursor: pointer;
}

.ranking-table tbody tr:hover { background: rgba(255,255,255,.045); }

.rank-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.rank-1    { background: linear-gradient(135deg,#dfc291,#a68845); color:#0a0a0a; }
.rank-2    { background: rgba(255,255,255,0.08); color:#d1d5db; }
.rank-3    { background: rgba(251,146,60,0.12); color:#fb923c; }
.rank-other{ background: transparent; color:var(--text-muted); font-size:12px; }

.agent-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.agent-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.agent-expert {
    font-size: 10px;
    margin-top: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.metric-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.bar-fill.green { background: var(--gradient-green); }
.bar-fill.gold  { background: var(--gradient-gold); }

.metric-val {
    font-size: 12px;
    font-weight: 700;
    width: 44px;
    text-align: right;
    flex-shrink: 0;
}

.time-val {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.time-good { background: rgba(74,222,128,0.12);  color:#4ade80; }
.time-ok   { background: rgba(251,191,36,0.12);  color:#fbbf24; }
.time-bad  { background: rgba(248,113,113,0.12); color:#f87171; }

.stars { display: flex; gap: 2px; margin-bottom: 3px; }

.star { font-size: 13px; }
.star.filled { color: var(--ux-gold); }
.star.empty  { color: rgba(255,255,255,0.1); }

.perf-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perf-excellent          { color: var(--ux-gold); }
.perf-good               { color: var(--accent-green); }
.perf-average            { color: var(--accent-amber); }
.perf-needs-improvement  { color: var(--accent-red); }

/* =============================================
   INFO TIP
   ============================================= */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    cursor: help;
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
}

.info-tip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 400;
    white-space: normal;
    word-break: break-word;
    max-width: 320px;
    width: max-content;
    box-shadow: var(--shadow);
    z-index: 9999;
    border: 1px solid var(--ux-gold-dark);
    pointer-events: none;
    text-align: center;
    line-height: 1.5;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    text-align: center;
    padding: 20px 36px;
    color: var(--text-muted);
    font-size: 11px;
    border-top: 1px solid var(--border);
}

.footer strong { color: var(--ux-gold); font-weight: 600; }

/* =============================================
   STATUS ONLINE / OFFLINE
   ============================================= */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s;
}

.status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74,222,128,0.2);
    animation: pulse-online 2.5s infinite;
}

.status-dot.offline { background: #3f3f3f; }

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 0 2px rgba(74,222,128,0.2); }
    50%       { box-shadow: 0 0 0 4px rgba(74,222,128,0.0); }
}

.agent-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.avatar-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--bg-card);
    border-radius: 50%;
}

.agent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.agent-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.agent-chip .status-dot { width: 6px; height: 6px; }

/* =============================================
   USUÁRIO LOGADO — sidebar footer
   ============================================= */
.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    gap: 8px;
    transition: background 0.18s, border-color 0.18s;
}

.sidebar-user:hover {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.12);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #dfc291, #a68845);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #0a0a0a;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.user-details { min-width: 0; }

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: #f5f5f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10px;
    color: #6b6b6b;
    margin-top: 1px;
}

.logout-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid #242424;
    background: transparent;
    color: #6b6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s;
}

.logout-btn svg { width: 14px; height: 14px; }

.logout-btn:hover {
    background: rgba(248,113,113,0.1);
    border-color: rgba(248,113,113,0.3);
    color: #f87171;
}

/* =============================================
   DATE RANGE PICKER
   ============================================= */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 5px 10px;
    transition: border-color 0.2s;
}

.date-range-picker:focus-within {
    border-color: var(--ux-gold-dark);
    box-shadow: 0 0 0 3px rgba(201,169,110,0.08);
}

.date-range-picker svg {
    width: 14px;
    height: 14px;
    color: var(--ux-gold);
    flex-shrink: 0;
}

.date-range-picker input[type="date"] {
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    color-scheme: dark;
}

.date-range-picker input[type="date"]::-webkit-datetime-edit {
    color: var(--text-primary);
}

.date-range-picker input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    color: var(--text-primary);
}

/* Ícone nativo dourado */
.date-range-picker input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(75%) sepia(30%) saturate(500%) hue-rotate(5deg);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.date-range-picker input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.date-range-separator {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0 2px;
    flex-shrink: 0;
}

.date-range-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--gradient-gold);
    color: #0a0a0a;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity 0.18s;
}

.date-range-apply:hover {
    opacity: 0.85;
}
.date-range-apply:active { transform: scale(0.97); }

/* Label que mostra o período ativo */
.date-range-label {
    font-size: 11px;
    color: var(--ux-gold);
    font-weight: 600;
    white-space: nowrap;
    padding: 0 2px;
}

/* Botão de refresh */
.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    font-family: 'Inter', sans-serif;
}

.refresh-btn svg {
    width: 13px;
    height: 13px;
    transition: transform 0.4s;
}

.refresh-btn:hover {
    color: var(--ux-gold);
    border-color: var(--ux-gold-dark);
}

.refresh-btn:hover svg { transform: rotate(180deg); }

/* Cache status */
.cache-status {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 2px;
}

/* =============================================
   LOADING OVERLAY
   ============================================= */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5,5,5,0.75);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--ux-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* =============================================
   BANNER DE INFORMAÇÃO / ERRO
   ============================================= */
.info-banner {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.info-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

.info-banner code {
    background: rgba(255,255,255,0.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.banner-warn {
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.2);
    color: #fbbf24;
}

.banner-error {
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    color: #f87171;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ux-gold-dark); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
    .header-date { display: none; }
    .bar-track { min-width: 40px; }
}

@media (max-width: 900px) {
    :root { --sidebar-width: 0px; }
    .sidebar { transform: translateX(-100%); }
    .app-wrapper { margin-left: 0; }
    .ranking-table thead th:nth-child(5),
    .ranking-table tbody td:nth-child(5) { display: none; }
}

@media (max-width: 680px) {
    .date-range-picker input[type="date"] { font-size: 11px; }
    .date-range-label { display: none; }
    .ranking-table thead th:nth-child(6),
    .ranking-table tbody td:nth-child(6) { display: none; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   RANKING — LINHA EXPANDIDA
   ============================================= */
.ranking-row:hover {
    background: rgba(255,255,255,0.03);
}

.ranking-expand td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border);
}

.expand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
    animation: expandIn 0.18s ease;
}

@keyframes expandIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.expand-block {
    background: rgba(255,255,255,0.02);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.expand-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.expand-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.expand-detail {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* =============================================
   DATE PICKER — FILTROS RÁPIDOS
   ============================================= */
.date-range-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-quick-filters {
    display: flex;
    gap: 4px;
}

.quick-filter-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 10px;
    height: 32px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.quick-filter-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}

.quick-filter-btn.active {
    background: rgba(201,169,110,0.15);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* =============================================
   DESEMPENHO INDIVIDUAL
   ============================================= */
.agent-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding: 16px 20px 20px;
}

.agent-select-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: all 0.15s;
}

.agent-select-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
}

.agent-select-card.selected {
    border-color: var(--accent);
    background: rgba(201,169,110,0.08);
}

/* =============================================
   CONVERSAS — date inputs color-scheme fix
   ============================================= */
#conv-start,
#conv-end {
    color-scheme: dark;
}

#conv-start::-webkit-calendar-picker-indicator,
#conv-end::-webkit-calendar-picker-indicator {
    filter: invert(75%) sepia(30%) saturate(500%) hue-rotate(5deg);
    cursor: pointer;
    opacity: 0.7;
}

#conv-start:focus,
#conv-end:focus {
    border-color: var(--ux-gold-dark) !important;
    box-shadow: 0 0 0 2px rgba(201,169,110,.08);
}

#conv-agente-sel:focus {
    border-color: var(--ux-gold-dark) !important;
}

/* Modal chat scrollbar */
#conv-modal-chat::-webkit-scrollbar       { width: 4px; }
#conv-modal-chat::-webkit-scrollbar-track  { background: transparent; }
#conv-modal-chat::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 2px; }

/* Responsive modal */
@media (max-width: 640px) {
    #conv-modal > div {
        max-height: 92vh !important;
    }
}

/* =============================================
   PREMIUM OVERRIDES GLOBAIS
   ============================================= */

/* Section label estilo Resumo */
.section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 2px;
}

/* Expert tag pill colorida */
.expert-tag {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-radius: 6px;
    padding: 3px 8px;
}

/* Hero card — gradiente dourado sutil */
.hero-card {
    background: linear-gradient(135deg, rgba(201,169,110,.07) 0%, rgba(201,169,110,.02) 100%);
    border: 1px solid rgba(201,169,110,.18);
    border-radius: 16px;
    padding: 26px 30px;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--gap);
}

.hero-card::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(201,169,110,.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Bloco KPI bipartido (Humano / IA) */
.kpi-block {
    border-radius: 14px;
    padding: 18px 22px;
}

.kpi-block-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
}

.kpi-block-label .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Stat mini-card dentro de expert cards */
.stat-mini {
    background: rgba(255,255,255,.03);
    border-radius: 10px;
    padding: 10px 12px;
}

.stat-mini .stat-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-mini .stat-value {
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.stat-mini .stat-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Hover row premium */
.table-premium tbody tr {
    transition: background 0.12s;
}

.table-premium tbody tr:hover {
    background: rgba(255,255,255,.03);
}

/* Agent chip refinado */
.agent-chip {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,.05);
    color: var(--text-secondary);
    margin: 2px 2px;
    font-weight: 500;
}

/* Sidebar nav melhorada */
.nav-section-title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    padding: 16px 20px 6px;
    opacity: .6;
}
