body {
    font-family: "Trebuchet MS", "Segoe UI", "Segoe UI Symbol", Arial, sans-serif;
    background-color: #060606;
    color: #d3d3d3;
    margin: 0;
    padding: 20px;
}

.home-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 12px;
    overflow-x: hidden;
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin: 8px auto 10px auto;
}

h1 {
    text-align: center;
    margin-bottom: 8px;
    color: #efefef;
}

.page-home-link {
    color: inherit;
    text-decoration: none;
    margin-right: 10px;
}

.page-home-link:hover,
.page-home-link:focus-visible {
    color: #9cc8ff;
}

.page-subtitle {
    text-align: center;
    margin: 0 0 16px 0;
    color: #dcdcdc;
    font-weight: 600;
}

.meta {
    text-align: center;
    margin: 0 0 12px 0;
    color: #a3a3a3;
}

.config-nav {
    text-align: center;
    margin: 0 0 14px 0;
}

.config-nav a {
    color: #9cc8ff;
    text-decoration: none;
    border: 1px solid #2e4e77;
    border-radius: 8px;
    padding: 6px 10px;
    background: #0f1721;
}

.top-nav {
    max-width: 980px;
    margin: 0 auto 14px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.top-nav a,
.top-nav span {
    color: #cfe2ff;
    text-decoration: none;
    border: 1px solid #2e4e77;
    border-radius: 8px;
    padding: 6px 10px;
    background: #0f1721;
    font-size: 13px;
}

.top-nav span {
    opacity: 0.6;
}

.legend {
    margin: 0 auto 16px auto;
    max-width: 980px;
    background: #101010;
    border: 1px solid #2a2a2a;
    padding: 10px 14px;
    border-radius: 10px;
}

.legend ul {
    margin: 8px 0 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.legend li {
    display: inline-flex;
    align-items: center;
}

#search {
    margin: 0 auto 16px auto;
    padding: 10px;
    width: 100%;
    max-width: 980px;
    display: block;
    box-sizing: border-box;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #111;
    color: #d8d8d8;
}

.search-actions {
    max-width: 980px;
    margin: 0 auto 8px auto;
    display: flex;
    justify-content: flex-start;
}

.today-button {
    color: #cfe2ff;
    text-decoration: none;
    border: 1px solid #2e4e77;
    border-radius: 8px;
    padding: 6px 10px;
    background: #0f1721;
    font-size: 13px;
    cursor: pointer;
}

.today-button:hover,
.today-button:focus-visible {
    background: #16263a;
    border-color: #3f6799;
}

.table-wrap {
    max-width: 980px;
    margin: 0 auto;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    background: #0b0b0b;
    color: #d3d3d3;
    border-radius: 10px;
    overflow: hidden;
}

th,
td {
    padding: 12px;
    text-align: left;
    border: 1px solid #232323;
    vertical-align: top;
    background: #080808;
}

th {
    background-color: #121212;
    color: #f0f0f0;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 2;
}

th.sortable {
    cursor: pointer;
}

th .sort-indicator {
    margin-left: 6px;
    font-size: 0.9em;
    opacity: 0.85;
}

tbody tr:hover {
    background-color: #151515;
}

tbody tr.row-alt-yellow td:first-child {
    border-left: 3px solid #8e6d2f;
}

tbody tr.row-alt-green td:first-child {
    border-left: 3px solid #3f7d52;
}

tbody tr:nth-child(odd) td:first-child {
    border-left: 3px solid #8e6d2f;
}

tbody tr:nth-child(even) td:first-child {
    border-left: 3px solid #3f7d52;
}

td.cats {
    min-width: 220px;
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    margin: 2px 6px 2px 0;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
}

.cat-badge.is-active {
    border-width: 2px !important;
    box-shadow: 0 0 0 2px #d8d8d8 inset;
    outline: 1px solid #f0f0f0;
    outline-offset: 1px;
}

.cat-icon {
    font-size: 14px;
    line-height: 1;
}

.cat-enfant { background:#1f2b3f; color:#b9d8ff; border-color:#37517a; }
.cat-culture { background:#2d2436; color:#dfc4ff; border-color:#5b4177; }
.cat-cinema { background:#2a2f45; color:#c8d6ff; border-color:#4a5c9a; }
.cat-transport { background:#20352e; color:#c2f0dc; border-color:#3f7b68; }
.cat-alerte_info { background:#3a311f; color:#ffe0a8; border-color:#8e6d2f; }
.cat-film { background:#2d2d40; color:#d0d0ff; border-color:#6c6ca8; }
.cat-importance_alerte { background:#3a1f1f; color:#ffc1c1; border-color:#944949; }
.cat-stage { background:#2d3320; color:#deefb8; border-color:#6d8240; }
.cat-communaute { background:#21313a; color:#bee7ff; border-color:#426b84; }
.cat-sport { background:#1f2f24; color:#b9f2c8; border-color:#3f7d52; }
.cat-theatre { background:#35243a; color:#f0c6ff; border-color:#7a4d8a; }
.cat-danse { background:#33273a; color:#f3c9ff; border-color:#7a5a8b; }
.cat-musique { background:#2c2332; color:#dfc7ff; border-color:#634877; }
.cat-divers { background:#1f1f1f; color:#d0d0d0; border-color:#4c4c4c; }

a {
    color: #9cc8ff;
}

.cell-filter {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
    margin: 0;
    text-align: inherit;
    cursor: pointer;
}

.cell-filter.is-active {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.active-filters {
    max-width: 980px;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.active-filters-label {
    color: #a9a9a9;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-filters-clear {
    border: 1px solid #944949;
    background: #2a1212;
    color: #ffc1c1;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    padding: 1px 6px;
    border-radius: 999px;
}

.active-filters-clear:hover,
.active-filters-clear:focus-visible {
    background: #3a1f1f;
    color: #ffe1e1;
    border-color: #b85a5a;
}

.active-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #191919;
    color: #ddd;
    border: 1px solid #404040;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
}

.active-filter-pill button {
    border: none;
    background: transparent;
    color: #d8d8d8;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.config-list {
    max-width: 760px;
    margin: 0 auto;
    background: #101010;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px 14px;
}

.config-list ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.config-list li {
    margin: 6px 0;
}

.group-card {
    min-width: 0;
}

.group-list {
    overflow-wrap: anywhere;
}

.config-link {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

.generation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.generation-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #426b84;
    background: #21313a;
    color: #bee7ff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.generation-link:hover,
.generation-link:focus-visible {
    border-color: #6f9aba;
    background: #2a3e4a;
    color: #d8efff;
}

@media (max-width: 900px) {
    body { padding: 12px; }
    .table-wrap { overflow: visible; }
    table, thead, tbody, tr, td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    tbody tr {
        margin: 0 0 12px 0;
        border: 1px solid #252525;
        border-radius: 10px;
        overflow: hidden;
        background: #0b0b0b;
    }
    tbody tr.row-alt-yellow {
        border-color: #8e6d2f;
    }
    tbody tr.row-alt-green {
        border-color: #3f7d52;
    }
    tbody tr:nth-child(odd) {
        border-color: #8e6d2f;
    }
    tbody tr:nth-child(even) {
        border-color: #3f7d52;
    }
    td {
        border: none;
        border-bottom: 1px solid #1f1f1f;
        padding: 8px 10px;
    }
    td:last-child {
        border-bottom: none;
    }
    td::before {
        content: attr(data-label) " : ";
        font-weight: 700;
        color: #9f9f9f;
    }
    td.cats {
        min-width: 0;
    }

    .cat-badge.is-active {
        border-width: 3px !important;
        box-shadow: 0 0 0 3px #d8d8d8 inset;
        outline: 2px solid #f0f0f0;
    }
}