/* ================================================
   FABARA — Coquille "Pro" (Admin / Partenaire / Livreur)
   Sidebar + topbar + navigation mobile/tablette dédiée
   ================================================ */

/* ========== ICON TILES ========== */
.icon-tile {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; border-radius: 10px;
}
.icon-tile i { display: block; }
.icon-tile-sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-tile-sm i { width: 14px; height: 14px; }
.icon-tile-md { width: 38px; height: 38px; }
.icon-tile-md i { width: 19px; height: 19px; }
.icon-tile-lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-tile-lg i { width: 24px; height: 24px; }

.icon-tile-green  { background: var(--tone-green-bg);  color: var(--tone-green-fg); }
.icon-tile-gold   { background: var(--tone-gold-bg);   color: var(--tone-gold-fg); }
.icon-tile-blue   { background: var(--tone-blue-bg);   color: var(--tone-blue-fg); }
.icon-tile-purple { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.icon-tile-teal   { background: var(--tone-teal-bg);   color: var(--tone-teal-fg); }
.icon-tile-red    { background: var(--tone-red-bg);    color: var(--tone-red-fg); }
.icon-tile-amber  { background: var(--tone-amber-bg);  color: var(--tone-amber-fg); }
.icon-tile-slate  { background: var(--tone-slate-bg);  color: var(--tone-slate-fg); }

/* ========== SHELL ========== */
.pro-body { background: var(--green-bg); }

.pro-shell { min-height: 100vh; }

.pro-overlay {
    position: fixed; inset: 0; background: rgba(17, 24, 20, 0.45);
    z-index: 1150; opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}

/* ========== SIDEBAR ========== */
.pro-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px;
    background: #ffffff; border-right: 1px solid var(--green-pale);
    display: flex; flex-direction: column;
    z-index: 1200; transition: width 0.2s ease, transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.pro-brand {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 1.35rem 1.25rem; border-bottom: 1px solid var(--green-pale);
    flex-shrink: 0; white-space: nowrap; overflow: hidden;
}
.pro-brand-mark {
    font-family: var(--font-display); font-weight: 900; font-size: 1.3rem;
    color: var(--green-dark); flex-shrink: 0;
}
.pro-brand-mark span { color: var(--gold); }

.pro-nav {
    flex: 1; overflow-y: auto; padding: 1rem 0.75rem;
    display: flex; flex-direction: column; gap: 1.3rem;
}

.pro-nav-group-label {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; border: none; background: none; cursor: pointer;
    padding: 0 0.5rem 0.5rem; font-family: var(--font-body);
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--gray-mid); white-space: nowrap;
}
.pro-nav-group-chevron { width: 15px; height: 15px; transition: transform 0.2s ease; }
.pro-nav-group.collapsed .pro-nav-group-chevron { transform: rotate(-90deg); }
.pro-nav-group.collapsed .pro-nav-group-items { display: none; }

.pro-nav-group-items { display: flex; flex-direction: column; gap: 0.2rem; }

.pro-nav-link {
    position: relative;
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem; border-radius: 10px;
    font-size: 0.88rem; font-weight: 500; color: var(--text);
    white-space: nowrap; transition: background 0.15s ease, color 0.15s ease;
}
.pro-nav-link:hover { background: var(--green-bg); }
.pro-nav-link.active { background: var(--green-bg); color: var(--green-dark); font-weight: 700; }
.pro-nav-link.active .icon-tile { box-shadow: 0 0 0 2px rgba(46,125,50,0.18); }

.pro-nav-link-label { overflow: hidden; text-overflow: ellipsis; flex: 1; }

.pro-nav-badge {
    background: var(--gold); color: var(--green-dark);
    font-size: 0.7rem; font-weight: 700; line-height: 1;
    padding: 0.25rem 0.45rem; border-radius: 50px; min-width: 18px; text-align: center;
    flex-shrink: 0;
}

