
/* ============================================
   Manager – CSS complet responsive
   ============================================ */

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
}

/* ---- Navigation ---- */
.topmenu {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #020617;
    padding: 12px 20px;
    border-bottom: 1px solid #1e293b;
    flex-wrap: wrap;
}
.topmenu .logo { height: 36px; }
.topmenu a {
    color: #94a3b8;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}
.topmenu a:hover, .topmenu a.active {
    color: #e2e8f0;
    background: #1e293b;
}

/* ---- Contenu ---- */
.content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}
h2 { font-size: 1.6rem; margin-bottom: 20px; color: #f1f5f9; }
h3 { font-size: 1.2rem; margin: 25px 0 12px; color: #cbd5e1; }

/* ---- Cartes dashboard ---- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.card {
    background: #020617;
    padding: 24px 20px;
    border-radius: 14px;
    border-left: 4px solid #334155;
    text-align: center;
}
.card span { font-size: 13px; color: #94a3b8; display: block; margin-bottom: 6px; }
.card strong { font-size: 2rem; color: #f1f5f9; }
.card.green  { border-color: #22c55e; }
.card.orange { border-color: #f97316; }
.card.warn   { border-color: #eab308; }
.card.blue   { border-color: #3b82f6; }

/* ---- Tableaux ---- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}
thead th {
    color: #93c5fd;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
th, td {
    padding: 12px 14px;
    border-bottom: 1px solid #1e293b;
}
tbody tr:hover { background: rgba(99,102,241,.06); }

/* ---- Formulaires ---- */
input, select, textarea, button {
    width: 100%;
    padding: 11px 14px;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 14px;
    transition: border-color .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366f1;
}
button {
    background: #6366f1;
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
button:hover { background: #4f46e5; }
textarea { resize: vertical; min-height: 80px; }

/* ---- Boutons ---- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: #334155;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
    border: none;
    cursor: pointer;
}
.btn:hover { background: #475569; }
.btn.ok { background: #16a34a; color: #fff; }
.btn.ok:hover { background: #15803d; }
.btn.danger { background: #dc2626; color: #fff; }
.btn.danger:hover { background: #b91c1c; }

/* ---- Badges statut ---- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge.active  { background: #16a34a22; color: #4ade80; }
.badge.expired { background: #eab30822; color: #facc15; }
.badge.revoked { background: #dc262622; color: #f87171; }
.badge.inactive { background: #64748b22; color: #94a3b8; }

/* ---- Actions bar ---- */
.actions-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ---- Filter bar ---- */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-bar select { width: auto; max-width: 220px; margin-top: 0; }
.filter-bar button { width: auto; margin-top: 0; }
.filter-bar .btn { margin-top: 0; }

/* ---- Form toggle ---- */
.form-toggle {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.form-toggle summary {
    cursor: pointer;
    list-style: none;
}
.form-toggle summary::-webkit-details-marker { display: none; }
.form-toggle form { margin-top: 16px; }

/* ---- Messages ---- */
.msg {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.msg.success { background: #16a34a22; color: #4ade80; border: 1px solid #16a34a44; }
.msg.error, .error-msg { background: #dc262622; color: #f87171; border: 1px solid #dc262644; padding: 12px 16px; border-radius: 10px; }

/* ---- Code / API key ---- */
code, .api-key {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
}

/* ---- Login ---- */
.login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login form {
    text-align: center;
    background: #020617;
    padding: 40px;
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    border: 1px solid #1e293b;
}
.login img { height: 60px; margin-bottom: 20px; }
.login h1 { font-size: 1.5rem; margin-bottom: 8px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .content { padding: 16px; }
    .topmenu { padding: 10px 14px; gap: 4px; }
    .topmenu a { padding: 6px 10px; font-size: 13px; }
    table { font-size: 13px; }
    th, td { padding: 10px 8px; }
    .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card { padding: 16px 12px; }
    .card strong { font-size: 1.5rem; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar select { max-width: 100%; }
}

@media (max-width: 480px) {
    .cards { grid-template-columns: 1fr; }
    .actions-bar { flex-direction: column; }
}

/* Badges résultats vérification */
.badge.valid    { background: #d4edda; color: #155724; }
.badge.expired  { background: #f8d7da; color: #721c24; }
.badge.invalid  { background: #fff3cd; color: #856404; }
.badge.suspended{ background: #ffeaa7; color: #d35400; }
