/**
 * HarasGest - Modern Equine & Haras Management System
 * CSS Stylesheet optimized for Joomla 4 & Joomla 5 (JA Purity IV & T4 Framework Compatible)
 * Version: 1.3.0
 */

:root {
    --hg-primary: #1e3a8a;
    --hg-primary-hover: #172554;
    --hg-primary-light: #eff6ff;
    --hg-accent: #0284c7;
    --hg-accent-light: #f0f9ff;
    --hg-success: #059669;
    --hg-success-light: #ecfdf5;
    --hg-warning: #d97706;
    --hg-warning-light: #fffbeb;
    --hg-danger: #dc2626;
    --hg-danger-light: #fef2f2;
    --hg-bg: #f8fafc;
    --hg-card-bg: #ffffff;
    --hg-border: #e2e8f0;
    --hg-border-light: #f1f5f9;
    --hg-text: #0f172a;
    --hg-text-secondary: #475569;
    --hg-text-muted: #64748b;
    --hg-radius: 14px;
    --hg-radius-md: 10px;
    --hg-radius-sm: 8px;
    --hg-radius-pill: 9999px;
    --hg-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --hg-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --hg-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hg-shadow-md: 0 10px 20px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --hg-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --hg-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   APP WRAPPER & CONTAINER INTEGRATION
   ========================================================================== */
.haras-app-wrapper {
    font-family: var(--hg-font);
    color: var(--hg-text);
    background-color: transparent;
    padding: 10px 0 40px;
    box-sizing: border-box;
    width: 100%;
    margin: 0 auto;
}

.haras-app-wrapper *,
.haras-app-wrapper *::before,
.haras-app-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   SUBNAV TOOLBAR / TAB PILLS BAR (.haras-navbar)
   Intégration moderne et légère sous le menu principal du site
   ========================================================================== */
.haras-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: #ffffff;
    padding: 8px 16px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    gap: 12px;
    margin-bottom: 24px;
    box-shadow: var(--hg-shadow-sm);
}

.haras-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 12px;
    border-right: 1px solid var(--hg-border);
}

.haras-brand-icon {
    font-size: 22px;
    background: var(--hg-primary-light);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.haras-brand-text {
    display: flex;
    flex-direction: column;
}

.haras-brand-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--hg-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.haras-brand-tag {
    font-size: 10.5px;
    text-transform: uppercase;
    color: var(--hg-text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* Onglets Pilules de Navigation Rapide */
.haras-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.haras-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hg-text-secondary);
    text-decoration: none !important;
    border-radius: var(--hg-radius-pill);
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.haras-nav-link:hover {
    color: var(--hg-primary);
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.haras-nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    border-color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.haras-nav-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
    line-height: 1.3;
}

.haras-nav-link:not(.active) .haras-nav-badge {
    background: #e2e8f0;
    color: var(--hg-text-secondary);
}

/* Menu Utilisateur Compact */
.haras-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid var(--hg-border);
}

.haras-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hg-text);
}

.haras-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.haras-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--hg-text);
}

/* ==========================================================================
   CONTENT CONTAINER & PAGE HEADERS
   ========================================================================== */
.haras-content {
    padding: 0;
    width: 100%;
}

.haras-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hg-border-light);
}

.haras-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--hg-text);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.haras-subtitle {
    font-size: 13.5px;
    color: var(--hg-text-muted);
    margin: 0;
    font-weight: 400;
}

.haras-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   ALERTS & NOTICES
   ========================================================================== */
.haras-alert {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-radius: var(--hg-radius-md);
    gap: 14px;
    margin-bottom: 24px;
    font-size: 13.5px;
    line-height: 1.5;
}

.haras-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.haras-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.haras-alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.haras-alert-body {
    flex: 1;
}

/* ==========================================================================
   KPI CARDS & DASHBOARD STATS
   ========================================================================== */
.haras-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.haras-kpi-card {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--hg-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.haras-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hg-shadow-md);
}

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

