:root {
    --bg: #0b1120;
    --sidebar: #101827;
    --panel: #151f30;
    --panel2: #1b273a;
    --border: #273449;
    --text: #e8edf5;
    --muted: #91a0b6;
    --accent: #38bdf8;
    --green: #34d399;
    --orange: #fbbf24;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}

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

.sidebar {
    width: 250px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 25px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 30px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
}

.brand strong {
    display: block;
    font-size: 15px;
    letter-spacing: 1px;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

nav a {
    text-decoration: none;
    color: var(--muted);
    padding: 12px 14px;
    border-radius: 9px;
    transition: 0.2s;
}

nav a:hover {
    background: var(--panel2);
    color: var(--text);
}

nav a.active {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    border: 1px solid rgba(56, 189, 248, 0.15);
}

nav a.disabled {
    cursor: default;
    opacity: 0.65;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 10px 0;
    border-top: 1px solid var(--border);
    color: var(--text);
}

.sidebar-footer small {
    display: block;
    color: var(--muted);
    margin: 8px 0 0 17px;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 7px;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

.main {
    flex: 1;
    padding: 32px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

h1 {
    font-size: 26px;
    margin: 0;
    font-weight: 700;
}

.topbar p {
    color: var(--muted);
    margin: 8px 0 0;
}

.version-badge {
    padding: 8px 13px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 8px;
    color: var(--accent);
    font-weight: 600;
}

.welcome {
    background: linear-gradient(120deg, #162b46, #172235);
    border: 1px solid #294362;
    border-radius: 16px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.welcome h2 {
    font-size: 24px;
    margin: 12px 0;
}

.welcome p {
    color: var(--muted);
    margin: 0;
}

.welcome-icon {
    font-size: 65px;
    color: #60a5fa;
    opacity: 0.8;
    padding: 0 20px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    min-width: 0;
}

.card-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.card-value {
    font-size: 23px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.card-value.compact {
    font-size: 16px;
    line-height: 1.5;
}

.card-value.status {
    color: var(--green);
    font-size: 18px;
}

.card-note {
    color: var(--muted);
    margin-top: 10px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 24px;
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.panel-header h2 {
    margin: 0;
    font-size: 19px;
}

.panel-header p {
    color: var(--muted);
    margin: 7px 0 0;
}

.live-badge {
    font-size: 11px;
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.08);
    border-radius: 20px;
    padding: 6px 10px;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.system-item {
    padding: 15px;
    border: 1px solid var(--border);
    background: var(--panel2);
    border-radius: 10px;
    min-width: 0;
}

.system-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 9px;
}

.system-item strong {
    display: block;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.service-list {
    margin-top: 28px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.service-list h3 {
    font-size: 15px;
    margin: 0 0 15px;
}

.service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.service-row:last-child {
    border-bottom: none;
}

.service-state {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 20px;
}

.service-state.active {
    color: var(--green);
    background: rgba(52, 211, 153, 0.1);
}

.service-state.inactive {
    color: var(--orange);
    background: rgba(251, 191, 36, 0.1);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.module {
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.module-icon {
    font-size: 25px;
    color: var(--accent);
}

.module strong {
    font-size: 15px;
}

.module small {
    color: var(--muted);
}

.coming {
    margin-top: 5px;
    font-size: 11px;
    padding: 5px 9px;
    border-radius: 20px;
    color: var(--orange);
    background: rgba(251, 191, 36, 0.08);
}

footer {
    text-align: center;
    color: var(--muted);
    padding: 15px 0 5px;
    font-size: 12px;
}

footer span {
    color: var(--green);
}

@media (max-width: 1200px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .system-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-footer {
        margin-top: 20px;
    }

    .main {
        padding: 20px;
    }
}

@media (max-width: 550px) {
    .cards,
    .system-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        gap: 15px;
        flex-direction: column;
    }

    h1 {
        font-size: 22px;
    }

    .welcome {
        padding: 20px;
    }

    .welcome-icon {
        display: none;
    }
}

/* =========================================================
   DNS SERVER 2027 V1.1.1 - PAGE DE CONNEXION
   ========================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(59,130,246,.13), transparent 45%),
        #0b1120;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 38px;
    background: rgba(17,24,39,.96);
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0,0,0,.4);
}

.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #ffffff;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1px;
}

.login-box h1 {
    text-align: center;
    margin: 0 0 10px;
    font-size: 26px;
    color: #f8fafc;
}

.login-box > p {
    text-align: center;
    color: #94a3b8;
    margin: 0 0 30px;
    font-size: 14px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-box label {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    color: #f8fafc;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.login-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.math-box {
    margin-top: 12px;
    padding: 20px;
    border: 1px solid rgba(59,130,246,.3);
    background: rgba(30,41,59,.65);
    border-radius: 12px;
}

.math-title {
    color: #93c5fd;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .7px;
    text-align: center;
    margin-bottom: 14px;
}

.math-question {
    text-align: center;
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    padding: 10px 0 16px;
    letter-spacing: 3px;
}

.login-box button {
    margin-top: 12px;
    padding: 14px;
    width: 100%;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #0891b2);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, filter .15s;
}

.login-box button:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.login-error {
    padding: 13px 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(239,68,68,.4);
    background: rgba(127,29,29,.25);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 14px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 480px) {
    .login-box {
        padding: 26px 20px;
    }

    .login-box h1 {
        font-size: 23px;
    }
}

/* =========================================================
   DNS SERVER 2027 V1.1.1 - UTILISATEUR ET DECONNEXION
   ========================================================= */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar-actions form {
    margin: 0;
}

.logged-user {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 8px;
    background: rgba(15,23,42,.6);
}

.logout-button {
    padding: 9px 14px;
    border: 1px solid rgba(239,68,68,.35);
    border-radius: 8px;
    background: rgba(127,29,29,.22);
    color: #fca5a5;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.logout-button:hover {
    background: rgba(127,29,29,.45);
    border-color: rgba(239,68,68,.65);
}

@media (max-width: 700px) {
    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 15px;
    }
}
