/* ============================================
   SKOTA — palette teal/mint (refonte design)
   ============================================ */
:root {
    /* Couleurs SKOTA */
    --skota-mint-100: #f0f9f5;     /* fond très clair */
    --skota-mint-200: #e1f0e9;     /* fond pastilles compteur */
    --skota-mint-300: #c8e3d6;     /* bordures soft */
    --skota-mint-400: #93c4ae;     /* accents */
    --skota-teal-500: #2d8474;     /* primary médium */
    --skota-teal-600: #1f6b5b;     /* primary fort */
    --skota-teal-700: #155244;     /* foncé hover */
    --skota-ink: #0e1d1b;          /* texte titre */
    --skota-ink-soft: #38484a;     /* texte body */

    /* Override Bootstrap */
    --bs-primary: #1f6b5b;
    --bs-primary-rgb: 31, 107, 91;
    --bs-link-color: #1f6b5b;
    --bs-link-color-rgb: 31, 107, 91;
    --bs-link-hover-color: #155244;
    --bs-link-hover-color-rgb: 21, 82, 68;
    --bs-body-color: #1f2937;
    --bs-body-bg: transparent;
}

/* ============================================
   Body — Inter, gradient mint, hiérarchie premium
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(180deg, #e8f4ef 0%, #f1f9f5 60%, #f7fbf9 100%);
    background-attachment: fixed;
    color: var(--skota-ink-soft);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    min-height: 100dvh; /* évite le saut lié à la barre d'URL mobile ; ≈ 100vh sur desktop */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--skota-ink);
    font-family: inherit;
    letter-spacing: -0.3px;
    font-weight: 700;
}
h1 { font-size: 2rem;    letter-spacing: -0.7px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 1.5rem;  letter-spacing: -0.5px; font-weight: 800; line-height: 1.2; }
h3 { font-size: 1.25rem; letter-spacing: -0.3px; font-weight: 700; line-height: 1.25; }
h4 { font-size: 1.125rem; font-weight: 700; }

/* Classes de taille (façon Bootstrap), surtout pour les grands chiffres de
   stats posés sur des <div> (couts, food, permis feu). Elles l'emportent sur
   Bootstrap par l'ordre de chargement de style.css — aucun !important requis. */
.h1 { font-size: 2rem;     letter-spacing: -0.7px; font-weight: 800; }
.h3 { font-size: 1.875rem; letter-spacing: -0.5px; font-weight: 800; }
.h4 { font-size: 1.5rem;   letter-spacing: -0.3px; font-weight: 700; }

/* ============================================
   Titres de page uniformes
   --------------------------------------------
   Dans les pages applicatives (<main class="container">), tous les <h1> de
   titre partagent le même rendu : 2rem, graisse 500 (parti pris « titre léger
   premium », réf. « Factures »), quelle que soit la classe de taille héritée
   (.h2/.h3/.h4…). La spécificité de « main.container h1.hN » (0,2,2) bat les
   classes .hN (0,1,0) : plus aucun !important n'est nécessaire.

   Portée limitée à main.container à dessein : la page de login (main.login-main)
   n'est PAS concernée et conserve son propre .login-title.
   Les <div class="h3"> (chiffres de stats) ne matchent pas ces sélecteurs
   (ancrés sur l'élément h1) et gardent donc leur taille de classe.
   ============================================ */
main.container h1,
main.container h1.h1, main.container h1.h2, main.container h1.h3,
main.container h1.h4, main.container h1.h5, main.container h1.h6 {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.7px;
    line-height: 1.2;
    color: var(--skota-ink);
}
/* Les compteurs/annotations en gris dans un titre gardent leur graisse normale
   via l'utilitaire Bootstrap .fw-normal (déjà en !important) — rien à ajouter. */