.pro-nav-link.pro-nav-logout { color: var(--danger); }
.pro-nav-link.pro-nav-logout .icon-tile { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.pro-nav-link.pro-nav-logout:hover { background: #fee2e2; }

.pro-sidebar-footer {
    padding: 0.75rem; border-top: 1px solid var(--green-pale); flex-shrink: 0;
    display: flex; flex-direction: column; gap: 0.3rem;
}

/* ========== TOPBAR ========== */
.pro-main { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }

.pro-topbar {
    position: sticky; top: 0; z-index: 1050;
    display: flex; align-items: center; gap: 1rem;
    background: rgba(255,255,255,0.94); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--green-pale);
    padding: 0.9rem 1.5rem; min-height: 66px;
}

.pro-topbar-toggle {
    display: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    border: 1.5px solid var(--green-pale); background: white; cursor: pointer; color: var(--text);
}
.pro-topbar-toggle:hover { background: var(--green-bg); border-color: var(--green-main); }

.pro-topbar-back {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    border: 1.5px solid var(--green-pale); background: white; cursor: pointer; color: var(--text);
}
.pro-topbar-back:hover { background: var(--green-bg); border-color: var(--green-main); }
.pro-topbar-back i { width: 18px; height: 18px; }

.pro-topbar-title { min-width: 0; }
.pro-topbar-title h1 {
    font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
    color: var(--text); line-height: 1.2;
}
.pro-topbar-title p { font-size: 0.8rem; color: var(--gray-mid); margin-top: 1px; }

.pro-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }

.pro-user-chip {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem; border-radius: 50px;
    border: 1.5px solid var(--green-pale); background: white;
    font: inherit; text-align: left; cursor: pointer;
}
.pro-user-avatar {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
    background: var(--green-bg); display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--green-dark); font-size: 0.85rem; flex-shrink: 0;
}
.pro-user-meta { display: none; }
.pro-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text); line-height: 1.1; }
.pro-user-role { font-size: 0.7rem; color: var(--gray-mid); }

.pro-content { flex: 1; padding: 1.75rem 1.75rem 3rem; max-width: 1280px; width: 100%; }

/* ========== BOTTOM NAV (mobile) ========== */
.pro-bottom-nav {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
    background: rgba(255,255,255,0.97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--green-pale);
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
    align-items: stretch; justify-content: space-between;
}
.pro-bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    padding: 0.35rem 0.2rem; border: none; background: none; cursor: pointer;
    font-family: var(--font-body); color: var(--gray-mid); font-size: 0.65rem; font-weight: 600;
    border-radius: 10px;
}
.pro-bottom-nav-item .icon-tile { background: none; color: var(--gray-mid); width: 24px; height: 24px; }
.pro-bottom-nav-item .icon-tile i { width: 20px; height: 20px; }
.pro-bottom-nav-item.active { color: var(--green-dark); }
.pro-bottom-nav-item.active .icon-tile { color: var(--green-dark); }

/* ========== RESPONSIVE MODES ========== */

/* Tablette : sidebar en rail d'icônes, dépliable en tiroir */
@media (max-width: 1179px) {
    .pro-topbar-toggle { display: flex; }
}

@media (min-width: 768px) and (max-width: 1179px) {
    .pro-sidebar { width: 76px; }
    .pro-sidebar .pro-nav-link-label,
    .pro-sidebar .pro-nav-group-label span:first-child,
    .pro-sidebar .pro-nav-group-chevron { display: none; }
    .pro-sidebar .pro-nav-group-label { justify-content: center; padding: 0 0 0.4rem; }
    .pro-sidebar .pro-nav-link { justify-content: center; }
    .pro-sidebar .pro-nav-badge {
        position: absolute; top: 2px; right: 2px; min-width: 9px; height: 9px;
        padding: 0; font-size: 0;
    }
    .pro-main { margin-left: 76px; }

    [data-nav-state="open"] .pro-sidebar {
        width: 264px; box-shadow: var(--shadow-lg);
    }
    [data-nav-state="open"] .pro-sidebar .pro-nav-link-label,
    [data-nav-state="open"] .pro-sidebar .pro-nav-group-label span:first-child,
    [data-nav-state="open"] .pro-sidebar .pro-nav-group-chevron { display: unset; }
    [data-nav-state="open"] .pro-sidebar .pro-nav-group-label { justify-content: space-between; padding: 0 0.5rem 0.5rem; }
    [data-nav-state="open"] .pro-sidebar .pro-nav-link { justify-content: flex-start; }
    [data-nav-state="open"] .pro-sidebar .pro-nav-badge {
        position: static; min-width: 18px; height: auto; padding: 0.25rem 0.45rem; font-size: 0.7rem;
    }
    [data-nav-state="open"] .pro-overlay { opacity: 1; pointer-events: all; }
}

