:root {
    --bg: #f7f8fb;
    --primary: #2d6cdf;
    --warning: #f6c041;
    --danger: #e0474c;
    --success: #2f9d62;
    --text: #1f2933;
    --muted: #6b7280;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f0f4ff, #f8fafc);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(45,108,223,0.08);
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.page-header h2 {
    margin: 0.15rem 0 0.35rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5472b8;
    margin: 0;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
}

header {
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

header h1 {
    margin: 0;
}

nav a {
    margin-right: 1rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.user-badge {
    margin-right: 1rem;
    color: var(--muted);
    font-weight: 600;
}

main {
    padding: 1.5rem 0 2rem;
}

.table-actions, .actions {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 0.55rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(45,108,223,0.25);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(45,108,223,0.22);
}

.button.secondary {
    background: white;
    color: var(--text);
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.inline-form {
    display: inline;
}

.table .inline-form {
    margin: 0;
}

.link {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f3f4f6;
    font-weight: 700;
}

tr:hover td {
    background: #f9fafb;
}

.monospace {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.95rem;
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
    color: white;
}

.status-info {
    background: var(--primary);
}

.status-warning {
    background: var(--warning);
    color: #111827;
}

.status-ok { background: var(--success); }
.status-failed { background: var(--danger); }

.status-error {
    background: var(--danger);
}

.status-non-reçu {
    background: var(--muted);
}

.table-card {
    padding: 0;
    border: 1px solid #e5e7eb;
}

.table-header {
    padding: 1rem 1.25rem 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.table-header h3 {
    margin: 0 0 0.35rem;
}

.table-responsive {
    overflow-x: auto;
}

.client-name {
    font-weight: 700;
}

.row-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    white-space: nowrap;
}

.card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.card.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

label {
    display: block;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.form-actions.full-width {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
}

.flash-messages {
    list-style: none;
    padding: 0;
}

.flash {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.flash.success {
    background: #ecfdf3;
    color: #14532d;
}

.flash.error {
    background: #fef2f2;
    color: #7f1d1d;
}

footer {
    padding: 1rem 0 2rem;
    color: var(--muted);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-signature {
    font-size: 0.75rem;
    color: var(--muted);
}

.empty {
    text-align: center;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    margin-top: 0.5rem;
}

.test-status {
    min-height: 1.5rem;
    margin: 0.5rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--muted);
}

.test-status.loading {
    color: var(--primary);
}

.test-status.success {
    color: var(--success);
}

.test-status.error {
    color: var(--danger);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
