/* css/home.css — Tableau de bord home */

.home-wrap { padding: 24px; font-family: -apple-system, system-ui, sans-serif; color: #e5e7eb; max-width: 1600px; margin: 0 auto; }

/* ─── Title ─── */
.home-title { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.home-title h1 { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.home-sub { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .8px; margin-top: 4px; }
.home-refresh { padding: 8px 16px; background: rgba(34,211,238,.08); border: 1px solid #164e63; color: #67e8f9; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.home-refresh:hover { background: rgba(34,211,238,.15); }

/* ─── Alert bar ─── */
.home-alert-bar { border-radius: 10px; padding: 14px 18px; margin-bottom: 18px; border: 1px solid; }
.home-alert-bar.ok   { background: rgba(16,185,129,.05); border-color: #065f46; color: #34d399; font-size: 12px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .5px; }
.home-alert-bar.crit { background: rgba(239,68,68,.05); border-color: #7f1d1d; }
.home-alert-bar.warn { background: rgba(251,191,36,.05); border-color: #78350f; }
.home-alert-bar .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.home-alert-bar.ok .dot   { background: #10b981; box-shadow: 0 0 8px #10b981; }
.home-alert-bar.crit .dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: pulse 2s infinite; }
.home-alert-bar.warn .dot { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.home-alert-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #fbbf24; }
.home-alert-bar.crit .home-alert-head { color: #f87171; }
.home-alert-head b { font-weight: 700; }
.home-alert-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 1100px) { .home-alert-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .home-alert-list { grid-template-columns: 1fr; } }
.home-alert-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #0b0f17; border: 1px solid #1f2937; border-radius: 6px; font-size: 12px; cursor: pointer; transition: border-color .12s; }
.home-alert-item:hover { border-color: #4c1d95; }
.home-alert-item.crit { border-left: 3px solid #ef4444; }
.home-alert-item.warn { border-left: 3px solid #fbbf24; }
.home-alert-item .sev { font-weight: 800; }
.home-alert-item.crit .sev { color: #f87171; }
.home-alert-item.warn .sev { color: #fbbf24; }
.home-alert-item .acc { color: #fff; font-weight: 700; }
.home-alert-item .msg { color: #9ca3af; flex: 1; }
.home-alert-more { padding: 8px; text-align: center; font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; }

/* ─── KPI strip ─── */
.home-kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 1100px) { .home-kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .home-kpi-strip { grid-template-columns: repeat(2, 1fr); } }
.home-kpi { background: #0b0f17; border: 1px solid #1f2937; border-radius: 10px; padding: 18px 20px; position: relative; overflow: hidden; }
.home-kpi .lbl { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 1px; }
.home-kpi .val { font-size: 32px; font-weight: 800; color: #fff; font-family: ui-monospace, monospace; margin-top: 6px; line-height: 1; }
.home-kpi .sub { font-size: 10px; color: #4b5563; margin-top: 6px; }
.home-kpi.accent { border-color: #4c1d95; background: radial-gradient(ellipse at top right, rgba(168,85,247,.1), #0b0f17 70%); }
.home-kpi.accent .val { color: #fbbf24; }
.home-kpi.accent .lbl { color: #a5b4fc; }

/* ─── Grid blocks ─── */
.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } }
.home-block { background: #0b0f17; border: 1px solid #1f2937; border-radius: 10px; padding: 18px 20px; }
.home-block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.home-block-head h2 { font-size: 13px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .8px; }
.home-block-head .sub-head { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; }
.home-empty { padding: 24px; text-align: center; color: #4b5563; font-size: 12px; }

/* ─── Timeline 24h ─── */
.home-block-head .legend { display: flex; gap: 10px; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.home-block-head .legend .lg { color: #6b7280; position: relative; padding-left: 14px; }
.home-block-head .legend .lg::before { content: ''; position: absolute; left: 0; top: 3px; width: 8px; height: 8px; border-radius: 2px; }
.home-block-head .legend .lg.pub::before { background: #10b981; }
.home-block-head .legend .lg.sch::before { background: #22d3ee; }
.home-block-head .legend .lg.failed::before { background: #ef4444; }
.home-tl { display: flex; gap: 3px; align-items: flex-end; height: 100px; padding-bottom: 20px; position: relative; }
.home-tl-slot { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; height: 100%; }
.home-tl-bar { width: 100%; height: 80%; display: flex; align-items: flex-end; justify-content: center; }
.home-tl-bar > div { width: 80%; border-radius: 3px 3px 0 0; background: #1f2937; min-height: 8px; transition: background .12s; }
.home-tl-slot.pub    .home-tl-bar > div { background: linear-gradient(to top, #065f46, #10b981); }
.home-tl-slot.sch    .home-tl-bar > div { background: linear-gradient(to top, #164e63, #22d3ee); }
.home-tl-slot.failed .home-tl-bar > div { background: linear-gradient(to top, #7f1d1d, #ef4444); }
.home-tl-slot.now::after { content: ''; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #a855f7; }
.home-tl-h { font-size: 8px; color: #4b5563; margin-top: 4px; font-family: ui-monospace, monospace; }
.home-tl-slot.now .home-tl-h { color: #a855f7; font-weight: 700; }

/* ─── Feed ─── */
.home-feed { display: flex; flex-direction: column; gap: 6px; }
.home-feed-item { display: grid; grid-template-columns: 20px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: #060913; border: 1px solid #111827; border-radius: 6px; font-size: 11px; }
.home-feed-item .icon { font-size: 14px; }
.home-feed-item .acc { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-feed-item .type { color: #6b7280; text-transform: uppercase; font-size: 9px; letter-spacing: .5px; }
.home-feed-item .pill { padding: 2px 8px; border-radius: 8px; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.home-feed-item .pill.pub    { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid #065f46; }
.home-feed-item .pill.sch    { background: rgba(34,211,238,.1); color: #67e8f9; border: 1px solid #164e63; }
.home-feed-item .pill.failed { background: rgba(239,68,68,.1); color: #f87171; border: 1px solid #7f1d1d; }
.home-feed-item .time { color: #4b5563; font-family: ui-monospace, monospace; font-size: 10px; }

/* ─── Top/Flop ─── */
.home-perf-row { display: grid; grid-template-columns: 28px 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #111827; cursor: pointer; transition: background .12s; }
.home-perf-row:last-child { border-bottom: none; }
.home-perf-row:hover { background: rgba(34,211,238,.04); }
.home-perf-row .rank { font-size: 18px; font-weight: 800; color: #4b5563; font-family: ui-monospace, monospace; text-align: center; }
.home-perf-row .avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); overflow: hidden; border: 2px solid #1e1b4b; }
.home-perf-row .avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-perf-row .avatar .fb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 14px; }
.home-perf-row .id .u { font-size: 13px; font-weight: 700; color: #fff; }
.home-perf-row .id .sub { font-size: 10px; color: #6b7280; margin-top: 2px; }
.home-perf-row .er { font-size: 18px; font-weight: 800; color: #fbbf24; font-family: ui-monospace, monospace; }
#home-flop .home-perf-row .er { color: #f87171; }
#home-top .home-perf-row:first-child .rank { color: #fbbf24; }