.haras-kpi-blue { background: #dbeafe; color: #1e40af; }
.haras-kpi-purple { background: #f3e8ff; color: #6b21a8; }
.haras-kpi-emerald { background: #d1fae5; color: #065f46; }
.haras-kpi-amber { background: #fef3c7; color: #92400e; }

.haras-kpi-data {
    display: flex;
    flex-direction: column;
}

.haras-kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--hg-text);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.haras-kpi-label {
    font-size: 12px;
    color: var(--hg-text-muted);
    font-weight: 600;
    margin-top: 3px;
}

/* ==========================================================================
   CUVES DE CRYOCONSERVATION (RÉSERVOIRS D'AZOTE)
   ========================================================================== */
.haras-cuves-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.haras-cuve-card {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-top: 4px solid #0284c7;
    border-radius: var(--hg-radius-md);
    padding: 16px 18px;
    box-shadow: var(--hg-shadow-xs);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.haras-cuve-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -3px rgba(2, 132, 199, 0.12);
    border-color: #38bdf8;
    border-top-color: #0284c7;
}

.haras-cuve-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hg-border-light);
}

.haras-cuve-code-badge {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.haras-cuve-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--hg-text);
    margin: 0;
}

.haras-cuve-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    display: inline-block;
}

.haras-cuve-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: var(--hg-text-secondary);
}

.haras-cuve-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.haras-cuve-metric-label {
    font-size: 12px;
    color: var(--hg-text-muted);
    font-weight: 500;
}

.haras-cuve-metric-val {
    font-size: 13.5px;
    color: var(--hg-text);
    font-weight: 700;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.haras-card {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    box-shadow: var(--hg-shadow-xs);
    overflow: hidden;
    margin-bottom: 24px;
}

.haras-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--hg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.haras-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--hg-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* ==========================================================================
   TABLES & LISTES SAAS
   ========================================================================== */
.haras-table-card {
    border-radius: var(--hg-radius);
    overflow: hidden;
}

.haras-table-responsive {
    overflow-x: auto;
    width: 100%;
}

.haras-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}

.haras-table th {
    background: #f8fafc;
    color: var(--hg-text-muted);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 13px 16px;
    border-bottom: 1px solid var(--hg-border);
    white-space: nowrap;
}

.haras-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--hg-text);
    vertical-align: middle;
    transition: background 0.15s ease;
}

.haras-table tr:last-child td {
    border-bottom: none;
}

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

.haras-horse-link {
    color: var(--hg-primary);
    font-weight: 700;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.haras-horse-link:hover {
    color: var(--hg-accent);
    text-decoration: underline !important;
}

.haras-subtext {
    font-size: 11.5px;
    color: var(--hg-text-muted);
    margin-top: 2px;
}

.haras-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 12px;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   BADGES & ÉTIQUETTES
   ========================================================================== */
.haras-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--hg-radius-pill);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.haras-badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.haras-badge-blue { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.haras-badge-pink { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }
.haras-badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.haras-badge-emerald { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.haras-badge-green { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.haras-badge-purple { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.haras-badge-orange { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.haras-badge-teal { background: #ccfbf1; color: #115e59; border: 1px solid #99f6e4; }
.haras-badge-indigo { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.haras-badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ==========================================================================
   FORMULAIRES, FILTRES & RECHERCHE
   ========================================================================== */
.haras-filter-form {
    margin-bottom: 24px;
}

.haras-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    background: #ffffff;
    padding: 18px 20px;
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    box-shadow: var(--hg-shadow-xs);
    align-items: flex-end;
}

.haras-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 180px;
}

.haras-filter-search {
    flex: 2 1 260px;
}

.haras-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--hg-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.haras-input,
.haras-select,
.haras-textarea {
    width: 100% !important;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--hg-radius-sm, 8px);
    font-size: 13.5px;
    font-family: inherit;
    background: #ffffff;
    color: var(--hg-text, #1e293b);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box !important;
    display: block !important;
}

.haras-textarea {
    min-height: 90px;
    line-height: 1.5;
    resize: vertical;
}

.haras-input:focus,
.haras-select:focus,
.haras-textarea:focus {
    border-color: var(--hg-accent, #0284c7);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    background-color: #ffffff;
}

.haras-form-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px;
    width: 100%;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.haras-form-label {
    display: block !important;
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.haras-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.haras-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--hg-radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.haras-btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.haras-btn-primary:hover {
    background: linear-gradient(135deg, #172554, #1d4ed8);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.haras-btn-outline {
    background: #ffffff;
    border-color: #cbd5e1;
    color: var(--hg-text-secondary) !important;
}

.haras-btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: var(--hg-text) !important;
}

.haras-btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 6px;
}

.haras-btn-xs {
    padding: 4px 9px;
    font-size: 11.5px;
    border-radius: 5px;
}

.haras-btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626 !important;
}

.haras-btn-danger:hover {
    background: #fee2e2;
}

/* ==========================================================================
   MODULES DU DASHBOARD
   ========================================================================== */
.haras-modules-section {
    margin: 28px 0;
}

.haras-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 14px;
}

.haras-module-card {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 20px;
    text-decoration: none !important;
    color: var(--hg-text) !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--hg-shadow-xs);
    position: relative;
    overflow: hidden;
}

.haras-module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hg-shadow-md);
    border-color: var(--hg-accent);
}

.haras-module-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.haras-module-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-primary-light);
}

