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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f9;
    color: #222;
    padding: 30px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

/*  Titres  */
h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    border-left: 4px solid #3a7bd5;
    padding-left: 12px;
    color: #1a1a2e;
}

h2 {
    font-size: 1.15rem;
    margin: 24px 0 12px;
    color: #333;
}

/*  Lien retour  */
a {
    color: #3a7bd5;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

p {
    margin-bottom: 12px;
}

hr {
    border: none;
    border-top: 1px solid #dde2ea;
    margin: 24px 0;
}

/*  Tableaux  */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

th {
    background: #3a7bd5;
    color: #fff;
    text-align: left;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td {
    padding: 9px 14px;
    font-size: 0.9rem;
    border-bottom: 1px solid #eef0f4;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f0f5ff;
}

/*  Statut UP / DOWN  */
td:nth-child(3) {
    font-weight: bold;
}

/*  Formulaire sélecteur (historique.php)  */
form {
    margin-bottom: 20px;
}

form label {
    font-size: 0.9rem;
    margin-right: 8px;
}

select {
    padding: 6px 10px;
    font-size: 0.9rem;
    border: 1px solid #c5cdd8;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

select:focus {
    outline: 2px solid #3a7bd5;
}

/*  Canvas graphique  */
canvas {
    display: block;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 16px;
    max-width: 100%;
}

/*  Navbar  */
nav {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 2px solid #3a7bd5;
    padding-bottom: 0;
}

nav a {
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3a7bd5;
    border-radius: 4px 4px 0 0;
    text-decoration: none;
    border: 1px solid transparent;
}

nav a:hover {
    background: #e8f0fe;
    text-decoration: none;
}

nav a.active {
    background: #3a7bd5;
    color: #fff;
    border-color: #3a7bd5;
}

/*  Bouton ajouter (navbar)  */
nav .btn-ajouter {
    margin-left: auto;
    padding: 6px 16px;
    background: #3a7bd5;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    align-self: center;
}

nav .btn-ajouter:hover {
    background: #2c63b5;
}

/*  Modal overlay  */
#modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

#modal-box h2 {
    margin-bottom: 20px;
}

#modal-box label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 14px 0 4px;
    color: #444;
}

#modal-box input,
#modal-box select {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9rem;
    border: 1px solid #c5cdd8;
    border-radius: 4px;
}

#modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

#modal-actions button[type="button"] {
    padding: 7px 16px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

#modal-actions button[type="submit"] {
    padding: 7px 16px;
    background: #3a7bd5;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

#modal-actions button[type="submit"]:hover {
    background: #2c63b5;
}

/*  Nav droite (user Discord)  */
.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.nav-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.nav-user a {
    color: #e55;
    font-size: 0.85rem;
}

.nav-user a:hover {
    text-decoration: underline;
}

/*  Page login Discord  */
body.login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
}

.login-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    padding: 48px 52px;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.login-card .logo {
    font-size: 2.4rem;
    margin-bottom: 8px;
}

.login-card h1 {
    border: none;
    padding: 0;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.login-card p {
    color: #666;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.features {
    text-align: left;
    margin: 28px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #444;
}

.feature-icon {
    width: 32px;
    height: 32px;
    background: #e8f0fe;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.btn-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #5865F2;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    width: 100%;
    margin-top: 8px;
    transition: background 0.15s;
}

.btn-discord:hover {
    background: #4752c4;
    text-decoration: none;
    color: #fff;
}

.btn-discord svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.login-footer {
    margin-top: 20px;
    font-size: 0.78rem;
    color: #aaa;
}

/*  mode sombre  */

html.dark {
    color-scheme: dark;
}

html.dark body {
    background: #1a1d23;
    color: #d0d4dc;
}

html.dark nav {
    background: #1a1d23;
    border-bottom-color: #2c63b5;
}

html.dark nav a {
    color: #7aacff;
}

html.dark nav a.active {
    background: #2c63b5;
    color: #fff;
    border-color: #2c63b5;
}

html.dark nav a:hover {
    background: #22283a;
}

html.dark h1 { color: #d0d4dc; }
html.dark h2 { color: #aab; }

html.dark hr {
    border-top-color: #2e3340;
}

/* Tableau */
html.dark table {
    background: #23272f;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

html.dark th {
    background: #1e3a6e;
    color: #d0d4dc;
}

html.dark td {
    border-bottom-color: #2e3340;
    color: #d0d4dc;
}

html.dark tr:hover td {
    background: #2a2f3d;
}

/* Formulaires */
html.dark select,
html.dark input {
    background: #23272f;
    color: #d0d4dc;
    border-color: #3a3f50;
}

/* Canvas */
html.dark canvas {
    background: #23272f;
}

/* Modal */
html.dark #modal {
    background: rgba(0,0,0,0.65);
}

html.dark #modal-box {
    background: #23272f;
    color: #d0d4dc;
}

html.dark #modal-box input,
html.dark #modal-box select {
    background: #1a1d23;
    color: #d0d4dc;
    border-color: #3a3f50;
}

html.dark #modal-actions button[type="button"] {
    background: #2e3340;
    border-color: #3a3f50;
    color: #d0d4dc;
}

/* Bouton dark toggle */
.btn-dark {
    background: none;
    border: 1px solid #c5cdd8;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: inherit;
    align-self: center;
}

html.dark .btn-dark {
    border-color: #3a3f50;
    color: #d0d4dc;
}

/* Page login dark */
html.dark body.login {
    background: #1a1d23;
}

html.dark .login-card {
    background: #23272f;
    color: #d0d4dc;
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

html.dark .login-card p,
html.dark .feature {
    color: #999;
}

html.dark .feature-icon {
    background: #22283a;
}

/*  Widgets côte à côte  */
.widgets {
    display: flex;
    gap: 24px;
    margin-top: 28px;
}

.widget {
    flex: 1;
}

.widget h2 {
    margin-bottom: 12px;
}