body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #111827;
    color: #fff;
    padding: 24px;
    box-sizing: border-box;
}

.sidebar h1 {
    margin-top: 0;
}

.sidebar nav a {
    display: block;
    color: #fff;
    padding: 10px 0;
}

.content {
    margin-left: 240px;
    padding: 32px;
}

.guest-body {
    background: linear-gradient(120deg, #eff6ff, #f8fafc);
}

.guest-container {
    max-width: 520px;
    margin: 60px auto;
    padding: 16px;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.btn {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-block;
}

.btn-danger {
    background: #dc2626;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid .col-2 {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: white;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.danger {
    background: #fee2e2;
    color: #991b1b;
}

.error {
    color: #b91c1c;
    display: block;
    margin-top: 6px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.lang-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.help-box {
    margin-top: 16px;
    padding: 12px;
    background: #eff6ff;
    border-radius: 10px;
}

.pref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
}

.pref-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.pref-desc {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.locked-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.55);
    border: 1px solid #fdba74;
    color: #7c2d12;
    font-weight: 700;
}

.state-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.switch {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 32px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: 0.25s ease;
    cursor: pointer;
}

.slider::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    left: 4px;
    top: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.25s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

.switch input:checked + .slider {
    background: #2563eb;
}

.switch input:checked + .slider::before {
    transform: translateX(26px);
}

/* =========================
   THEME SOMBRE QG
========================= */

body.dark {
    background: #0f172a;
    color: #e5e7eb;
}

body.dark .sidebar {
    background: #020617;
    border-right: 1px solid #1f2937;
}

body.dark .card {
    background: #111827;
    border: 1px solid #1f2937;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

body.dark h1,
body.dark h2,
body.dark h3,
body.dark strong,
body.dark label,
body.dark .pref-title {
    color: #f9fafb;
}

body.dark p,
body.dark span,
body.dark div,
body.dark td,
body.dark th,
body.dark .pref-desc {
    color: #d1d5db;
}

body.dark .table {
    background: #111827;
    color: #e5e7eb;
}

body.dark .table th {
    background: #1f2937;
    color: #cbd5e1;
}

body.dark .table td {
    border-color: #1f2937;
}

body.dark input,
body.dark textarea,
body.dark select {
    background: #1f2937;
    border: 1px solid #374151;
    color: #f9fafb;
}

body.dark .btn {
    background: #2563eb;
    color: #ffffff;
}

body.dark .btn:hover {
    background: #1d4ed8;
}

body.dark .btn-danger {
    background: #dc2626;
}

body.dark .btn-danger:hover {
    background: #b91c1c;
}

body.dark .alert.success {
    background: #14532d;
    color: #dcfce7;
    border: 1px solid #166534;
}

body.dark .alert.danger {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #991b1b;
}

body.dark a {
    color: #60a5fa;
}

body.dark .pref-row,
body.dark .state-line {
    background: #0f172a;
    border-color: #1f2937;
}

body.dark .locked-item {
    background: rgba(154, 52, 18, 0.15);
    border-color: #9a3412;
    color: #fdba74;
}

/* =========================
   LOGO CENTRAL QG
========================= */

body.dark.logo-bg::before {
    content: "QG";
    position: fixed;
    top: 50%;
    left: 58%;
    transform: translate(-50%, -50%);
    font-size: 220px;
    font-weight: 900;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.025);
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

body.dark .sidebar,
body.dark .content,
body.dark .card,
body.dark .page-head,
body.dark .alert,
body.dark table,
body.dark form,
body.dark main,
body.dark aside {
    position: relative;
    z-index: 1;
}

/* aides désactivées */
body.no-help-panels .help-panel {
    display: none !important;
}

/* alertes visuelles désactivées */
body.no-visual-alerts .alert,
body.no-visual-alerts .locked-item {
    box-shadow: none !important;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
        height: auto;
    }

    .content {
        margin-left: 0;
    }

    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .pref-row,
    .state-line {
        flex-direction: column;
        align-items: flex-start;
    }

    body.dark.logo-bg::before {
        left: 50%;
        font-size: 140px;
    }
}