.haras-module-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--hg-primary);
    margin: 0 0 6px 0;
}

.haras-module-desc {
    font-size: 12.5px;
    color: var(--hg-text-muted);
    line-height: 1.45;
    margin: 0 0 16px 0;
    flex: 1;
}

.haras-module-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--hg-border-light);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--hg-accent);
}

/* ==========================================================================
   FICHE CHEVAL DÉTAILLÉE
   ========================================================================== */
.haras-horse-banner {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    box-shadow: var(--hg-shadow-sm);
}

.haras-banner-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1e3a8a, #0284c7);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}

.haras-banner-info {
    flex: 1;
}

.haras-banner-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--hg-text);
}

.haras-banner-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--hg-text-secondary);
}

/* ==========================================================================
   PAGINATION JOOMLA
   ========================================================================== */
.haras-pagination-container {
    padding: 16px 20px;
    border-top: 1px solid var(--hg-border);
    display: flex;
    justify-content: center;
    background: #ffffff;
}

.haras-pagination-container ul.pagination {
    margin: 0;
    display: flex;
    gap: 5px;
    list-style: none;
    padding: 0;
}

.haras-pagination-container .page-item .page-link {
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--hg-border);
    color: var(--hg-text-secondary);
    text-decoration: none !important;
    background: #ffffff;
    transition: all 0.15s ease;
}

.haras-pagination-container .page-item .page-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--hg-primary);
}

.haras-pagination-container .page-item.active .page-link {
    background: var(--hg-primary);
    color: #ffffff;
    border-color: var(--hg-primary);
}

/* ==========================================================================
   CONNEXION (LOGIN FORM)
   ========================================================================== */
.haras-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.haras-login-card {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    box-shadow: var(--hg-shadow-md);
    padding: 36px;
    width: 100%;
    max-width: 440px;
}

.haras-login-header {
    text-align: center;
    margin-bottom: 24px;
}

.haras-logo-badge {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--hg-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}

.haras-login-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--hg-primary);
    margin: 0 0 6px;
}

.haras-login-subtitle {
    font-size: 13px;
    color: var(--hg-text-muted);
    margin: 0;
}

.haras-login-notice {
    background: #f8fafc;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-sm);
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.haras-login-notice.haras-session-expired-notice {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-left: 4px solid #f59e0b !important;
}

.haras-login-notice.haras-session-expired-notice .haras-notice-icon {
    font-size: 20px;
}

.haras-login-notice.haras-session-expired-notice .haras-notice-text strong {
    color: #92400e !important;
    font-size: 13.5px !important;
}

.haras-login-notice.haras-session-expired-notice .haras-notice-text p {
    color: #b45309 !important;
    font-size: 12px !important;
    margin-top: 3px !important;
    line-height: 1.4 !important;
}

.haras-login-messages {
    margin-bottom: 16px;
}

.haras-notice-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.haras-notice-text strong {
    font-size: 13px;
    color: var(--hg-text);
}

.haras-notice-text p {
    font-size: 12px;
    color: var(--hg-text-muted);
    margin: 2px 0 0;
}

.haras-form-group {
    margin-bottom: 16px;
}

.haras-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--hg-text);
    margin-bottom: 6px;
}

.haras-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.haras-input-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: var(--hg-text-muted);
}

.haras-input-wrapper .haras-input {
    padding-left: 36px;
}

.haras-form-group-remember {
    margin-bottom: 20px;
}

.haras-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--hg-text-muted);
    cursor: pointer;
}

.haras-btn-block {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

.haras-login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--hg-text-muted);
    font-size: 11.5px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 991.98px) {
    .haras-navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }

    .haras-brand {
        border-right: none;
        border-bottom: 1px solid var(--hg-border);
        padding-right: 0;
        padding-bottom: 10px;
    }

    .haras-nav-links {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .haras-user-menu {
        border-left: none;
        border-top: 1px solid var(--hg-border);
        padding-left: 0;
        padding-top: 10px;
        justify-content: space-between;
    }

    .haras-filter-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .haras-filter-actions {
        margin-top: 8px;
    }
}

