/* ============================================================
   Home&Family — Custom Design System
   Thème : violet/rose/blanc, responsive, moderne
   ============================================================ */

/* --- Variables --- */
:root {
    --hf-primary: #6f42c1;
    --hf-primary-dark: #5a32a3;
    --hf-primary-soft: rgba(111, 66, 193, 0.1);
    --hf-secondary: #e91e8c;
    --hf-success: #20c997;
    --hf-success-soft: rgba(32, 201, 151, 0.1);
    --hf-danger: #dc3545;
    --hf-danger-soft: rgba(220, 53, 69, 0.1);
    --hf-warning: #fd7e14;
    --hf-warning-soft: rgba(253, 126, 20, 0.1);
    --hf-info: #0dcaf0;
    --hf-info-soft: rgba(13, 202, 240, 0.1);
    --hf-purple: #6f42c1;
    --hf-purple-soft: rgba(111, 66, 193, 0.1);

    --hf-sidebar-w: 260px;
    --hf-sidebar-bg: #1a1a2e;
    --hf-sidebar-text: rgba(255,255,255,0.85);
    --hf-sidebar-hover: rgba(255,255,255,0.08);
    --hf-sidebar-active: rgba(111, 66, 193, 0.3);
    --hf-sidebar-section-color: rgba(255,255,255,0.4);

    --hf-topnav-h: 60px;
    --hf-topnav-bg: #fff;
    --hf-topnav-shadow: 0 1px 4px rgba(0,0,0,0.08);

    --hf-bg: #f0f2f7;
    --hf-card-bg: #fff;
    --hf-card-radius: 12px;
    --hf-card-shadow: 0 2px 8px rgba(0,0,0,0.06);

    --hf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --hf-font-size: 14px;
    --hf-border-radius: 8px;
    --hf-transition: 0.2s ease;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--hf-font-size); }
body {
    font-family: var(--hf-font);
    background: var(--hf-bg);
    color: #2d3748;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.hf-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.hf-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--hf-sidebar-w);
    height: 100vh;
    background: var(--hf-sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform var(--hf-transition);
}

.hf-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hf-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.hf-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--hf-primary), var(--hf-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.hf-brand-text {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.hf-sidebar-content {
    flex: 1;
    padding: 12px 0 20px;
    overflow-y: auto;
}

.hf-sidebar-section {
    margin-bottom: 8px;
    padding: 0 12px;
}

.hf-sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hf-sidebar-section-color);
    padding: 14px 8px 6px;
    display: flex;
    align-items: center;
}

.hf-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hf-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--hf-sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--hf-transition);
    margin-bottom: 2px;
}

