@font-face {
    font-family: 'Metric';
    src: url('../fonts/Metric-SemiBold.eot');
    src: url('../fonts/Metric-SemiBold.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Metric-SemiBold.woff2') format('woff2'),
         url('../fonts/Metric-SemiBold.woff') format('woff'),
         url('../fonts/Metric-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Metric', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    color: #000;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

/* En-tête */
.header {
    position: relative;
    text-align: center;
    padding: 10px 0;
    border-bottom: 3px solid #E30613;
}

.logo {
    max-width: 140px;
    height: auto;
}

.logout-btn {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: none;
    border: 1px solid #ddd;
    color: #888;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.logout-btn:hover {
    background: #fef0f0;
    border-color: #E30613;
    color: #E30613;
}
.logout-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Barre de navigation */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.nav-btn {
    padding: 7px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-btn:hover {
    border-color: #E30613;
    color: #E30613;
}
.nav-btn.active {
    background: #E30613;
    border-color: #E30613;
    color: #fff;
}

h1, h2 {
    color: #E30613;
    margin: 12px 0 10px;
    font-size: 1.35em;
}

/* Formulaires */
.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #000;
}

select, input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="tel"], textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Metric', sans-serif;
    transition: border-color 0.3s;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #E30613;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #E30613;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Metric', sans-serif;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 8px;
    text-align: center;
}

/* Boutons de formulaire en largeur 100% SAUF dans popup et button-group */
form > .btn:not(.btn-compact),
.container > .btn {
    width: 100%;
}

/* Classe pour les boutons compacts */
.btn-compact {
    width: auto !important;
    min-width: 0 !important;
}

.btn:hover {
    background: #c5050f;
}

.btn-secondary {
    background: #000;
}

