/* ==========================================================================
   CRM LS — styles propres à l'application
   Tout ce qui est faisable en classes Tailwind reste dans les vues ; on ne
   descend ici que pour ce que Tailwind ne couvre pas (Quill, transitions du
   menu, impression).
   ========================================================================== */

[x-cloak] { display: none !important; }

/* Menu latéral : glissement sur mobile */
#sidebar { transition: transform 0.2s ease-in-out; }

/* --------------------------------------------------------------------------
   Éditeur d'emails (Quill)
   -------------------------------------------------------------------------- */
.ql-container { min-height: 180px; font-size: 0.95rem; }

/* Police avec fallback emoji : les emojis gardent la taille du texte, sur la meme ligne. */
.ql-editor {
    min-height: 180px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
                 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}

/* Filet de securite : une image restee dans le corps ne doit pas casser la ligne. */
.ql-editor img { max-width: 100%; height: auto; vertical-align: middle; }

/* Selecteur d'emojis de la barre d'outils */
.ql-toolbar button.ql-emoji { font-size: 15px; line-height: 1; }
.ls-emoji-panel {
    position: absolute; z-index: 60; width: 296px; max-height: 264px; overflow-y: auto;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,.14); padding: 8px;
}
.ls-emoji-title { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #9ca3af; margin: 6px 2px 4px; }
.ls-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ls-emoji-btn {
    font-size: 19px; line-height: 1; padding: 4px 0; border: 0; border-radius: 6px;
    background: none; cursor: pointer;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.ls-emoji-btn:hover { background: #f3f4f6; }
.ls-emoji-panel.hidden { display: none; }

/* --------------------------------------------------------------------------
   Rendu Markdown (App\Core\Markdown)

   Tailwind remet à zéro les listes et les titres : tout ce que le convertisseur
   produit doit donc être restylé ici. Le même jeu de règles est repris, en
   version simplifiée, dans le gabarit PDF du compte rendu.
   -------------------------------------------------------------------------- */
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 .5em; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
    font-weight: 600; line-height: 1.3; margin: .9em 0 .35em; color: #111827;
}
.md h1 { font-size: 1.25em; }
.md h2 { font-size: 1.15em; }
.md h3 { font-size: 1.05em; }
.md h4, .md h5, .md h6 { font-size: 1em; }
.md ul, .md ol { margin: .35em 0 .6em; padding-left: 1.35em; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin: .15em 0; }
.md li > ul, .md li > ol { margin: .15em 0; }
.md li.md-task { list-style: none; margin-left: -1.2em; }
.md .md-box { color: #0d9488; }
.md .md-done { color: #6b7280; text-decoration: line-through; }
.md a { color: #0d9488; text-decoration: underline; }
.md a:hover { color: #0f766e; }
.md strong { font-weight: 600; }
.md em { font-style: italic; }
.md del { text-decoration: line-through; color: #6b7280; }
.md code.md-code {
    background: #f3f4f6; border-radius: 4px; padding: .1em .35em; font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.md pre.md-pre {
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: .6em .75em; overflow-x: auto; margin: .5em 0;
}
.md pre.md-pre code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em;
}
.md blockquote {
    border-left: 3px solid #d1d5db; padding-left: .75em; margin: .5em 0; color: #4b5563;
}
.md hr { border: 0; border-top: 1px solid #e5e7eb; margin: .8em 0; }
.md table.md-table { border-collapse: collapse; width: 100%; margin: .5em 0; font-size: .95em; }
.md table.md-table th, .md table.md-table td {
    border: 1px solid #e5e7eb; padding: .3em .5em; text-align: left; vertical-align: top;
}
.md table.md-table th { background: #f9fafb; font-weight: 600; }

/* --------------------------------------------------------------------------
   Confort mobile
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    /* iOS zoome sur un champ dont la police fait moins de 16px. */
    input, select, textarea { font-size: 16px !important; }
}

/* --------------------------------------------------------------------------
   Impression : le menu et les barres d'action n'ont rien à faire sur papier.
   -------------------------------------------------------------------------- */
@media print {
    #sidebar, #sidebar-overlay, .no-print { display: none !important; }
    main { margin-left: 0 !important; }
}
