/* =====================================================================
   MARCHÉ LOCAL — Feuille de style principale
   ===================================================================== */

:root {
    --primary-50:  #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-300: #7dd3fc;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-900: #0c4a6e;

    --secondary-100: #d1fae5;
    --secondary-500: #10b981;
    --secondary-600: #059669;
    --secondary-700: #047857;

    --accent-500: #f59e0b;
    --accent-600: #d97706;

    --success-500: #22c55e;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --error-500:   #ef4444;
    --error-600:   #dc2626;

    --neutral-50:  #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    --bg:        #f8fafc;
    --surface:   #ffffff;
    --text:      #0f172a;
    --text-soft: #475569;
    --border:    #e2e8f0;

    --radius:    12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow:    0 4px 12px rgba(15,23,42,.08);
    --shadow-lg: 0 12px 32px rgba(15,23,42,.12);

    --font-body: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --font-head: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---- Header ---- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.25rem; font-weight: 700; color: var(--primary-700);
}
.logo i { color: var(--secondary-600); font-size: 1.4rem; }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--neutral-700); font-weight: 500; }
.main-nav a:hover { color: var(--primary-600); }

/* ---- Buttons ---- */
.btn-primary, .btn-outline, .btn-danger, .btn-success {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .9rem; cursor: pointer;
    border: 1px solid transparent; transition: all .15s ease;
}
.btn-primary { background: var(--primary-600); color: #fff; }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--neutral-700); }
.btn-outline:hover { border-color: var(--primary-500); color: var(--primary-600); }
.btn-danger { background: var(--error-500); color: #fff; }
.btn-danger:hover { background: var(--error-600); color: #fff; }
.btn-success { background: var(--secondary-500); color: #fff; }
.btn-success:hover { background: var(--secondary-600); color: #fff; }

button, input[type="submit"] { font-family: inherit; }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin: 16px 0; display: flex; align-items: center; gap: 8px;
    font-size: .9rem;
}
.alert-success { background: var(--secondary-100); color: var(--secondary-700); }
.alert-danger  { background: #fee2e2; color: var(--error-600); }
.alert-warning { background: #fef3c7; color: var(--warning-600); }
.alert-info    { background: var(--primary-100); color: var(--primary-700); }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, var(--primary-700), var(--secondary-600));
    color: #fff; padding: 64px 0; text-align: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 12px; font-weight: 700; }
.hero p { font-size: 1.1rem; opacity: .95; max-width: 600px; margin: 0 auto 24px; }
.hero .btn-primary {
    background: #fff; color: var(--primary-700); font-size: 1rem; padding: 12px 28px;
}
.hero .btn-primary:hover { background: var(--neutral-100); }

/* ---- Cards grid ---- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card img, .card .img-placeholder {
    width: 100%; height: 180px; object-fit: cover;
    background: var(--neutral-100);
    display: flex; align-items: center; justify-content: center;
    color: var(--neutral-400); font-size: 3rem;
}
.card-body { padding: 16px; }
.card-body h3 { font-size: 1.05rem; margin-bottom: 4px; }
.card-body .price { color: var(--secondary-700); font-weight: 700; font-size: 1.1rem; }
.card-body .meta { color: var(--neutral-500); font-size: .85rem; margin-top: 4px; }

/* ---- Section ---- */
.section { padding: 48px 0; }
.section-title {
    font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; color: var(--neutral-900);
}
.section-sub { color: var(--neutral-500); margin-bottom: 32px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; color: var(--neutral-700); }
.form-control, select, textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"] {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: .95rem; font-family: inherit;
    background: var(--surface); color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}
textarea { min-height: 100px; resize: vertical; }

.form-card {
    max-width: 440px; margin: 40px auto;
    background: var(--surface); padding: 32px;
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.form-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.form-card .subtitle { color: var(--neutral-500); margin-bottom: 24px; font-size: .9rem; }

/* ---- Dashboard ---- */
.dash-layout { display: flex; gap: 24px; padding: 24px 0; align-items: flex-start; }
.sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    position: sticky; top: 80px;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 16px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-user i { font-size: 2rem; color: var(--primary-500); }
.sidebar-user strong { display: block; font-size: .9rem; }
.sidebar-user span { font-size: .8rem; color: var(--neutral-500); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--neutral-700); font-size: .9rem; font-weight: 500;
}
.sidebar-link:hover { background: var(--neutral-100); color: var(--primary-700); }
.sidebar-link.active { background: var(--primary-50); color: var(--primary-700); font-weight: 600; }
.sidebar-link.logout { margin-top: 16px; color: var(--error-600); }
.sidebar-link.logout:hover { background: #fee2e2; }

.dash-content { flex: 1; min-width: 0; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.dash-header h1 { font-size: 1.5rem; }

/* ---- Stat cards ---- */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px; margin-bottom: 32px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow-sm);
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff;
}
.stat-icon.blue   { background: var(--primary-600); }
.stat-icon.green  { background: var(--secondary-500); }
.stat-icon.amber  { background: var(--accent-500); }
.stat-icon.red    { background: var(--error-500); }
.stat-icon.purple { background: var(--neutral-600); }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--neutral-500); font-size: .85rem; margin-top: 4px; }

/* ---- Table ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: .9rem; }
th { background: var(--neutral-50); font-weight: 600; color: var(--neutral-600); border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--neutral-50); }
.table-actions { display: flex; gap: 8px; }
.table-actions a, .table-actions button {
    padding: 4px 10px; font-size: .8rem; border-radius: 6px;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 600;
}
.badge-pending  { background: #fef3c7; color: var(--warning-600); }
.badge-approved { background: var(--secondary-100); color: var(--secondary-700); }
.badge-rejected { background: #fee2e2; color: var(--error-600); }
.badge-role     { background: var(--primary-50); color: var(--primary-700); }

/* ---- Map ---- */
#map, #map-large { height: 420px; border-radius: var(--radius); box-shadow: var(--shadow); }
#map-large { height: 560px; }

/* ---- Footer ---- */
.site-footer { background: var(--neutral-900); color: var(--neutral-400); margin-top: auto; padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-inner a { color: var(--neutral-300); }
.footer-inner a:hover { color: #fff; }
.footer-links a { margin: 0 6px; }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--neutral-500); }
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; color: var(--neutral-300); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .dash-layout { flex-direction: column; }
    .sidebar { width: 100%; position: static; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-link { flex: 1; justify-content: center; }
}
@media (max-width: 640px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
    .main-nav { gap: 12px; flex-wrap: wrap; }
    .hero h1 { font-size: 1.75rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.4rem; }
}
