* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f6fa; color: #333; }

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 260px; background: #1a1a2e; color: #fff;
    display: flex; flex-direction: column; flex-shrink: 0;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.sidebar-subtitle { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1); padding: 12px 0; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; color: rgba(255,255,255,0.7); text-decoration: none;
    font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: #e74c3c; }
.nav-item i { width: 20px; text-align: center; font-size: 16px; }

.admin-main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; }

.admin-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 32px; background: #fff; border-bottom: 1px solid #e2e8f0;
    position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 22px; font-weight: 700; }

.admin-content { padding: 24px 32px; flex: 1; }
.admin-section { display: none; }
.admin-section.active { display: block; }

.btn {
    padding: 10px 20px; border: none; border-radius: 4px; font-size: 14px;
    font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.btn-primary { background: #e74c3c; color: #fff; }
.btn-primary:hover { background: #c0392b; }
.btn-secondary { background: #e2e8f0; color: #475569; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.table-wrap { overflow-x: auto; background: #fff; border-radius: 6px; border: 1px solid #e2e8f0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left; padding: 12px 16px; background: #f8fafc;
    font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tr:hover { background: #f8fafc; }
.admin-table .actions { display: flex; gap: 6px; }
.admin-table .thumb { width: 60px; height: 40px; object-fit: cover; border-radius: 3px; background: #e2e8f0; }

.empty-msg { text-align: center; padding: 60px 20px; color: #94a3b8; font-size: 15px; }
.empty-msg:only-child { display: block; }

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 200;
}
.modal-overlay.show { display: block; }
.modal {
    display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #fff; border-radius: 8px; width: 640px; max-width: 90vw; max-height: 85vh;
    z-index: 201; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal.show { display: block; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: #94a3b8; padding: 0; line-height: 1; }
.modal-close:hover { color: #333; }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px; border-top: 1px solid #e2e8f0;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 4px;
    font-size: 14px; font-family: inherit; transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231,76,60,0.1); }
textarea.form-control { resize: vertical; min-height: 70px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-fieldset {
    border: 1px solid #e2e8f0; border-radius: 4px; padding: 16px; margin-bottom: 16px;
}
.form-fieldset legend { font-size: 13px; font-weight: 600; color: #374151; padding: 0 8px; }
.stats-editor { display: flex; flex-direction: column; gap: 8px; }
.stat-row { display: flex; gap: 8px; }
.stat-row input { flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; }
.stat-row input:focus { outline: none; border-color: #e74c3c; }

@media (max-width: 768px) {
    .admin-sidebar { width: 200px; }
    .admin-main { margin-left: 200px; }
    .admin-topbar { padding: 16px; flex-direction: column; gap: 12px; align-items: flex-start; }
    .admin-content { padding: 16px; }
    .form-row { flex-direction: column; gap: 0; }
}
