* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #222;
}

header {
    background: linear-gradient(135deg, #003b8f, #00a86b);
    color: white;
    padding: 24px 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 30px;
}

header p {
    margin: 6px 0 0;
}

nav {
    background: #10233f;
    padding: 12px 38px;
}

nav a {
    color: white;
    text-decoration: none;
    margin-right: 18px;
    font-weight: bold;
    font-size: 14px;
}

nav a:hover {
    text-decoration: underline;
}

.logout {
    background: white;
    color: #003b8f;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

main {
    width: 96%;
    max-width: 1600px;
    margin: 25px auto;
}

.stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-left: 7px solid #003b8f;
}

.stat h2 {
    margin: 0;
    font-size: 32px;
}

.stat p {
    margin: 6px 0 0;
}

.stat.green {
    border-left-color: #00a86b;
}

.stat.orange {
    border-left-color: #fbbc04;
}

.stat.red {
    border-left-color: #d93025;
}

.stat.blue {
    border-left-color: #0066cc;
}

.card {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.card h2 {
    margin-top: 0;
}

.preview {
    background: #eaf3ff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 18px;
    border-left: 5px solid #003b8f;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 16px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
}

textarea {
    height: 95px;
}

button,
.btn {
    background: #003b8f;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.btn:hover {
    background: #002b68;
}

.btn-secondary {
    background: #555;
}

.btn-success {
    background: #15803d;
}

.btn-warning {
    background: #b45309;
}

.small-btn {
    padding: 7px 10px;
    font-size: 12px;
    margin-top: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #003b8f;
    color: white;
    padding: 12px;
    text-align: left;
}

td {
    padding: 11px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

tr:hover {
    background: #f3f8ff;
}

a {
    color: #003b8f;
    font-weight: bold;
}

.badge {
    padding: 6px 10px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    display: inline-block;
    background: #555;
}

.badge.en_attente {
    background: #fbbc04;
    color: #222;
}

.badge.cle_recue {
    background: #0066cc;
}

.badge.actif {
    background: #00a86b;
}

.badge.suspendu {
    background: #d93025;
}

.badge.maintenance {
    background: #555;
}

.alert {
    background: #ffe5e5;
    color: #b00020;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 5px solid #b00020;
}

footer {
    text-align: center;
    padding: 25px;
    color: #666;
}

.login-page {
    background: linear-gradient(135deg, #003b8f, #00a86b);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: white;
    padding: 35px;
    width: 390px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.login-box h1 {
    color: #003b8f;
    margin-bottom: 5px;
}

.login-box p {
    color: #555;
}

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

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

    table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    nav {
        text-align: center;
    }

    nav a {
        display: inline-block;
        margin: 6px;
    }
}

.btn-complete {
    background: #047857;
    margin-bottom: 6px;
}

.btn-complete:hover {
    background: #065f46;
}

.rsc-action-form {
    display: block;
    margin-top: 4px;
}

.inline-form {
    display: inline-block;
    margin-top: 6px;
}

.btn-danger {
    background: #b91c1c;
}

.btn-danger:hover {
    background: #991b1b;
}

.inline-form {
    display: inline-block;
    margin: 5px 0;
}

.btn-danger {
    background: #b91c1c;
}

.btn-danger:hover {
    background: #991b1b;
}

/* EMSOGRO UI V4: statut automatique des sites */
.badge.provisioning {
    background: #0b6fc2;
    color: #fff;
}
.site-status-control-v4 {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 100px;
}
.site-status-form-v4 {
    display: block;
    margin: 0;
}
.site-status-form-v4 button {
    white-space: nowrap;
}

