/* Retro Bide Collec : styles de l'administration */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--page-bg);
    background-attachment: fixed;
    color: var(--fg);
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: rgb(var(--shade) / 0.3);
    backdrop-filter: blur(10px);
    position: fixed;
    height: 100vh;
    padding: 20px;
    border-right: 1px solid rgb(var(--ink) / 0.1);
}

.sidebar h2 {
    color: var(--accent);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgb(var(--ink) / 0.1);
    font-size: 1.5rem;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin: 10px 0;
}

.sidebar a {
    color: var(--muted);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar a:hover, .sidebar a.active {
    background: rgb(var(--accent-rgb) / 0.1);
    color: var(--accent);
}

.sidebar a i {
    font-size: 1.1rem;
}

.main-content {
    margin-left: 270px;
    padding: 20px;
}

.header {
    background: rgb(var(--shade) / 0.2);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgb(var(--ink) / 0.1);
}

.header h1 {
    color: var(--accent);
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--muted);
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: var(--accent);
    color: #1a1a2e;
}

.btn-primary:hover {
    background: #00b8e6;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ff3742;
}

.btn-success {
    background: #2ed573;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-warning {
    background: #ffa502;
    color: #1a1a2e;
}

.btn-warning:hover {
    background: #ff9f1c;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.card {
    background: rgb(var(--shade) / 0.2);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgb(var(--ink) / 0.1);
}

.card h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgb(var(--shade) / 0.3);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgb(var(--ink) / 0.1);
}

.stat-card h4 {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: rgb(var(--ink) / 0.05);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgb(var(--ink) / 0.1);
}

th {
    background: rgb(var(--shade) / 0.3);
    color: var(--accent);
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background: rgb(var(--accent-rgb) / 0.05);
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: var(--accent);
    color: #1a1a2e;
}

.badge-user {
    background: #6c757d;
    color: white;
}

.badge-suspended {
    background: #ffa502;
    color: #1a1a2e;
}

