:root {
    --color-primary: #1e3a8a;      /* bleu nuit */
    --color-primary-light: #3b82f6; /* bleu digital */
    --color-accent: #f59e0b;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-muted: #64748b;
    --color-border: #e2e8f0;
    --color-success: #16a34a;
    --color-error: #dc2626;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 480px; }

a { color: var(--color-primary); text-decoration: none; }

h1, h2, h3 { color: #0f172a; }

.muted { color: var(--color-muted); font-size: 0.92rem; }

/* --- Header --- */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.logo { font-weight: 700; font-size: 1.3rem; color: var(--color-primary); }
.logo span { color: var(--color-accent); }
.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav a { font-weight: 500; }

/* --- Boutons --- */
.btn { display: inline-block; padding: 10px 18px; border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none; font-size: 0.95rem; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-light); }
.btn-outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-block { width: 100%; text-align: center; }

/* --- Hero --- */
.hero { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)); color: #fff; padding: 70px 0 90px; text-align: center; }
.hero h1 { color: #fff; font-size: 2.2rem; max-width: 720px; margin: 0 auto 10px; }
.hero p { color: #dbeafe; margin-bottom: 30px; }

.search-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; background: var(--color-surface); padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 820px; margin: 0 auto; }
.search-form input, .search-form select { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 0.95rem; }
.search-form input[type="text"] { flex: 2; min-width: 200px; }
.search-form select { flex: 1; min-width: 140px; }

/* --- Cards --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 24px 0; }
.company-card, .product-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: block; transition: transform .15s ease; padding-bottom: 4px; }
.company-card:hover { transform: translateY(-3px); }
.company-card-cover, .product-card-img { height: 120px; background: linear-gradient(135deg, #dbeafe, #e0e7ff); background-size: cover; background-position: center; }
img.product-card-img { width: 100%; object-fit: cover; display: block; }
.company-card-body, .product-card { padding: 16px; }
.product-card { padding: 0 16px 16px; }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 100px; margin-left: 6px; vertical-align: middle; }
.badge-verified { background: #dcfce7; color: var(--color-success); }
.badge-premium { background: #fef3c7; color: #b45309; }
.badge-sponsored { background: #ede9fe; color: #6d28d9; }
.badge-status-pending { background: #fef3c7; color: #b45309; }
.badge-status-verified, .badge-status-active { background: #dcfce7; color: var(--color-success); }
.badge-status-suspended, .badge-status-rejected { background: #fee2e2; color: var(--color-error); }

.rating { color: var(--color-accent); font-weight: 600; font-size: 0.9rem; }

.price { font-weight: 700; color: var(--color-primary); }
.old-price { text-decoration: line-through; color: var(--color-muted); font-weight: 400; margin-right: 6px; }

/* --- Formulaires --- */
.form { display: flex; flex-direction: column; gap: 16px; background: var(--color-surface); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.form input, .form select, .form textarea { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 0.95rem; font-weight: 400; }
.form-row { display: flex; gap: 14px; }
.form-row label { flex: 1; }
.checkbox { flex-direction: row !important; align-items: center; font-weight: 400 !important; }

/* --- Alerts --- */
.alert { padding: 12px 16px; border-radius: 8px; margin: 16px 0; font-size: 0.92rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* --- Pagination --- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0; }
.pagination a { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-surface); }
.pagination a.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* --- Fiche entreprise --- */
.company-cover { height: 220px; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)); background-size: cover; background-position: center; }
.company-header { display: flex; align-items: flex-start; gap: 20px; margin-top: -50px; flex-wrap: wrap; }
.company-logo { width: 96px; height: 96px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); border: 4px solid #fff; background-size: cover; background-position: center; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 24px 0; align-items: start; }
.product-main-image { width: 100%; border-radius: var(--radius); object-fit: cover; max-height: 420px; }
.product-info h1 { margin-top: 0; }
.product-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.breadcrumb { margin-top: 20px; }
@media (max-width: 720px) { .product-detail { grid-template-columns: 1fr; } }
.company-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.company-description { background: var(--color-surface); border-radius: var(--radius); padding: 20px; margin: 24px 0; box-shadow: var(--shadow); }