.hf-nav-link:hover {
    background: var(--hf-sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.hf-nav-link.active {
    background: var(--hf-sidebar-active);
    color: #fff;
    border-left: 3px solid var(--hf-primary);
}

.hf-nav-link i {
    font-size: 16px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.hf-cart-badge {
    background: var(--hf-secondary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.4;
}

/* --- Main Panel --- */
.hf-main-panel {
    margin-left: var(--hf-sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Top Navbar --- */
.hf-topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--hf-topnav-bg);
    box-shadow: var(--hf-topnav-shadow);
    height: var(--hf-topnav-h);
    padding: 0;
    border-bottom: 1px solid #eef0f4;
}

.hf-page-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.hf-nav-action {
    position: relative;
    color: #555;
    text-decoration: none;
    padding: 6px;
}

.hf-nav-action:hover { color: var(--hf-primary); }

.hf-nav-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--hf-secondary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hf-user-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    transition: all var(--hf-transition);
}

.hf-user-btn:hover {
    background: var(--hf-primary-soft);
    border-color: var(--hf-primary);
    color: var(--hf-primary);
}

/* --- Content area --- */
.hf-content {
    flex: 1;
    padding: 24px;
}

/* --- Footer --- */
.hf-footer {
    background: #fff;
    border-top: 1px solid #eef0f4;
    padding: 12px 24px;
    font-size: 12px;
    color: #888;
}

/* ============================================================
   CARDS & UI COMPONENTS
   ============================================================ */
.hf-card {
    background: var(--hf-card-bg);
    border-radius: var(--hf-card-radius);
    box-shadow: var(--hf-card-shadow);
    border: 1px solid #eef0f4;
}

.hf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.hf-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #1a1a2e;
}

.hf-card-body {
    padding: 20px;
}

/* --- Stat Cards --- */
.hf-stat-card {
    background: #fff;
    border-radius: var(--hf-card-radius);
    box-shadow: var(--hf-card-shadow);
    border: 1px solid #eef0f4;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--hf-transition), box-shadow var(--hf-transition);
}

.hf-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.hf-stat-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.hf-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.hf-stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: #1a1a2e;
}

.hf-stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Colored backgrounds for stat icons */
.bg-primary-soft { background: var(--hf-primary-soft); }
.bg-success-soft { background: var(--hf-success-soft); }
.bg-danger-soft { background: var(--hf-danger-soft); }
.bg-warning-soft { background: var(--hf-warning-soft); }
.bg-info-soft { background: var(--hf-info-soft); }
.bg-purple-soft { background: var(--hf-purple-soft); }

.text-purple { color: var(--hf-purple) !important; }

/* --- Welcome banner --- */
.hf-welcome-banner {
    background: linear-gradient(135deg, var(--hf-primary) 0%, var(--hf-secondary) 100%);
    border-radius: var(--hf-card-radius);
    padding: 20px 24px;
    color: #fff;
}

.hf-welcome-banner .hf-page-heading {
    color: #fff;
    font-size: 20px;
}

.hf-welcome-banner .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

/* --- Page heading --- */
.hf-page-heading {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1a1a2e;
}

/* --- Tables --- */
.hf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.hf-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #eef0f4;
}

.hf-table thead th {
    padding: 10px 16px;
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.hf-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background var(--hf-transition);
}

.hf-table tbody tr:hover { background: #f8fafc; }

.hf-table tbody td {
    padding: 12px 16px;
    color: #374151;
}

.hf-table tfoot td {
    padding: 12px 16px;
    border-top: 2px solid #eef0f4;
}

/* --- Buttons --- */
.hf-btn-primary {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--hf-primary), var(--hf-secondary));
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--hf-border-radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--hf-transition);
    line-height: 1.4;
}

.hf-btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.hf-btn-outline {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--hf-primary);
    border: 1.5px solid var(--hf-primary);
    padding: 9px 18px;
    border-radius: var(--hf-border-radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--hf-transition);
}

.hf-btn-outline:hover {
    background: var(--hf-primary-soft);
    text-decoration: none;
    color: var(--hf-primary);
}

.hf-btn-ghost {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    padding: 9px 18px;
    border-radius: var(--hf-border-radius);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--hf-transition);
}

.hf-btn-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    text-decoration: none;
    color: #374151;
}

.hf-btn-outline-sm {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--hf-primary);
    border: 1px solid var(--hf-primary);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--hf-transition);
}

/* --- Form controls --- */
.hf-form-group { margin-bottom: 16px; }

.hf-form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hf-form-label.required::after {
    content: ' *';
    color: var(--hf-danger);
}

.hf-form-control {
    display: block;
    width: 100%;
    padding: 9px 13px;
    font-size: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--hf-border-radius);
    background: #fff;
    color: #1a1a2e;
    transition: border-color var(--hf-transition), box-shadow var(--hf-transition);
    font-family: var(--hf-font);
}

.hf-form-control:focus {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.12);
}

/* --- Action buttons in tables --- */
.hf-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    text-decoration: none;
    color: #64748b;
    transition: all var(--hf-transition);
    font-size: 14px;
}

.hf-action-btn:hover {
    background: var(--hf-primary-soft);
    color: var(--hf-primary);
    text-decoration: none;
}

.hf-action-btn.text-danger:hover {
    background: var(--hf-danger-soft);
    color: var(--hf-danger);
}

