/* ============================================================
   MonBonVTC — Design System & Styles principaux
   ============================================================ */

/* --- Variables (charte graphique stricte) --- */
:root {
    --gold:          #C8A84B;
    --gold-light:    #E8C96A;
    --gold-bg:       #FDF8EE;
    --gold-border:   #E8C96A;
    --dark:          #0F0F0F;
    --bg:            #FAFAF7;
    --bg2:           #F0EFE9;
    --text:          #1A1A1A;
    --text2:         #6B6B65;
    --text3:         #A8A8A0;
    --border:        #D8D6CE;
    --border2:       #ECEAE2;
    --success-bg:    #EAF3DE;
    --success-text:  #27500A;
    --warning-bg:    #FDF8EE;
    --warning-text:  #7A5C10;
    --danger-bg:     #FEE7E7;
    --danger-text:   #C0392B;
    --info-bg:       #EEEDFE;
    --info-text:     #3C3489;
    --r-sm:   6px;
    --r-md:   10px;
    --r-lg:   14px;
    --r-full: 9999px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "SF Mono", "Courier New", monospace;
}

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

/* --- Base --- */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    min-height: 100vh;
}

/* --- Typographie --- */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
h4 { font-size: 1rem; font-weight: 600; line-height: 1.4; }

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover {
    color: var(--gold-light);
}

small, .text-sm {
    font-size: 0.875rem;
}

/* --- Layout principal --- */
.contenu {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.contenu.avec-nav {
    padding-top: calc(56px + 20px);  /* header 56px + marge */
    padding-bottom: calc(64px + 20px); /* bottom bar 64px + marge */
}

@media (max-width: 767px) {
    .contenu {
        padding: 16px;
    }
    .contenu.avec-nav {
        padding-top: calc(56px + 16px);
        padding-bottom: calc(64px + 16px);
    }
    .card {
        padding: 14px;
    }
    h1 { font-size: 1.5rem; }
}

/* --- Boutons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gold);
    color: var(--dark);
    border-color: var(--gold);
}
.btn-primary:hover:not(:disabled) {
    background: var(--gold-light);
    border-color: var(--gold-light);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg2);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: transparent;
}
.btn-danger:hover:not(:disabled) {
    background: #fdd;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

/* --- Cards --- */
.card {
    background: white;
    border: 1px solid var(--border2);
    border-radius: var(--r-md);
    padding: 20px;
}
.card + .card {
    margin-top: 16px;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}
.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}
.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}
.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}
.badge-info {
    background: var(--info-bg);
    color: var(--info-text);
}

/* --- Alertes / Messages flash --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--r-sm);
    font-size: 0.9375rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}
.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}
.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
}
.alert-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    line-height: 1;
}
.alert-close:hover {
    opacity: 1;
}

/* --- Tableaux --- */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border2);
}
th {
    font-weight: 600;
    color: var(--text2);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
tr:hover td {
    background: var(--bg);
}

/* --- Séparateur --- */
.separator {
    border: none;
    border-top: 1px solid var(--border2);
    margin: 16px 0;
}
