/* ═══════════════════════════════════════════════════════════
   Creator Analytics - Dashboard Artisan (v3 clean)
   ═══════════════════════════════════════════════════════════ */

.th-cs-wrap {
    --th-primary:       rgba(255,255,255,0.3);
    --th-primary-glow:  rgba(255,255,255,0.03);
    --th-primary-soft:  rgba(255,255,255,0.04);
    --th-info:          #ddd;
    --th-success:       #ddd;
    --th-danger:        #ddd;
    --th-warning:       #ddd;
    --th-purple:        #ddd;
    --th-pink:          #ddd;
    --th-cyan:          #ddd;

    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 36px;

    --th-bg:            rgba(255,255,255,0.025);
    --th-bg-hover:      rgba(255,255,255,0.045);
    --th-border:        rgba(255,255,255,0.07);
    --th-border-strong: rgba(255,255,255,0.14);

    --th-text:          rgba(255,255,255,0.92);
    --th-text-muted:    rgba(255,255,255,0.5);
    --th-text-dim:      rgba(255,255,255,0.3);

    font-family: 'Montserrat', sans-serif;
    color: var(--th-text);
}

/* ═══ En-tete ═══ */
.th-cs-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--th-border);
}
.th-cs-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.th-cs-title {
    margin: 0;
    color: #f0f0f0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 0;
}
.th-cs-title::before {
    display: none;
}
.th-cs-subtitle {
    color: #888;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    padding-left: 0;
}
.th-cs-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ═══ Barre des periodes ═══ */
.th-cs-period-bar {
    display: inline-flex;
    gap: 2px;
    background: var(--th-bg);
    border: 1px solid var(--th-border);
    border-radius: 10px;
    padding: 3px;
}
.th-cs-period-btn {
    padding: 7px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}
.th-cs-period-btn:hover {
    color: #ccc;
    background: rgba(255,255,255,0.04);
}
.th-cs-period-btn.active {
    background: #fff;
    color: #0a0a0a;
    box-shadow: none;
}

/* ═══ Bouton Export ═══ */
.th-cs-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: #ccc;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.th-cs-export-btn:hover {
    background: #fff;
    color: #0a0a0a;
    border-color: #fff;
    transform: translateY(-1px);
}
.th-cs-export-icon { font-size: 13px; }

/* ═══ Sections ═══ */
.th-cs-section {
    margin-bottom: 28px;
}
.th-cs-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #888;
    margin: 0 0 14px 0;
    padding-left: 0;
    position: relative;
}
.th-cs-section-title::before {
    display: none;
}

/* ═══ KPIs - compacts, neutres ═══ */
.th-cs-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.th-cs-kpi {
    position: relative;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--th-border);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.2s ease;
}
.th-cs-kpi::before {
    display: none;
}
.th-cs-kpi::after {
    display: none;
}
.th-cs-kpi:hover {
    border-color: var(--th-border-strong);
}
.th-cs-kpi-value {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: 0;
    text-shadow: none;
}
.th-cs-kpi-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #777;
}
.th-cs-kpi-sub {
    font-size: 10px;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

/* Valeur crypto plus petite pour les decimales */
.th-cs-kpi-crypto .th-cs-kpi-value { font-size: 15px; }

/* ═══ Cards ═══ */
.th-cs-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--th-border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 14px;
    transition: border-color 0.2s ease;
}
.th-cs-card:hover {
    border-color: rgba(255,255,255,0.1);
}
.th-cs-card-hero {
    padding: 24px;
}
.th-cs-card canvas {
    max-height: 220px;
    width: 100% !important;
    height: auto !important;
}
.th-cs-card-hero canvas {
    max-height: 260px;
}
.th-cs-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 0;
}
.th-cs-card-title::before {
    display: none;
}

/* ═══ Grille 2 colonnes ═══ */
.th-cs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ═══ Barres de progression (listes) ═══ */
.th-cs-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.th-cs-bar-label {
    min-width: 60px;
    font-size: 12px;
    font-weight: 600;
    color: #ccc;
    white-space: nowrap;
}
.th-cs-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.th-cs-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.th-cs-bar-value {
    min-width: 30px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #ddd;
}

/* ═══ Top contenus (tableau) - reset WordPress ═══ */
table.th-cs-top-table,
table.th-cs-top-table thead,
table.th-cs-top-table tbody,
table.th-cs-top-table tr,
table.th-cs-top-table th,
table.th-cs-top-table td {
    border: none !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    box-shadow: none !important;
    outline: none !important;
    background-image: none !important;
}
.th-cs-top-table {
    width: 100%;
    border-collapse: collapse !important;
    font-family: 'Montserrat', sans-serif;
}
.th-cs-top-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    border-right: 1px solid rgba(255,255,255,0.05) !important;
    text-align: left;
    cursor: pointer;
    background: rgba(255,255,255,0.04) !important;
    white-space: nowrap;
    user-select: none;
}
.th-cs-top-table th:last-child {
    border-right: none !important;
}
.th-cs-top-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    border-right: 1px solid rgba(255,255,255,0.03) !important;
    font-size: 13px;
    color: #ccc;
    background: transparent !important;
    vertical-align: middle;
}
.th-cs-top-table td:last-child {
    border-right: none !important;
}
.th-cs-top-table tbody tr:last-child td {
    border-bottom: none !important;
}
.th-cs-top-table tbody tr:hover {
    background: rgba(255,255,255,0.04) !important;
}

/* ═══ Loading & Empty ═══ */
.th-cs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #888;
    font-size: 13px;
}
.th-cs-spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: th-cs-spin 0.7s linear infinite;
}
@keyframes th-cs-spin { to { transform: rotate(360deg); } }

.th-cs-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 13px;
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .th-cs-grid { grid-template-columns: 1fr; }
    .th-cs-header { flex-direction: column; align-items: flex-start; }
    .th-cs-kpis { grid-template-columns: repeat(2, 1fr); }
    .th-cs-wrap { padding: 20px; }
}
@media (max-width: 480px) {
    .th-cs-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .th-cs-kpi { padding: 12px 14px; }
    .th-cs-kpi-value { font-size: 16px; }
    .th-cs-card { padding: 16px; }
    .th-cs-wrap { padding: 16px; }
}
