/* ==========================================
   J.A. CRÉA — Admin Panel Styles
   ========================================== */

:root {
    --gold: #C9A96E;
    --gold-light: #D4B87A;
    --gold-dark: #A88B4A;
    --cream: #FAF7F2;
    --cream-dark: #F0EBE3;
    --warm-white: #FDFCFA;
    --text-dark: #2C1810;
    --text-medium: #5C4A3A;
    --text-light: #8B7D72;
    --border: #E8E0D6;
    --shadow-sm: 0 2px 8px rgba(44, 24, 16, 0.06);
    --shadow-md: 0 4px 20px rgba(44, 24, 16, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background: var(--cream);
    line-height: 1.6;
    font-size: 14px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-medium); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-danger { background: #F5E6E6; color: #B85C5C; }
.btn-danger:hover { background: #B85C5C; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Login Page ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2C1810, #4A3020);
}

.login-container {
    background: var(--warm-white);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 400px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.login-container h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.login-container .form-group {
    margin-bottom: 14px;
    text-align: left;
}
.login-container label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-medium);
}
.login-container input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    transition: var(--transition);
}
.login-container input:focus {
    outline: none;
    border-color: var(--gold);
}

.login-container .btn { margin-top: 8px; }

.back-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-light);
}
.back-link:hover { color: var(--gold); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #FDE8E8; color: #B85C5C; }
.alert-success { background: #E8F5E9; color: #2E7D32; }

.product-admin-card { position: relative; }
.bulk-check input { width: 18px; height: 18px; }

/* Bottom nav (caché en desktop, visible en mobile via media query) */
.bottom-nav { display: none; }

/* ── Admin Layout ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--text-dark);
    color: var(--cream);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.sidebar-header span {
    font-weight: 600;
    font-size: 16px;
}

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 400;
    color: rgba(250, 247, 242, 0.7);
    transition: var(--transition);
}
.sidebar-link:hover {
    background: rgba(201, 169, 110, 0.1);
    color: var(--gold-light);
}
.sidebar-link svg { flex-shrink: 0; }

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.sidebar-link.logout { color: rgba(250, 247, 242, 0.5); }
.sidebar-link.logout:hover { color: #E88; }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    padding: 8px;
}

/* ── Main Content ── */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.admin-header {
    background: var(--warm-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.admin-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.admin-content {
    padding: 28px;
}

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--warm-white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 52px;
    height: 52px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    flex-shrink: 0;
}
.stat-icon.paid { color: #4A8C5C; background: #E8F5E9; }
.stat-icon.pending { color: #E6A23C; background: #FFF3E0; }
.stat-icon.messages { color: #5C8CB8; background: #E3F2FD; }

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ── Admin Table ── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--warm-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-table th {
    background: var(--cream);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 500;
}
.admin-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.admin-table tbody tr { cursor: pointer; transition: var(--transition); }
.admin-table tbody tr:hover { background: var(--cream); }
.admin-table tfoot td {
    font-size: 14px;
    padding: 10px 16px;
}
.total-row td { font-weight: 600; }

/* ── Status Badges ── */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-pending { background: #FFF3E0; color: #E6A23C; }
.status-paid { background: #E8F5E9; color: #4A8C5C; }
.status-shipped { background: #E3F2FD; color: #5C8CB8; }
.status-delivered { background: #E8F5E9; color: #2E7D32; }
.status-cancelled { background: #FDE8E8; color: #B85C5C; }

/* ── Admin Toolbar ── */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-toolbar h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
}

/* ── Quick Actions ── */
.quick-actions { margin-top: 28px; }
.quick-actions h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.action-card {
    background: var(--warm-white);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.action-card svg {
    color: var(--gold);
    margin-bottom: 8px;
}
.action-card span {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

/* ── Products Admin Grid ── */
.products-admin-grid {
    display: grid;
    gap: 12px;
}

.product-admin-card {
    display: flex;
    gap: 16px;
    background: var(--warm-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    align-items: center;
}
.product-admin-card.inactive { opacity: 0.5; }

.pac-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--cream);
}
.pac-image img { width: 100%; height: 100%; object-fit: cover; }

.pac-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--border);
}

.pac-info { flex: 1; }
.pac-info h3 { font-size: 15px; font-family: 'Montserrat', sans-serif; margin-bottom: 4px; }
.pac-cat { font-size: 12px; color: var(--gold); margin-bottom: 4px; }
.pac-price { font-size: 13px; color: var(--text-medium); }

.pac-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    background: var(--gold);
    color: #fff;
    margin-top: 4px;
}
.pac-badge-inactive { background: var(--text-light); }

.pac-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Form Cards ── */
.form-card {
    background: var(--warm-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.form-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}
.form-card h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
}

/* ── Product Form ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.product-form .form-group { margin-bottom: 14px; }
.product-form label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-medium);
}
.product-form input,
.product-form select,
.product-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    transition: var(--transition);
    background: #fff;
}
.product-form input:focus,
.product-form select:focus,
.product-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}
.product-form textarea { resize: vertical; }
.product-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.checkbox-label input { width: auto !important; }

.upload-group {
    margin-bottom: 16px;
}
.upload-group label { margin-bottom: 6px; }
.upload-group input[type="file"] {
    padding: 8px;
    border: 1.5px dashed var(--border);
    cursor: pointer;
}
.upload-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.upload-hint {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 8px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* ── Order Detail ── */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.status-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}
.status-form select {
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
}
.meta-text { font-size: 12px; color: var(--text-light); margin-top: 12px; }

/* ── Messages ── */
.messages-list { display: grid; gap: 12px; }

.message-card {
    background: var(--warm-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--border);
}
.message-card.unread { border-left-color: var(--gold); }

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.message-email, .message-phone {
    font-size: 12px;
    color: var(--text-light);
    margin-left: 8px;
}
.message-date { font-size: 12px; color: var(--text-light); }
.message-body { color: var(--text-medium); font-size: 13px; line-height: 1.6; margin-bottom: 12px; }

/* ── Empty State ── */
.empty-state-admin {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state-admin svg { margin: 0 auto 16px; }
.empty-state-admin h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state-admin .btn { margin-top: 16px; }

.admin-section { margin-bottom: 28px; }
.admin-section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ── Responsive (iOS-first) ── */
@media (max-width: 900px) {
    /* Sidebar drawer */
    .admin-sidebar {
        transform: translateX(-100%);
        width: 78%;
        max-width: 320px;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .admin-main { margin-left: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* Inputs : 16px = pas de zoom auto Safari */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="tel"], textarea, select {
        font-size: 16px !important;
        padding: 12px 14px;
    }

    /* Touch targets ≥ 44px (Apple HIG) */
    .btn { min-height: 44px; padding: 12px 18px; font-size: 14px; }
    .btn-sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }
    .btn-lg { min-height: 50px; padding: 14px 22px; font-size: 15px; }
    .sidebar-link { padding: 14px 20px; font-size: 15px; }
    .sidebar-toggle { padding: 12px; }

    /* Header sticky avec safe-area iPhone */
    .admin-header {
        position: sticky; top: 0; z-index: 50;
        background: var(--warm-white);
        padding-top: max(16px, env(safe-area-inset-top));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    /* Contenu : padding bas pour ne pas être caché par la bottom nav */
    .admin-content {
        padding: 16px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    /* Bottom tab bar (style iOS) */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--warm-white);
        border-top: 1px solid var(--border);
        padding: 6px 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
        z-index: 60;
        justify-content: space-around;
    }
    .bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 4px;
        font-size: 11px;
        color: var(--text-light);
        text-decoration: none;
    }
    .bottom-nav a.active { color: var(--gold-dark); }
    .bottom-nav a svg { width: 22px; height: 22px; }

    /* Cards de produit : 1-2 colonnes propre */
    .products-admin-grid { grid-template-columns: 1fr; gap: 10px; }
    .product-admin-card { display: flex; flex-direction: row; }
    .product-admin-card .pac-image { width: 100px; height: 100px; flex-shrink: 0; }
    .product-admin-card .pac-info { flex: 1; padding: 10px 12px; }
    .product-admin-card .pac-actions {
        flex-direction: column;
        gap: 6px;
        padding: 10px;
        justify-content: center;
    }
    .product-admin-card .pac-actions .btn,
    .product-admin-card .pac-actions form { width: 100%; }
    .product-admin-card .pac-actions form .btn { width: 100%; }

    /* Tableaux → mode cartes empilées */
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table tr {
        background: var(--warm-white);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        padding: 12px 14px;
    }
    .admin-table td {
        padding: 4px 0;
        border: none;
        text-align: left !important;
        font-size: 14px;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-medium);
        display: block;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }
    .admin-table tfoot { display: block; padding-top: 8px; border-top: 1px solid var(--border); }
    .admin-table tfoot tr { border: none; padding: 4px 0; margin: 0; background: transparent; }

    /* Sticky save button en bas des formulaires */
    .form-actions {
        position: sticky;
        bottom: 80px;
        z-index: 40;
        background: linear-gradient(to bottom, transparent, var(--cream) 25%);
        padding: 16px 0;
        margin: 0 -16px -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .form-actions .btn-lg { width: 100%; }

    /* Filter tabs : wrap propre sur 2 lignes en mobile */
    .filter-tabs { gap: 6px !important; flex-wrap: wrap !important; }
    .filter-tabs .btn {
        flex: 1 1 calc(33% - 6px);
        min-width: 0;
        padding: 10px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Photos upload : preview plus grand, tap zone élargie */
    .upload-preview { max-width: 100%; height: auto; max-height: 240px; }
    .upload-group input[type="file"] { padding: 14px; font-size: 14px; }

    /* Cards stats sur 1 colonne en très petit */
    @media (max-width: 380px) {
        .stats-grid { grid-template-columns: 1fr; }
    }
}

/* ── Stats page ── */
.period-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.btn-period {
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    background: var(--cream);
    color: var(--text);
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-period:hover { opacity: 0.85; }
.btn-period.active {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.stats-info-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 12px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--cream);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-light);
}
.stats-info-bar > div { line-height: 1.5; }
.stats-info-bar strong { color: var(--text); }
.stats-info-bar .hint {
    color: var(--text-lighter, #a1a1aa);
    font-size: 12px;
}

.stats-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .stats-tables-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    .period-switcher {
        gap: 6px;
        margin-bottom: 16px;
    }
    .btn-period {
        flex: 1 1 calc(33.33% - 6px);
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        padding: 8px 10px;
    }
    .stats-info-bar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
        font-size: 13px;
    }
    .stats-info-bar .hint { display: block; margin-top: 2px; }
}

/* ── Compact rank list (top 10) ── */
.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--warm-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.rank-list li {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border, #ecebe7);
    font-size: 14px;
}
.rank-list li:last-child { border-bottom: none; }
.rank-list .rank-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cream);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}
.rank-list li:nth-child(1) .rank-num { background: var(--gold); color: white; }
.rank-list li:nth-child(2) .rank-num { background: #d4af37cc; color: white; }
.rank-list li:nth-child(3) .rank-num { background: #c9a85788; color: white; }
.rank-list .rank-name {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
a.rank-name:hover { color: var(--gold); }
.rank-list .rank-value {
    font-variant-numeric: tabular-nums;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
}
.rank-list .rank-value small {
    font-size: 11px;
    color: var(--text-lighter, #a1a1aa);
}

/* ── Visits chart (CSS bars, no JS dependency) ── */
.visits-chart-section {
    background: var(--warm-white);
    border-radius: var(--radius);
    padding: 16px 18px 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.visits-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}
.visits-chart-header .hint {
    font-size: 12px;
    color: var(--text-lighter, #a1a1aa);
}
.visits-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-bottom: 22px;
    position: relative;
    overflow-x: auto;
}
.visits-chart .bar-col {
    flex: 1 1 0;
    min-width: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}
.visits-chart .bar {
    background: linear-gradient(180deg, var(--gold) 0%, #d4af37bb 100%);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: opacity 0.2s;
    cursor: help;
}
.visits-chart .bar[data-count="0"] {
    background: var(--cream);
    min-height: 1px;
}
.visits-chart .bar:hover { opacity: 0.75; }
.visits-chart .bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-light);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .rank-list li {
        grid-template-columns: 28px 1fr auto;
        gap: 8px;
        padding: 9px 12px;
        font-size: 13px;
    }
    .rank-list .rank-num { width: 22px; height: 22px; font-size: 11px; }
    .rank-list .rank-value { font-size: 12px; }
    .visits-chart-section { padding: 12px 12px 10px; }
    .visits-chart {
        height: 100px;
        gap: 3px;
        padding-bottom: 20px;
    }
    .visits-chart .bar-col { min-width: 8px; }
    .visits-chart .bar-label { font-size: 9px; }
    /* En mobile, n'affiche pas tous les labels si trop nombreux (1 sur 3) */
    .visits-chart.dense .bar-col:not(:nth-child(3n+1)) .bar-label { display: none; }
}

/* Mode standalone PWA : safe-areas */
@media (display-mode: standalone) {
    body { padding-top: env(safe-area-inset-top); }
}
