/* GEVA Guard, tableau de bord. Global Essor */
:root {
  --bg: #f4f6f9; --surface: #fff; --text: #1d2733; --muted: #66727f; --border: #e1e6ec; --soft: #f7f9fb;
  --brand: #1e5f8a; --ok: #1e7e4a; --low: #6b7785; --medium: #2b6cb0; --high: #b7791f; --critical: #c53030;
  --radius: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f151c; --surface: #17202a; --text: #e6edf3; --muted: #93a0ad; --border: #26323f; --soft: #1c2733;
    --brand: #5aa9da; --ok: #48bb78; --medium: #63a4e8; --high: #ecc94b; --critical: #f56565; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: .2rem 0 .3rem; display: flex; align-items: center; gap: .5rem; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
h3 { font-size: .95rem; margin: 1.2rem 0 .5rem; }
code { background: var(--soft); border: 1px solid var(--border); border-radius: 4px; padding: 0 .3em; font-size: .9em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .good { color: var(--ok); } .nowrap { white-space: nowrap; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .8rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand svg, .login h1 svg { width: 26px; height: 26px; fill: var(--brand); }
.top nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.top nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--brand); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 1.5rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem; }

.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.crumb { margin: 0; font-size: .85rem; } .crumb a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
details.card > summary { cursor: pointer; list-style: none; } details.card > summary h2 { display: inline; margin: 0; }
details.card[open] > summary { margin-bottom: .8rem; }
.card.empty { text-align: center; padding: 3rem 1rem; }
.danger { border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); }

.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .95rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 .9rem/1.2 inherit; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--good { border-color: var(--ok); color: var(--ok); }
.btn--danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn--small { padding: .35rem .7rem; font-size: .82rem; }
button.link { background: none; border: 0; padding: 0; color: var(--text); font: 500 15px/1.5 inherit; cursor: pointer; }
button.link:hover { color: var(--brand); }
form { margin: 0; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--border); background: var(--surface); }
.flash--ok { border-color: var(--ok); } .flash--error { border-color: var(--critical); color: var(--critical); } .flash--info { border-color: var(--medium); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.site { display: block; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--text); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.site:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.site--ok { border-top-color: var(--ok); } .site--medium { border-top-color: var(--medium); } .site--high { border-top-color: var(--high); } .site--critical { border-top-color: var(--critical); }
.site__head { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.site__url { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.site__status { margin: .5rem 0 .7rem; font-weight: 600; font-size: .9rem; }
.site__kpi { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .8rem; margin: 0; }
.site__kpi dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); } .site__kpi dd { margin: 0; font-weight: 600; }
.tag { margin-left: auto; font-size: .7rem; padding: .1rem .45rem; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }

.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--low); flex: none; }
.dot--ok { background: var(--ok); } .dot--medium { background: var(--medium); } .dot--high { background: var(--high); } .dot--critical { background: var(--critical); box-shadow: 0 0 0 4px color-mix(in srgb, var(--critical) 20%, transparent); } .dot--pending, .dot--paused { background: var(--border); }

.tabs { display: flex; gap: .2rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; }
.tabs a { padding: .6rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: .92rem; }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--brand); }
.count { background: var(--critical); color: #fff; border-radius: 99px; font-size: .72rem; padding: .05rem .45rem; }

.period { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1.1rem; }
.chip { padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: .85rem; }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.period__custom { display: inline-flex; gap: .4rem; align-items: center; margin-left: auto; font-size: .85rem; flex-wrap: wrap; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; }
.period input { padding: .3rem .5rem; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; background: var(--soft); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge--ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.badge--low { color: var(--low); } .badge--medium { background: var(--medium); color: #fff; border-color: var(--medium); }
.badge--high { background: var(--high); color: #1d2733; border-color: var(--high); } .badge--critical { background: var(--critical); color: #fff; border-color: var(--critical); }

.issue { border: 1px solid var(--border); border-left: 4px solid var(--low); border-radius: 8px; margin-bottom: .55rem; }
.issue--2 { border-left-color: var(--medium); } .issue--3 { border-left-color: var(--high); } .issue--4 { border-left-color: var(--critical); }
.issue summary { cursor: pointer; padding: .6rem .8rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.issue__title { font-weight: 600; flex: 1 1 300px; }
.issue pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .9rem; background: var(--soft); margin: 0 .8rem .6rem; padding: .7rem .9rem; border-radius: 6px; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; padding: 0 .8rem .8rem; }
.form .actions { padding: 1rem 0 0; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.table td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.path { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.row span { overflow-wrap: anywhere; } .row small { white-space: nowrap; }
.row--error span { color: var(--critical); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; }
.kpi span { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.kpi strong { font-size: 1.6rem; line-height: 1.25; } .kpi small { color: var(--muted); font-size: .8rem; }
.chart { width: 100%; height: 190px; display: block; }
.chart rect { fill: var(--brand); } .chart text { fill: var(--muted); font-size: 11px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 1.1rem; }
.cols--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.meter { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; min-width: 120px; } .meter span { display: block; height: 100%; background: var(--brand); }

.uptime { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; }
.uptime__day { height: 34px; border-radius: 3px; background: var(--border); }
.uptime__day--ok { background: var(--ok); } .uptime__day--medium { background: var(--high); } .uptime__day--critical { background: var(--critical); }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: .35rem 0 .35rem 1.1rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .75rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline__click::before, .timeline__form_submit::before { background: var(--ok) !important; }
.timeline__form_abandon::before { background: var(--critical) !important; }
.timeline time { color: var(--muted); font-size: .8rem; margin-right: .6rem; font-variant-numeric: tabular-nums; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; margin: 0 0 1rem; }
.facts dt { font-size: .75rem; text-transform: uppercase; color: var(--muted); } .facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.copy { display: flex; gap: .5rem; } .copy input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
.help li { margin-bottom: .3rem; }
.exports { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .6rem; }
.form { max-width: 680px; display: flex; flex-direction: column; }
.form label { font-weight: 600; margin: .9rem 0 .3rem; font-size: .9rem; } .form label small { font-weight: 400; color: var(--muted); }
.form label.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }

body.center { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login { width: min(400px, 100%); display: flex; flex-direction: column; gap: .4rem; }
.login h1 { justify-content: center; margin-bottom: 1rem; }
.login button { margin-top: .8rem; justify-content: center; }

@media (max-width: 640px) {
  .wrap { padding: 1rem; } .top { padding: .7rem 1rem; } .period__custom { margin-left: 0; }
  .table { font-size: .82rem; } .uptime__day { height: 24px; }
}