.text-muted {
    /* #4f6d66 : AA (>=4.5:1) aussi bien sur blanc que sur le fond mint */
    color: #4f6d66 !important;
}
.text-muted.small,
.small {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ============================================
   Navbar — transparente
   ============================================ */
.navbar-skota {
    background: transparent !important;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.navbar-skota .nav-link {
    /* teal-600 (et non 500) : AA sur le fond mint — teal-500 tombait à ~4.1:1 */
    color: var(--skota-teal-600) !important;
    font-weight: 600;
    font-size: 0.9375rem;
    padding-left: 14px !important;
    padding-right: 14px !important;
}
.navbar-skota .nav-link:hover {
    color: var(--skota-teal-700) !important;
}
.navbar-skota .nav-link.active {
    color: var(--skota-ink) !important;
}
/* Pas de carré bleu au clic : on retire l'anneau de focus par défaut… */
.navbar-skota .nav-link:focus {
    box-shadow: none;
    outline: none;
}
/* …mais on garde un focus discret en teal pour la navigation au clavier (a11y). */
.navbar-skota .nav-link:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(45, 132, 116, 0.25);
    border-radius: 8px;
    outline: none;
}

.navbar-skota .navbar-toggler {
    border-color: var(--skota-mint-300);
}
.navbar-skota .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231f6b5b' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   Logo SKOTA — wordmark sans pilule, dark
   ============================================ */
.skota-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-right: 1.5rem;
}

/* Mark SKOTA (pictogramme monoligne encre, sans cadre) accolé au wordmark.
   Distinct de l'icône PWA carrée conservée telle quelle (assets/icons/icon.svg). */
.skota-logo {
    width: 34px;
    height: 34px;
    display: block;
    flex-shrink: 0;
    transition: opacity .15s ease;
}
.skota-brand:hover .skota-logo { opacity: 0.85; }

.skota-pill {
    background: transparent;
    color: var(--skota-ink);
    padding: 0;
    border-radius: 0;
    /* Wordmark en Inter (police de l'app) au lieu de Verdana : plus moderne
       et cohérent avec le reste. inherit reprend la stack Inter du body. */
    font-family: inherit;
    font-weight: 800;
    font-size: 1.7rem;
    letter-spacing: 0.3px;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: none;
    transition: opacity .15s ease;
}
.skota-brand:hover .skota-pill { opacity: 0.85; }

/* ============================================
   Cartes — blanches, ombre douce
   ============================================ */
.card {
    border: 1px solid var(--skota-mint-300);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 50, 45, 0.04);
}
.card-header {
    background: #ffffff !important;
    border-bottom: 1px solid var(--skota-mint-300);
    font-weight: 600;
    color: var(--skota-ink);
}

/* Cartes statistiques (dashboard) */
.card.shadow-sm { box-shadow: 0 1px 3px rgba(15, 50, 45, 0.04) !important; }

/* ============================================
   Étiquette « tag-type » sur cartes appareils
   ============================================ */
.tag-type {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--skota-teal-500);
    margin-bottom: 6px;
}

/* Titres de cartes appareils plus généreux */
.card-title {
    font-size: 1.125rem !important;
    font-weight: 700;
    color: var(--skota-ink);
    line-height: 1.25;
    letter-spacing: -0.2px;
}

/* Cartes d'appareils */
.card-device {
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    border: 1px solid var(--skota-mint-300);
}
.card-device:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 107, 91, 0.10);
    border-color: var(--skota-mint-400);
}

/* Pastille SVG type d'appareil */
.device-icon-wrap {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e1f0e9 0%, #cfe5d9 100%);
    border-radius: 12px;
    color: var(--skota-teal-600);
    transition: transform .15s ease, box-shadow .15s ease;
}
.card-device:hover .device-icon-wrap {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(31, 107, 91, 0.18);
}
.type-icon { display: block; }

/* ============================================
   Filtres par type — pastilles
   ============================================ */