/* ==========================================================================
   ONGLETS MODERNES (TABS)
   ========================================================================== */
.haras-tabs-wrapper {
    margin: 20px 0;
}

.haras-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--hg-border);
    padding-bottom: 0;
    overflow-x: auto;
}

.haras-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--hg-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}

.haras-tab:hover {
    color: var(--hg-primary);
    background: #f8fafc;
}

.haras-tab.active {
    color: var(--hg-primary);
    border-bottom-color: var(--hg-primary);
    background: #ffffff;
}

/* ==========================================================================
   DOCUMENT FACTURE & ÉDITIONS IMPRIMABLES (REMPLACEMENT CRYSTAL REPORTS)
   ========================================================================== */
.haras-print-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.haras-invoice-document {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 40px;
    box-shadow: var(--hg-shadow-md);
    max-width: 960px;
    margin: 0 auto;
    font-size: 13px;
    color: #1e293b;
}

.haras-invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.haras-invoice-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.haras-invoice-logo-icon {
    font-size: 38px;
}

.haras-invoice-brand {
    font-size: 22px;
    font-weight: 900;
    color: var(--hg-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.haras-invoice-sub {
    font-size: 11.5px;
    color: var(--hg-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.haras-invoice-sender-details p {
    margin: 2px 0;
    font-size: 12px;
    color: var(--hg-text-secondary);
}

.haras-invoice-meta-box {
    background: #f8fafc;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-sm);
    padding: 16px 20px;
    min-width: 250px;
    text-align: right;
}

.haras-invoice-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--hg-primary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.haras-invoice-num {
    font-size: 24px;
    font-weight: 900;
    color: var(--hg-primary);
    margin-bottom: 10px;
}

.haras-invoice-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.haras-invoice-divider {
    border: none;
    border-top: 1px solid var(--hg-border);
    margin: 24px 0;
}

.haras-invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.haras-invoice-client-card,
.haras-invoice-horse-card {
    background: #f8fafc;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-sm);
    padding: 18px 20px;
}

.haras-invoice-party-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--hg-text-muted);
    display: block;
    margin-bottom: 8px;
}

.haras-invoice-client-name,
.haras-invoice-horse-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--hg-text);
    margin: 0 0 8px 0;
}

.haras-invoice-party-line {
    margin: 3px 0;
    font-size: 12.5px;
    color: var(--hg-text-secondary);
}

.haras-invoice-client-code {
    display: inline-block;
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
}

.haras-invoice-table-wrapper {
    margin-bottom: 28px;
}

.haras-invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.haras-invoice-table th {
    background: #f1f5f9;
    padding: 10px 14px;
    font-weight: 700;
    border-bottom: 2px solid var(--hg-border);
    text-align: left;
}

.haras-invoice-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--hg-border-light);
}

.haras-invoice-totals-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 36px;
}

.haras-invoice-legal {
    font-size: 12px;
    color: var(--hg-text-secondary);
    line-height: 1.5;
}

.haras-invoice-in-words {
    margin-top: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border-left: 3px solid var(--hg-primary);
    font-style: italic;
    font-weight: 600;
}

.haras-invoice-totals-box {
    background: #f8fafc;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-sm);
    padding: 16px 20px;
}

.haras-invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.haras-invoice-grand-total {
    border-top: 2px solid var(--hg-primary);
    margin-top: 8px;
    padding-top: 10px;
    font-size: 17px;
    font-weight: 900;
    color: var(--hg-primary);
}

.haras-invoice-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
    padding-top: 20px;
}

.haras-sig-box {
    border: 1px dashed var(--hg-border);
    border-radius: var(--hg-radius-sm);
    padding: 14px 18px;
    text-align: center;
}

.haras-sig-space {
    height: 70px;
}

/* ==========================================================================
   STYLE D'IMPRESSION SUR PAPIER (MEDIA PRINT)
   ========================================================================== */
