/* === VARIABLES & RESET (THEME AMSTAFF HOMEPAGE) === */
:root {
    --bg-primary: #050505;
    /* Noir profond */
    --bg-secondary: rgba(20, 20, 20, 0.85);
    /* Verre fumé */
    --bg-tertiary: #0a0a0a;
    /* Fond inputs */

    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #a0a0a0;

    --accent: #ff8800;
    /* Orange Perroquet */
    --accent-hover: #cc4400;
    /* Orange Brûlé */
    --success: #00cc66;
    --danger: #ff2a2a;
    /* Rouge Sang */

    --border: #2a2a2a;
    --sidebar-width: 245px;
    --bg-card: rgba(25, 25, 25, 0.9);
    --warning: #ffaa33;
    --accent-glow: rgba(255, 136, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 50% 0%, #1a0a00 0%, #050505 40%);
    color: var(--text-secondary);
    line-height: 1.55;
    position: relative;
}

/* Motif subtil en arrière-plan (identique homepage) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px,
            rgba(255, 136, 0, 0.02) 10px,
            rgba(255, 136, 0, 0.02) 12px);
    pointer-events: none;
    z-index: -1;
}

/* === LAYOUT PRINCIPAL === */
.app {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 15, 15, 0.9);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
}

.server-info {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.server-info img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    margin-bottom: 10px;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(255, 136, 0, 0.2);
}

.server-info h3 {
    color: var(--text-primary);
    font-size: 1.05rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-info .status {
    color: var(--success);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.server-info .status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
}

/* Menu */
.menu {
    padding: 12px;
    flex: 1;
}

.menu .category {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    padding: 14px 16px 6px;
    letter-spacing: 0.5px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.menu a:hover {
    background: rgba(255, 136, 0, 0.08);
    color: var(--text-primary);
    transform: translateX(2px);
}

.menu a.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(255, 136, 0, 0.3);
}

.menu a.active::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #fff;
    border-radius: 3px;
    margin-right: 4px;
}

.footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--danger);
}

.footer a:last-child:hover {
    color: var(--accent);
}

/* === CONTENU === */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 35px 45px;
    max-width: 1100px;
    overflow-x: hidden;
    box-sizing: border-box;
}

.content h1 {
    color: var(--text-primary);
    font-size: 2.1rem;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.content>p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.98rem;
}

/* === CARTES & FORMULAIRES === */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 26px 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Barre orange décorative (comme homepage) */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    opacity: 0.8;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(255, 136, 0, 0.15);
    transform: translateY(-2px);
}

.card h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent);
    border-radius: 3px;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.field input,
.field select,
.field textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-height: 42px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.15);
}

.field textarea {
    min-height: 85px;
    resize: vertical;
    line-height: 1.4;
}

.field small {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Toggle */
.toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.toggle:last-child {
    border-bottom: none;
}

.toggle label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle input[type="checkbox"] {
    width: 42px;
    height: 22px;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.25s;
}

.toggle input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 136, 0, 0.5);
}

.toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

/* Boutons */
.save-area {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.btn-save {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    padding: 11px 28px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.25);
}

.btn-save:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(255, 136, 0, 0.4);
    transform: translateY(-1px);
}