.type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    color: var(--skota-ink);
    border: 1px solid var(--skota-mint-300);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(15, 50, 45, 0.04);
    transition: transform .08s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
    user-select: none;
    white-space: nowrap;
}
.type-pill:hover {
    background-color: var(--skota-mint-100);
    border-color: var(--skota-mint-400);
    color: var(--skota-teal-700);
    box-shadow: 0 2px 6px rgba(31, 107, 91, 0.10);
    transform: translateY(-1px);
}
.type-pill .type-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background-color: var(--skota-mint-200);
    color: var(--skota-teal-600);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.type-pill i {
    color: var(--skota-teal-500);
    font-size: 0.95rem;
}

/* État actif */
.type-pill-active,
.type-pill-active:hover {
    background-color: var(--skota-teal-600);
    border-color: var(--skota-teal-600);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(31, 107, 91, 0.30);
    transform: none;
}
.type-pill-active i { color: #ffffff; }
.type-pill-active .type-pill-count {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Sous-filtres (sous-catégorie déployée) */
.type-subfilters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding-left: 8px;
    margin-top: 6px;
}
.type-subfilters-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--skota-teal-500);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.type-subfilters-label i { font-size: 0.95rem; }

.type-pill-sub {
    padding: 5px 12px;
    font-size: 0.825rem;
    background-color: #f5fbf8;
    border-color: var(--skota-mint-200);
}
.type-pill-sub.type-pill-active,
.type-pill-sub.type-pill-active:hover {
    background-color: var(--skota-teal-500);
    border-color: var(--skota-teal-500);
    box-shadow: 0 3px 8px rgba(45, 132, 116, 0.25);
}

/* ============================================
   Boutons — palette teal
   ============================================ */
.btn-primary {
    background-color: var(--skota-teal-600);
    border-color: var(--skota-teal-600);
    color: #ffffff;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--skota-teal-700);
    border-color: var(--skota-teal-700);
    color: #ffffff;
}

.btn-outline-primary {
    background-color: #ffffff;
    border-color: var(--skota-mint-300);
    color: var(--skota-teal-600);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--skota-mint-100);
    border-color: var(--skota-teal-500);
    color: var(--skota-teal-700);
}

.btn-outline-secondary {
    border-color: var(--skota-mint-300);
    color: var(--skota-ink-soft);
}
.btn-outline-secondary:hover {
    background-color: var(--skota-mint-100);
    color: var(--skota-ink);
    border-color: var(--skota-mint-400);
}

/* Liens */
a { color: var(--skota-teal-600); }
a:hover { color: var(--skota-teal-700); }

/* Badges Bootstrap teintés */
.badge.bg-primary { background-color: var(--skota-teal-600) !important; }
.badge.bg-primary-subtle { background-color: var(--skota-mint-200) !important; }
.text-primary { color: var(--skota-teal-600) !important; }
.text-info { color: var(--skota-teal-500) !important; }

/* ============================================
   Harmonisation SKOTA — neutralise le bleu Bootstrap résiduel.
   Certains composants figent la couleur « primary » (#0d6efd) à la
   compilation et n'héritent donc PAS de --bs-primary : on force le teal
   via leurs variables de composant (Bootstrap 5.3), sans !important.
   Les utilitaires sémantiques (.bg-success, .bg-danger…) restent prioritaires.
   ============================================ */
.nav-pills {
    --bs-nav-pills-link-active-bg: var(--skota-teal-600);
    --bs-nav-pills-link-active-color: #ffffff;
}
.nav-tabs { --bs-nav-tabs-link-active-color: var(--skota-teal-700); }
.list-group {
    --bs-list-group-active-bg: var(--skota-teal-600);
    --bs-list-group-active-border-color: var(--skota-teal-600);
}
.pagination {
    --bs-pagination-color: var(--skota-teal-600);
    --bs-pagination-hover-color: var(--skota-teal-700);
    --bs-pagination-active-bg: var(--skota-teal-600);
    --bs-pagination-active-border-color: var(--skota-teal-600);
}
.progress { --bs-progress-bar-bg: var(--skota-teal-600); }
.form-check-input:checked {
    background-color: var(--skota-teal-600);
    border-color: var(--skota-teal-600);
}
.form-check-input:focus {
    border-color: var(--skota-mint-400);
    box-shadow: 0 0 0 0.2rem rgba(45, 132, 116, 0.20);
}

