/* Listes portail / admin — style OFIVEGE (partagé portail + super-admin) */
.portal-list-page {
    font-size: 0.875rem;
}

.portal-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.portal-list-header__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem;
}

.portal-list-header__subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

.portal-list-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.portal-list-card {
    margin-bottom: 1rem;
}

.portal-list-filters .form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.portal-list-filters__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portal-list-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.portal-list-legend__swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    vertical-align: -2px;
    margin-right: 0.35rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.portal-list-legend__swatch--success { background: #e8f5e9; }
.portal-list-legend__swatch--warning { background: #fff8e1; }
.portal-list-legend__swatch--danger { background: #ffebee; }

.portal-list-legend__count {
    font-weight: 500;
    color: #374151;
}

.portal-list-table-wrap {
    overflow: hidden;
}

.portal-list-table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.portal-list-table thead th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #98a6ad;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.portal-list-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #eef2f7;
    color: #374151;
}

.portal-list-table tbody tr:last-child td {
    border-bottom: none;
}

.portal-list-row--success { background: #f1f8f4; }
.portal-list-row--warning { background: #fffdf5; }
.portal-list-row--danger { background: #fff5f5; }

.portal-list-item.portal-list-row--success { background: #f1f8f4; }
.portal-list-item.portal-list-row--warning { background: #fffdf5; }

.map-aside .portal-list-legend {
    margin-bottom: 0.5rem;
}

.portal-list-table tbody tr:hover {
    filter: brightness(0.98);
}

.portal-list-table__code code {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1f2937;
    background: transparent;
}

.portal-list-table__name {
    font-weight: 600;
    color: #1f2937;
}

.portal-list-table__meta {
    font-size: 0.8125rem;
    color: #6b7280;
}

.portal-status-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 50rem;
    white-space: nowrap;
}

.portal-status-badge--success {
    background: #e8f5e9;
    color: #2e7d32;
}

.portal-status-badge--info {
    background: #e8f0fa;
    color: #1E5BA8;
}

.portal-status-badge--warning {
    background: #fff3e0;
    color: #e65100;
}

.portal-status-badge--danger {
    background: #ffebee;
    color: #c62828;
}

.portal-status-badge--muted {
    background: #f3f4f6;
    color: #4b5563;
}

.portal-list-actions {
    white-space: nowrap;
}

.portal-action-link {
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.65rem;
}

.portal-action-link:first-child {
    margin-left: 0;
}

.portal-action-link--primary {
    color: var(--sf-primary, #1E5BA8);
}

.portal-action-link--primary:hover {
    color: var(--sf-primary-dark, #153E7A);
    text-decoration: underline;
}

.portal-action-link--muted {
    color: #6b7280;
}

.portal-action-link--muted:hover {
    color: #374151;
    text-decoration: underline;
}

.portal-action-link--danger {
    color: #c62828;
}

.portal-action-link--danger:hover {
    color: #b71c1c;
    text-decoration: underline;
}

.portal-list-table .form-select-sm {
    font-size: 0.8125rem;
    min-width: 7.5rem;
}

.portal-list-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.portal-list-section {
    margin-top: 1rem;
}

.portal-list-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.portal-list-section__count {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

/* Carte live — panneau latéral */
.map-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    height: calc(100vh - var(--sf-topbar-height, 56px));
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.875rem;
}

#map {
    flex: 1;
    min-height: 320px;
    width: 100%;
    z-index: 1;
}

.map-aside {
    width: 340px;
    max-width: 42vw;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
    padding: 1rem;
}

.map-aside.portal-list-page {
    margin-bottom: 0;
}

.map-aside .portal-list-legend {
    margin-bottom: 0.5rem;
}

.map-aside__section--priority {
    margin-top: 0;
}

.map-aside__details {
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0;
}

.map-aside__details summary {
    cursor: pointer;
    padding: 0.65rem 0.75rem;
    list-style: none;
    user-select: none;
}

.map-aside__details summary::-webkit-details-marker {
    display: none;
}

.map-aside__details summary::after {
    content: '▾';
    float: right;
    color: #6b7280;
    font-size: 0.75rem;
}

.map-aside__details[open] summary::after {
    content: '▴';
}

.map-route-panel__body {
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid #eef2f7;
}

.map-aside__footer-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eef2f7;
}

.map-route-panel {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    font-family: "DM Sans", system-ui, sans-serif;
}

.map-route-panel label,
.map-route-panel__body label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.map-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #eef2f7;
    border-radius: 0.5rem;
}

.map-status-bar .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27AE60;
    animation: map-pulse 1.5s infinite;
    flex-shrink: 0;
}

.map-status-bar .pulse.off {
    background: #bdbdbd;
    animation: none;
}

@keyframes map-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.map-route-panel select,
.map-route-panel input[type="date"] {
    width: 100%;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0;
    font-size: 0.875rem;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    outline: none;
}

.map-route-panel select:focus,
.map-route-panel input[type="date"]:focus {
    border-color: #1E5BA8;
    box-shadow: 0 0 0 1px #1E5BA8;
}

.map-route-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.map-route-actions button {
    flex: 1;
    min-width: 5.5rem;
    padding: 0.45rem 0.65rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}

.btn-route-load { background: #1E5BA8; color: #fff; }
.btn-route-load:hover { background: #153E7A; }
.btn-route-play { background: #27AE60; color: #fff; }
.btn-route-stop { background: #6b7280; color: #fff; }

#routeStatus {
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.map-marker-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #eef2f7;
    border-radius: 0.5rem;
}

.map-marker-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #374151;
}

.map-marker-legend .leg-icon {
    width: 22px;
    height: 22px;
    border-radius: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.6875rem;
}

.portal-list-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portal-list-item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
    border: 1px solid #eef2f7;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    background: #fff;
}

.portal-list-item.is-stale {
    opacity: 0.88;
    border-style: dashed;
}

.portal-list-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.portal-list-item__body {
    flex: 1;
    min-width: 0;
}

.portal-list-empty {
    color: #6b7280;
    font-size: 0.8125rem;
    font-style: italic;
    line-height: 1.5;
    margin: 0;
}

.portal-list-info-table td:first-child {
    width: 38%;
    color: #6b7280;
    font-size: 0.8125rem;
}

.portal-list-info-table td:last-child {
    font-weight: 500;
    color: #1f2937;
}

/* Marqueurs Leaflet (carte) */
.map-marker-wrap { background: transparent !important; border: none !important; }

.map-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50% 50% 50% 6px;
    transform: rotate(-45deg);
    border: 2.5px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
    color: #fff;
    font-size: 17px;
}

.map-marker i { transform: rotate(45deg); line-height: 1; }

.map-marker--person { background: #1E5BA8; }
.map-marker--person.stale { background: #9ca3af; }
.map-marker--boutique { background: #2D5F3F; }
.map-marker--entreprise { background: #3E4E5E; }
.map-marker--kiosque { background: #e65100; }
.map-marker--particulier { background: #6a1b9a; }

.leaflet-popup-content { margin: 10px 14px; min-width: 220px; max-width: 280px; }

.map-popup { font-size: 13px; line-height: 1.45; color: #1a1a2e; }
.map-popup__title { font-size: 15px; font-weight: 700; color: #1E5BA8; margin-bottom: 4px; display: block; }
.map-popup__type { font-size: 11px; color: #7a8494; margin-bottom: 8px; }
.map-popup__row { display: flex; gap: 8px; align-items: flex-start; margin: 5px 0; font-size: 12px; word-break: break-word; }
.map-popup__row i { color: #1E5BA8; width: 16px; text-align: center; margin-top: 2px; flex-shrink: 0; }
.map-popup__row a { color: #1E5BA8; text-decoration: none; }
.map-popup__row a:hover { text-decoration: underline; }
.map-popup__actions { margin-top: 10px; padding-top: 8px; border-top: 1px solid #eef2f7; display: flex; flex-wrap: wrap; gap: 10px; }
.map-popup__actions a { font-size: 12px; font-weight: 600; color: #1E5BA8; text-decoration: none; }

@media (max-width: 768px) {
    .map-layout { flex-direction: column; height: auto; }
    .map-aside { width: 100%; max-width: none; max-height: 45vh; }
    #map { height: 50vh; }
}
