/* ══════════════════════════════════════
   THE DOOF — Gestion Styles
   ══════════════════════════════════════ */

:root {
    --bg: #0a0a0a;
    --card: #111;
    --border: #222;
    --border-hover: #444;
    --text: #fff;
    --text-muted: #888;
    --text-dim: #555;
    --red: #ef4444;
    --red-hover: #dc2626;
    --green: #34d399;
    --yellow: #fbbf24;
    --danger: #f87171;
}

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

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

/* ── Layout ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.page-content { padding: 1.5rem 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-5 { display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr auto; gap: 0.5rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-gap { display: flex; gap: 0.75rem; }
.space-y > * + * { margin-top: 1rem; }
.space-y-sm > * + * { margin-top: 0.5rem; }

@media (min-width: 768px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Card ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}
.card-hover { cursor: pointer; transition: border-color 0.2s; }
.card-hover:hover { border-color: var(--border-hover); }

/* ── Buttons ── */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: #1a1a1a; }
.btn-ghost.active { background: var(--red); border-color: var(--red); }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; padding: 0.25rem; }

/* ── Input ── */
.input {
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    width: 100%;
    font-size: 0.875rem;
}
.input:focus { outline: none; border-color: var(--red); }
select.input { appearance: none; }
.label { color: var(--text-muted); font-size: 0.75rem; display: block; margin-bottom: 0.25rem; }

/* ── Badge ── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-green  { background: #065f4620; color: var(--green); }
.badge-yellow { background: #78350f20; color: var(--yellow); }
.badge-orange { background: #92400e20; color: #fb923c; }
.badge-red    { background: #7f1d1d20; color: var(--danger); }
.badge-clickable:hover { opacity: 0.8; }

/* ── Stats ── */
.stat-value { font-size: 1.4rem; font-weight: 800; }
.stat-label { color: var(--text-dim); font-size: 0.7rem; margin-bottom: 0.25rem; }

/* ── Header ── */
.header {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 40;
}
.header-logo { font-size: 1.25rem; font-weight: 900; color: var(--red); }
.header-user { color: var(--text-muted); font-size: 0.875rem; }

/* ── Navigation ── */
.nav {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}
.nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: #1a1a1a; }
.nav-link.active { color: var(--red); background: #ef444415; }

/* ── Modal ── */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}
.modal h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Toast ── */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}
.toast-success { background: #065f46; color: var(--green); }
.toast-error { background: #7f1d1d; color: var(--danger); }

/* ── Animations ── */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Utility ── */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--danger); }
.text-primary { color: var(--red); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-2 { padding-top: 0.5rem; }
.border-b { border-bottom: 1px solid var(--border); }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.hidden { display: none; }