/* Alertes douces */
.alert { border: none; border-radius: 12px; }
.alert-info {
    background-color: var(--skota-mint-200);
    color: var(--skota-teal-700);
}

/* Inputs et form */
.form-control,
.form-select {
    font-family: inherit;
    font-size: 0.9375rem;
    border-color: #d6e2dd;
    /* Padding droit élargi pour réserver la place de la flèche native
       (sinon elle chevauche le texte, surtout sur les select w-auto). */
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--skota-teal-500);
    box-shadow: 0 0 0 0.2rem rgba(45, 132, 116, 0.15);
}
.input-group-text { background-color: #ffffff; border-color: #d6e2dd; }

/* Champs de la barre de filtres dashboard — fond blanc pur pour
   un maximum de contraste avec le gradient mint de la page. */
.filter-form .form-control,
.filter-form .form-select,
.filter-form .input-group-text {
    background-color: #ffffff;
    border-color: #b9d3c6;
    box-shadow: 0 1px 3px rgba(15, 50, 45, 0.08);
}
.filter-form .form-control:focus,
.filter-form .form-select:focus {
    background-color: #ffffff;
    border-color: var(--skota-teal-500);
    box-shadow: 0 0 0 0.2rem rgba(45, 132, 116, 0.15);
}
.filter-form .input-group-text {
    border-right: 0;
}
.filter-form .input-group .form-control {
    border-left: 0;
}

/* Espacement custom mb-6 (Bootstrap s'arrête à mb-5 = 3rem) */
.mb-6 { margin-bottom: 4.5rem !important; }

/* Pastille de comptage à l'intérieur d'un <select> (à droite, avant la flèche) */
.select-with-counter {
    position: relative;
}
.select-with-counter .form-select {
    padding-right: 4rem;        /* laisse de la place pour la pastille + flèche */
}
.select-counter {
    position: absolute;
    right: 2.4rem;              /* avant la flèche native du <select> */
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--skota-mint-200);
    color: var(--skota-teal-700);
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
    user-select: none;
}
.form-label {
    font-weight: 600;
    color: var(--skota-ink);
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

/* Boutons : tailles plus généreuses */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    transition: all .15s ease;
}
.btn-sm {
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
}
.btn-lg { font-size: 1.0625rem; padding: 0.7rem 1.5rem; }

/* Card-body padding plus généreux */
.card-body { padding: 1.25rem 1.4rem; }
.card-header { padding: 0.9rem 1.25rem; font-size: 0.95rem; }

/* Date prochaine intervention sur la stat card */
.next-date {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--skota-ink);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* Sous-lignes des tables admin_zones / admin_types (zones et types enfants) */
.sub-row,
.sub-zone-row { background-color: #f5fbf8; }
.sub-row td:first-child,
.sub-zone-row td:first-child { padding-left: 1.8rem; }

/* Stats cards — titre cliquable, sans soulignement nulle part */
.stat-card-link,
.stat-card-link:hover,
.stat-card-link:focus,
.stat-card-link *,
.stat-card-link:hover * {
    text-decoration: none !important;
}
.stat-card-link {
    display: block;
    color: inherit;
    transition: transform .12s ease;
}
.stat-card-link:hover { transform: translateY(-2px); color: inherit; }
.stat-card-link:hover .card { border-color: var(--skota-mint-400); box-shadow: 0 6px 18px rgba(31, 107, 91, 0.10); }
.stat-card-link:hover .stat-title { color: var(--skota-teal-700); }

.stat-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--skota-teal-600);
    letter-spacing: -0.3px;
    margin-bottom: 0.6rem;
    line-height: 1.2;
    transition: color .12s ease;
}
.stat-value {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--skota-ink);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 0;
}