/* --- Link styles --- */
.hf-link { color: var(--hf-primary); text-decoration: none; font-weight: 500; }
.hf-link:hover { text-decoration: underline; }
.hf-link-sm { font-size: 12px; color: var(--hf-primary); text-decoration: none; font-weight: 600; }
.hf-link-sm:hover { text-decoration: underline; }

/* --- Empty states --- */
.hf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

/* --- Color dot --- */
.hf-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

/* --- Form page layout --- */
.hf-form-page { max-width: 800px; }
.hf-form-header { display: flex; flex-direction: column; margin-bottom: 20px; gap: 8px; }
.hf-back-btn {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.hf-back-btn:hover { color: var(--hf-primary); }

/* --- Prorata UI --- */
.hf-prorata-explain { display: flex; flex-direction: column; gap: 16px; }
.hf-prorata-step { display: flex; align-items: flex-start; gap: 12px; }
.hf-prorata-step-num {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--hf-primary), var(--hf-secondary));
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.hf-stat-block { border-top: 1px solid #f1f5f9; padding-top: 12px; }
.hf-stat-big { font-size: 28px; font-weight: 700; color: #1a1a2e; }
.hf-prorata-card {
    background: #f8fafc;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 14px;
}
.hf-prorata-label { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; }
.hf-prorata-value { font-size: 20px; font-weight: 700; margin-top: 4px; }

/* ============================================================
   AUTH PAGES (Login, Register)
   ============================================================ */
.hf-auth-body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hf-auth-container {
    width: 100%;
    max-width: 440px;
}

.hf-auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.hf-auth-brand { text-align: center; margin-bottom: 28px; }

.hf-auth-logo {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--hf-primary), var(--hf-secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(111, 66, 193, 0.4);
}

.hf-auth-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 6px;
}

.hf-brand-amp { color: var(--hf-secondary); }

.hf-auth-subtitle {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.hf-auth-form { margin-bottom: 16px; }
.hf-auth-divider {
    text-align: center;
    color: #ccc;
    font-size: 12px;
    margin: 16px 0;
    position: relative;
}
.hf-auth-divider::before, .hf-auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background: #e2e8f0;
}
.hf-auth-divider::before { left: 0; }
.hf-auth-divider::after { right: 0; }
.hf-auth-divider span { background: #fff; padding: 0 8px; }

.hf-lang-switcher { display: flex; justify-content: center; gap: 8px; }
.hf-lang-btn {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all var(--hf-transition);
}
.hf-lang-btn.active, .hf-lang-btn:hover {
    background: var(--hf-primary);
    color: #fff;
    border-color: var(--hf-primary);
    text-decoration: none;
}

.hf-auth-footer { text-align: center; margin-top: 16px; font-size: 12px; color: rgba(255,255,255,0.6); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hf-sidebar {
        transform: translateX(-100%);
    }
    .hf-sidebar.open {
        transform: translateX(0);
    }
    .hf-main-panel {
        margin-left: 0;
    }
    .hf-content {
        padding: 16px;
    }
    .hf-welcome-banner {
        padding: 16px;
    }
    .hf-auth-card {
        padding: 24px;
    }
    .hf-card-body { padding: 16px; }
}

/* Toggle button */
.hf-sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 18px;
}

/* Overlay for mobile sidebar */
.hf-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.hf-sidebar-overlay.show { display: block; }

/* Badge variants */
.badge.bg-primary-soft { background: var(--hf-primary-soft) !important; }

/* Avatar */
.hf-avatar { line-height: 1; }


/* ============================================================
   BOOTSTRAP 3/LBD COMPATIBILITY LAYER
   Ensures old content fragments render correctly under Bootstrap 5
   ============================================================ */
.wrapper { display: flex; min-height: 100vh; }
.main-panel { flex: 1; }
.content { padding: 24px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eef0f4; margin-bottom: 20px; }
.card .header { padding: 16px 20px 8px; border-bottom: 1px solid #f1f5f9; }
.card .header h4.title { font-size: 16px; font-weight: 700; margin: 0 0 4px; color: #1a1a2e; }
.card .content { padding: 16px 20px; }
.card-body { padding: 16px 20px; }
.card-header { padding: 14px 20px; background: #f8fafc; border-bottom: 1px solid #eef0f4; border-radius: 12px 12px 0 0; }
.card-title { font-size: 15px; font-weight: 700; color: #1a1a2e; margin: 0; }
.strpied-tabled-with-hover { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eef0f4; }
.table-full-width { overflow-x: auto; }
.table { width: 100%; margin-bottom: 0; }
.table thead tr { background: #f8fafc; }
.table thead th { padding: 10px 14px; font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 2px solid #eef0f4; white-space: nowrap; }
.table tbody td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; color: #374151; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }
.table-striped tbody tr:nth-child(odd) { background: #fafbfc; }

/* Buttons compat */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; border: none; transition: all 0.2s; line-height: 1.4; gap: 4px; }
.btn-primary, .btn-fill { background: linear-gradient(135deg, #6f42c1, #e91e8c); color: #fff !important; }
.btn-primary:hover, .btn-fill:hover { opacity: 0.88; color: #fff !important; }
.btn-default, .btn-outline { background: transparent; border: 1.5px solid #d1d5db; color: #374151 !important; }
.btn-default:hover, .btn-outline:hover { background: #f3f4f6; color: #374151 !important; }
.btn-danger { background: #dc3545; color: #fff !important; }
.btn-danger:hover { background: #c82333; color: #fff !important; }
.btn-round { border-radius: 20px; padding: 4px 12px; font-size: 13px; }
.btn-info { background: #0dcaf0; color: #fff !important; }
.btn-success { background: #20c997; color: #fff !important; }
.btn-warning { background: #fd7e14; color: #fff !important; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-block { width: 100%; display: flex; }

/* Form compat */
.form-group { margin-bottom: 14px; }
.form-control { display: block; width: 100%; padding: 8px 12px; font-size: 14px; border: 1.5px solid #e2e8f0; border-radius: 8px; background: #fff; color: #1a1a2e; transition: border-color 0.2s; font-family: var(--hf-font); }
.form-control:focus { outline: none; border-color: #6f42c1; box-shadow: 0 0 0 3px rgba(111,66,193,0.12); }
.form-control[disabled], .form-control[readonly] { background: #f8fafc; color: #9ca3af; }
select.form-control { cursor: pointer; }
label { font-size: 12.5px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; display: block; }
.border-input { border: 1.5px solid #e2e8f0; }

/* Alert compat */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; border: none; }
.alert-success { background: rgba(32,201,151,0.12); color: #0a6148; }
.alert-danger { background: rgba(220,53,69,0.1); color: #b91c1c; }
.alert-info { background: rgba(13,202,240,0.1); color: #0c5460; }
.alert-warning { background: rgba(253,126,20,0.1); color: #7c3100; }

/* Row/col compat - already provided by Bootstrap 5 */
.pull-left { float: left; }
.pull-right { float: right; }
.text-center { text-align: center !important; }

/* Modal - overriding BS5 defaults to ensure proper display */
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eef0f4; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3.modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #eef0f4; display: flex; justify-content: flex-end; gap: 8px; }
.modal-content { border-radius: 12px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.vertical-alignment-helper { display: flex; align-items: center; min-height: 100%; }
.vertical-align-center { margin: auto; }
.close { background: none; border: none; font-size: 20px; color: #64748b; cursor: pointer; padding: 0; line-height: 1; }
.close:hover { color: #dc3545; }

/* Card variations */
.card-user { position: relative; overflow: hidden; }
.card-image { height: 140px; overflow: hidden; position: relative; }
.card-image img { width: 100%; object-fit: cover; }
.card-body .author { text-align: center; padding: 10px 0 6px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.avatar.border-gray { border: 3px solid #e2e8f0; }
.title { font-size: 17px; font-weight: 700; margin: 8px 0 2px; }
.description { color: #888; font-size: 13px; }
.team-members { padding: 0; list-style: none; }
.team-members li { padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.team-members li:last-child { border-bottom: none; }

/* Search form in product list */
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid #f1f5f9; }
.form-inline .form-group { margin: 0; }
.form-inline .form-control { width: auto; }

/* Nav tabs compat */
.nav-tabs { border-bottom: 2px solid #eef0f4; margin-bottom: 16px; display: flex; gap: 4px; }
.nav-tabs .nav-link { padding: 8px 16px; color: #64748b; border: none; border-bottom: 3px solid transparent; font-weight: 500; font-size: 13.5px; border-radius: 0; }
.nav-tabs .nav-link.active { color: #6f42c1; border-bottom-color: #6f42c1; }

/* Pagination */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.page-link { padding: 6px 12px; border: 1.5px solid #e2e8f0; border-radius: 6px; color: #6f42c1; text-decoration: none; font-size: 13px; }
.page-link:hover { background: #f3f0ff; }
.page-item.active .page-link { background: #6f42c1; border-color: #6f42c1; color: #fff; }

/* Misc compat */
abbr[title] { text-decoration: underline dotted; cursor: help; }
.fa, .fas, .far { font-family: 'Font Awesome 6 Free'; font-weight: 900; }
center { display: flex; align-items: center; justify-content: center; }

/* ============================================================
   RESPONSIVE — Mobile First (corrigé)
   ============================================================ */

/* ── Tableaux : scroll horizontal sur mobile ── */
.table-responsive,
.hf-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Empêcher les tableaux de déborder leur container */
.hf-table,
.table {
    min-width: 500px; /* force le scroll plutôt que l'écrasement */
}

/* Sur mobile, les colonnes "MàJ par", "Créé par" etc. peuvent être cachées */
@media (max-width: 576px) {
    .hf-table th.d-sm-none-col,
    .hf-table td.d-sm-none-col { display: none; }
}

/* ── Layout mobile ── */
@media (max-width: 768px) {

    /* Sidebar cachée par défaut, glisse depuis la gauche */
    .hf-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(.4,0,.2,1);
        z-index: 1050;
        width: var(--hf-sidebar-w);
    }
    .hf-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
    }

    /* Le contenu principal prend toute la largeur */
    .hf-main-panel {
        margin-left: 0 !important;
        width: 100%;
        min-width: 0;
    }

    /* Padding réduit sur mobile */
    .hf-content {
        padding: 12px;
    }

    /* Navbar : hauteur fixe et cohérente sur tous les breakpoints */
    .hf-topnav {
        height: 56px !important;
        min-height: 56px !important;
        max-height: 56px !important;
        display: flex !important;
        align-items: center !important;
    }
    .hf-topnav .container-fluid {
        height: 100%;
        display: flex;
        align-items: center;
    }

    /* Cartes : padding réduit */
    .hf-card-body { padding: 12px; }
    .hf-card-header { padding: 12px 14px; }

    /* Boutons côte à côte : wrap si nécessaire */
    .d-flex.gap-2 { flex-wrap: wrap; }

    /* Stat cards : 2 colonnes sur mobile */
    .col-md-3, .col-sm-6 { margin-bottom: 8px; }

    /* Row g-4 → g-2 sur mobile */
    .row.g-4 { --bs-gutter-x: 0.75rem; --bs-gutter-y: 0.75rem; }

    /* Formulaires : pleine largeur */
    .hf-form-page { max-width: 100%; }
    .col-md-4, .col-md-6, .col-md-8 { width: 100%; }
    .row.g-3 > .col-md-4,
    .row.g-3 > .col-md-6,
    .row.g-3 > .col-md-8 { flex: 0 0 100%; max-width: 100%; }

    /* Cards niveau upgrade : empilement vertical */
    .col-md-4.d-flex { flex: 0 0 100%; max-width: 100%; }

    /* Modals : pleine largeur */
    .modal-dialog { margin: 8px; }
    .modal-content { border-radius: 12px; }

    /* Cacher les labels longs sur mobile */
    .d-mobile-hidden { display: none !important; }

    /* Auth card */
    .hf-auth-card { padding: 20px 16px; }

    /* Page heading */
    .hf-page-heading { font-size: 17px; }
}

/* ── Petits mobiles (≤ 480px) ── */
@media (max-width: 480px) {
    .hf-content { padding: 8px; }

    /* Bouton sidebar toggle toujours visible */
    #sidebarToggleOpen { display: inline-flex !important; }

    /* Tableaux : police légèrement réduite */
    .hf-table thead th { font-size: 10px; padding: 8px 8px; }
    .hf-table tbody td { padding: 8px; font-size: 12.5px; }
    .table thead th { padding: 8px; font-size: 11px; }
    .table tbody td { padding: 8px; font-size: 12.5px; }

    /* Boutons d'action dans les tables */
    .hf-action-btn { width: 26px; height: 26px; font-size: 12px; }

    /* Navbar */
    .hf-topnav { padding: 0 8px; }
}

/* ── Tablette (769px – 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    :root { --hf-sidebar-w: 220px; }

    .hf-content { padding: 16px; }
    .hf-main-panel { margin-left: var(--hf-sidebar-w); }
}

/* ── Desktop : sidebar toujours visible ── */
@media (min-width: 769px) {
    #sidebarToggleOpen { display: none !important; }
    .hf-sidebar-overlay { display: none !important; }
    .hf-sidebar {
        transform: translateX(0) !important;
        box-shadow: none;
    }
}

/* ── Prevent horizontal scroll on body ── */
body { overflow-x: hidden; }

/* ── Tableaux responsive dans les anciens fragments ── */
.card .table-full-width,
.strpied-tabled-with-hover .table-full-width {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   TABLE HEADER — Titre + Actions (responsive)
   ============================================================ */
.hf-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 10px;
}

.hf-table-header-title {
    flex: 1 1 auto;
    min-width: 0;
}

.hf-table-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Formulaire de recherche inline */
.hf-search-form {
    display: flex;
    gap: 4px;
    align-items: center;
}

.hf-search-form .form-control {
    width: 160px;
    min-width: 80px;
}

/* Sur petit mobile : champ de recherche pleine largeur */
@media (max-width: 480px) {
    .hf-table-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }
    .hf-table-header-actions {
        width: 100%;
    }
    .hf-search-form {
        flex: 1;
    }
    .hf-search-form .form-control {
        width: 100%;
        flex: 1;
    }
}

/* ============================================================
   HAMBURGER BUTTON — visible et bien identifiable
   ============================================================ */
.hf-sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s;
}
.hf-sidebar-toggle:hover {
    background: rgba(255,255,255,0.12);
}

/* Dans la navbar (fond blanc) : hamburger sombre */
.hf-topnav #sidebarToggleOpen {
    color: #1a1a2e;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 9px;
    background: #f8fafc;
    font-size: 20px;
    display: none; /* géré par JS selon breakpoint */
}
.hf-topnav #sidebarToggleOpen:hover {
    background: var(--hf-primary-soft);
    border-color: var(--hf-primary);
    color: var(--hf-primary);
}

/* Indicateur visuel "Menu" sous le bouton sur mobile */
@media (max-width: 768px) {
    .hf-topnav #sidebarToggleOpen::after {
        content: 'Menu';
        display: block;
        font-size: 9px;
        font-weight: 700;
        text-align: center;
        color: #6f42c1;
        margin-top: 1px;
        letter-spacing: 0.5px;
    }
    .hf-topnav #sidebarToggleOpen {
        padding: 3px 7px;
        height: auto;
    }
}

/* Colonnes cachées sur mobile dans les tableaux Bootstrap */
@media (max-width: 575px) {
    .d-sm-table-cell { display: none !important; }
}
@media (min-width: 576px) {
    .d-sm-table-cell { display: table-cell !important; }
}
