body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #003366;
    color: #fff;
    padding: 10px 20px;
}

.topbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 10px;
}

.main-container {
    padding: 20px;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.client-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.equipments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.equipment-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fafafa;
}

.equipment-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.equipment-name {
    font-weight: bold;
    margin-left: 8px;
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.led.green { background: #28a745; }
.led.red   { background: #dc3545; }
.led.grey  { background: #6c757d; }

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #003366;
}

.login-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 320px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.login-card label {
    display: block;
    margin-top: 10px;
}

.login-card input {
    width: 100%;
    padding: 8px;
    margin-top: 3px;
    box-sizing: border-box;
}

.login-card button {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    background: #003366;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.alert.alert-error {
    background: #f8d7da;
    color: #721c24;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.logo-ddv {
    height: 32px;
    margin-right: 10px;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.hero-monitoring {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.hero-monitoring h1 {
    margin-top: 0;
}

.hero-actions {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.btn-primary {
    background: #003366;
    color: #fff;
}

.btn-secondary {
    background: #e0e6f0;
    color: #003366;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.hero-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* LED supplémentaires */
.led.orange { background: #fd7e14; }  /* UP mais lent */

/* Mini-map client */
.client-mini-map {
    margin-top: 4px;
    margin-bottom: 10px;
}

.client-summary-text {
    font-size: 0.9rem;
    color: #555;
}

.mini-dot {
    margin-right: 4px;
    transform: scale(0.9);
}

/* Bloc info sur la page historique */
.equipment-info-block {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.legend {
    margin-top: 10px;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-right {
        margin-top: 5px;
    }

    .clients-grid {
        grid-template-columns: 1fr;
    }

    .equipments-grid {
        grid-template-columns: 1fr;
    }

    .main-container {
        padding: 10px;
    }
}


/* ============================================================
   Supervision des sauvegardes Synology
   ============================================================ */

.nas-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.nas-tile {
    background: #fff;
    border-radius: 8px;
    padding: 12px 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border-left: 4px solid #6c757d;
}

.nas-tile .nas-tile-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.nas-tile .nas-tile-label { font-size: 0.75rem; text-transform: uppercase; color: #666; letter-spacing: .04em; }

.nas-tile.ok       { border-left-color: #28a745; }
.nas-tile.warning  { border-left-color: #fd7e14; }
.nas-tile.critical { border-left-color: #dc3545; }
.nas-tile.unknown  { border-left-color: #6c757d; }

.nas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

.nas-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 4px solid #6c757d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nas-card.ok       { border-top-color: #28a745; }
.nas-card.warning  { border-top-color: #fd7e14; }
.nas-card.critical { border-top-color: #dc3545; }

.nas-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px 10px;
    border-bottom: 1px solid #eee;
}

.nas-card-title { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.nas-card-sub   { font-size: 0.78rem; color: #777; margin-top: 3px; }

.nas-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    background: #e9ecef;
    color: #495057;
}

.nas-badge.ok       { background: #e3f5e9; color: #1c7a3c; }
.nas-badge.warning  { background: #fff2e3; color: #a85708; }
.nas-badge.critical { background: #fdeaec; color: #a71d2a; }

.nas-reasons {
    background: #fbfbfc;
    border-bottom: 1px solid #eee;
    padding: 8px 15px;
    margin: 0;
    list-style: none;
    font-size: 0.78rem;
    color: #666;
}

.nas-reasons li { padding: 1px 0; }

.nas-section { padding: 10px 15px; }
.nas-section + .nas-section { border-top: 1px solid #f0f0f0; }

.nas-section h4 {
    margin: 0 0 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #999;
    font-weight: 600;
}

.nas-task { margin-bottom: 9px; }
.nas-task:last-child { margin-bottom: 0; }

.nas-task-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}

.nas-task-name { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nas-task-meta { font-size: 0.75rem; color: #888; }
.nas-task-meta .nas-when { white-space: nowrap; }

.nas-st-success { color: #28a745; font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.nas-st-failed  { color: #dc3545; font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.nas-st-warning { color: #fd7e14; font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.nas-st-running { color: #0d6efd; font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.nas-st-never,
.nas-st-unknown { color: #888; font-weight: 600; font-size: 0.8rem; white-space: nowrap; }

.nas-vol { margin-bottom: 8px; }
.nas-vol:last-child { margin-bottom: 0; }

.nas-vol-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #555;
}

.nas-bar {
    height: 7px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
    margin-top: 4px;
}

.nas-bar span { display: block; height: 100%; background: #0d6efd; }
.nas-bar span.warning  { background: #fd7e14; }
.nas-bar span.critical { background: #dc3545; }

.nas-card-footer {
    margin-top: auto;
    background: #fafbfc;
    border-top: 1px solid #eee;
    padding: 8px 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 10px;
    font-size: 0.74rem;
    color: #888;
}

.nas-card-footer b { color: #444; font-weight: 600; }
.nas-card-footer .right { text-align: right; }

/* Tables et formulaires de l'administration NAS */
.nas-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.nas-table th, .nas-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 0.88rem; }
.nas-table th { background: #f0f3f7; color: #003366; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; }
.nas-table tr:last-child td { border-bottom: none; }
.nas-table .actions a, .nas-table .actions button { margin-right: 10px; font-size: 0.82rem; }

.nas-form { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); margin-bottom: 18px; }
.nas-form h3 { margin-top: 0; color: #003366; font-size: 1rem; }
.nas-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.nas-form label { display: block; font-size: 0.78rem; color: #555; margin-bottom: 3px; }
.nas-form input[type=text], .nas-form input[type=password], .nas-form input[type=number],
.nas-form select, .nas-form textarea {
    width: 100%; padding: 7px 9px; border: 1px solid #ccd3dd; border-radius: 5px;
    font-size: 0.9rem; font-family: inherit; box-sizing: border-box;
}
.nas-form .hint { font-size: 0.74rem; color: #888; margin-top: 4px; }
.nas-form .check { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: #555; margin-top: 20px; }

.nas-flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 15px; font-size: 0.88rem; }
.nas-flash.success { background: #e3f5e9; color: #1c7a3c; border: 1px solid #b7e2c6; }
.nas-flash.error   { background: #fdeaec; color: #a71d2a; border: 1px solid #f2c2c7; }
.nas-flash.warning { background: #fff2e3; color: #a85708; border: 1px solid #f5d9b8; }
.nas-flash ul { margin: 6px 0 0; padding-left: 20px; font-size: 0.82rem; }

.nas-raw { background: #fff; border-radius: 8px; padding: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.nas-raw details { border: 1px solid #e6e9ee; border-radius: 6px; margin-bottom: 8px; }
.nas-raw summary { cursor: pointer; padding: 8px 12px; font-size: 0.85rem; font-weight: 600; color: #003366; }
.nas-raw pre {
    margin: 0; padding: 10px 12px; background: #f7f8fa; font-size: 0.74rem;
    max-height: 380px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 768px) {
    .nas-grid { grid-template-columns: 1fr; }
}

/* Bandeau des mises à jour en attente (maintenance, pas une alerte de sauvegarde) */
.nas-updates {
    padding: 7px 15px;
    border-bottom: 1px solid #eee;
    background: #f4f8ff;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nas-update-chip {
    font-size: 0.72rem;
    font-weight: 600;
    color: #0b4a8f;
    background: #dbe9fb;
    border-radius: 20px;
    padding: 2px 9px;
    white-space: nowrap;
}