/* ============================================
   Dashboard — tuile « Activité en cours »
   Fonds teintés par statut + pastilles pleines.
   Couleurs de texte validées WCAG AA (>= 4.5:1).
   ============================================ */
.activity-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}
.activity-head-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--skota-teal-700);
}
.activity-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
    background: #fbeecb;
    color: #6f4f0e;
}
.activity-count--ok { background: var(--skota-mint-200); color: var(--skota-teal-700); }

.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease;
}
.activity-row:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(15, 50, 45, 0.09); }
.activity-row--progress { background: #fdf6e3; border-color: #f0e3b3; }
.activity-row--done     { background: #e9f6ee; border-color: #cde8d7; }

.activity-title { font-weight: 700; font-size: 1.05rem; color: var(--skota-ink); line-height: 1.25; }
.activity-sub   { font-size: 0.9rem; color: #55655f; margin-top: 2px; }
.activity-meta  { font-size: 0.8125rem; margin-top: 6px; }
.activity-meta--progress { color: #8a6a2f; }
.activity-meta--done     { color: #17604e; }

.activity-right { flex-shrink: 0; }
.activity-pill {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}
.activity-pill--progress { background: #946011; }
.activity-pill--done     { background: var(--skota-teal-600); }

/* ============================================
   Dashboard — listes rapides (Tâches à faire / Commande)
   Ajout via le champ en tête, suppression via le bouton ✓.
   ============================================ */
.quick-list { display: flex; flex-direction: column; }
.quick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--skota-mint-200);
}
.quick-item:last-child { border-bottom: 0; }
.quick-text {
    font-size: 0.95rem;
    color: var(--skota-ink);
    line-height: 1.3;
    word-break: break-word;
}
.quick-del {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #cde8d7;
    background: #e9f6ee;
    color: var(--skota-teal-700);
    border-radius: 9px;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.quick-del:hover { background: var(--skota-teal-600); color: #ffffff; }

/* Sous-bandeau (alerte mauvais état) sous la carte Appareils */
.stat-card-with-sub { overflow: hidden; }
.stat-sub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 1.4rem;
    background-color: #fdebea;
    color: #b53236;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border-top: 1px solid #f0d2d2;
    transition: background-color .12s ease;
}
.stat-sub-link:hover {
    background-color: #fbdcd9;
    color: #921e22;
    text-decoration: none;
}
.stat-sub-link i { font-size: 1rem; }
.stat-sub-link-ok {
    background-color: #e6f4e9;
    color: #1f6b3a;
    border-top: 1px solid #c8e3d2;
    cursor: default;
}
.stat-sub-link-ok:hover { background-color: #e6f4e9; color: #1f6b3a; }

/* ============================================
   Coordonnées principales (page prestataire)
   ============================================ */
.coord-link {
    color: var(--skota-ink);
    text-decoration: none;
    word-break: break-word;
}
.coord-link:hover {
    color: var(--skota-teal-600);
    text-decoration: underline;
}

/* ============================================
   Cartes de contact (prestataire & appareil)
   ============================================ */
.contact-cell {
    border-top: 1px solid var(--skota-mint-200);
    border-right: 1px solid var(--skota-mint-200);
}
.contact-cell:nth-child(2n) { border-right: none; }
@media (max-width: 768px) {
    .contact-cell { border-right: none; }
}

.contact-card {
    padding: 14px 16px;
    height: 100%;
    transition: background-color .12s ease;
}
.contact-card:hover { background-color: var(--skota-mint-100); }

.contact-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.contact-header i.bi-person-circle {
    font-size: 1.7rem;
    color: var(--skota-teal-500);
    line-height: 1;
}

.contact-name {
    font-weight: 700;
    color: var(--skota-ink);
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: -0.1px;
}

.contact-role {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--skota-teal-500);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 3px;
}

.contact-coords {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-left: 40px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--skota-ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 3px 0;
    word-break: break-all;
}
.contact-link i { color: var(--skota-teal-500); flex-shrink: 0; }
.contact-link:hover { color: var(--skota-teal-600); text-decoration: underline; }

/* ============================================
   Annuaire de contacts (onglet « Contacts »)
   Carnet d'adresses épuré, façon iPhone.
   ============================================ */
.annuaire { overflow: hidden; }

.annuaire-search {
    position: relative;
    padding: 14px 16px;
    border-bottom: 1px solid var(--skota-mint-200);
}
.annuaire-search i {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--skota-mint-400);
    pointer-events: none;
}
.annuaire-search input {
    padding-left: 38px;
    border-radius: 999px;
    background-color: var(--skota-mint-100);
    border-color: transparent;
}
.annuaire-search input:focus {
    background-color: #fff;
    border-color: var(--skota-mint-400);
    box-shadow: none;
}

.annuaire-letter {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 4px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--skota-teal-600);
    background-color: var(--skota-mint-100);
    border-bottom: 1px solid var(--skota-mint-200);
}

.annuaire-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--skota-mint-200);
    transition: background-color .12s ease;
}
.annuaire-item:hover { background-color: var(--skota-mint-100); }
.annuaire-group:last-child .annuaire-item:last-child { border-bottom: none; }

.annuaire-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, var(--skota-teal-500), var(--skota-teal-600));
    letter-spacing: 0.3px;
}
.annuaire-avatar.is-societe {
    background: var(--skota-mint-200);
    color: var(--skota-teal-600);
    font-size: 1.1rem;
}

