/* =============================================
   VENTOU — Admin Panel — Styles
   ============================================= */

:root {
  --primary: #FF6B2C;
  --primary-dark: #e55a1f;
  --sidebar-bg: #1A1A2E;
  --sidebar-width: 240px;
  --text: #1a1a1a;
  --text-light: #6b7280;
  --bg: #f3f4f6;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }

/* ---------- Login ---------- */
.view-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1A1A2E, #16213E);
}

.login-card {
  background: #fff;
  padding: 48px 40px;
  border-radius: 16px;
  text-align: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo { font-size: 2rem; margin-bottom: 20px; font-weight: 800; color: var(--primary); }
.login-logo span { vertical-align: middle; }
.login-card h2 { font-size: 1.4rem; margin-bottom: 8px; }
.login-card > p { color: var(--text-light); margin-bottom: 28px; font-size: 0.9rem; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: box-shadow 0.2s;
}
.btn-google:hover { box-shadow: var(--shadow); }
.btn-google img { width: 20px; }

.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 14px; min-height: 20px; }

/* ---------- Login Form ---------- */
.form-group { margin-bottom: 14px; text-align: left; }

.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--primary); }

.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}
.btn-submit:hover:not(:disabled) { background: var(--primary-dark); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-card {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.modal-card > p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 24px; }

/* ---------- Layout ---------- */
#viewDashboard { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  transition: background 0.2s, color 0.2s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(255,107,44,0.15); color: var(--primary); border-left-color: var(--primary); }
.nav-icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.admin-user {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-logout:hover { background: rgba(239,68,68,0.25); }

/* ---------- Main ---------- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { font-size: 1.25rem; font-weight: 700; }

.topbar-actions input {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  width: 240px;
  transition: border-color 0.2s;
}
.topbar-actions input:focus { border-color: var(--primary); }

.page-content { padding: 28px; flex: 1; }

/* ---------- Stats Cards ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; margin-top: 4px; }
.stat-card .stat-delta { font-size: 0.8rem; color: var(--success); margin-top: 4px; }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.success { border-left-color: var(--success); }

/* ---------- Data Table ---------- */
.data-table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-table-header {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.data-table-header h3 { font-size: 1rem; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  padding: 12px 16px;
  background: var(--bg);
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
tbody td { padding: 12px 16px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.active  { background: #dcfce7; color: #16a34a; }
.badge.pending { background: #fef9c3; color: #a16207; }
.badge.banned  { background: #fee2e2; color: #dc2626; }
.badge.sold    { background: #e0e7ff; color: #4338ca; }

/* ---------- Action Buttons ---------- */
.btn-action {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0 2px;
  transition: opacity 0.2s;
}
.btn-action:hover { opacity: 0.8; }
.btn-action.view   { background: #eff6ff; color: #2563eb; }
.btn-action.ban    { background: #fee2e2; color: #dc2626; }
.btn-action.delete { background: #fee2e2; color: #dc2626; }
.btn-action.approve { background: #dcfce7; color: #16a34a; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); z-index: 50; transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* =============================================
   EXTENSIONS — nouvelles pages & composants
   ============================================= */

/* Stat card icon */
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 6px; color: var(--primary); }
.stat-card.success .stat-icon { color: var(--success); }
.stat-card.danger  .stat-icon { color: var(--danger); }
.stat-card.warning .stat-icon { color: var(--warning); }

/* Loading */
.loading { padding: 60px; text-align: center; color: var(--text-light); font-size: 1rem; }

/* Grid 2 colonnes */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

/* Page toolbar */
.page-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-toolbar input[type="text"], .page-toolbar input:not([type]) {
  flex: 1; min-width: 180px; max-width: 320px;
  padding: 9px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem; outline: none;
  font-family: var(--font); transition: border-color 0.2s;
}
.page-toolbar input:focus { border-color: var(--primary); }

/* Count badge */
.count-badge {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 0.8rem; white-space: nowrap;
}

/* Create button */
.btn-create {
  padding: 9px 18px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 0.9rem; font-weight: 600; font-family: var(--font);
  transition: background 0.2s; white-space: nowrap;
}
.btn-create:hover { background: var(--primary-dark); }

/* Filter tabs */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 0.82rem; background: #fff; font-family: var(--font);
  transition: all 0.15s;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-count { font-weight: 700; margin-left: 4px; }
.tab-danger { color: var(--danger); }

/* User / pub cell */
.user-cell, .pub-cell { display: flex; align-items: center; gap: 10px; }
.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.avatar-placeholder {
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}

/* UID */
.uid { font-family: monospace; font-size: 0.78rem; color: var(--text-light); word-break: break-all; }
.uid.small { font-size: 0.72rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; display: inline-block; white-space: nowrap; vertical-align: middle; }

/* Empty cell */
.empty-cell { text-align: center; padding: 28px; color: var(--text-light); }

/* Actions cell */
.actions-cell { white-space: nowrap; }

/* Text muted */
.text-muted { color: var(--text-light); font-size: 0.88rem; }

/* Textarea full */
.textarea-full {
  width: 100%; resize: vertical; padding: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 0.9rem; outline: none;
  transition: border-color 0.2s; box-sizing: border-box;
}
.textarea-full:focus { border-color: var(--primary); }

/* Input disabled */
.input-disabled { background: #f9fafb; cursor: not-allowed; color: var(--text-light); }

/* Form label */
.form-group label { display: block; font-size: 0.82rem; color: var(--text-light); margin-bottom: 6px; font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ─── Modal générique ─── */
#modalOverlay { z-index: 100; }
.modal-box {
  background: #fff; border-radius: 16px;
  width: 92%; max-width: 520px; max-height: 88vh;
  overflow-y: auto; padding: 32px;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-large { max-width: 740px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg); border: none; font-size: 0.95rem; cursor: pointer;
  color: var(--text-light); width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.2s;
}
.modal-close:hover { background: var(--border); }

/* Modal inner layout */
.modal-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.2rem; margin-bottom: 4px; }
.modal-footer { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* Detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.detail-item { background: var(--bg); border-radius: 8px; padding: 10px 14px; }
.detail-item label { display: block; font-size: 0.72rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.detail-item span { font-size: 0.9rem; }

/* Mini cards */
.mini-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mini-card {
  background: var(--bg); border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 0.88rem;
}
.mini-card strong { flex: 1; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Desc block */
.desc-block { background: var(--bg); border-radius: 8px; padding: 14px; margin: 12px 0; font-size: 0.9rem; }
.desc-block label { display: block; font-size: 0.72rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }

/* Pub images */
.pub-images { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.pub-thumb { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; }

/* h4 in modals */
h4 { font-size: 0.95rem; color: var(--text); margin-bottom: 8px; }

/* ─── Annonces ─── */
.annonce-preview { padding: 10px 14px; background: var(--bg); border-radius: 8px; }
.annonce-preview strong { display: block; font-size: 0.9rem; margin-bottom: 3px; }
.annonce-preview p { font-size: 0.85rem; color: var(--text-light); margin: 0; }
.annonce-link { font-size: 0.78rem; color: var(--primary); display: block; margin-top: 4px; word-break: break-all; }

/* ─── Toggle switch ─── */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  width: 42px; height: 24px; background: var(--border); border-radius: 12px;
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.toggle-slider::after {
  content: ""; position: absolute; left: 4px; top: 4px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }

/* ─── Notifications grid ─── */
.notif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ─── Charts ─── */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.chart-card h4 { font-size: 0.88rem; color: var(--text-light); margin-bottom: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* CSS bar chart */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bar-label { width: 90px; font-size: 0.8rem; text-align: right; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 12px; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.6s ease; }
.bar-val { font-size: 0.82rem; font-weight: 600; min-width: 28px; color: var(--text); }

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: #1a1a2e; color: #fff;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 0.9rem; z-index: 999;
  transform: translateY(20px); opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast.toast-show { transform: translateY(0); opacity: 1; }

/* ─── Reason chips (ban modal) ─── */
.reason-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.reason-chip {
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 0.82rem; font-family: var(--font); cursor: pointer;
  color: var(--text); transition: all 0.18s;
}
.reason-chip:hover { border-color: var(--danger); color: var(--danger); }
.reason-chip.active { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }

/* ─── Btn-vendor (pub table) ─── */
.btn-vendor {
  background: none; border: none; cursor: pointer; color: var(--text);
  font-family: var(--font); font-size: 0.82rem; padding: 2px 4px;
  display: flex; align-items: center; gap: 5px;
  border-radius: 4px; transition: background 0.15s;
}
.btn-vendor:hover { background: var(--bg); color: var(--primary); }

/* ─── Responsive extras ─── */
@media (max-width: 960px) {
  .grid-2, .charts-grid, .notif-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filter-tabs { flex-wrap: wrap; }
}
