/* ==========================================================================
   Largess Mag — surcharges de marque appliquées au nouveau template admin
   (Bootstrap 5 + Tabler Icons). Chargé après bootstrap.min.css/style.css,
   ne modifie pas la structure du template, uniquement l'identité visuelle.
   ========================================================================== */

:root {
    --primary: #0B3C7C;
    --primary-rgb: 11, 60, 124;
    --primary-hover: #082c5c;
    --primary-transparent: #E4EBF4;
}

body {
    font-family: 'Sora', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

:root[data-bs-theme="dark"] {
    --primary-transparent: #0f2542;
}

/* Modales du panneau admin : en-tête dégradé assorti aux cartes, coins
   nettement arrondis, séparation nette avec le corps du formulaire. */
.modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2, 12, 27, 0.28);
}
.modal-header {
    background: linear-gradient(135deg, #061a33 0%, #0B3C7C 60%, #124b96 100%);
    border: 0;
    padding: 1.1rem 1.5rem;
}
.modal-header .modal-title {
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lm-modal-icon-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
}
.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}
.modal-header .btn-close:hover {
    opacity: 1;
}
.modal-body {
    padding: 1.5rem;
}
.modal-body .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--body-color, #888);
}
.modal-footer {
    border-top: 1px solid var(--border-color, #eef0f2);
    padding: 1rem 1.5rem;
    background: var(--light, #f8f9fb);
}

/* Coins bien arrondis + liseré coloré en haut sur toutes les cartes du
   panneau. La couleur du liseré se règle via --lm-card-accent (voir les
   variantes .lm-kpi-*) sans conflit de spécificité CSS. */
.page-wrapper .card {
    border-radius: 14px;
    border-color: var(--border-color, #eef0f2);
    border-top: 3px solid var(--lm-card-accent, var(--primary));
    overflow: hidden;
}

/* Cartes formulaire / détail : en-tête en bandeau dégradé plutôt qu'un
   simple liseré (utilisées dans les formulaires et les pages "voir"). */
.card-header.lm-card-header-accent {
    background: linear-gradient(135deg, #061a33 0%, #0B3C7C 60%, #124b96 100%);
    border: 0;
    padding: 0.9rem 1.25rem;
}
.lm-card-header-accent .card-title {
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}
.lm-card-header-accent .card-title i {
    font-size: 1.05rem;
}
.page-wrapper .card.lm-card-no-top-border {
    border-top: 0;
}

/* Bandeau "hero" en tête de page (remplace le titre simple) */
.lm-hero {
    background: linear-gradient(135deg, #061a33 0%, #0B3C7C 55%, #124b96 100%);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 10px 26px rgba(11, 60, 124, 0.25);
}
.lm-hero-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.lm-hero-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}
.lm-hero-title {
    font-weight: 700;
    margin-bottom: 2px;
    color: #fff;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.lm-hero-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0;
}
.lm-hero-actions .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}
.lm-hero-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}
.lm-hero-actions .btn-light {
    color: var(--primary);
    font-weight: 600;
}
@media (max-width: 575.98px) {
    .lm-hero { padding: 1.25rem; }
    .lm-hero-title { max-width: 180px; }
}

/* Toasts LMNotify (succès/erreur/avertissement/info) */
.lm-swal-toast {
    border-radius: 10px !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14) !important;
    border-left: 4px solid transparent;
}
.lm-swal-toast .swal2-title {
    font-size: 14px;
    font-weight: 600;
}
.lm-swal-toast-success { border-left-color: #198754; }
.lm-swal-toast-error { border-left-color: #dc3545; }
.lm-swal-toast-warning { border-left-color: #fd7e14; }
.lm-swal-toast-info { border-left-color: #0d6efd; }

/* Cartes tableau premium */
.lm-table-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.lm-slug-chip {
    background: var(--light, #f5f6f8);
    color: var(--body-color, #666);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.8rem;
}

/* Module Commentaires — aperçu du commentaire parent dans la modale détail */
.lm-comment-parent-preview {
    background: var(--light, #f8f9fb);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    padding: 10px 14px;
}

/* Module Catégories — pastille de couleur + sélecteur de couleur */
.lm-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--white, #fff);
}
.lm-color-dot.lm-color-none {
    background: repeating-conic-gradient(#adb5bd 0% 25%, transparent 0% 50%) 0 0 / 8px 8px;
}
.lm-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.lm-color-swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid var(--border-color, #e2e2e2);
    border-radius: 22px;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--body-color, inherit);
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
    margin-bottom: 0;
}
.lm-color-swatch:active {
    transform: scale(0.96);
}
.lm-color-swatch:hover {
    border-color: var(--primary);
}
.lm-color-swatch.is-active {
    border-color: var(--primary);
    background: var(--primary-transparent);
    font-weight: 600;
}
.lm-color-swatch .lm-color-dot {
    box-shadow: none;
}

/* Page Publicités : guide simple pour un administrateur non technique */
.lm-ads-guide {
    background: var(--primary-transparent);
}
.lm-ads-guide .card-title {
    color: var(--primary);
}
.lm-ads-steps {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}
.lm-ads-steps li {
    margin-bottom: 6px;
}
.lm-advanced-toggle {
    font-size: 0.85rem;
    color: var(--body-color, #666);
    text-decoration: none;
}
.lm-advanced-toggle:hover {
    color: var(--primary);
}
.lm-advanced-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}
.lm-advanced-toggle i {
    transition: transform 0.15s ease;
    vertical-align: middle;
}

/* Modales de confirmation (partagées avec LMNotify) */
.lm-swal-popup {
    border-radius: 14px !important;
}

/* Emplacement "décor" en attendant le contenu réel des modules. */
.lm-placeholder-card {
    border: 1px dashed var(--border-color, #e2e2e2);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted, #888);
}
.lm-placeholder-card i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    color: var(--primary);
    opacity: 0.6;
}

/* ==========================================================================
   Page de connexion — thème finance/banque, glassmorphism
   ========================================================================== */
.lm-auth-body {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
    background: radial-gradient(circle at 15% 15%, #133866 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, #0e2f57 0%, transparent 50%),
        linear-gradient(135deg, #061a33 0%, #0B3C7C 55%, #124b96 100%);
}

/* Symboles monétaires en mosaïque répétée, dispersés et animés */
.lm-auth-symbol {
    position: absolute;
    color: #fff;
    opacity: 0.09;
    pointer-events: none;
    line-height: 1;
    animation: lm-auth-float 7s ease-in-out infinite;
}
@keyframes lm-auth-float {
    0%, 100% { transform: translateY(0) rotate(var(--lm-rot, 0deg)); }
    50% { transform: translateY(-12px) rotate(var(--lm-rot, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
    .lm-auth-symbol {
        animation: none !important;
    }
}

.lm-auth-bank {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    opacity: 0.08;
    font-size: 220px;
    line-height: 1;
    pointer-events: none;
}
@media (max-width: 767.98px) {
    .lm-auth-bank { font-size: 150px; }
}

.lm-auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 410px;
}
.lm-auth-card {
    position: relative;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    border-top: 4px solid #FFC300;
    box-shadow: 0 25px 60px rgba(2, 12, 27, 0.45);
    padding: 2.5rem 2.25rem 2.25rem;
    animation: lm-auth-card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes lm-auth-card-in {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .lm-auth-card { animation: none; }
}
.lm-auth-logo {
    font-size: 26px;
}
.lm-auth-logo .lm-logo-img {
    margin: 0 auto;
}
.lm-auth-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
}
.lm-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-transparent);
    border-radius: 20px;
    padding: 5px 14px;
    margin-top: 0.75rem;
}
#password {
    padding-right: 32px;
}
.lm-auth-toggle-password {
    border: 0;
    background: transparent;
    color: var(--text-muted, #888);
    pointer-events: auto;
    cursor: pointer;
}

/* ==========================================================================
   Module Articles — cartes KPI, filtres, tableau premium
   ========================================================================== */

.lm-kpi-row {
    margin-bottom: 1.25rem;
}
.lm-kpi-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.lm-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.lm-kpi-card .card-body {
    padding: 1.25rem;
}
.lm-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}
.lm-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
}
.lm-kpi-label {
    font-size: 0.8rem;
    color: var(--body-color, #888);
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.lm-kpi-neutral .lm-kpi-icon { background: var(--primary-transparent); color: var(--primary); }
.lm-kpi-success .lm-kpi-icon { background: rgba(25, 135, 84, 0.12); color: #198754; }
.lm-kpi-secondary .lm-kpi-icon { background: rgba(108, 117, 125, 0.14); color: #6c757d; }
.lm-kpi-warning .lm-kpi-icon { background: rgba(253, 126, 20, 0.16); color: #b35900; }
.lm-kpi-dark .lm-kpi-icon { background: rgba(33, 37, 41, 0.14); color: #495057; }
.lm-kpi-info .lm-kpi-icon { background: rgba(13, 202, 240, 0.14); color: #0aa9c4; }

.lm-kpi-neutral { --lm-card-accent: #0B3C7C; }
.lm-kpi-success { --lm-card-accent: #198754; }
.lm-kpi-secondary { --lm-card-accent: #6c757d; }
.lm-kpi-warning { --lm-card-accent: #fd7e14; }
.lm-kpi-dark { --lm-card-accent: #212529; }
.lm-kpi-info { --lm-card-accent: #0dcaf0; }

.lm-filters-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.25rem;
}
.lm-filters-card .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--body-color, #888);
    margin-bottom: 4px;
}

.lm-article-row {
    transition: background-color 0.15s ease;
}
.lm-thumb {
    display: block;
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--light, #f1f1f1);
}
.lm-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lm-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--body-color, #bbb);
    font-size: 22px;
}
.lm-article-link:hover .lm-article-title {
    color: var(--primary);
    text-decoration: underline;
}
.lm-article-title {
    transition: color 0.15s ease;
}
.lm-article-excerpt {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.lm-star-btn {
    transition: transform 0.15s ease, color 0.15s ease;
}
.lm-star-btn:hover {
    transform: scale(1.2);
    color: #ffc107 !important;
}

.lm-avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
}
.lm-avatar-sm {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}
.lm-avatar-md {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

@media (max-width: 767.98px) {
    .lm-kpi-value { font-size: 1.2rem; }
    .lm-article-excerpt { max-width: 180px; }
}

/* Formulaire article : aperçu Google + aperçu image de couverture */
.lm-google-preview {
    border: 1px solid var(--border-color, #e2e2e2);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--light, #f8f9fa);
    font-family: arial, sans-serif;
}
.lm-google-preview-url {
    color: #5f6a72;
    font-size: 0.8rem;
}
.lm-google-preview-title {
    color: #1a0dab;
    font-size: 1.1rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.lm-google-preview-desc {
    color: #4d5156;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lm-cover-preview {
    border-radius: 10px;
    overflow: hidden;
    background: var(--light, #f1f1f1);
}

.lm-banner-preview {
    border-radius: 10px;
    overflow: hidden;
    background: var(--light, #f1f1f1);
    border: 1px dashed var(--border-color, #e2e2e2);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lm-banner-preview img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    display: block;
}
.lm-banner-preview-empty {
    color: var(--body-color, #999);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 1.5rem;
}
.lm-banner-preview-empty i {
    font-size: 1.75rem;
}
.lm-cover-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* Rendu du corps d'article (page détail) */
.lm-article-body {
    line-height: 1.75;
    font-size: 1rem;
}
.lm-article-body img {
    max-width: 100%;
    border-radius: 8px;
}
.lm-article-body h2, .lm-article-body h3 {
    margin-top: 1.5rem;
}

/* ==========================================================================
   Tableau de bord — graphique de tendance des vues, barres de répartition
   ========================================================================== */

.lm-chart-card .card-body {
    padding: 1.25rem 1.25rem 0.5rem;
}
.lm-chart-wrap {
    position: relative;
}
.lm-chart-svg {
    width: 100%;
    height: 240px;
    display: block;
    overflow: visible;
}
.lm-chart-grid {
    stroke: var(--border-color, #eef0f2);
    stroke-width: 1;
}
.lm-chart-axis-label {
    fill: var(--body-color, #888);
    font-size: 11px;
    font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.lm-chart-area {
    fill: var(--primary);
    opacity: 0.1;
    stroke: none;
}
.lm-chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.lm-chart-end-dot {
    fill: var(--primary);
    stroke: var(--white, #fff);
    stroke-width: 2;
}
.lm-chart-crosshair {
    stroke: var(--body-color, #999);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    transition: opacity 0.1s ease;
    pointer-events: none;
}
.lm-chart-hover-dot {
    fill: var(--primary);
    stroke: var(--white, #fff);
    stroke-width: 2;
    transition: opacity 0.1s ease;
    pointer-events: none;
}
.lm-chart-hit {
    cursor: crosshair;
}
.lm-chart-tooltip {
    position: absolute;
    transform: translate(-50%, -115%);
    background: #061a33;
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.1s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    z-index: 5;
}
.lm-chart-tooltip-date {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.7rem;
}
.lm-chart-tooltip-value {
    display: block;
    font-weight: 700;
}

.lm-bar-track {
    height: 8px;
    border-radius: 4px;
    background: var(--light, #f1f1f1);
    overflow: hidden;
}
.lm-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--primary);
    transition: width 0.4s ease;
}

.min-w-0 {
    min-width: 0;
}

.lm-tag-chip {
    cursor: pointer;
    border: none;
    font-size: 12.5px;
    padding: 6px 12px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.lm-tag-chip:hover {
    filter: brightness(0.95);
}

/* Logo Largess Mag (remplace le wordmark texte). */
.lm-logo-link {
    display: inline-block;
}
.lm-logo-img {
    width: 130px;
    height: auto;
    display: block;
}
.lm-logo-img--small {
    width: 36px;
    height: 36px;
    object-fit: cover;
    object-position: left center;
    border-radius: 4px;
}
