/* ============================================
   DNDM — Thème "Malt" pour Paheko
   Palette ambrée sobre, ergonomie adoucie
   ============================================ */

/* --- 1. Palette : surcharge des variables Paheko --- */
:root {
    /* Couleurs principales */
    --gColorMain: #8b4513;          /* Brun "malt torréfié" */
    --gColorMain1: #a0522d;
    --gColorMain2: #6b3410;
    --gColorSecondary: #c08840;     /* Ambre miel */
    --gColorBg: #faf6f0;            /* Crème papier */
    --gColorLight: #f3ece0;
    --gColorGrey: #e8e0d2;
    --gColorBlack: #2a2520;         /* Noir chaud, pas pur */
    --gColorRed: #b03a2e;
    --gColorGreen: #5d8233;
    --gColorOrange: #d68910;

    /* Rayons et ombres modernes */
    --gBorderRadius: 6px;
    --gBoxShadow: 0 1px 3px rgba(60, 40, 20, 0.08);
}

/* --- 2. Typographie : plus aérée et moderne --- */
body, input, select, textarea, button {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: #2a2520;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #2a2520;
}

/* --- 3. Fond général et conteneurs --- */
body {
    background-color: #faf6f0;
    background-image: none;
}

main, .main, #main {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60, 40, 20, 0.06);
    padding: 1.5rem;
}

/* --- 4. Barre de navigation / menu principal --- */
nav.menu, #menu, header nav, .nav-main {
    background: linear-gradient(180deg, #6b3410 0%, #8b4513 100%);
    border: none;
    box-shadow: 0 2px 6px rgba(60, 40, 20, 0.15);
}

nav.menu a, #menu a, header nav a {
    color: #f3ece0;
    border-radius: 4px;
    padding: 0.5rem 0.9rem;
    transition: background 0.15s ease;
    font-weight: normal;
}

nav.menu a:hover, #menu a:hover, header nav a:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

nav.menu a.current, #menu a.current,
nav.menu li.current > a {
    background-color: #c08840;
    color: #ffffff !important;
}


.header .menu a {
    font-weight: normal !important;
}

/* --- 5. Boutons : plus modernes --- */
button, .button, a.button, input[type="submit"], input[type="button"] {
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(60, 40, 20, 0.08);
}

button:hover, .button:hover, a.button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(60, 40, 20, 0.15);
}

.button.main, input[type="submit"].main,
button.main {
    background: #8b4513;
    color: #fff;
    border-color: #6b3410;
}

.button.main:hover {
    background: #a0522d;
}

/* --- 6. Tableaux : lisibilité --- */
table.list, table.list-table, .list table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(60, 40, 20, 0.05);
}

table.list th, .list table th {
    background-color: #f3ece0;
    color: #6b3410;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.9rem;
    border-bottom: 2px solid #c08840;
    text-align: left;
}

table.list td, .list table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #f3ece0;
}

table.list tbody tr:hover, .list table tbody tr:hover {
    background-color: #fdf9f1;
}

table.list tbody tr:nth-child(even) {
    background-color: rgba(243, 236, 224, 0.25);
}

/* --- 7. Formulaires --- */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
textarea, select {
    border: 1px solid #d8cdb8;
    border-radius: 5px;
    padding: 0.5rem 0.7rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, textarea:focus, select:focus {
    border-color: #c08840;
    outline: none;
    box-shadow: 0 0 0 3px rgba(192, 136, 64, 0.15);
}

fieldset {
    border: 1px solid #e8e0d2;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: #fdfbf6;
}

fieldset legend {
    font-weight: 600;
    color: #8b4513;
    padding: 0 0.5rem;
}

/* --- 8. Liens --- */
a {
    color: #a0522d;
    text-decoration: none;
}

a:hover {
    color: #6b3410;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- 9. Messages d'alerte --- */
.alert, p.alert, .block.alert {
    border-radius: 6px;
    border-left: 4px solid;
    padding: 0.8rem 1rem;
}

.alert.error, .alert.danger { border-left-color: #b03a2e; background: #fdf2f0; }
.alert.confirm, .alert.success { border-left-color: #5d8233; background: #f4f8ed; }
.alert.info { border-left-color: #c08840; background: #fdf9f1; }

/* --- 10. Petites touches finales --- */
hr {
    border: none;
    border-top: 1px solid #e8e0d2;
    margin: 1.5rem 0;
}

code, pre {
    background-color: #f3ece0;
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    font-size: 0.9em;
    color: #6b3410;
}

/* Scrollbar discrète (Webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d8cdb8; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #c08840; }
::-webkit-scrollbar-track { background: #faf6f0; }

/* --- Correctif : élément actif du menu --- */
nav.menu a.current, nav.menu li.current > a,
nav.menu a.selected, nav.menu li.selected > a,
nav.menu a.active, nav.menu li.active > a,
nav.menu a[aria-current], nav.menu li[aria-current] > a,
#menu a.current, #menu li.current > a,
#menu a.selected, #menu li.selected > a,
#menu a.active, #menu li.active > a,
header nav a.current, header nav a.selected, header nav a.active,
.nav-main a.current, .nav-main a.selected, .nav-main a.active {
    background-color: #faf6f0 !important;   /* fond crème, clair */
    color: #6b3410 !important;              /* texte brun foncé, lisible */
    font-weight: 700 !important;
    box-shadow: inset 0 -3px 0 #c08840;     /* petit liseré ambré sous l'onglet actif */
}