/* InfraPro — design system
   Palette : fond app clair, sidebar "ops" sombre, accent teal (scan réseau).
   Les données techniques (IP, MAC, specs) sont en monospace pour lisibilité
   et pour marquer visuellement "ceci est une donnée machine". */

:root {
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --sidebar-bg: #0b1220;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --accent: #14b8a6;
    --accent-dark: #0d9488;
    --bg: #f7f9fb;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    --radius: 8px;
}

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

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ---------- Layout général ---------- */

.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px 28px;
    color: #fff;
    font-size: 1.15em;
}
.brand-mark { color: var(--accent); font-size: 1.1em; }
.brand-text strong { font-weight: 700; }

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.sidebar__nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 10px 24px;
    font-size: 0.92em;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar__nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
}
.sidebar__nav a.is-active {
    color: var(--sidebar-text-active);
    border-left-color: var(--accent);
    background: rgba(20,184,166,0.08);
}

.sidebar__footer {
    padding: 12px 24px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 12px;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar__footer a {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.82em;
}
.sidebar__footer a:hover { color: #fff; }

.content {
    flex: 1;
    padding: 36px 44px;
    max-width: 1200px;
}

h1 { font-size: 1.7em; margin-bottom: 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.05em; margin-bottom: 14px; color: var(--ink); }
.hint { color: var(--text-muted); font-size: 0.9em; margin-bottom: 18px; }

a { color: var(--accent-dark); }

/* ---------- Grilles ---------- */

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 800px) {
    .grid-2col { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
}

.info-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.info-box code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: var(--mono);
}

/* ---------- Boutons ---------- */

.btn, button, .form button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 9px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
}
.btn:hover, button:hover, .form button:hover { background: var(--accent-dark); }

.btn--outline {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--accent);
}
.btn--outline:hover { background: rgba(20,184,166,0.08); color: var(--accent-dark); }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.page-header h1 { margin-bottom: 4px; }
.page-header p { color: var(--text-muted); margin: 0; }

/* ---------- Stats dashboard ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-number {
    display: block;
    font-size: 2.1em;
    font-weight: 700;
    color: var(--ink);
    font-family: var(--mono);
}
.stat-label { color: var(--text-muted); font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------- Tables ---------- */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.table th, .table td {
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
}
.table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafcfd; }

/* IP/MAC/hostname techniques -> monospace pour distinguer donnée machine */
.table td:nth-child(3), .table td:nth-child(4) {
    font-family: var(--mono);
    font-size: 0.87em;
    color: var(--ink-soft);
}

.table--kv th {
    width: 200px;
    background: #f8fafc;
}
.table--kv td { font-family: var(--mono); font-size: 0.88em; }

/* ---------- Badges type d'équipement ---------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.78em;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-muted);
    text-transform: capitalize;
}
.badge--pc { background: #eff6ff; color: #1d4ed8; }
.badge--mac { background: #f5f3ff; color: #6d28d9; }
.badge--imprimante { background: #fff7ed; color: #c2410c; }
.badge--reseau { background: #ecfdf5; color: #047857; }
.badge--nas { background: #fdf4ff; color: #a21caf; }
.badge--machine_virtuelle { background: #f0f9ff; color: #0369a1; }
.badge--inconnu { background: #f1f5f9; color: #64748b; }

/* ---------- Formulaires ---------- */

.form {
    max-width: 440px;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius);
}
.form--flat {
    max-width: none;
    background: transparent;
    border: none;
    padding: 0;
}
.form label {
    display: block;
    margin: 14px 0 6px;
    font-size: 0.86em;
    color: var(--text-muted);
    font-weight: 500;
}
.form label:first-of-type { margin-top: 0; }
.form label small { font-weight: 400; color: #94a3b8; }
.form input, .form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.92em;
    font-family: var(--sans);
    background: #fff;
}
.form textarea { font-family: var(--mono); font-size: 0.85em; resize: vertical; }
.form input:focus, .form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
}
.form button { margin-top: 20px; }

/* ---------- Alertes ---------- */

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.88em;
    border: 1px solid #fecaca;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.88em;
    border: 1px solid #bbf7d0;
}

/* ---------- Login ---------- */

.login-body {
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

.login-screen {
    display: flex;
    height: 100vh;
}

.login-visual {
    flex: 1.1;
    background: var(--sidebar-bg);
    background-image:
        radial-gradient(circle at 15% 15%, rgba(20,184,166,0.14), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(20,184,166,0.08), transparent 40%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px;
}
.login-visual__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
}
.login-visual__graph {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    flex: 1;
}
.login-visual__caption {
    color: var(--sidebar-text);
    font-size: 0.95em;
    max-width: 360px;
    line-height: 1.6;
}

.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
    position: relative;
}

.login-box {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
}
.login-box h2 { font-size: 1.3em; margin-bottom: 4px; }

@media (max-width: 860px) {
    .login-visual { display: none; }
    .login-screen { height: auto; min-height: 100vh; }
}

/* ---------- Pages publiques (espace client) ---------- */

.topbar {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 18px 32px;
}
.topbar .logo { font-size: 1.2em; font-weight: 700; }
.topbar .logo span { color: var(--accent); }
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px;
}
.container--narrow { max-width: 760px; }

.login-footer-links {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.76em;
    color: #cbd5e1;
}
.login-footer-links a { color: #cbd5e1; text-decoration: none; }
.login-footer-links a:hover { color: var(--accent-dark); }
.login-footer-links span { margin: 0 8px; }

/* ---------- Notice d'installation ---------- */

.install-download {
    background: var(--ink);
    background-image: linear-gradient(135deg, var(--sidebar-bg), #132030);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 28px;
}
.install-download .hint { color: var(--sidebar-text); margin-top: 12px; margin-bottom: 0; }
.btn--large {
    font-size: 1em;
    padding: 13px 28px;
}

.step {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}
.step__number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95em;
}
.step__content h2 { font-size: 1.05em; margin-bottom: 8px; }
.step__content p { margin-bottom: 10px; line-height: 1.6; }
.step__content code {
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.88em;
}
.install-list { margin: 8px 0 12px 20px; }
.install-list li { margin-bottom: 6px; line-height: 1.6; }