@media print {
    body, html {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    .haras-navbar,
    .haras-no-print,
    .haras-header-actions,
    .haras-filter-form,
    .haras-pagination-container,
    .haras-tabs-wrapper,
    .haras-stats-grid,
    .haras-btn,
    header,
    footer,
    nav {
        display: none !important;
    }

    .haras-app-wrapper,
    .haras-content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .haras-invoice-document {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    .haras-invoice-table th {
        background: #f1f5f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .haras-invoice-grand-total {
        color: #000000 !important;
        font-weight: bold !important;
    }
}

/* ==========================================================================
   MODAL COMPONENT
   ========================================================================== */
.haras-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 99999;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.haras-modal-backdrop.active,
.haras-modal-backdrop[style*="display: flex"] {
    display: flex !important;
}

.haras-modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid #cbd5e1;
    position: relative;
    animation: harasModalFadeIn 0.2s ease-out;
}

@keyframes harasModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   MOTEUR DE RECHERCHE CHEVAL CONCERNÉ (PICKER INTERACTIF)
   ========================================================================== */
.haras-cheval-search-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.haras-cheval-input-wrapper {
    position: relative;
    width: 100%;
}

.haras-cheval-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: #64748b;
    pointer-events: none;
}

.haras-cheval-input-wrapper input {
    width: 100% !important;
    padding-left: 38px !important;
    padding-right: 36px !important;
    height: 42px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease;
}

.haras-cheval-input-wrapper input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

.haras-cheval-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #475569;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
}

.haras-cheval-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.haras-filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.haras-chip {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1.2;
}

.haras-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.haras-chip.active {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.25);
}

.haras-cheval-picker-list {
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    padding: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.haras-cheval-item {
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 3px;
    border: 1.5px solid transparent;
    user-select: none;
    display: block;
}

.haras-cheval-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.haras-cheval-item:focus {
    outline: none;
    background: #eff6ff;
    border-color: #3b82f6;
}

.haras-cheval-item.selected {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    border-left: 4px solid #2563eb !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.12);
}

.haras-cheval-item-nom {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 14px;
}

.haras-cheval-item.selected .haras-cheval-item-nom {
    color: #1d4ed8;
}

.haras-highlight {
    background-color: #fef08a;
    color: #854d0e;
    font-weight: 700;
    border-radius: 2px;
    padding: 0 2px;
}

.haras-selected-horse-card {
    margin-top: 12px;
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(22, 101, 52, 0.08);
}




/* ==========================================================================
   SUBNAV TOOLBAR & PILL TABS (.haras-subnav-bar)
   Navigation secondaire moderne et épurée par sous-module
   ========================================================================== */
.haras-subnav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 10px 18px;
    margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.haras-subnav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.haras-subnav-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hg-text-secondary);
    text-decoration: none !important;
    border-radius: var(--hg-radius-pill);
    background: #f8fafc;
    border: 1px solid var(--hg-border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.haras-subnav-tab:hover {
    color: var(--hg-primary);
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.haras-subnav-tab.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    border-color: #1e3a8a;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.28);
}

.haras-subnav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* ==========================================================================
   MODAL COMPONENT ENHANCED (.haras-modal-dialog, etc.)
   ========================================================================== */
.haras-modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #cbd5e1;
    position: relative;
    animation: harasModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
}

.haras-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--hg-border);
    background: #f8fafc;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.haras-modal-title {
    font-size: 16.5px;
    font-weight: 800;
    color: var(--hg-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.haras-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--hg-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.haras-modal-close:hover {
    color: var(--hg-danger);
    background: var(--hg-danger-light);
}

.haras-modal-body {
    padding: 24px;
}

.haras-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--hg-border);
    background: #f8fafc;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* ==========================================================================
   FORM CONTROLS & GRIDS
   ========================================================================== */
.haras-form-grid {
    display: grid;
    gap: 16px;
}

.haras-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: -8px;
}

.haras-form-row > * {
    padding: 8px;
    box-sizing: border-box;
}

.haras-form-input,
.haras-form-select {
    width: 100% !important;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--hg-radius-sm, 8px);
    font-size: 13.5px;
    font-family: inherit;
    background: #ffffff;
    color: var(--hg-text, #1e293b);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box !important;
    display: block !important;
}