.badge-banned {
    background: #ff4757;
    color: white;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgb(var(--ink) / 0.2);
    border-radius: 5px;
    background: rgb(var(--ink) / 0.1);
    color: var(--fg);
    font-size: 0.9rem;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-bar select {
    padding: 10px 15px;
    border: 1px solid rgb(var(--ink) / 0.2);
    border-radius: 5px;
    background: rgb(var(--ink) / 0.1);
    color: var(--fg);
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgb(var(--ink) / 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgb(var(--ink) / 0.1);
}

.modal-header h3 {
    color: var(--accent);
}

.close-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.close-btn:hover {
    color: #ff4757;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body p {
    margin-bottom: 15px;
    color: var(--muted);
}

.password-display {
    background: rgb(var(--shade) / 0.3);
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--accent);
}

.spinner {
    border: 3px solid rgb(var(--accent-rgb) / 0.3);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.alert-success {
    background: rgba(46, 213, 115, 0.2);
    border: 1px solid #2ed573;
    color: #2ed573;
    display: block;
}

.alert-error {
    background: rgba(255, 71, 87, 0.2);
    border: 1px solid #ff4757;
    color: #ff4757;
    display: block;
}

.chart-container {
    height: 300px;
    background: rgb(var(--shade) / 0.3);
    border-radius: 8px;
    padding: 15px;
}

.tab-container {
    margin-top: 20px;
}

.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid rgb(var(--ink) / 0.1);
    margin-bottom: 15px;
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Retro button styles to match main site */
.retro-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 3px solid;
    border-top-color: rgb(var(--ink) / 0.4);
    border-left-color: rgb(var(--ink) / 0.4);
    border-right-color: rgb(var(--shade) / 0.4);
    border-bottom-color: rgb(var(--shade) / 0.4);
    background: linear-gradient(135deg, rgb(var(--ink) / 0.15), rgb(var(--shade) / 0.1));
    box-shadow: -4px -4px 0 rgb(var(--shade) / 0.3), 4px 4px 0 rgb(var(--shade) / 0.5);
    transition: all 0.1s ease;
    cursor: pointer;
    user-select: none;
}
.retro-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: -2px -2px 0 rgb(var(--shade) / 0.3), 2px 2px 0 rgb(var(--shade) / 0.5);
}
.retro-btn:active {
    transform: translate(3px, 3px);
    box-shadow: -1px -1px 0 rgb(var(--shade) / 0.3), 1px 1px 0 rgb(var(--shade) / 0.5);
    border-top-color: rgb(var(--shade) / 0.4);
    border-left-color: rgb(var(--shade) / 0.4);
    border-right-color: rgb(var(--ink) / 0.4);
    border-bottom-color: rgb(var(--ink) / 0.4);
}
.retro-btn-primary { background: linear-gradient(135deg, #6b2f8f, #4a1e5c); border-color: #4a1e5c; color: #fff; }
.retro-btn-success { background: linear-gradient(135deg, #2ed573, #1a7d3a); border-color: #1a7d3a; color: #000; }
.retro-btn-danger { background: linear-gradient(135deg, #ff4757, #8b0000); border-color: #8b0000; color: #fff; }
.retro-btn-warning { background: linear-gradient(135deg, #ffa502, #8b5a00); border-color: #8b5a00; color: #000; }
.retro-btn-info { background: linear-gradient(135deg, #00e5ff, #008ba3); border-color: #008ba3; color: #000; }
.retro-btn-secondary { background: linear-gradient(135deg, #3f3f5f, #2a2a3a); border-color: #2a2a3a; color: #fff; }

/* Terminal input style */
.terminal-input {
    font-family: 'VT323', monospace;
    font-size: 1.25rem;
    line-height: 1.4;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--fg);
    padding: 8px 12px;
}
.terminal-input:focus {
    outline: none;
    border-color: #00e5ff;
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25);
}

/* Console border style */
.console-border {
    position: relative;
    border: 4px solid var(--panel-border);
    border-radius: 12px;
    background: var(--panel-bg);
}
.console-border::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: var(--panel-frame);
    border-radius: 16px;
    z-index: -1;
}

/* Themes : sombre par defaut, clair avec html.light (voir /theme.js) */
:root {
    --fg: #e0e0e0; --muted: #a0a0a0; --accent: #00d4ff; --accent-rgb: 0 212 255;
    --ink: 255 255 255;      /* traits et voiles clairs sur fond sombre */
    --shade: 0 0 0;          /* panneaux assombris */
    --page-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --modal-bg: rgba(26, 26, 46, 0.95);
    --input-bg: #0a0a14; --input-border: #3f3f5f;
    --panel-border: #2a2a3a; --panel-bg: linear-gradient(145deg, #1a1a2e, #2a1e5c);
    --panel-frame: linear-gradient(145deg, #3f3f5f, #1a1a2e);
}
html.light {
    --fg: #1e1633; --muted: #5a5470; --accent: #006f96; --accent-rgb: 0 111 150;
    --ink: 30 22 51;
    --shade: 255 255 255;
    --page-bg: linear-gradient(135deg, #f6f3fc 0%, #ece9f7 50%, #e1e8f5 100%);
    --modal-bg: rgba(252, 251, 255, 0.98);
    --input-bg: #ffffff; --input-border: #b8a8dc;
    --panel-border: #cfc4e6; --panel-bg: linear-gradient(145deg, #ffffff, #f1ecfa);
    --panel-frame: linear-gradient(145deg, #d9d0ec, #bfb2dd);
}
html.light .stat-card, html.light .card, html.light .header, html.light .sidebar { box-shadow: 0 2px 8px rgba(60, 30, 110, 0.08); }

/* Telephone : menu lateral en bandeau defilant, contenu pleine largeur */
@media (max-width: 768px) {
    .sidebar {
        position: static; width: auto; height: auto; padding: 12px 12px 6px;
        border-right: 0; border-bottom: 1px solid rgb(var(--ink) / 0.1);
    }
    .sidebar h2 { margin-bottom: 8px; padding-bottom: 8px; font-size: 1.2rem; }
    .sidebar ul { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
    .sidebar li { margin: 0; flex: 0 0 auto; }
    .sidebar a { padding: 8px 10px; white-space: nowrap; }
    .main-content { margin-left: 0; padding: 12px; }
    .header { flex-wrap: wrap; gap: 10px; }
    .header h1 { font-size: 1.2rem; }
    .user-info { flex-wrap: wrap; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { padding: 12px; }
    .stat-card .value { font-size: 1.5rem; }
    .search-bar { flex-wrap: wrap; }
    .search-bar input, .search-bar select { flex: 1 1 100%; min-width: 0; font-size: 16px; }
    .modal-content { padding: 18px; max-height: 90vh; overflow-y: auto; }
    th, td { padding: 8px; }
}

/* Retro colors for admin */
:root {
    --retro-800: #0a0a1a;
    --retro-700: #1a1a2e;
    --retro-600: #2a1e5c;
    --retro-500: #3a2e6c;
    --retro-400: #4a3e7c;
    --retro-300: #6b2f8f;
    --retro-200: #8b3fa0;
    --retro-100: #c77dff;
    --snes-cyan: #00e5ff;
    --snes-pink: #ff6ec7;
}

/* ---- Avatars ---- */
.admin-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #4a3e7c;
    background: #000;
    vertical-align: middle;
}
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-avatar img.pixel { image-rendering: pixelated; }
.admin-avatar-big { width: 96px; height: 96px; border-width: 3px; }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
.avatar-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    min-width: 140px;
    border: 2px solid #4a3e7c;
    border-radius: 8px;
}
.avatar-name { font-weight: bold; word-break: break-all; text-align: center; }
.avatar-color input { width: 48px; height: 28px; border: none; background: none; cursor: pointer; }
.avatar-help { opacity: 0.8; margin: 4px 0 8px; }
.avatar-add { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; }
.avatar-add input[type="color"] { width: 48px; height: 28px; vertical-align: middle; margin-left: 6px; }

/* ---- Quotas des API externes ---- */
.quota-bar { height: 10px; background: #1a1a2e; border: 1px solid #4a3e7c; border-radius: 5px; overflow: hidden; margin: 4px 0 2px; min-width: 140px; }
.quota-bar span { display: block; height: 100%; }
.quota-account { display: grid; gap: 10px; margin-bottom: 12px; }
.quota-week { display: flex; gap: 4px; }
.quota-week span { min-width: 34px; text-align: center; padding: 2px 4px; background: #1a1a2e; border: 1px solid #4a3e7c; border-radius: 4px; font-size: 12px; }