.annuaire-info {
    flex-grow: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.annuaire-name {
    font-weight: 600;
    color: var(--skota-ink);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.annuaire-sub {
    font-size: 0.8125rem;
    color: var(--skota-ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.annuaire-info:hover .annuaire-name { color: var(--skota-teal-600); }

.annuaire-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
.annuaire-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--skota-teal-600);
    background-color: var(--skota-mint-100);
    border: 1px solid var(--skota-mint-200);
    text-decoration: none;
    transition: background-color .12s ease, color .12s ease;
}
.annuaire-btn:hover {
    background-color: var(--skota-teal-500);
    border-color: var(--skota-teal-500);
    color: #fff;
}
.annuaire-btn.is-disabled {
    color: var(--skota-mint-400);
    background-color: transparent;
    border-color: var(--skota-mint-200);
    cursor: default;
}
.annuaire-btn.is-edit {
    color: var(--skota-ink-soft);
    background-color: transparent;
}
.annuaire-btn.is-edit:hover {
    background-color: var(--skota-ink-soft);
    border-color: var(--skota-ink-soft);
    color: #fff;
}

.annuaire-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--skota-ink-soft);
}
.annuaire-empty i { color: var(--skota-mint-400); }

/* ============================================
   QR code — page imprimable
   ============================================ */
.qr-print {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--skota-mint-300);
    padding: 12px;
    background: #fff;
    border-radius: 8px;
}

.qr-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--skota-teal-600);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}
.qr-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--skota-ink);
}
.qr-location { color: var(--skota-ink-soft); font-size: 1rem; }
.qr-location i { color: var(--skota-teal-500); margin-right: 4px; }

