/* =============================================
   UwU Café Dashboard — Thème sombre Discord
   ============================================= */

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

:root {
    --bg-dark      : #23272a;
    --bg-medium    : #2c2f33;
    --bg-light     : #36393f;
    --bg-card      : #2c2f33;
    --accent       : #5865F2;
    --accent-hover : #4752c4;
    --succes       : #57F287;
    --erreur       : #ED4245;
    --attente      : #FEE75C;
    --info         : #5865F2;
    --text         : #dcddde;
    --text-muted   : #8e9297;
    --border       : #40444b;
}

body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg-dark); color: var(--text); min-height: 100vh; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg-medium);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-header .logo { font-size: 1.2rem; font-weight: 700; display: block; color: #fff; }
.sidebar-header .subtitle { font-size: 0.75rem; color: var(--text-muted); }

.nav-list { list-style: none; padding: 0.5rem 0; flex: 1; }
.nav-list li { margin: 2px 0; }
.nav-link {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    margin: 0 0.5rem;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active {
    background: var(--bg-light);
    color: #fff;
}
.nav-link.active { background: var(--accent); color: #fff; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; }
#userName { font-size: 0.85rem; font-weight: 600; color: #fff; }
.logout-btn {
    display: block;
    text-align: center;
    padding: 0.4rem;
    background: var(--bg-light);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background 0.15s;
}
.logout-btn:hover { background: var(--erreur); color: #fff; }

/* ── Contenu principal ── */
.content { flex: 1; padding: 2rem; overflow-y: auto; }
.section { display: none; }
.section.active { display: block; }
h1 { font-size: 1.5rem; margin-bottom: 1.5rem; color: #fff; }

/* ── Cartes stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}
.stat-card.wide { grid-column: span 2; }
.stat-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: #fff; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.875rem;
}
th {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Badges statut ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-approved { background: rgba(87,242,135,0.15); color: var(--succes); }
.badge-rejected { background: rgba(237,66,69,0.15); color: var(--erreur); }
.badge-pending  { background: rgba(254,231,92,0.15); color: var(--attente); }
.badge-active   { background: rgba(87,242,135,0.15); color: var(--succes); }
.badge-offline  { background: rgba(142,146,151,0.15); color: var(--text-muted); }

/* ── Boutons ── */
.btn {
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-danger  { background: var(--erreur); color: #fff; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-success { background: var(--succes); color: #000; }

/* ── Config ── */
.config-info {
    background: rgba(88,101,242,0.1);
    border: 1px solid rgba(88,101,242,0.3);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text);
}
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.config-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.config-key {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}
.config-input-row { display: flex; gap: 0.5rem; }
.config-input {
    flex: 1;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    outline: none;
}
.config-input:focus { border-color: var(--accent); }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 999;
    transition: opacity 0.3s;
}
.toast.hidden { display: none; }
.toast.success { border-color: var(--succes); }
.toast.error   { border-color: var(--erreur); }

/* ── Médailles classement ── */
.medal-1 { color: #FFD700; }
.medal-2 { color: #C0C0C0; }
.medal-3 { color: #CD7F32; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { width: 180px; min-width: 180px; }
    .config-grid { grid-template-columns: 1fr; }
    .stat-card.wide { grid-column: span 1; }
}