/* Mobile : sidebar en tiroir hors-écran + barre de navigation basse */
@media (max-width: 767px) {
    .pro-sidebar {
        width: 280px; transform: translateX(-100%); box-shadow: var(--shadow-lg);
    }
    [data-nav-state="open"] .pro-sidebar { transform: translateX(0); }
    [data-nav-state="open"] .pro-overlay { opacity: 1; pointer-events: all; }

    .pro-main { margin-left: 0; }
    .pro-content { padding: 1.25rem 1.1rem 5.5rem; }
    .pro-topbar { padding: 0.8rem 1.1rem; }
    .pro-topbar-title h1 { font-size: 1.05rem; }
    .pro-topbar-title p { display: none; }

    .pro-bottom-nav { display: flex; }
    .pro-user-chip { padding: 0.3rem; }
}

@media (min-width: 992px) {
    .pro-user-meta { display: block; }
}

@media (max-width: 480px) {
    .pro-content { padding-left: 0.85rem; padding-right: 0.85rem; }
}

/* ================================================
   Contenu admin mutualisé (repris des pages admin —
   auparavant dupliqué dans chaque fichier)
   ================================================ */

.admin-page-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem;
}
.admin-page-header h2 {
    font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text);
}
.admin-page-header p { color: var(--gray-mid); font-size: 0.9rem; margin-top: 0.2rem; }

.admin-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
    gap: 1rem; margin-bottom: 2rem;
}
.admin-stat {
    background: white; border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem; box-shadow: var(--shadow); border: 1px solid var(--green-pale);
    cursor: pointer; transition: transform 0.15s; display: flex; align-items: center; gap: 0.9rem;
}
.admin-stat:hover { transform: translateY(-2px); }
.admin-stat-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 900; line-height: 1; }
.admin-stat-label { font-size: 0.8rem; color: var(--gray-mid); margin-top: 0.2rem; }
.admin-stat-link { text-decoration: none; color: inherit; }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.sub-tabs-nav { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.sub-tab-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.1rem; border-radius: 50px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
    border: 1.5px solid var(--green-pale); background: var(--green-bg);
    color: var(--gray-mid); font-family: var(--font-body); transition: all 0.2s;
}
.sub-tab-btn.active { background: white; border-color: #1B5E20; color: #1B5E20; }
.sub-tab-btn i { width: 14px; height: 14px; }
.sub-panel { display: none; }
.sub-panel.active { display: block; }

.admin-section {
    background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
    margin-bottom: 2rem; border: 1px solid var(--green-pale);
}
.admin-section-header {
    padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--green-pale);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem;
}
.admin-section-header h2 {
    display: flex; align-items: center; gap: 0.7rem;
    font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 0;
}