/* Bouton icône */
.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tables */
.table {
    --bs-table-bg: #ffffff;
    --bs-table-border-color: var(--skota-mint-200);
    color: var(--skota-ink-soft);
}
.table thead.table-light th {
    background-color: var(--skota-mint-100);
    color: var(--skota-ink);
    border-color: var(--skota-mint-300);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Panel Admin — tuiles
   ============================================ */
.admin-tile {
    display: flex;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--skota-mint-300);
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    height: 100%;
}
.admin-tile:hover {
    transform: translateY(-2px);
    border-color: var(--skota-mint-400);
    box-shadow: 0 6px 16px rgba(31, 107, 91, 0.10);
    color: inherit;
    text-decoration: none;
}
.admin-tile-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #e1f0e9, #cfe5d9);
    color: var(--skota-teal-600);
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.admin-tile-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--skota-ink);
}
.admin-tile-meta {
    font-size: 0.78rem;
    color: var(--skota-teal-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 2px;
}
.admin-tile-desc {
    font-size: 0.875rem;
    color: var(--skota-ink-soft);
    margin-top: 6px;
    line-height: 1.4;
}
.admin-tile-disabled {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* Bloc affichant le mot de passe temporaire généré */
.generated-password {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--skota-mint-300);
    border-radius: 8px;
    padding: 10px 14px;
}
.generated-password code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--skota-teal-700);
    letter-spacing: 1px;
    background: transparent;
}

/* ============================================
   Login & menu utilisateur
   ============================================ */
.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #e8f4ef 0%, #f1f9f5 60%, #f7fbf9 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--skota-ink-soft);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}
.login-main {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--skota-mint-300);
    border-radius: 16px;
    padding: 36px 36px 32px;
    box-shadow: 0 8px 30px rgba(31, 107, 91, 0.08);
}
.login-brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.login-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
}
.login-brand .skota-pill {
    font-size: 1.85rem;
}
.login-tagline {
    font-size: 0.875rem;
    color: var(--skota-teal-500);
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 0.3px;
}
.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--skota-ink);
    margin-bottom: 24px;
    letter-spacing: -0.4px;
}
.login-subtitle {
    color: var(--skota-ink-soft);
    font-size: 0.95rem;
    margin-bottom: 24px;
}
.login-footer {
    margin-top: 20px;
    /* #4f6d66 : AA sur mint — #6c8980 ne faisait que 3.55:1 */
    color: #4f6d66;
    font-size: 0.78rem;
    text-align: center;
}

/* Séparateur « ou » (login passkey) */
.login-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6c8980;
    font-size: 0.8rem;
    margin: 6px 0 14px;
}

/* Menu utilisateur dans la navbar */
.user-menu-toggle {
    background: #fff;
    border: 1px solid var(--skota-mint-300);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--skota-ink);
    font-family: inherit;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"] {
    border-color: var(--skota-teal-500);
    box-shadow: 0 2px 6px rgba(31, 107, 91, 0.12);
}
.user-menu-toggle::after {
    margin-left: 6px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--skota-teal-600);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.1;
}
.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--skota-ink);
}
.user-role {
    font-size: 0.7rem;
    color: var(--skota-teal-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 1px;
}
.dropdown-menu {
    /* Item actif (page courante) : rendu doux mint comme le survol,
       au lieu du bleu Bootstrap figé (--bs-dropdown-link-active-bg). */
    --bs-dropdown-link-active-bg: var(--skota-mint-100);
    --bs-dropdown-link-active-color: var(--skota-teal-700);
    background-color: #ffffff;
    border: 1px solid var(--skota-mint-300);
    border-radius: 12px;
    padding: 6px;
    min-width: 230px;
    box-shadow: 0 12px 32px rgba(15, 50, 45, 0.18), 0 4px 10px rgba(15, 50, 45, 0.06);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.dropdown-item {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--skota-ink);
}
.dropdown-item:hover {
    background-color: var(--skota-mint-100);
    color: var(--skota-teal-700);
}
.dropdown-item.text-danger:hover { background-color: #fee; color: #b00 !important; }

@media (max-width: 768px) {
    .user-meta { display: none; }
}

/* ============================================
   Navigation mobile — barre fixe en bas
   Visible uniquement < md (768px, téléphones). Le bureau n'est pas impacté :
   masquage via .d-md-none + toutes les règles ci-dessous sont sous media query.
   ============================================ */
.skota-bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(0px + env(safe-area-inset-bottom, 0px));
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: calc(100% - 32px);
    max-width: 520px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(15, 50, 45, 0.18), 0 2px 6px rgba(15, 50, 45, 0.08);
}
.skota-bottom-nav > a,
.skota-bottom-nav > button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--skota-ink);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.skota-bottom-nav i { font-size: 1.4rem; line-height: 1; }
.skota-bottom-nav > a:hover,
.skota-bottom-nav > button:hover { background: rgba(15, 50, 45, 0.05); }
.skota-bottom-nav .bn-active { background: var(--skota-mint-200); }
.skota-bottom-nav .bn-active i { color: var(--skota-teal-700); }

