:root {
    --iliade-blue: #0b3d63;
    --iliade-accent: #2ea3a3;
    --error: #c0392b;
    --warning: #b8860b;
    --info: #2e6da4;
    --ok: #2e7d32;
    --bg: #f5f7f8;
    --border: #d9dee2;
}

* { box-sizing: border-box; }

body {
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: #1c2733;
}

header {
    background: var(--iliade-blue);
    color: white;
    padding: 24px 32px;
}

header h1 { margin: 0 0 4px 0; font-size: 22px; }
.subtitle { margin: 0 0 14px 0; opacity: 0.85; font-size: 14px; }

nav { display: flex; gap: 4px; }
nav a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 6px 6px 0 0;
}
nav a:hover { color: white; background: rgba(255, 255, 255, 0.08); }
nav a.active { color: white; background: rgba(255, 255, 255, 0.16); font-weight: 600; }

main {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

.upload-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.upload-box form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

button {
    background: var(--iliade-accent);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
button:hover { opacity: 0.9; }

.report {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

.summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    color: white;
}
.badge.ok { background: var(--ok); }
.badge.ko { background: var(--error); }
.badge.small { padding: 2px 8px; font-size: 11px; }

.chip.permalink {
    text-decoration: none;
    color: var(--iliade-blue);
    border: 1px solid var(--border);
}
.chip.permalink:hover { background: #e4ecf1; }

.chip {
    background: #eef2f5;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
}
.chip.small { font-family: monospace; font-size: 11px; color: #556; }

.count { font-size: 13px; padding: 2px 8px; border-radius: 4px; }
.count.error { color: var(--error); }
.count.warning { color: var(--warning); }
.count.info { color: var(--info); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #eef2f5; }

.tag {
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    text-transform: uppercase;
}
.tag.error { background: var(--error); }
.tag.warning { background: var(--warning); }
.tag.info { background: var(--info); }

.row-error { background: #fdf1f0; }
.row-warning { background: #fdf8ec; }

.no-issues { color: var(--ok); font-weight: 600; }

.xml-excerpt {
    background: #1c2733;
    color: #d9e2ea;
    font-size: 11px;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 6px;
    max-width: 360px;
    max-height: 160px;
    overflow: auto;
    white-space: pre;
    margin: 0;
}
.xml-excerpt.xml-full { max-width: 100%; max-height: 480px; font-size: 12px; }
.xml-missing { color: #9aa7b2; font-style: italic; font-size: 12px; }

footer { text-align: center; color: #7a8894; font-size: 12px; padding: 24px; }

/* Page règles de gestion */
.rules-intro {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #445;
}

.rule-category { margin-bottom: 32px; }
.rule-category h2 {
    font-size: 16px;
    color: var(--iliade-blue);
    border-bottom: 2px solid var(--iliade-accent);
    padding-bottom: 6px;
    margin-bottom: 14px;
}

.rule-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }

.rule-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.rule-card-header { display: flex; gap: 8px; margin-bottom: 8px; }
.rule-id {
    font-family: monospace;
    font-size: 12px;
    background: var(--iliade-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}
.rule-bt {
    font-family: monospace;
    font-size: 12px;
    background: #eef2f5;
    color: #445;
    padding: 2px 8px;
    border-radius: 4px;
}

.rule-card h3 { margin: 0 0 6px 0; font-size: 15px; }
.rule-description { font-size: 13px; color: #445; margin: 0 0 12px 0; line-height: 1.5; }

.rule-examples { display: flex; flex-direction: column; gap: 8px; }
.example {
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
}
.example-label {
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    margin-bottom: 4px;
}
.example-ok { background: #eef7ee; }
.example-ok .example-label { color: var(--ok); }
.example-ko { background: #fdf1f0; }
.example-ko .example-label { color: var(--error); }
.example code { display: block; word-break: break-word; }
.example-message { margin: 6px 0 0 0; color: var(--error); font-style: italic; }