.admin-table {
    width: 100%; border-collapse: collapse; overflow-x: auto; display: block;
    background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow);
    border: 1px solid var(--green-pale);
}
.admin-table thead tr { background: var(--green-bg); }
.admin-table th {
    padding: 1rem 1.2rem; text-align: left; font-size: 0.76rem; font-weight: 700;
    color: var(--green-dark); text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap;
    border-bottom: 2px solid var(--green-pale);
}
.admin-table tbody tr { border-top: 1px solid #eef2ee; transition: background 0.15s; }
.admin-table tbody tr:nth-child(even) { background: #fafbf8; }
.admin-table tbody tr:hover { background: var(--green-bg); }
.admin-table td { padding: 0.9rem 1.2rem; font-size: 0.88rem; white-space: nowrap; color: var(--text); }
.admin-table td[colspan] { text-align: center; color: var(--gray-mid); padding: 2.75rem 1.2rem; white-space: normal; }

.s-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.8rem; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}
.s-en-attente, .s-en_attente { background: #fef3c7; color: #b45309; }
.s-confirmee, .s-confirmed  { background: #dbeafe; color: #1d4ed8; }
.s-en-livraison, .s-en_livraison { background: #f3e8ff; color: #15803d; }
.s-livree, .s-livrée { background: #d1fae5; color: #065f46; }
.s-annulee, .s-annulée { background: #fee2e2; color: #dc2626; }
.s-actif     { background: #d1fae5; color: #065f46; }
.s-inactif   { background: #fee2e2; color: #dc2626; }
.s-suspendu  { background: #fee2e2; color: #dc2626; }
.s-epuise    { background: #f1f5f9; color: #64748b; }
.s-contacte  { background: #dbeafe; color: #1d4ed8; }
.s-rejete    { background: #fee2e2; color: #dc2626; }
.s-traite    { background: #d1fae5; color: #065f46; }
.s-validee   { background: #d1fae5; color: #065f46; }
.s-suspendue { background: #fef3c7; color: #b45309; }
.s-refusee   { background: #fee2e2; color: #dc2626; }
.s-fermee    { background: #f1f5f9; color: #64748b; }
.s-paye      { background: #d1fae5; color: #065f46; }
.s-echec     { background: #fee2e2; color: #dc2626; }
.s-rembourse, .s-rembourse_partiel { background: #f3e8ff; color: #7c3aed; }
.s-brouillon { background: #f1f5f9; color: #475569; }
.s-envoye    { background: #dbeafe; color: #1d4ed8; }
.s-signe     { background: #d1fae5; color: #065f46; }
.s-resilie   { background: #fee2e2; color: #dc2626; }
.s-acceptee  { background: #dbeafe; color: #1e40af; }
.s-en_preparation { background: #ede9fe; color: #5b21b6; }
.s-prete     { background: #dcfce7; color: #166534; }
.s-en_cours  { background: #dbeafe; color: #1e40af; }
.s-partiellement_livree { background: #fef3c7; color: #92400e; }

.role-badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 50px;
    font-size: 0.72rem; font-weight: 700; margin: 1px;
}
.role-client      { background: #f1f5f9; color: #475569; }
.role-partenaire  { background: #f3e8ff; color: #7c3aed; }
.role-agriculteur { background: #dcfce7; color: #15803d; }
.role-artisan     { background: #f3e8ff; color: #15803d; }
.role-livreur     { background: #dbeafe; color: #1d4ed8; }
.role-admin       { background: #fee2e2; color: #dc2626; }

.act-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.4rem 0.8rem; border-radius: 8px;
    font-size: 0.78rem; font-weight: 600; border: 1px solid #e2e8f0;
    cursor: pointer; font-family: var(--font-body); transition: all 0.15s;
    background: #f1f5f9; color: #334155; text-decoration: none;
}
.act-btn:hover  { opacity: 1; background: #e2e8f0; border-color: #cbd5e1; }
.act-btn i { width: 14px; height: 14px; }
.act-valider   { background: #d1fae5; color: #065f46; border-color: transparent; }
.act-suspendre { background: #fef3c7; color: #b45309; border-color: transparent; }
.act-delete    { background: #fee2e2; color: #dc2626; border-color: transparent; }
.act-assign    { background: #eff6ff; color: #2563eb; border-color: transparent; }
.act-edit      { background: #eff6ff; color: #2563eb; border-color: transparent; }
.act-notif     { background: #fef3c7; color: #b45309; border-color: transparent; }
.act-role      { background: #dcfce7; color: #15803d; border-color: transparent; }

.admin-form { padding: 1.5rem; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-form .form-group { margin-bottom: 1rem; }
.admin-form .form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text); display: block; margin-bottom: 0.4rem; }
.admin-form .form-group input,
.admin-form .form-group select,
.admin-form .form-group textarea {
    width: 100%; padding: 0.75rem 1rem;
    border: 1.5px solid var(--green-pale); border-radius: var(--radius);
    font-family: var(--font-body); font-size: 0.9rem; background: var(--green-bg);
    color: var(--text); outline: none; transition: border-color 0.2s; box-sizing: border-box;
}
.admin-form .form-group input:focus,
.admin-form .form-group select:focus,
.admin-form .form-group textarea:focus { border-color: var(--green-main); background: white; }
.admin-form .form-group textarea { min-height: 80px; resize: vertical; }
.span-2 { grid-column: span 2; }

.modal-user-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); z-index: 9999;
    align-items: center; justify-content: center;
}
.modal-user-overlay.open { display: flex; }
.modal-user-box {
    background: white; border-radius: 16px; padding: 2rem;
    width: 90%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity:0; transform: translateY(16px) scale(0.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}
.modal-user-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--green-pale);
}
.modal-user-header h3 { display:flex; align-items:center; gap:0.6rem; font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }
.modal-close-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray-mid); line-height: 1; }

.admin-success { display:flex; align-items:center; gap:0.6rem; background: #d1fae5; color: #065f46; padding: 1rem 1.5rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-weight: 500; }
.admin-error   { display:flex; align-items:center; gap:0.6rem; background: #fee2e2; color: #dc2626; padding: 1rem 1.5rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-weight: 500; }

.user-search-wrap { padding: 1rem 1.5rem; border-bottom: 1px solid var(--green-pale); }
.user-search-input {
    width: 100%; padding: 0.65rem 1rem; border: 1.5px solid var(--green-pale); border-radius: 8px;
    font-family: var(--font-body); font-size: 0.9rem; box-sizing: border-box; outline: none;
}
.user-search-input:focus { border-color: var(--green-main); }

/* Dashboards Partenaire / Livreur */
.dash-section { background: white; border-radius: var(--radius-lg); border: 1px solid var(--green-pale); box-shadow: var(--shadow); margin-bottom: 1.5rem; overflow: hidden; }
.dash-section-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--green-pale); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.dash-section-header h3 { display: flex; align-items: center; gap: 0.7rem; font-size: 1.05rem; }
.boutique-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 1.5rem; border-bottom: 1px solid #f5f5f5; flex-wrap: wrap; }
.boutique-row:last-child { border-bottom: none; }
.empty-dash { text-align: center; padding: 2.5rem; color: var(--gray-mid); }
.avis-row { padding: 1.1rem 1.5rem; border-bottom: 1px solid #f5f5f5; }
.avis-row:last-child { border-bottom: none; }
.avis-row-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.avis-row-nom { font-weight: 600; font-size: 0.88rem; }
.avis-row-note { color: #f59e0b; }
.avis-row-comment { font-size: 0.85rem; color: var(--text); margin-bottom: 0.5rem; }
.avis-row-reponse { display:flex; align-items:flex-start; gap:0.5rem; padding: 0.6rem 0.9rem; background: var(--green-bg); border-radius: 8px; font-size: 0.82rem; }
.avis-row form textarea {
    width: 100%; padding: 0.6rem 0.8rem; border: 1.5px solid var(--green-pale); border-radius: 8px;
    font-family: var(--font-body); font-size: 0.85rem; box-sizing: border-box; min-height: 60px; resize: vertical; margin-bottom: 0.5rem;
}
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: white; border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; border: 1px solid var(--green-pale); box-shadow: var(--shadow); display: flex; align-items: center; gap: 0.9rem; }
.stat-card-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 900; color: #1B5E20; line-height:1; }
.stat-card-label { font-size: 0.82rem; color: var(--gray-mid); margin-top:0.2rem; }
.order-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid #f5f5f5; flex-wrap: wrap; }
.order-row:last-child { border-bottom: none; }
.badge-livraison { display:inline-flex; align-items:center; gap:0.3rem; background: #e0f2fe; color: #0369a1; padding: 0.25rem 0.7rem; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.badge-type-agricole  { display:inline-flex; align-items:center; gap:0.3rem; background: #dcfce7; color: #15803d; padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700; }
.badge-type-artisanat { display:inline-flex; align-items:center; gap:0.3rem; background: #f3e8ff; color: #15803d; padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700; }

@media (max-width: 768px) {
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .admin-form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
}

/* ================================================
   Dashboard décisionnel (vue d'ensemble admin)
   ================================================ */

.decision-section { margin-bottom: 2rem; }
.decision-section-title {
    display: flex; align-items: center; gap: 0.6rem;
    font-size: 0.95rem; font-weight: 700; color: var(--text);
    margin-bottom: 1rem;
}
.decision-section-title i { width: 18px; height: 18px; color: var(--gold); }

.decision-queue {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem; margin-bottom: 2rem;
}
.decision-card {
    display: flex; align-items: center; gap: 0.9rem;
    background: white; border: 1px solid var(--green-pale); border-radius: var(--radius-lg);
    padding: 1rem 1.1rem; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
}
.decision-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.decision-card-body { flex: 1; min-width: 0; }
.decision-card-count { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; line-height: 1; }
.decision-card-label { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-top: 0.15rem; }
.decision-card-desc { font-size: 0.76rem; color: var(--gray-mid); margin-top: 0.15rem; }
.decision-card-arrow { color: var(--gray-mid); flex-shrink: 0; }
.decision-card-arrow i { width: 18px; height: 18px; }

.decision-empty {
    display: flex; align-items: center; gap: 0.9rem;
    background: var(--green-bg); border: 1px solid var(--green-pale); border-radius: var(--radius-lg);
    padding: 1.1rem 1.3rem; margin-bottom: 2rem; color: var(--green-dark); font-weight: 600; font-size: 0.9rem;
}

.kpi-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}
.kpi-card {
    background: white; border: 1px solid var(--green-pale); border-radius: var(--radius-lg);
    padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 0.6rem;
}
.kpi-card-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 900; color: var(--text); line-height: 1; }
.kpi-label { font-size: 0.8rem; color: var(--gray-mid); font-weight: 600; }

.kpi-trend {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 50px;
}
.kpi-trend i { width: 12px; height: 12px; }
.kpi-trend-up   { background: #d1fae5; color: #065f46; }
.kpi-trend-down { background: #fee2e2; color: #dc2626; }
.kpi-trend-flat { background: var(--gray-light); color: var(--gray-mid); }

.chart-card {
    background: white; border: 1px solid var(--green-pale); border-radius: var(--radius-lg);
    padding: 1.3rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 2rem;
}
.chart-card-title { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; }
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar-value { font-size: 0.72rem; font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
.chart-bar { width: 100%; max-width: 34px; background: var(--green-main); border-radius: 6px 6px 2px 2px; transition: background 0.15s; min-height: 3px; }
.chart-bar-col:hover .chart-bar { background: var(--green-dark); }
.chart-bar-label { font-size: 0.72rem; color: var(--gray-mid); margin-top: 6px; }

.sales-chart-svg { width: 100%; height: 180px; display: block; overflow: visible; }
.sales-chart-area { fill: var(--green-main); opacity: 0.12; }
.sales-chart-line { fill: none; stroke: var(--green-main); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sales-chart-dot { fill: white; stroke: var(--green-main); stroke-width: 2; opacity: 0; transition: opacity 0.15s, r 0.15s; }
.sales-chart-svg:hover .sales-chart-dot { opacity: 0.55; }
.sales-chart-dot:hover { opacity: 1 !important; r: 5; }
.sales-chart-axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--gray-mid); margin-top: 0.5rem; }

/* ================================================
   Notifications (topbar)
   ================================================ */

.pro-notif-wrap { position: relative; }
.pro-notif-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    border: 1.5px solid var(--green-pale); background: white; cursor: pointer; color: var(--text);
}
.pro-notif-btn:hover { background: var(--green-bg); border-color: var(--green-main); }
.pro-notif-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--danger); color: white; font-size: 0.65rem; font-weight: 700;
    min-width: 17px; height: 17px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.pro-notif-dropdown {
    display: none; position: absolute; top: calc(100% + 10px); right: 0;
    width: 340px; max-width: 90vw; max-height: 420px; overflow-y: auto;
    background: white; border-radius: 16px; border: 1px solid var(--green-pale);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15); z-index: 1300;
}
.pro-notif-dropdown.open { display: block; }

/* Sous 768px (seuil mobile utilisé partout ailleurs dans ce fichier), la
   position "right:0 relative au bouton" fait déborder le panneau hors de
   l'écran selon la position de l'icône dans le topbar (bulle d'annonce vs
   cloche vs puce utilisateur). On le fixe plutôt sous la barre du haut,
   pleine largeur, quelle que soit l'icône qui l'a ouvert. */
@media (max-width: 768px) {
    .pro-notif-dropdown {
        position: fixed; top: 64px; left: 10px; right: 10px;
        width: auto; max-width: none; max-height: calc(100vh - 140px);
    }
}
.pro-notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--green-pale); position: sticky; top: 0; background: white;
}
.pro-notif-header h4 { font-size: 0.88rem; font-weight: 700; }

/* Bouton son des notifications (js/notif-son.js) */
.pro-notif-son {
    margin-left: auto; margin-right: 0.6rem;
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--green-bg); color: var(--green-main); border: none; border-radius: 999px;
    padding: 0.25rem 0.6rem; font-size: 0.72rem; font-weight: 600; cursor: pointer; font-family: var(--font-body);
}
.pro-notif-son svg { width: 14px; height: 14px; }
.pro-notif-son .pro-notif-son-off { display: none; }
.pro-notif-son[aria-pressed="false"] { background: #f5f5f5; color: var(--gray-mid); }
.pro-notif-son[aria-pressed="false"] .pro-notif-son-on { display: none; }
.pro-notif-son[aria-pressed="false"] .pro-notif-son-off { display: inline; }

/* Invitation aux notifications push sur le téléphone (js/push.js) */
.push-invite {
    position: fixed; z-index: 1250; left: 50%; bottom: 24px;
    width: min(560px, calc(100% - 24px));
    display: flex; align-items: center; gap: 0.9rem;
    padding: 0.9rem 1rem; border-radius: 16px;
    background: var(--green-dark, #1B5E20); color: white;
    box-shadow: 0 18px 44px rgba(10, 40, 12, 0.35);
    opacity: 0; transform: translate(-50%, 20px);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.push-invite.is-visible { opacity: 1; transform: translate(-50%, 0); }
.push-invite[hidden] { display: none; }
.push-invite-icone {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(249, 168, 37, 0.18); color: var(--gold, #F9A825);
}
.push-invite-icone svg { width: 22px; height: 22px; }
.push-invite-texte { flex: 1; min-width: 0; }
.push-invite-texte strong { display: block; font-size: 0.9rem; }
.push-invite-texte span { display: block; font-size: 0.78rem; line-height: 1.4; color: rgba(255, 255, 255, 0.8); margin-top: 2px; }
.push-invite-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.push-invite-oui, .push-invite-non {
    border: none; border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer;
    font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
}
.push-invite-oui { background: var(--gold, #F9A825); color: var(--green-dark, #1B5E20); }
.push-invite-oui[hidden] { display: none; }
.push-invite-non { background: transparent; color: rgba(255, 255, 255, 0.75); }
@media (max-width: 768px) {
    /* au-dessus de la barre de navigation du bas ET de la bulle de messagerie (bottom 78px + 56px) */
    .push-invite { bottom: 146px; }
}

/* La cloche s'agite à l'arrivée d'une notification */
@keyframes proNotifSonne {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); }
}
.pro-notif-btn.is-ringing svg { animation: proNotifSonne 0.9s ease; transform-origin: 50% 3px; }
@media (prefers-reduced-motion: reduce) { .pro-notif-btn.is-ringing svg { animation: none; } }
.pro-notif-mark-all { background: none; border: none; color: var(--green-main); font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: var(--font-body); }
.pro-notif-item {
    display: flex; gap: 0.7rem; padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #f5f5f5; text-decoration: none; color: inherit; transition: background 0.15s;
}
.pro-notif-item:last-child { border-bottom: none; }
.pro-notif-item:hover { background: var(--green-bg); }
.pro-notif-item-body { flex: 1; min-width: 0; }
.pro-notif-item-title { font-size: 0.82rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.pro-notif-item-time { font-size: 0.72rem; color: var(--gray-mid); margin-top: 0.2rem; }
.pro-notif-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--gray-mid); font-size: 0.85rem; }

/* Bouton « contour » dans les espaces pro : .btn-outline (fabara.css) est prévu pour les fonds
   verts du site public (texte blanc) et devenait invisible sur les fonds clairs des espaces
   admin, partenaire et gestion (« Mes commandes », « Annuler », « Retour »…). */
.pro-content .btn-outline {
    border: 1.5px solid var(--green-pale);
    color: var(--green-main);
    background: white;
    padding: 0.7rem 1.4rem;
    font-size: 0.92rem;
}
.pro-content .btn-outline:hover {
    background: var(--green-bg);
    border-color: var(--green-main);
    color: var(--green-dark);
}
