/* ═══════════════════════════════════════════════════════════════
   Hub Tabs — barre d'onglets horizontale pour les pages-hub
   (Stock, Trésorerie, TVA, Factures, Paramètres, Administration)
   Inspiré de Medivio : Identité · Antécédents · Visites · Examens
   ═══════════════════════════════════════════════════════════════ */

.hub-page-header {
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    padding-bottom: 0;
}

/* Header unifié : titre+sous-titre à gauche, actions à droite sur la MÊME ligne que les onglets.
   Pattern "Medivio" : pas de ligne supplémentaire page-header. */
.hub-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 0;
}

.hub-header-title {
    padding: 0 0 10px;
    flex: 1;
    min-width: 0;
}

.hub-header-title h1 {
    margin-bottom: 2px !important;
}

.hub-header-title p {
    font-size: 12.5px;
}

.hub-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.hub-header-actions .btn {
    font-size: 13px;
    padding: 6px 14px;
}

.hub-tabs-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
    grid-column: 1 / -1;
    width: 100%;
}

.hub-tabs {
    display: flex;
    gap: 4px;
    min-width: 0;
    padding-bottom: 0;
}

.hub-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary, #6b7280);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

.hub-tab:hover,
.hub-tab:focus,
.hub-tab:focus-visible,
.hub-tab:active,
.hub-tab-active {
    text-decoration: none !important;
}

.hub-tab i {
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.hub-tab:hover {
    color: var(--color-text-primary, #1f2937);
    background: var(--color-bg-tertiary, rgba(0, 0, 0, 0.03));
}

.hub-tab:hover i {
    opacity: 1;
}

.hub-tab-active {
    color: var(--brand-primary, #4361ee) !important;
    font-weight: 600;
    border-bottom-color: var(--brand-primary, #4361ee);
}

.hub-tab-active i {
    opacity: 1;
    color: var(--brand-primary, #4361ee);
}

.hub-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--brand-primary, #4361ee);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

.hub-tab-badge-danger {
    background: #ef4444;
}

/* Mode sombre : ajustements */
[data-theme="dark"] .hub-page-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .hub-tab-active {
    color: #93c5fd !important;
    border-bottom-color: #93c5fd;
}

[data-theme="dark"] .hub-tab-active i {
    color: #93c5fd;
}

/* Responsive : scroll horizontal sur mobile */
@media (max-width: 768px) {
    .hub-tab {
        padding: 10px 12px;
        font-size: 12.5px;
    }
    .hub-tab span {
        display: none;
    }
    .hub-tab i {
        font-size: 17px;
    }
}
