:root {
    --blue: #004795;
    --blue-light: #1a6fd4;
    --accent: #3b9eff;
    --bg: #060d1a;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(0, 71, 149, 0.4);
    --text: #e8edf5;
    --muted: #5a6a82;
    --green: #22c55e;
    --orange: #f59e0b;
    --red: #ef4444;
    --radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 71, 149, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 71, 149, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
}
.orb-1 { width: 600px; height: 600px; background: rgba(0, 71, 149, 0.1); top: -200px; left: -150px; }
.orb-2 { width: 500px; height: 500px; background: rgba(59, 158, 255, 0.06); bottom: -150px; right: -150px; }

/* Header */
header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 20px 40px;
    width: 100%;
    animation: fadeUp 0.6s ease both;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 5px 14px;
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    color: var(--muted);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    transition: background 0.4s ease, box-shadow 0.4s ease;
    animation: pulse 2s ease-in-out infinite;
}

.badge-dot.all-ok     { background: var(--green);  box-shadow: 0 0 8px var(--green); }
.badge-dot.some-down  { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.badge-dot.all-down   { background: var(--red);    box-shadow: 0 0 8px var(--red); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text) 40%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Section labels */
.section-label {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 1000px;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-left: 2px;
    animation: fadeUp 0.6s ease 0.1s both;
}

.section-label--infra {
    margin-top: 40px;
}

/* Grid */
.grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    width: 90%;
    max-width: 1000px;
    padding-bottom: 20px;
    animation: fadeUp 0.6s ease 0.2s both;
}

.grid-infra {
    padding-bottom: 60px;
}

/* ── Card base ──────────────────────────────────────────────────────────── */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 158, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Cliquable (tag <a>) */
a.app-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 71, 149, 0.15);
}
a.app-card:hover::before { opacity: 1; }

/* Non-cliquable (tag <div>) */
.app-card.no-link {
    cursor: default;
    opacity: 0.7;
    border-style: dashed;
}
.app-card.no-link:hover {
    /* pas d'effet hover */
    background: var(--surface);
    transform: none;
    box-shadow: none;
}

/* Card unavailable (stopped, degraded, unknown, error) */
.app-card.unavailable {
    opacity: 0.45;
    pointer-events: none;
}

/* ── Icônes ─────────────────────────────────────────────────────────────── */
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-icon {
    font-size: 28px;
    line-height: 1;
}

.app-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

/* ── Status dot ─────────────────────────────────────────────────────────── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.status-dot.loading  { background: var(--muted); animation: pulse 1s ease-in-out infinite; }
.status-dot.online   { background: var(--green);  box-shadow: 0 0 8px var(--green); }
.status-dot.degraded { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.status-dot.stopped  { background: var(--red);    box-shadow: 0 0 8px var(--red); }
.status-dot.unknown  { background: var(--muted); }
.status-dot.error    { background: var(--red);    box-shadow: 0 0 8px var(--red); }

/* ── Textes ─────────────────────────────────────────────────────────────── */
.app-name { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.app-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* ── Card footer ────────────────────────────────────────────────────────── */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.status-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.4s ease;
}

.status-label.online   { color: var(--green); }
.status-label.degraded { color: var(--orange); }
.status-label.stopped  { color: var(--red); }
.status-label.unknown  { color: var(--muted); }
.status-label.error    { color: var(--red); }
.status-label.loading  { color: var(--muted); }

/* Badge "interne" sur les cartes sans lien */
.no-link-badge {
    font-family: 'Space Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 2px 8px;
    letter-spacing: 0.05em;
}

/* ── Flèche ─────────────────────────────────────────────────────────────── */
.arrow {
    width: 16px;
    height: 16px;
    color: var(--muted);
    transition: transform 0.3s ease, color 0.3s ease;
}

a.app-card:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    text-align: center;
    letter-spacing: 0.05em;
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}