/* Homline Holiday Alerts — charte La Homline : rouge #E53935, gris foncé #333, fond #F5F5F5 (cf. Homline Ops). */
:root {
    --red: #E53935; --red-h: #C62828; --dark: #333; --light: #F5F5F5;
    --g100: #F3F4F6; --g200: #E5E7EB; --g300: #D1D5DB; --g500: #6B7280; --g700: #374151;
    --ok-bg: #DCFCE7; --ok-fg: #166534; --warn-bg: #FEF9C3; --warn-fg: #854D0E; --err-bg: #FEE2E2; --err-fg: #991B1B;
    --info-bg: #E0E7FF; --info-fg: #3730A3; --violet-bg: #EDE9FE; --violet-fg: #5B21B6;
    --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--g700); background: var(--light); }
a { color: var(--red-h); }
h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 1rem; color: var(--dark); }
h2 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 .6rem; color: var(--dark); }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; background: var(--dark); color: #e5e7eb; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 16px; border-bottom: 1px solid var(--g700); text-align: center; text-decoration: none; }
.brand img { display: block; width: 100%; height: auto; background: #fff; border-radius: 8px; padding: 6px; }
.brand span { display: block; margin-top: 8px; font-size: 13px; color: #cbd5e1; letter-spacing: .04em; }
.side nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.side nav a, .side-foot a { display: block; padding: 9px 14px; margin: 2px 0; border-radius: 8px; color: #cbd5e1; font-size: 14px; font-weight: 500; text-decoration: none; }
.side nav a:hover, .side nav a.active, .side-foot a:hover, .side-foot a.active { background: var(--red); color: #fff; }
.nav-title { margin: 14px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; }
.side-foot { padding: 12px 8px 16px; border-top: 1px solid var(--g700); font-size: 13px; }
.side-foot a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot button.link { color: #94a3b8; margin-left: 14px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header { background: #fff; border-bottom: 1px solid var(--g200); padding: 12px 24px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.tenant-name { font-weight: 600; color: var(--dark); }
.tenant-logo { max-height: 32px; max-width: 140px; }
.acting { background: var(--warn-bg); color: var(--warn-fg); padding: .5rem 24px; font-size: 14px; }
.content { flex: 1; padding: 24px; max-width: 1200px; width: 100%; }
.foot { padding: 14px 24px; font-size: 12px; color: var(--g500); border-top: 1px solid var(--g200); background: #fff; }
.foot a { color: var(--g500); }

/* Components */
.card { background: #fff; border: 1px solid var(--g200); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { font-size: 1.9rem; font-weight: 700; color: var(--dark); }
.stat-label { color: var(--g500); font-size: .85rem; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--g200); border-radius: var(--radius); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--g100); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--g500); border-bottom-color: var(--g200); }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--g500); font-size: .88rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-high, .badge-failed, .badge-suspended, .badge-error { background: var(--err-bg); color: var(--err-fg); }
.badge-medium, .badge-partial, .badge-superseded, .badge-excluded { background: var(--warn-bg); color: var(--warn-fg); }
.badge-low { background: var(--g200); color: var(--g700); }
.badge-confirm { background: var(--violet-bg); color: var(--violet-fg); }
.badge-ok, .badge-sent, .badge-success, .badge-active { background: var(--ok-bg); color: var(--ok-fg); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); }
.flash-error { background: var(--err-bg); color: var(--err-fg); }
.flash-warning { background: var(--warn-bg); color: var(--warn-fg); }
.flash-info { background: var(--info-bg); color: var(--info-fg); }

/* Forms */
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; align-items: end; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--g500); margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--g300); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; color: var(--dark);
}
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 57, 53, .15); }
.check { display: inline-flex; gap: .35rem; align-items: center; font-weight: 400; color: var(--g700); font-size: 14px; margin-right: .9rem; }
.check input { width: auto; accent-color: var(--red); }
.checks { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin-bottom: 4px; }
button, .button { display: inline-block; padding: 9px 16px; border: 0; border-radius: 8px; background: var(--red); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--red-h); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: #eef1f7; color: var(--dark); border: 1px solid var(--g200); }
button.secondary:hover { background: var(--g200); }
button.danger { background: var(--dark); }
button.danger:hover { background: #000; }
button.small { padding: 5px 10px; font-size: 12px; }
button.link { background: none; color: inherit; padding: 0; font-weight: 500; text-decoration: underline; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: 12px; }
details { margin-top: .4rem; }
details > summary { cursor: pointer; color: var(--red-h); font-size: 14px; font-weight: 500; }
details[open] > summary { margin-bottom: .5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 16px; }
.filters > div { min-width: 170px; }
.day h2 { margin-top: 0; }
.regions { max-height: 320px; overflow-y: auto; border: 1px solid var(--g200); border-radius: 8px; padding: .5rem; background: #fff; }
.regions .check { display: flex; margin: .15rem 0; }
.regions .child { padding-left: 1.2rem; }
.threshold { border: 1px solid var(--g200); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.codes { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; columns: 2; background: var(--g100); padding: 1rem; border-radius: 8px; }
.qr { width: 220px; height: 220px; display: block; margin: .5rem 0; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; color: var(--dark); }
.logo-preview img { max-height: 80px; max-width: 320px; border: 1px solid var(--g200); border-radius: 8px; padding: 6px; background: #fff; }

/* Sign-in pages */
.auth { max-width: 420px; margin: 6vh auto 2rem; padding: 0 16px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img { max-width: 100%; height: auto; }
.auth-brand p { margin: 6px 0 0; font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--g500); }
.auth .card { padding: 24px; }
.auth label { margin-top: 12px; }
.auth button { width: 100%; margin-top: 16px; }
.passkey-box { text-align: center; }
.passkey-box button { margin-top: 0; }

/* Phone and tablet */
@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .side { width: auto; height: auto; position: static; }
    .brand { display: flex; align-items: center; gap: 10px; padding: 10px 16px; text-align: left; }
    .brand img { width: 130px; }
    .brand span { margin: 0; }
    .side nav { display: flex; overflow-x: auto; padding: 6px 8px; }
    .side nav a { white-space: nowrap; }
    .nav-title { display: none; }
    .side-foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; }
    .header, .content, .foot { padding-left: 16px; padding-right: 16px; }
    .codes { columns: 1; }
}

/* Language switch (FR / EN) */
.lang-switch { display: inline-flex; gap: 2px; margin: 0; }
.lang-switch button { padding: 3px 8px; font-size: 12px; font-weight: 600; background: transparent; color: #94a3b8; border: 1px solid var(--g700); border-radius: 6px; }
.lang-switch button:hover { background: var(--g700); color: #fff; }
.lang-switch button.current { background: var(--red); border-color: var(--red); color: #fff; }
.side-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 14px 0; }
.side-actions button.link { margin-left: 0; }
.auth-lang { text-align: center; margin-top: 8px; }
.auth-lang .lang-switch button { color: var(--g500); border-color: var(--g300); }
.auth-lang .lang-switch button.current { color: #fff; }
