* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000; color: #fff;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  touch-action: none;
}
#app { width: 600px; height: 600px; display: flex; flex-direction: column; padding: 22px 26px; }
header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
#title { font-size: 24px; font-weight: 700; }
#period { font-size: 20px; color: #7fd8ff; font-weight: 600; }
main { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
footer { display: flex; justify-content: space-between; margin-top: 10px; font-size: 16px; color: #9a9a9a; }

[data-focusable] { outline: none; }
.card, .row, .btn {
  border: 2px solid #333; border-radius: 16px; background: #0d0d0d; flex: none;
}
.card:focus, .row:focus, .btn:focus { border-color: #7fd8ff; background: #10222b; }

.card { padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; row-gap: 4px; min-height: 88px; }
.card .name { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card .spend { font-size: 30px; font-weight: 800; text-align: right; }
.card .sub { font-size: 18px; color: #c9c9c9; }
.card .sub2 { font-size: 16px; color: #9a9a9a; text-align: right; }

.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.ok { background: #3ddc84; } .warn { background: #ffb020; } .bad { background: #ff5a5a; } .off { background: #666; }
.alertcount { color: #ffb020; font-weight: 700; }
.err { color: #ff8a8a; }
.total { font-size: 17px; color: #c9c9c9; text-align: center; flex: none; }
.total b { color: #fff; font-size: 22px; }

/* Écran d'un élément */
.head { display: flex; align-items: center; gap: 10px; flex: none; }
.head .t { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pill { font-size: 15px; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex: none; }
.pill.ok { background: #123d27; color: #3ddc84; } .pill.off { background: #262626; color: #bdbdbd; }
.pill.warn { background: #3d2e0b; color: #ffb020; } .pill.bad { background: #3d1414; color: #ff7070; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; flex: none; }
.kpi { background: #0d0d0d; border: 2px solid #222; border-radius: 12px; padding: 8px 10px; }
.kpi .l { font-size: 15px; color: #9a9a9a; }
.kpi .v { font-size: 23px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.v.good { color: #3ddc84; } .v.meh { color: #ffb020; } .v.poor { color: #ff5a5a; }
.meta { font-size: 16px; color: #b5b5b5; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta b { color: #fff; }

.spark { flex: none; height: 64px; }
.spark svg { display: block; }

.actions { display: flex; gap: 10px; flex: none; }
.btn { display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; min-height: 64px; flex: 1; padding: 0 12px; }
.btn.danger:focus { border-color: #ff7070; background: #2b1010; }
.btn.go:focus { border-color: #3ddc84; background: #0f2b1c; }

.sect { font-size: 16px; color: #9a9a9a; text-transform: uppercase; letter-spacing: .06em; flex: none; margin-top: 2px; }
.row { padding: 10px 14px; display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; row-gap: 4px; align-items: center; min-height: 80px; }
.row .n { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 22px; font-weight: 800; }
.row .d { font-size: 15px; color: #b5b5b5; grid-column: 2 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.paused .n, .row.paused .s { color: #8a8a8a; }

.adview { display: flex; gap: 14px; flex: none; }
.adview img { width: 190px; height: 190px; object-fit: cover; border-radius: 12px; background: #111; flex: none; }
.adview .noimg { width: 190px; height: 190px; border-radius: 12px; background: #111; display: flex; align-items: center; justify-content: center; color: #666; font-size: 16px; flex: none; }
.adview .kpis { grid-template-columns: repeat(2, 1fr); flex: 1; }

.center { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 22px; color: #c9c9c9; padding: 0 20px; }
.demo { color: #ffb020; }

/* Confirmation */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
#modal[hidden] { display: none; }
#mbox { width: 540px; border: 2px solid #444; border-radius: 20px; background: #0a0a0a; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
#mbox .q { font-size: 24px; font-weight: 800; line-height: 1.25; }
#mbox .x { font-size: 18px; color: #c9c9c9; line-height: 1.35; }
#mbox .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#mbox .btn { min-height: 72px; }