.btn-save:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === LIGNES DE MOTIFS (Tickets) === */
.type-row {
    background: rgba(15, 15, 15, 0.6);
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 1.4fr 1.1fr 1.1fr auto;
    gap: 14px;
    align-items: end;
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.type-row:hover {
    border-color: var(--accent);
    background: rgba(25, 25, 25, 0.8);
}

.type-row input,
.type-row select {
    padding: 10px 12px;
    font-size: 0.88rem;
    border-radius: 5px;
    height: 42px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.type-row .remove-type {
    height: 42px;
    padding: 0 16px;
    font-weight: 600;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.type-row .remove-type:hover {
    filter: brightness(1.15);
}

#add-type {
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 6px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    border: none;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

#add-type:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* === RESPONSIVE (INTACT) === */
@media (max-width: 1050px) {
    .content {
        padding: 30px;
    }

    .type-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .type-row .remove-type {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .content {
        margin-left: 0;
        padding: 22px;
    }

    .row {
        grid-template-columns: 1fr;
    }

    .menu {
        display: flex;
        overflow-x: auto;
        padding: 10px;
        gap: 4px;
    }

    .menu .category {
        display: none;
    }

    .menu a {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .menu a.active::before {
        display: none;
    }

    .server-info {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        padding: 14px 18px;
    }

    .server-info img {
        width: 44px;
        height: 44px;
        margin: 0;
    }

    .server-info h3 {
        margin: 0;
        font-size: 0.98rem;
    }

    .server-info .status {
        display: none;
    }
}

/* === COMPOSANTS PARTAGÉS (consolidés depuis les pages individuelles) === */

/* Liste de rôles/salons à cocher (utilisé par Sécurité, Tickets, Modération, Annonces) */
.role-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    background: var(--bg-tertiary);
}
.role-list::-webkit-scrollbar { width: 6px; }
.role-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.role-list::-webkit-scrollbar-track { background: transparent; }

/* Carte générique (alias de .card, utilisé sous le nom .tickets-card sur certaines pages) */
.tickets-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tickets-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    opacity: 0.9;
}
.tickets-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 30px rgba(255, 136, 0, 0.1);
}
.tickets-card h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bouton d'action secondaire générique */
.btn-add {
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.btn-add:hover {
    background: var(--accent);
    color: #fff;
}

/* Bouton de suppression / danger */
.btn-del {
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.btn-del:hover {
    background: var(--danger);
    color: #fff;
}

/* === RESPONSIVE MOBILE FIN (smartphones) === */
@media (max-width: 600px) {
    .content {
        padding: 14px;
    }
    .content h1 {
        font-size: 1.35rem;
    }
    .card, .tickets-card {
        padding: 1rem;
        border-radius: 10px;
    }
    .field input,
    .field select,
    .field textarea,
    .ann-input {
        font-size: 16px;
    }
    .row, .layout {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    .btn-save, .btn-add {
        width: 100%;
        text-align: center;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .role-list {
        max-height: 180px;
    }
    .menu a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .server-info img {
        width: 36px;
        height: 36px;
    }

    /* === TOUCH-FRIENDLY : zones tactiles agrandies (min 44px recommandé Apple/Google) === */
    button, .btn, .btn-save, .btn-add, .btn-del, .btn-primary,
    input[type="submit"], input[type="button"] {
        min-height: 44px;
    }
    input[type="checkbox"], input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
    }
    a.nav-item {
        min-height: 44px;
    }

    /* === Lisibilité générale sur mobile === */
    h1 { font-size: 1.35rem !important; }
    h2 { font-size: 1.15rem !important; }
    h3 { font-size: 1.05rem !important; }
    h4 { font-size: 0.95rem !important; }
    p, label, .field label { font-size: 0.9rem; }
    small { font-size: 0.78rem; }

    /* === Formulaires : empêche le zoom auto iOS + touch friendly === */
    input, select, textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    textarea {
        min-height: 80px;
    }

    /* === Cartes génériques : tous formats confondus === */
    .card, .tickets-card, .sec-card, .xp-card, .welcome-card, .am-card, .cmd-card {
        padding: 1rem !important;
        border-radius: 10px !important;
        margin-bottom: 1rem !important;
    }

    /* === Grilles : tout en 1 colonne sur mobile === */
    .grid-container, .form-grid, .validation-config {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* === Onglets/tabs : scrollables horizontalement, jamais empilés === */
    .tabs-header, .tab-nav, .security-nav {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn, .nav-tab {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.82rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* === Empêche tout débordement horizontal accidentel === */
    body, .app, .content {
        max-width: 100vw;
        overflow-x: hidden;
    }
    img, table, pre {
        max-width: 100%;
    }
}


/* === TOGGLE PRINCIPAL (interrupteur "Activer le module") === */
.toggle-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}
.toggle-main:hover {
    border-color: var(--accent);
}
.toggle-main label {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
}
.toggle-main input[type="checkbox"] {
    width: 48px;
    height: 24px;
    appearance: none;
    background: var(--bg-primary);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.toggle-main input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-primary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.25s;
}
.toggle-main input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 136, 0, 0.5);
}
.toggle-main input[type="checkbox"]:checked::before {
    transform: translateX(24px);
}
