/**
 * Statistiques APIs — Styles de la page de statistiques des APIs
 *
 * Badges de facturation, tableaux de coûts et visualisation
 * des statistiques d'utilisation des APIs IA.
 *
 * @file        cc-apis-stats.css
 * @package     CaisseConnect
 * @subpackage  CSS\Pages
 * @since       0.9
 * @version     1.7.1
 * @author      Microlibre <contact@microlibre.net>
 * @copyright   2026 Microlibre
 * @license     GPL-2.0+ https://www.gnu.org/licenses/gpl-2.0.html
 * @link        https://microlibre.net/caisse-connect
 */

.cc-badge-facturation {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.cc-badge-appel {
    background-color: var(--cc-info-alt-bg, #e7f3fe);
    color: var(--cc-info-alt, #2196f3);
    border: 1px solid var(--cc-info-alt-border, #90caf9);
}

.cc-badge-token {
    background-color: var(--cc-purple-bg, #f3e5f5);
    color: var(--cc-purple-dark, #7b1fa2);
    border: 1px solid var(--cc-purple-border, #ce93d8);
}

.cc-stats-totaux {
    background-color: var(--cc-gray-300, #f0f0f0);
    font-weight: bold;
    border-top: 2px solid var(--cc-text, #333);
}

.cc-stats-totaux td {
    padding: 12px 8px;
}

/* ========================================
   FILTRES
   ======================================== */

.cc-filter-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.cc-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cc-filter-retention {
    margin-left: auto;
}

.cc-filter-label {
    margin-left: 10px;
}

/* ========================================
   COULEURS DE STATS
   ======================================== */

.cc-stat-success {
    color: var(--cc-success, #28a745);
}

.cc-stat-error {
    color: var(--cc-error, #dc3545);
}

/* ========================================
   LIEN DETAIL API (nom cliquable)
   ======================================== */

.cc-api-detail-link {
    text-decoration: none;
    cursor: pointer;
}

.cc-api-detail-link:hover {
    text-decoration: underline;
}

/* ========================================
   MODALE DETAIL APPELS API
   ======================================== */

.cc-modal-api-detail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--cc-z-modal, 100000);
}

.cc-modal-api-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cc-overlay-bg, rgba(0, 0, 0, 0.6));
}

.cc-modal-api-detail-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 90%;
    max-height: 85vh;
    background: var(--cc-white, #fff);
    border-radius: var(--cc-border-radius, 4px);
    box-shadow: var(--cc-shadow-modal, 0 5px 30px rgba(0, 0, 0, 0.3));
    display: flex;
    flex-direction: column;
}

.cc-modal-api-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--cc-primary);
    color: var(--cc-white, #fff);
    border-radius: var(--cc-border-radius, 4px) var(--cc-border-radius, 4px) 0 0;
}

.cc-modal-api-detail-header h2 {
    margin: 0;
    font-size: 16px;
    color: var(--cc-white, #fff);
}

.cc-modal-api-detail-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.cc-modal-api-detail-body table {
    font-size: 12px;
}

.cc-modal-api-detail-body td,
.cc-modal-api-detail-body th {
    padding: 4px 6px;
    white-space: nowrap;
}

.cc-api-detail-col-nowrap {
    white-space: nowrap;
}

.cc-api-detail-col-fixed {
    width: 80px;
}

.cc-modal-api-detail-body td:last-child {
    white-space: normal;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
