* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    background: #f4f5f7;
    color: #1f2430;
}
a { color: #1d4ed8; }

/* ── Connexion ─────────────────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(135deg, #1a1e2e 0%, #2a3050 100%);
}
.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}
.login-logo { max-width: 140px; margin: 0 auto 16px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; text-align: center; }
.login-sub { color: #6b7280; font-size: 13px; text-align: center; margin: 0 0 20px; }
.login-error { color: #dc2626; background: #fee2e2; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.login-card label { font-size: 13px; font-weight: 600; margin-top: 10px; margin-bottom: 4px; }
.login-card input { padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.login-card button {
    margin-top: 18px; padding: 10px; border: none; border-radius: 6px;
    background: #2563eb; color: #fff; font-weight: 600; cursor: pointer; font-size: 14px;
}
.login-card button:hover { background: #1d4ed8; }

/* ── En-tête administration ─────────────────────────────────────────── */
.admin-header {
    background: #1a1e2e; color: #fff;
    padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.admin-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
.admin-brand img { height: 28px; }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav a { color: #c7d2fe; text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 5px; }
.admin-nav a:hover { background: rgba(255,255,255,0.08); }
.admin-nav a.active { background: rgba(255,255,255,0.14); color: #fff; }
.admin-nav .logout-link { color: #fca5a5; }

.admin-main { max-width: 1150px; margin: 24px auto; padding: 0 16px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; flex: 1; }
.back-link { width: 100%; font-size: 13px; text-decoration: none; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e3a8a; }

/* Identifiants a transmettre au client (affiches une seule fois). */
.credentials { border: 2px solid #2563eb; }
.credentials textarea {
    width: 100%; min-height: 250px; font: 13px/1.5 Consolas, monospace; padding: 10px 12px;
    border: 1px solid #d1d5db; border-radius: 6px; background: #f8fafd; resize: vertical;
}
.suspended-banner { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; font-weight: 600; }
.pill-warn { background: #fef3c7; color: #92400e; }

/* Intervention Ontech (super admin connecte en tant que client). */
.impersonation-banner {
    display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 0;
    padding: 7px 14px; background: #b45309; color: #fff; font-size: 13px; text-align: center;
}
.impersonation-banner button {
    border: 1px solid #fff; background: transparent; color: #fff; border-radius: 5px; padding: 4px 12px;
    font: inherit; font-weight: 700; cursor: pointer;
}
.impersonation-banner button:hover { background: rgba(255, 255, 255, 0.18); }
.pill-intervention { background: #b45309; color: #fff; }

.panel {
    background: #fff; border-radius: 10px; padding: 18px 22px; margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.panel h2 { margin: 0 0 10px; font-size: 17px; }
.panel-danger { border: 1px solid #fecaca; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.panel-danger h2 { width: 100%; color: #991b1b; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.section-head h2 { margin: 0; }
.hint { color: #6b7280; font-size: 13px; margin: 0 0 12px; }
.empty-hint { color: #6b7280; }
.muted { color: #6b7280; font-size: 12px; }
.text-err { color: #b91c1c; }
.nowrap { white-space: nowrap; }

.panel { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: middle; }
.data-table th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
.row-disabled td { opacity: 0.6; }
.row-actions { white-space: nowrap; text-align: right; }
.inline-form { display: inline; }
.url-cell { white-space: nowrap; }
.url-field { width: 260px; font-size: 12px; padding: 5px 7px; border: 1px solid #d1d5db; border-radius: 4px; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.pill-ok { background: #dcfce7; color: #166534; }
.pill-err { background: #fee2e2; color: #991b1b; }
.pill-muted { background: #eef0f3; color: #4b5563; }

.btn {
    display: inline-block; padding: 6px 12px; border-radius: 6px; border: 1px solid #d1d5db;
    background: #fff; color: #1f2430; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-small { padding: 4px 9px; font-size: 12px; }
.btn-danger { color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }

/* ── Formulaires ────────────────────────────────────────────────────── */
.edit-form { margin-top: 16px; border: 1px solid #dbe3f0; background: #f8fafd; border-radius: 8px; padding: 14px 16px; scroll-margin-top: 16px; }
.edit-form-plain { border: none; background: none; padding: 0; margin: 0; }
.edit-form h3 { margin: 0 0 10px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; align-items: end; }
.form-grid label, .inline-create label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.form-grid label.checkbox-line, .checks label.checkbox-line { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; padding-bottom: 8px; }
.form-grid input[type=text], .form-grid input[type=password], .form-grid input[type=number], .form-grid select,
.inline-create input[type=text], .inline-create input[type=password] {
    width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; background: #fff;
}
.checks { border: 1px solid #e5e7eb; border-radius: 8px; margin: 12px 0 0; padding: 8px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.checks legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.inline-create { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-create input[type=text], .inline-create input[type=password] { flex: 0 1 320px; min-width: 180px; }
.test-result { font-size: 13px; }
.test-ok { color: #166534; }
.test-error { color: #991b1b; }
.test-pending { color: #6b7280; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: #6b7280; }
.facts dd { margin: 0; font-weight: 600; }
