:root {
    /* Palette Prozic-inspired */
    --primary: #eb1e7a;
    --primary-dark: #c91866;
    --primary-light: #f04d93;
    --accent: #ff6b35;
    --accent-dark: #e55a2b;
    --secondary: #6c757d;
    --success: #28a745;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #212529;
    --text-light: #6c757d;
    --border: #dee2e6;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* HEADER */
header {
    background: #000000;
    color: white;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
header > div { display: flex; align-items: center; gap: 1rem; }
header .header-logo {
    height: 52px;
    width: auto;
    display: block;
}
header .header-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 1rem;
    margin-left: 0.2rem;
    line-height: 1.4;
}
/* Conserve la compatibilité si le logo n'est pas encore en place */
header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
}
header p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
}

/* MAIN */
main { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }

/* PAGE TITRE */
.page-title { text-align: center; margin-bottom: 2.5rem; }
.page-title h2 { font-size: 1.8rem; color: var(--text); }
.page-title p { color: var(--text-light); margin-top: 0.5rem; }

/* GRILLE CATÉGORIES */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: var(--text);
    display: block;
    position: relative;
}
.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.category-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    padding: 1rem;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
}
.category-card .card-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-bottom: 1px solid var(--border);
}
.category-card .card-body {
    padding: 1rem 1.2rem;
    text-align: center;
    background: white;
}
.category-card .card-body h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

/* LOADING */
.loading { text-align: center; padding: 3rem; color: var(--text-light); }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* FORMULAIRE CALCUL */
.calcul-container { max-width: 600px; margin: 0 auto; }
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); }

/* BOUTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.8rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.2);
}
.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}
.btn-secondary {
    background: #f8f9fa;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: #e9ecef;
    border-color: var(--secondary);
}
.btn-danger {
    background: #dc3545;
    color: white;
}
.btn-danger:hover { background: #c82333; }
.btn-success {
    background: var(--success);
    color: white;
}
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-full { width: 100%; justify-content: center; }

/* RÉSULTAT */
.result-box {
    background: white;
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.result-box h3 {
    font-size: 1.1rem;
    color: var(--success);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.result-range {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.result-price {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 2rem;
    min-width: 180px;
}
.result-price .label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.result-price .amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.result-separator {
    font-size: 2rem;
    color: var(--text-light);
    font-weight: 300;
}

/* BACK OFFICE */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    background: #212529;
    color: white;
    padding: 1.5rem 0;
    flex-shrink: 0;
    border-right: 1px solid #495057;
}
.admin-sidebar h2 {
    padding: 0 1.5rem 1.2rem;
    font-size: 0.9rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.5rem;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}
.admin-sidebar a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--primary-light);
}
.admin-sidebar a.active {
    background: rgba(235, 30, 122, 0.15);
    color: white;
    border-left-color: var(--primary);
    font-weight: 600;
}
.admin-content { flex: 1; padding: 2rem; background: var(--bg); }

/* TABLE */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.85rem; text-transform: uppercase; color: var(--text-light); background: #f8fafc; }
tr:hover td { background: #f8fafc; }

/* BADGE */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.badge-information { background: #dbeafe; color: #1d4ed8; }
.badge-valeur { background: #fef3c7; color: #b45309; }
.badge-liste { background: #f3e8ff; color: #7c3aed; }

/* BACK LINK */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ALERT */
.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* FORMULE */
.formule-help { font-size: 0.8rem; color: var(--text-light); margin-top: 0.3rem; }
.alias-tag { display: inline-block; background: #e0e7ff; color: #3730a3; padding: 0.1rem 0.4rem; border-radius: 4px; font-family: monospace; font-size: 0.85rem; margin: 0.1rem; }

/* BREADCRUMB */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.breadcrumb a {
    font-size: 0.9rem;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
.breadcrumb .sep {
    color: var(--text-light);
    font-weight: 300;
}
.breadcrumb .current {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}
.has-children-badge {
    font-size: 0.7rem;
    color: var(--primary);
    margin-top: 0.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* MODULE CONNEXION CLIENT (header) */
.header-client {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
}
.header-client a, .header-client button {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    white-space: nowrap;
}
.header-client a:hover, .header-client button:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}
.header-client .btn-header-cta {
    background: var(--primary);
    color: white !important;
    font-weight: 600;
}
.header-client .btn-header-cta:hover {
    background: var(--primary-dark);
}
.header-client .client-name {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

/* DEUX CTAs CÔTE À CÔTE */
.dual-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}
.cta-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}
.cta-box p { font-size: 1rem; font-weight: 500; color: var(--text); line-height: 1.4; }
.cta-box .cta-sub { font-size: 0.85rem; color: var(--text-light); font-weight: 400; }
@media (max-width: 600px) { .dual-cta { grid-template-columns: 1fr; } }

/* PHOTOS UPLOAD */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.photo-slot {
    aspect-ratio: 1;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
    background: #fafafa;
}
.photo-slot:hover { border-color: var(--primary); background: #fdf0f6; }
.photo-slot.filled { border-style: solid; border-color: var(--primary); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .slot-label { font-size: 0.7rem; color: var(--text-light); margin-top: 0.3rem; }
.photo-slot .slot-icon { font-size: 1.5rem; }
.photo-slot .slot-required { position: absolute; top: 4px; right: 4px; background: var(--primary); color: white; font-size: 0.6rem; border-radius: 99px; padding: 1px 5px; font-weight: 700; }
.photo-slot .slot-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.5); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; }
@media (max-width: 500px) { .photos-grid { grid-template-columns: repeat(3, 1fr); } }

/* ESPACE CLIENT */
.annonce-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    transition: box-shadow 0.2s;
}
.annonce-card:hover { box-shadow: var(--shadow-hover); }
.annonce-card .ann-photo {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.annonce-card .ann-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.annonce-card .ann-body { flex: 1; min-width: 0; }
.annonce-card .ann-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; }
.annonce-card .ann-prix { color: var(--primary); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }
.annonce-card .ann-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.6rem; }
.annonce-card .ann-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-archivée { background: #f3f4f6; color: #6b7280; }

/* RESPONSIVE */
@media (max-width: 640px) {
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .category-card img,
    .category-card .card-img-placeholder { height: 140px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .result-range { flex-direction: column; }
    .result-price { min-width: auto; width: 100%; }
    header { padding: 1rem; flex-direction: column; align-items: flex-start; }
    header h1 { font-size: 1.3rem; }
    header p { font-size: 0.8rem; }
    main { padding: 1.5rem 1rem; }
    .page-title h2 { font-size: 1.4rem; }
    .breadcrumb { padding: 0.6rem 0.8rem; font-size: 0.85rem; }
}
