:root {
    --bg: #f7f7f9;
    --surface: #ffffff;
    --surface-alt: #f0f2f5;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #d1d5db;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #15803d;
    --warning: #b45309;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --max-width: 980px;
    --font-size-base: 16px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
}

body {
    margin: 0;
    padding: 16px;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

h1, h2, h3 {
    margin-top: 0;
    line-height: 1.2;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 16px;
}

h2 {
    font-size: 1.35rem;
    margin: 24px 0 12px;
}

h3 {
    font-size: 1.1rem;
    margin: 18px 0 10px;
}

p {
    margin: 0 0 12px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.card-muted {
    background: var(--surface-alt);
}

.message {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    background: #fff;
}

.message-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: var(--success);
}

.message-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

.message-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: var(--warning);
}

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

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 1rem;
}

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

button,
.button,
input[type="submit"] {
    display: inline-block;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
    background: var(--primary-hover);
    text-decoration: none;
}

.button-secondary {
    background: #4b5563;
}

.button-secondary:hover {
    background: #374151;
}

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #b91c1c;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 16px;
}

.meta-list p {
    margin-bottom: 8px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    background: var(--surface);
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-alt);
    font-size: 0.95rem;
}

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

.preview-banner {
    border: 2px dashed #6b7280;
    background: #f9fafb;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.rich-content p:last-child {
    margin-bottom: 0;
}

.rich-content ul,
.rich-content ol {
    padding-left: 22px;
    margin: 0 0 12px;
}

.rich-content a {
    word-break: break-word;
}

.form-group {
    margin-bottom: 16px;
}

.centered {
    text-align: center;
}

.small {
    font-size: 0.9rem;
    color: var(--muted);
}

@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .card {
        padding: 14px;
    }

    button,
    .button,
    input[type="submit"] {
        width: 100%;
        text-align: center;
    }

    .actions {
        flex-direction: column;
    }

    .nav-links {
        flex-direction: column;
        gap: 8px;
    }
}
/* ===== GRID / COLONNES ===== */

.row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
}

.col,
.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11,
.col-12 {
    min-width: 0;
}

.col,
.col-12 { grid-column: span 12; }
.col-11 { grid-column: span 11; }
.col-10 { grid-column: span 10; }
.col-9  { grid-column: span 9; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
.col-2  { grid-column: span 2; }
.col-1  { grid-column: span 1; }

/* mobile : tout en pleine largeur */
@media (max-width: 640px) {
    .row {
        grid-template-columns: 1fr;
    }

    .col,
    .col-1,
    .col-2,
    .col-3,
    .col-4,
    .col-5,
    .col-6,
    .col-7,
    .col-8,
    .col-9,
    .col-10,
    .col-11,
    .col-12 {
        grid-column: span 1;
    }
}