/* SDT — Global styles */

:root {
    --color-bg: #f0f9ff;
    --color-bg-card: #ffffff;
    --color-text: #0c4a6e;
    --color-text-secondary: #64748b;
    --color-accent: #0369a1;
    --color-accent-hover: #075985;
    --color-accent-light: #0ea5e9;
    --color-border: #bae6fd;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(3, 105, 161, 0.12);
}

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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────── */

.sdt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 40px;
}

.sdt-header {
    text-align: center;
    margin-bottom: 40px;
}

.sdt-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
}

.sdt-header p {
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ── Cards ──────────────────────────────────────── */

.sdt-card {
    background: var(--color-bg-card);
    border: 1px solid rgba(3, 105, 161, 0.1);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

.sdt-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sdt-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ── Buttons ────────────────────────────────────── */

.sdt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.sdt-btn:active {
    transform: scale(0.97);
}

.sdt-btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.sdt-btn-primary:hover {
    background: var(--color-accent-hover);
}

.sdt-btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.sdt-btn-secondary:hover {
    background: var(--color-border);
}

.sdt-btn-danger {
    background: var(--color-danger);
    color: #fff;
}

/* ── Forms ──────────────────────────────────────── */

.sdt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg-card);
    transition: border-color 0.15s;
}

.sdt-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.sdt-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

/* ── Badges ─────────────────────────────────────── */

.sdt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--sdto-radius-pill, 999px);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sdt-badge-draft     { background: #f1f5f9; color: #475569; }
.sdt-badge-review    { background: #fef3c7; color: #92400e; }
.sdt-badge-approved  { background: #dcfce7; color: #166534; }
.sdt-badge-deprecated { background: #fee2e2; color: #991b1b; }

.sdt-badge-must   { background: #fee2e2; color: #991b1b; }
.sdt-badge-should { background: #fef3c7; color: #92400e; }
.sdt-badge-could  { background: #dbeafe; color: #1e40af; }
.sdt-badge-wont   { background: #f1f5f9; color: #475569; }

/* ── Table ──────────────────────────────────────── */

.sdt-table {
    width: 100%;
    border-collapse: collapse;
}

.sdt-table th,
.sdt-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.sdt-table th {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.sdt-table tr:hover {
    background: #e0f2fe;
}

/* ── Toast ──────────────────────────────────────── */

.sdt-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
}

.sdt-toast-success { background: var(--color-success); }
.sdt-toast-error   { background: var(--color-danger); }
.sdt-toast-warning { background: var(--color-warning); color: var(--color-text); }

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Identifiants uniques (codes) — plus évidents partout : bleu SDTO, un peu plus
   grands (option A validée par Benoit). Appliqué aux listes, en-têtes de fiche,
   Cap, Arbre, Carte dans SPT/SDT/STT/SOT. */
.sdto-code {
    color: var(--sdto-accent, #16406e);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: .3px;
}