.haras-form-input:focus,
.haras-form-select:focus {
    border-color: var(--hg-accent, #0284c7);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ==========================================================================
   LAYOUT GRIDS (.haras-grid)
   ========================================================================== */
.haras-grid {
    display: grid;
    gap: 20px;
}

.haras-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.haras-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .haras-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .haras-grid-2,
    .haras-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   BADGES & LABELS SUPPLEMENTAIRES
   ========================================================================== */
.haras-badge-primary { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.haras-badge-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.haras-badge-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.haras-badge-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.haras-badge-red { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.haras-badge-gray { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

.haras-code-badge {
    display: inline-block;
    padding: 2px 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    background: #f1f5f9;
    color: #1e3a8a;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.haras-cuve-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--hg-radius-pill);
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #bae6fd;
}

.haras-cuve-name {
    font-weight: 700;
    color: var(--hg-primary);
}

.haras-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ==========================================================================
   BUTTONS SUPPLEMENTAIRES
   ========================================================================== */
.haras-btn-secondary {
    background: #f1f5f9;
    color: var(--hg-text-secondary) !important;
    border: 1px solid var(--hg-border);
}

.haras-btn-secondary:hover {
    background: #e2e8f0;
    color: var(--hg-text) !important;
}

.haras-btn-outline-warning {
    background: transparent;
    color: var(--hg-warning) !important;
    border: 1px solid var(--hg-warning);
}

.haras-btn-outline-warning:hover {
    background: var(--hg-warning-light);
    color: #b45309 !important;
}

.haras-btn-del-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--hg-danger);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--hg-radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.haras-btn-del-row:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* ==========================================================================
   STAT CARDS & KPI DASHBOARD
   ========================================================================== */
.haras-stat-card {
    background: #ffffff;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--hg-shadow-xs);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.haras-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hg-shadow-md);
}

.haras-stat-icon {
    font-size: 26px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-primary-light);
    color: var(--hg-primary);
    flex-shrink: 0;
}

.haras-stat-content {
    display: flex;
    flex-direction: column;
}

.haras-stat-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--hg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.haras-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--hg-text);
    line-height: 1.2;
    margin-top: 2px;
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */
.haras-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: #ffffff;
    border-radius: var(--hg-radius);
    border: 1px dashed var(--hg-border);
    margin: 16px 0;
}

.haras-empty-icon {
    font-size: 44px;
    display: block;
    margin-bottom: 12px;
}

.haras-empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--hg-text);
    margin: 0 0 6px;
}

.haras-empty-state p,
.haras-empty-subtext {
    font-size: 13.5px;
    color: var(--hg-text-muted);
    margin: 0;
}

/* ==========================================================================
   HORSE LIST ITEMS & DETAILS
   ========================================================================== */
.haras-recent-horses {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.haras-horse-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--hg-radius-md);
    border: 1px solid var(--hg-border-light);
    background: #ffffff;
    transition: all 0.15s ease;
}

.haras-horse-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.haras-horse-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--hg-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.haras-horse-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.haras-horse-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--hg-text);
}

.haras-horse-meta {
    font-size: 12px;
    color: var(--hg-text-muted);
}

.haras-family-link {
    font-size: 12px;
    color: var(--hg-primary);
    text-decoration: none;
    font-weight: 600;
}
.haras-family-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   TABS, SECTIONS & UTILITIES
   ========================================================================== */
.haras-tab-pane,
.haras-repro-tab-pane,
.haras-stock-tab-pane {
    display: none;
    animation: harasFadeIn 0.2s ease-in-out;
}

.haras-tab-pane.active,
.haras-repro-tab-pane.active,
.haras-stock-tab-pane.active {
    display: block;
}

@keyframes harasFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.haras-banner-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.haras-banner-subtitle {
    font-size: 14px;
    color: var(--hg-text-muted);
    margin-top: 4px;
}

.haras-section-subtitle {
    font-size: 13px;
    color: var(--hg-text-muted);
    margin: 2px 0 0;
}

.haras-cuves-section {
    margin-bottom: 24px;
}

.haras-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.haras-table-compact th {
    padding: 8px 12px;
}

.haras-table-compact td {
    padding: 9px 12px;
    font-size: 13px;
}

.haras-chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 250px;
}

.haras-statut-table-wrapper {
    overflow-x: auto;
}

.haras-datalist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.haras-datalist-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--hg-border-light);
}

.haras-invoice-designation {
    font-weight: 600;
    color: var(--hg-text);
}

.haras-link {
    color: var(--hg-primary);
    text-decoration: none;
    font-weight: 600;
}
.haras-link:hover {
    text-decoration: underline;
}

.haras-logo-icon {
    font-size: 28px;
    margin-right: 8px;
}