@media (max-width: 767.98px) {
    /* Réserve la place sous la barre flottante pour ne pas masquer le contenu / footer. */
    body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    /* La barre du haut devient collante sur mobile pour que le bouton « Menu »
       (qui déplie #navMain) reste visible même après défilement. */
    .navbar-skota {
        position: sticky;
        top: 0;
        z-index: 1030;
        background: #f1f9f5 !important;
        /* En appli (status bar translucide iOS), on descend sous l'encoche.
           env() = 0 dans un onglet classique et sur desktop → aucun impact. */
        padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
    }
}

/* ============================================
   Tableaux → cartes empilées (mobile only, < 768px)
   Activé par assets/responsive-tables.js (ajoute .is-cards + data-label).
   100 % sous media query : le bureau garde le tableau classique. Sans le JS,
   les tableaux restent en affichage normal (dégradation propre).
   ============================================ */
@media (max-width: 767.98px) {
    table.is-cards {
        display: block;
        width: 100%;
        border: 0;
    }
    /* En-tête masqué à l'œil mais conservé pour les lecteurs d'écran. */
    table.is-cards thead {
        position: absolute;
        width: 1px; height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    table.is-cards tbody { display: block; width: 100%; }

    /* Chaque ligne devient une carte. */
    table.is-cards tbody tr {
        display: block;
        background: #fff;
        border: 1px solid var(--skota-mint-300);
        border-radius: 14px;
        padding: 6px 14px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(15, 50, 45, 0.08);
    }

    /* Chaque cellule = une ligne « libellé | valeur ».
       Le libellé est posé en absolu à gauche : la valeur (même multi-éléments)
       s'empile naturellement à droite, sans casser les cellules riches. */
    table.is-cards tbody td {
        display: block;
        position: relative;
        width: auto;
        min-height: 1.4em;
        padding: 8px 0 8px 42%;
        border: 0;
        border-bottom: 1px solid rgba(15, 50, 45, 0.06);
        text-align: right;
        box-shadow: none;      /* neutralise le striping/hover Bootstrap (box-shadow inset) */
        background: transparent;
        white-space: normal;
    }
    table.is-cards tbody td:last-child { border-bottom: 0; }

    table.is-cards tbody td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 8px;
        width: 38%;
        text-align: left;
        font-weight: 600;
        font-size: 0.82rem;
        line-height: 1.3;
        color: #5f6f6b;
    }

    /* Cellule sans libellé (colonne « Actions » à en-tête vide) : pleine largeur. */
    table.is-cards tbody td:not([data-label]) {
        padding-left: 0;
        text-align: right;
    }

    /* Ligne « état vide » (td colspan) : centrée, sans libellé. */
    table.is-cards tbody td[colspan] {
        padding-left: 0;
        text-align: center;
        border-bottom: 0;
    }
    table.is-cards tbody td[colspan]::before { content: none; }

    /* Le conteneur de scroll horizontal n'a plus lieu d'être en mode carte. */
    .table-responsive:has(table.is-cards) { overflow-x: visible; }
}

/* ============================================
   Print
   ============================================ */
@media print {
    nav.navbar, footer, .no-print { display: none !important; }
    body { background: #fff; }
    main { margin: 0; padding: 0; }
    .qr-print-card { border: 1px dashed #000; padding: 20px; }
    .qr-title { color: #000; }
    .qr-location i { color: #000; }
}
