/* Contact et tickets (contact.php, mes_tickets.php, ticket.php, admin_tickets.php, admin_ticket.php)
   À charger après style.css, categories.css et paiement.css. Reprend les variables de theme.css si elles existent. */

.tk { --tk-carte: var(--carte, #ffffff); --tk-bord: var(--bord, #c9ced7); --tk-texte: var(--texte, #111827);
      --tk-doux: var(--texte-doux, #4b5563); --tk-accent: var(--accent, #1f63d6); --tk-accent-hover: var(--accent-hover, #174fb0);
      --tk-accent-doux: var(--accent-doux, rgba(31, 99, 214, 0.08)); }
.tk * { box-sizing: border-box; }

.tk-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 4px; }
.tk-entete .section-titre { margin: 0; }

/* Cartes et textes */
.tk-carte { background: var(--tk-carte); color: var(--tk-texte); border: 1px solid var(--tk-bord); border-radius: 14px;
            padding: 18px 20px; margin-bottom: 16px; }
.tk-carte h3 { margin: 0 0 6px; font-size: 1.05rem; }
.tk-carte p { margin: 0 0 12px; color: var(--tk-doux); }
.tk-carte p:last-child { margin-bottom: 0; }
.tk-centre { text-align: center; }
.tk-detail { display: block; font-size: 0.78rem; color: var(--tk-doux); line-height: 1.5; }
.tk-petit { font-size: 0.8rem; color: var(--tk-doux); line-height: 1.55; }
.tk-vide { color: var(--tk-doux); padding: 20px 0; }

/* Mise en page formulaire + aide */
.tk-grille { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tk-grille-admin { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.tk-aside { background: var(--tk-carte); color: var(--tk-texte); border: 1px solid var(--tk-bord); border-radius: 14px; padding: 18px 20px; }
.tk-aside h3 { margin: 0 0 8px; font-size: 1rem; }
.tk-aside h3:not(:first-child) { margin-top: 18px; }
.tk-aside ol { margin: 0 0 14px; padding-left: 1.2rem; font-size: 0.85rem; line-height: 1.6; color: var(--tk-doux); }
.tk-aside p { margin: 0 0 10px; font-size: 0.85rem; }
.tk-aside a { color: var(--tk-accent); }

/* Formulaires */
.tk-form { display: flex; flex-direction: column; gap: 6px; background: var(--tk-carte); color: var(--tk-texte);
           border: 1px solid var(--tk-bord); border-radius: 14px; padding: 20px; }
.tk-form label { margin-top: 8px; font-size: 0.8rem; font-weight: 600; color: var(--tk-doux); }
.tk-form label small { font-weight: 400; }
.tk-form input[type="text"], .tk-form select, .tk-form textarea {
    width: 100%; padding: 11px 13px; font: inherit; font-size: 0.92rem; color: var(--tk-texte);
    background: #fff; border: 1px solid var(--tk-bord); border-radius: 8px; }
.tk-form textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.tk-form input:focus, .tk-form select:focus, .tk-form textarea:focus {
    border-color: var(--tk-accent); outline: 2px solid var(--tk-accent-doux); }
.tk-form .btn-orange { margin-top: 10px; }
.tk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 6px; }
.tk-choix { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 4px; }
.tk-choix label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; cursor: pointer; }

.tk-btn { font: inherit; font-size: 0.82rem; padding: 10px 16px; border: 0; border-radius: 8px; cursor: pointer;
          background: var(--tk-accent); color: #fff; font-weight: 600; }
.tk-btn:hover { background: var(--tk-accent-hover); }
.tk-lien { background: none; border: 0; padding: 0; font: inherit; font-size: 0.82rem; color: var(--tk-doux);
           text-decoration: underline; cursor: pointer; }
.tk-lien:hover { color: var(--tk-texte); }

/* Fil de discussion */
.tk-fil { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; margin-bottom: 16px;
          padding: 16px; background: var(--tk-carte); border: 1px solid var(--tk-bord); border-radius: 14px; }
.tk-msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; background: #eef0f4; color: var(--tk-texte);
          border-top-left-radius: 4px; align-self: flex-start; }
.tk-msg.moi { align-self: flex-end; background: var(--tk-accent-doux); border: 1px solid var(--tk-accent);
              border-top-left-radius: 14px; border-top-right-radius: 4px; }
.tk-msg.note { background: #fff8e1; border: 1px dashed #d8b13a; }
.tk-msg-tete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; margin-bottom: 4px; font-size: 0.74rem; }
.tk-msg-tete time { color: var(--tk-doux); }
.tk-msg-corps { font-size: 0.9rem; line-height: 1.55; overflow-wrap: anywhere; }

/* Liste */
.tk-liste { display: flex; flex-direction: column; gap: 10px; }
.tk-ligne { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px;
            background: var(--tk-carte); color: var(--tk-texte); border: 1px solid var(--tk-bord); border-radius: 12px;
            text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.tk-ligne:hover { border-color: var(--tk-accent); box-shadow: 0 2px 10px rgba(17, 24, 39, 0.08); }
.tk-ligne.ferme { opacity: 0.7; }
.tk-ligne-texte { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tk-ligne-texte strong { overflow-wrap: anywhere; }
.tk-point { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #e0493e; }

/* Pastilles de statut */
.tk-statut { display: inline-block; flex-shrink: 0; padding: 3px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.tk-statut.ouvert  { background: #fff3cd; color: #7a5b00; }
.tk-statut.repondu { background: #d6e9ff; color: #0b3d75; }
.tk-statut.ferme   { background: #e5e7eb; color: #374151; }

/* Onglets, recherche, pagination (admin) */
.tk-onglets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tk-onglet { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--tk-bord);
             border-radius: 999px; color: var(--tk-texte); background: var(--tk-carte); text-decoration: none; font-size: 0.82rem; }
.tk-onglet:hover { border-color: var(--tk-accent); }
.tk-onglet b { background: #e5e7eb; border-radius: 999px; padding: 1px 8px; font-size: 0.72rem; }
.tk-onglet.actif { background: var(--tk-accent); border-color: var(--tk-accent); color: #fff; }
.tk-onglet.actif b { background: rgba(255, 255, 255, 0.25); color: #fff; }
.tk-onglet.alerte:not(.actif) b { background: #e0493e; color: #fff; }

.tk-recherche { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.tk-recherche input[type="search"] { flex: 1 1 260px; padding: 10px 13px; font: inherit; font-size: 0.88rem; color: var(--tk-texte);
                                     background: #fff; border: 1px solid var(--tk-bord); border-radius: 8px; }
.tk-recherche input[type="search"]:focus { border-color: var(--tk-accent); outline: 2px solid var(--tk-accent-doux); }

.tk-pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; font-size: 0.85rem; }
.tk-pagination a { color: var(--tk-accent); text-decoration: none; }
.tk-pagination a:hover { text-decoration: underline; }

@media (max-width: 900px) {
    .tk-grille, .tk-grille-admin { grid-template-columns: 1fr; }
    .tk-msg { max-width: 94%; }
    .tk-ligne { flex-direction: column; align-items: flex-start; gap: 10px; }
    .tk-fil { max-height: 55vh; }
}