/* --- Dashboard --- */
.dashboard { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding-top: 30px; }
.dashboard-sidebar { background: var(--color-surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); height: fit-content; }
.dashboard-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.dashboard-nav a { padding: 8px 10px; border-radius: 8px; color: var(--color-text); font-size: 0.92rem; }
.dashboard-nav a.active, .dashboard-nav a:hover { background: #eff6ff; color: var(--color-primary); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 20px 0; }
.stat-card { background: var(--color-surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); text-align: center; }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--color-primary); }
.stat-label { font-size: 0.85rem; color: var(--color-muted); }

/* --- Panier / header --- */
.cart-link { position: relative; }
.cart-count { background: var(--color-accent); color: #fff; font-size: 0.7rem; font-weight: 700; border-radius: 100px; padding: 1px 6px; margin-left: 4px; }

.cart-group { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.cart-subtotal { text-align: right; margin-top: 10px; }
.cart-summary { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.inline-form { display: inline-block; }
.btn-small { padding: 6px 10px; font-size: 0.8rem; }

/* --- Tables génériques --- */
.data-table, .cart-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 16px 0; }
.data-table th, .data-table td, .cart-table th, .cart-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; }
.data-table th, .cart-table th { background: #f1f5f9; font-weight: 600; color: var(--color-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tr:last-child td, .cart-table tr:last-child td { border-bottom: none; }

.badge-status-new, .badge-status-confirmed { background: #dbeafe; color: #1e40af; }
.badge-status-preparing { background: #fef3c7; color: #b45309; }
.badge-status-shipped { background: #ede9fe; color: #6d28d9; }
.badge-status-delivered { background: #dcfce7; color: var(--color-success); }
.badge-status-cancelled, .badge-status-refunded { background: #fee2e2; color: var(--color-error); }

/* --- Checkout --- */
.checkout-recap { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.checkout-recap ul { margin: 6px 0 14px; padding-left: 18px; }

/* --- Suivi commande --- */
.order-tracker { display: flex; list-style: none; padding: 0; margin: 20px 0; counter-reset: step; }
.order-tracker li { flex: 1; text-align: center; position: relative; font-size: 0.85rem; color: var(--color-muted); }
.order-tracker li::before { content: '●'; display: block; font-size: 1.2rem; color: var(--color-border); }
.order-tracker li.done { color: var(--color-primary); font-weight: 600; }
.order-tracker li.done::before { color: var(--color-primary); }
.order-summary { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: 16px 0; }
.order-summary .total { border-top: 1px solid var(--color-border); margin-top: 8px; padding-top: 8px; }

/* --- Footer --- */
.site-footer { text-align: center; padding: 24px 0; color: var(--color-muted); font-size: 0.85rem; margin-top: 40px; }

/* --- Emploi --- */
.job-list { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.job-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.job-card:hover { transform: translateY(-2px); transition: transform .15s ease; }
.badge-contract { background: #e0e7ff; color: var(--color-primary); white-space: nowrap; }

/* --- Créneaux de rendez-vous --- */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin: 10px 0 16px; }
.slot-option { display: flex; align-items: center; justify-content: center; padding: 10px 6px; border: 1px solid var(--color-border); border-radius: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer; gap: 6px; }
.slot-option:has(input:checked) { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.slot-option input { accent-color: var(--color-primary); }

/* --- Dashboard : en-tête de section --- */
.dashboard-content-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dashboard-content-header h1 { margin: 0; }

@media (max-width: 720px) {
    .dashboard { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 10px; }
}

/* --- Avis --- */
.review-form { margin: 16px 0 24px; max-width: 480px; }
.review-list { display: flex; flex-direction: column; gap: 16px; margin: 16px 0; }
.review-item { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.review-rating { color: var(--color-accent); margin-bottom: 6px; }
.review-rating strong { color: var(--color-text); margin-left: 6px; }
.review-reply { background: #f1f5f9; border-radius: 8px; padding: 10px 14px; margin-top: 8px; font-size: 0.9rem; }
.review-reply-form { display: flex; gap: 8px; margin-top: 10px; }
.review-reply-form input[type="text"] { flex: 1; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px; }

/* --- Partage & actions sociales --- */
.share-buttons { display: flex; gap: 8px; }
.company-actions { flex-wrap: wrap; }

/* --- Messagerie --- */
.conversation-list { display: flex; flex-direction: column; gap: 2px; margin: 20px 0; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.conversation-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.conversation-item:last-child { border-bottom: none; }
.conversation-item:hover { background: #f8fafc; }
.conversation-item.unread strong { color: var(--color-primary); }
.message-thread { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; max-height: 480px; overflow-y: auto; padding: 4px; }
.message-bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; }
.message-bubble.mine { align-self: flex-end; background: var(--color-primary); color: #fff; }
.message-bubble.mine .muted { color: #dbeafe; }
.message-bubble.theirs { align-self: flex-start; background: var(--color-surface); box-shadow: var(--shadow); }
.message-bubble p { margin: 0 0 4px; }
.message-bubble .muted { font-size: 0.75rem; }
.message-form { flex-direction: row; align-items: flex-end; }
.message-form textarea { flex: 1; }

/* --- Abonnements --- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 20px 0; }
.plan-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; }
.plan-card.plan-current { border-color: var(--color-primary); }
.plan-price { font-size: 1.3rem; font-weight: 700; color: var(--color-primary); }
.plan-features { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; color: var(--color-muted); display: flex; flex-direction: column; gap: 6px; }

/* --- Notifications --- */
.notification-list { display: flex; flex-direction: column; gap: 2px; margin: 20px 0; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.notification-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: #f8fafc; }
.notification-item.unread { background: #eff6ff; }
.notification-item.unread strong { color: var(--color-primary); }
.notification-item p { margin: 4px 0 0; }

/* --- Actions de tableau (dashboard) --- */
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-input { width: 100%; padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.88rem; }

/* --- Miniatures images produit (dashboard) --- */
.image-thumb-list { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.image-thumb { position: relative; width: 90px; }
.image-thumb img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--color-border); }
.image-thumb form { position: absolute; top: -6px; right: -6px; margin: 0; }
.image-thumb button { padding: 2px 7px; border-radius: 50%; line-height: 1; }

/* --- Back-office administrateur --- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px; flex-shrink: 0; background: #0f172a; color: #cbd5e1;
    display: flex; flex-direction: column; padding: 20px; position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .logo { color: #fff; font-size: 1.2rem; font-weight: 700; margin-bottom: 24px; display: block; }
.admin-sidebar .logo span { color: var(--color-accent); }
.admin-sidebar .dashboard-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar .dashboard-nav a { color: #cbd5e1; padding: 9px 10px; border-radius: 8px; font-size: 0.92rem; }
.admin-sidebar .dashboard-nav a:hover { background: #1e293b; color: #fff; }
.admin-sidebar-footer { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.admin-sidebar-footer .btn-outline { border-color: #334155; color: #cbd5e1; }
.admin-main { flex: 1; padding: 30px 0 60px; background: var(--color-bg); min-height: 100vh; }

.admin-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.admin-filter-tabs a { padding: 8px 14px; border-radius: 100px; background: var(--color-surface); border: 1px solid var(--color-border); font-size: 0.88rem; }
.admin-filter-tabs a.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.admin-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.admin-list li { background: var(--color-surface); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 0.9rem; }

.stat-card-alert { border: 2px solid #fca5a5; }
.stat-card-alert .stat-value { color: var(--color-error); }

@media (max-width: 900px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; }
    .admin-grid-2 { grid-template-columns: 1fr; }
}