.btn-secondary:hover {
    background: #333;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

/* Choix de date rapide */
.quick-date {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.quick-date-btn {
    flex: 1;
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Metric', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.quick-date-btn.active {
    background: #E30613;
    color: #fff;
    border-color: #E30613;
}

/* Sélecteur d'heure */
.time-selector {
    display: flex;
    gap: 10px;
}

.time-selector select {
    flex: 1;
    font-size: 14px;
}

/* Radio buttons pour durée */
.radio-group {
    display: flex;
    gap: 10px;
}

.radio-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
    font-size: 14px;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-item:has(input:checked) {
    border-color: #E30613;
    background: #E30613;
    color: #fff;
}

.radio-item span {
    font-weight: 600;
}

/* Checkboxes pour rappels */
.checkbox-group-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkbox-item-inline {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
    font-size: 14px;
}

.checkbox-item-inline input[type="checkbox"] {
    display: none;
}

.checkbox-item-inline:has(input:checked) {
    border-color: #E30613;
    background: #fff5f6;
}

.checkbox-item-inline:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-item-inline span {
    font-weight: 600;
}

/* QR Code */
.qr-container {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.qr-container img {
    max-width: 250px;
    height: auto;
}

/* Page Event */
.event-info {
    background: #f8f9fa;
    padding: 14px 16px;
    border-radius: 8px;
    margin: 14px 0;
    border-left: 4px solid #E30613;
}

.event-info p {
    margin: 6px 0;
    font-size: 15px;
}

.event-info strong {
    color: #E30613;
}

.section {
    margin: 18px 0;
    padding: 14px 0;
    border-top: 2px solid #f0f0f0;
}

.section h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* Contenu BBCode rendu */
.bbcode-content {
    line-height: 1.6;
    font-size: 14px;
}

.bbcode-content p {
    margin: 8px 0;
}

.bbcode-content ul, .bbcode-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.bbcode-content li {
    margin: 4px 0;
}

.bbcode-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
}

/* Table de gestion */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

table th {
    background: #E30613;
    color: #fff;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

table tr:hover {
    background: #f8f9fa;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login */
.login-box {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ========== COMMERCIAUX COMPACT (tags) ========== */
.commercial-list-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.commercial-tag {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: #fff;
    border: 2px solid #E30613;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #E30613;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.commercial-tag:hover {
    background: #E30613;
    color: #fff;
    box-shadow: 0 3px 8px rgba(227,6,19,0.3);
    transform: translateY(-1px);
}

.commercial-tag:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(227,6,19,0.2);
}

.commercial-tag-add {
    background: #fff;
    border: 2px dashed #E30613;
    color: #E30613;
    font-weight: 600;
    box-shadow: none;
}

.commercial-tag-add:hover {
    background: #E30613;
    color: #fff;
    border-style: solid;
    box-shadow: 0 3px 8px rgba(227,6,19,0.3);
}

/* ========== POPUP OVERLAY ========== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.popup-box {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.popup-box h2 {
    margin-top: 0;
    font-size: 1.3em;
}

.popup-box .btn {
    margin-top: 8px;
}

/* Forcer button-group dans popup à rester en ligne */
.popup-box .button-group {
    flex-direction: row !important;
}

/* ========== POPUP PARTAGE (page event) ========== */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.share-btn {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Metric', sans-serif;
}

.share-btn:hover {
    filter: brightness(0.9);
}

.share-icon {
    margin-right: 12px;
    font-size: 20px;
}

.share-sms {
    background: #34c759;
    color: #fff;
}

.share-whatsapp {
    background: #25d366;
    color: #fff;
}

.share-copy {
    background: #f0f0f0;
    color: #000;
}

/* ========== AIDE BBCODE ========== */
.bbcode-help {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 25px;
    font-size: 13px;
    line-height: 1.8;
    color: #444;
}

.bbcode-help code {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    color: #E30613;
}

/* Button group */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
}

/* Trustpilot */
.trustpilot-widget {
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 8px;
    }
    
    h1, h2 {
        font-size: 1.25em;
        margin: 10px 0 8px;
    }

    .header {
        padding: 8px 0;
    }

    .logo {
        max-width: 110px;
    }

    .nav-bar {
        gap: 4px;
        padding: 8px 0;
    }

    .nav-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    label {
        margin-bottom: 5px;
        font-size: 14px;
    }

    select, input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="tel"], textarea {
        padding: 9px;
        font-size: 14px;
    }
    
    .btn {
        padding: 11px 18px;
        font-size: 14px;
        margin-top: 6px;
    }

    .quick-date-btn {
        padding: 9px;
        font-size: 13px;
    }

    .radio-item {
        padding: 9px;
        font-size: 13px;
    }

    .radio-item span {
        font-size: 13px;
    }

    .checkbox-item-inline {
        min-width: auto;
        padding: 9px;
        font-size: 13px;
    }
    
    .time-selector select {
        padding: 9px;
        font-size: 13px;
    }

    table {
        font-size: 13px;
    }
    
    table th, table td {
        padding: 7px;
    }

    .button-group {
        flex-direction: column;
    }

    /* Compaction page event en mobile */
    .event-info {
        padding: 10px 12px;
        margin: 10px 0;
    }

    .event-info p {
        margin: 5px 0;
        font-size: 14px;
    }

    .section {
        margin: 14px 0;
        padding: 10px 0;
    }

    .section h2 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }

    .bbcode-content {
        font-size: 13px;
        line-height: 1.5;
    }

    .bbcode-content p {
        margin: 6px 0;
    }

    .bbcode-content ul, .bbcode-content ol {
        margin: 6px 0;
        padding-left: 18px;
    }

    .bbcode-content li {
        margin: 3px 0;
    }
}

/* ========== RESPONSIVE CONFIG ADMIN MOBILE ========== */
@media (max-width: 600px) {
    /* Padding sur le container principal */
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Éléments avec max-width dans les panels doivent avoir padding */
    .config-panel div[style*="max-width: 600px"],
    .config-panel div[style*="max-width:600px"] {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
}

.hidden {
    display: none;
}

/* ========== RESPONSIVE CONFIG ADMIN MOBILE ========== */
@media (max-width: 600px) {
    /* Container principal avec padding */
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Panels - éléments avec max-width */
    .config-panel div[style*="max-width: 600px"],
    .config-panel div[style*="max-width:600px"] {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
    
    /* Titres et paragraphes dans les panels */
    .config-panel h2,
    .config-panel > p {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Liste des postes */
    .postes-list {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Formulaire ajout poste */
    #formAddPoste {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}