/* =============================================================================
   editor.gyromap.fr — Styles communs
   ============================================================================= */

:root {
  --bg: #0A0E27;
  --bg-card: #131836;
  --bg-input: #1A2048;
  --border: #2A3158;
  --text: #E8EBF7;
  --text-muted: #8B92AB;
  --primary: #5B8DEF;
  --primary-hover: #6B9DFF;
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  --radius: 10px;
  --radius-lg: 16px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  font-size: 15px;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* ===== Header ===== */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.app-header .logo span { color: var(--primary); }
.app-header nav { display: flex; gap: 20px; align-items: center; }
.app-header nav a { color: var(--text-muted); font-size: 14px; }
.app-header nav a.active { color: var(--primary); font-weight: 600; }
.app-header nav a:hover { color: var(--text); text-decoration: none; }
.app-header .user-pill {
  background: var(--bg-input);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.app-header .user-pill .role {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.user-pill .role.moderator { background: #5B8DEF22; color: var(--primary); }
.user-pill .role.admin { background: #FF950022; color: var(--warning); }
.user-pill .level-pill {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #5B8DEF, #34C759);
}
.user-pill .level-pill.hidden { display: none; }

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.container.narrow { max-width: 600px; }

h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 20px; font-weight: 600; margin-bottom: 16px; margin-top: 32px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.subtitle { color: var(--text-muted); margin-bottom: 24px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.card.compact { padding: 16px; }

/* ===== Forms ===== */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
}
.field textarea { resize: vertical; min-height: 100px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field .error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  background: var(--primary);
  color: white;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.05s;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.secondary { background: var(--bg-input); color: var(--text); border-color: var(--border); }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.warning { background: var(--warning); }
.btn.outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.small { padding: 7px 12px; font-size: 12px; }
.btn.full { width: 100%; }

/* ===== Alerts ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid;
}
.alert.success { background: #34C75922; border-color: var(--success); color: #B4F3C0; }
.alert.danger { background: #FF3B3022; border-color: var(--danger); color: #FFB8B5; }
.alert.warning { background: #FF950022; border-color: var(--warning); color: #FFD4A1; }
.alert.info { background: #5B8DEF22; border-color: var(--primary); color: #C2D6FA; }

/* ===== Status pills ===== */
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-pill.pending { background: #FF950022; color: var(--warning); }
.status-pill.approved { background: #34C75922; color: var(--success); }
.status-pill.rejected { background: #FF3B3022; color: var(--danger); }

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
}
table th, table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
table tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: var(--bg-input); }

/* ===== Map ===== */
.map-wrap {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.map-wrap.tall { height: 500px; }

/* ===== Badges grid ===== */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: transform 0.15s;
}
.badge-card.unlocked {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--bg-card) 0%, #34C75911 100%);
}
.badge-card.locked { opacity: 0.5; }
.badge-card .badge-icon { font-size: 48px; margin-bottom: 12px; }
.badge-card .badge-name { font-weight: 700; margin-bottom: 4px; }
.badge-card .badge-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.badge-card .badge-progress {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

/* ===== Stats cards ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-box .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-box .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  padding: 12px 18px;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab:hover { color: var(--text); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow: auto;
}

/* ===== Utilities ===== */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-small { font-size: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .app-header { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .app-header nav { order: 3; width: 100%; }
  .container { padding: 20px 16px; }
  h1 { font-size: 22px; }
  table { font-size: 13px; }
  table th, table td { padding: 8px 10px; }
}