.haras-login-form {
    max-width: 420px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    box-shadow: var(--hg-shadow-md);
}

.haras-text-muted { color: var(--hg-text-muted) !important; }
.haras-text-center { text-align: center !important; }
.haras-text-right { text-align: right !important; }
.haras-mb-2 { margin-bottom: 0.5rem !important; }
.haras-mb-4 { margin-bottom: 1.5rem !important; }
.haras-mt-4 { margin-top: 1.5rem !important; }


/* ==========================================================================
   ALIGNEMENT & STYLING DU MENU EN HAUT DE JOOMLA (T4 / PURITY IV)
   ========================================================================== */
#t4-header,
.t4-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.04) !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    position: relative !important;
    z-index: 999 !important;
}

.t4-megamenu .navbar-nav,
.header-wrap .navbar > .navbar-nav,
.t4-header .navbar-nav,
nav.navbar .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    gap: 2px !important;
}

.t4-megamenu .navbar-nav > li,
.header-wrap .navbar > .navbar-nav > li,
.t4-header .navbar-nav > li {
    flex: 0 0 auto !important;
    display: inline-block !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

.t4-megamenu .navbar-nav > li > a,
.t4-megamenu .navbar-nav > li > .nav-link,
.t4-megamenu .navbar-nav > li > span,
.header-wrap .navbar > .navbar-nav .nav-link {
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    padding: 7px 11px !important;
    height: auto !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    text-transform: none !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
}

.t4-megamenu .navbar-nav > li:hover > a,
.t4-megamenu .navbar-nav > li:hover > .nav-link,
.header-wrap .navbar > .navbar-nav .nav-link:hover,
.t4-megamenu .navbar-nav > li.show > a,
.t4-megamenu .navbar-nav > li.show > .nav-link {
    background-color: #f1f5f9 !important;
    color: #1d4ed8 !important;
    border-color: #e2e8f0 !important;
}

.t4-megamenu .navbar-nav > li.active > a,
.t4-megamenu .navbar-nav > li.active > .nav-link,
.t4-megamenu .navbar-nav > li.current > a,
.t4-megamenu .navbar-nav > li.current > .nav-link,
.header-wrap .navbar > .navbar-nav .nav-link.active,
.header-wrap .navbar > .navbar-nav .nav-link[aria-current="page"] {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
    border-color: #bfdbfe !important;
    box-shadow: 0 1px 2px 0 rgba(29, 78, 216, 0.08) !important;
}

.t4-megamenu .navbar-nav > li .item-caret,
.t4-megamenu .navbar-nav > li i.item-caret,
.header-wrap .navbar .item-caret {
    display: inline-block !important;
    margin-left: 3px !important;
    font-size: 0.65rem !important;
    color: #64748b !important;
    transition: transform 0.2s ease !important;
    vertical-align: middle !important;
}

.t4-megamenu .navbar-nav > li:hover .item-caret,
.t4-megamenu .navbar-nav > li.show .item-caret {
    color: #1d4ed8 !important;
    transform: rotate(180deg) !important;
}

.t4-megamenu .dropdown-menu,
.header-wrap .dropdown-menu,
.dropdown-menu.level1,
div.dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06) !important;
    padding: 8px !important;
    min-width: 220px !important;
    margin-top: 6px !important;
    z-index: 1050 !important;
}

.dropdown-menu-inner,
.dropdown-menu-inner > ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dropdown-menu-inner > ul > li,
.dropdown-menu > li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.dropdown-menu .dropdown-item,
.dropdown-menu-inner a,
.dropdown-menu a {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    text-transform: none !important;
    white-space: nowrap !important;
    transition: all 0.15s ease-in-out !important;
    margin-bottom: 2px !important;
    background: transparent !important;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu-inner a:hover,
.dropdown-menu-inner a:focus,
.dropdown-menu a:hover {
    background-color: #f1f5f9 !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
    padding-left: 18px !important;
    box-shadow: inset 3px 0 0 #1d4ed8 !important;
}

#t4-header,
.t4-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.04) !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    position: relative !important;
    z-index: 999 !important;
}

@media (min-width: 1400px) {
    .t4-megamenu .navbar-nav > li > a,
    .t4-megamenu .navbar-nav > li > .nav-link,
    .t4-megamenu .navbar-nav > li > span,
    .header-wrap .navbar > .navbar-nav .nav-link {
        font-size: 0.86rem !important;
        padding: 8px 13px !important;
    }
}
