/* ============================================================
   fiche-make — Design System
   Dark, orange accent, clean & sharp
   ============================================================ */

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

:root {
  --bg:        #0a0a0c;
  --bg-1:      #111115;
  --bg-2:      #18181f;
  --bg-3:      #222228;
  --border:    #2a2a33;
  --border-2:  #38383f;
  --text:      #e8e8f0;
  --text-2:    #9090a0;
  --text-3:    #55555f;
  --accent:    #f0a500;
  --accent-2:  #e67e00;
  --accent-bg: rgba(240,165,0,0.08);
  --danger:    #e05050;
  --danger-bg: rgba(224,80,80,0.08);
  --success:   #40c070;
  --success-bg:rgba(64,192,112,0.08);
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Mono', 'Consolas', monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ============================================================
   LOGIN / REGISTER
   ============================================================ */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(240,165,0,0.12) 0%, transparent 70%),
    var(--bg);
}

.auth-wrap { width: 100%; max-width: 420px; }

.auth-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}

.brand-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #000;
  flex-shrink: 0;
}

.brand-name { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); }
.brand-sub  { font-size: 11px; color: var(--text-3); letter-spacing: 0.5px; }

.auth-title {
  font-size: 22px; font-weight: 700;
  text-align: center; margin-bottom: 4px; color: var(--text);
}

.auth-sub {
  text-align: center; color: var(--text-3);
  font-size: 13px; margin-bottom: 28px;
}

.auth-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(224,80,80,0.2);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 20px;
  text-align: center; font-weight: 500;
}

.auth-error.banned {
  background: rgba(200,30,30,0.12);
  border-color: rgba(200,30,30,0.3);
  color: #ff4444;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }

.auth-label {
  font-size: 11px; color: var(--text-3);
  letter-spacing: 1px; font-weight: 600; text-transform: uppercase;
}

.auth-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; outline: none;
  font-family: var(--font);
  transition: border-color 0.15s;
}

.auth-input:focus { border-color: var(--accent); }
.auth-input:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-btn {
  background: var(--accent);
  color: #000;
  border: none; cursor: pointer;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700;
  font-family: var(--font);
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
}

.auth-btn:hover:not(:disabled) { opacity: 0.9; }
.auth-btn:active:not(:disabled) { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px; color: var(--text-3);
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}

.auth-link:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT
   ============================================================ */

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

/* ---- SIDEBAR ---- */

.sidebar {
  width: 220px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}

.nav-section { padding: 12px 0; }

.nav-title {
  font-size: 10px; font-weight: 600;
  color: var(--text-3); letter-spacing: 1.2px;
  padding: 0 18px 6px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  border-radius: 0;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
}

.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link.active { color: var(--accent); }
.nav-link.active::before { opacity: 1; }

.nav-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 8px; }

/* quota bar in sidebar */
.quota-bar-wrap {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.quota-label {
  font-size: 10px; color: var(--text-3); letter-spacing: 1px; font-weight: 600;
  margin-bottom: 6px; display: flex; justify-content: space-between;
}

.quota-bar {
  height: 4px; background: var(--bg-3); border-radius: 4px; overflow: hidden;
}

.quota-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

.quota-fill.danger { background: var(--danger); }

/* ---- MAIN ---- */

.main {
  flex: 1;
  margin-left: 220px;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  height: 52px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  position: sticky; top: 0; z-index: 50;
}

.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 18px; padding: 4px;
}

.top-bar-title {
  font-size: 14px; font-weight: 600; color: var(--text);
}

.top-bar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}

.badge-quota {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(240,165,0,0.2);
  font-family: var(--font-mono);
}

.badge-quota.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(224,80,80,0.2);
}

.content {
  flex: 1;
  padding: 24px;
  max-width: 900px;
  width: 100%;
}

/* ============================================================
   NO-KEY BANNER
   ============================================================ */

.no-key-banner {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  margin-bottom: 24px;
}

.no-key-icon {
  font-size: 40px; margin-bottom: 16px; display: block;
}

.no-key-title {
  font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text);
}

.no-key-sub {
  color: var(--text-2); font-size: 14px; margin-bottom: 24px; line-height: 1.6;
}

.key-input-row {
  display: flex; gap: 10px; max-width: 520px; margin: 0 auto;
}

.key-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.15s;
}

.key-input:focus { border-color: var(--accent); }
.key-input::placeholder { color: var(--text-3); }

.btn-activate {
  background: var(--accent); color: #000;
  border: none; cursor: pointer;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  font-family: var(--font);
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-activate:hover { opacity: 0.9; }
.btn-activate:active { transform: scale(0.97); }

.key-msg {
  margin-top: 12px; font-size: 13px; min-height: 18px;
}

.key-msg.ok { color: var(--success); }
.key-msg.err { color: var(--danger); }

.quota-exceeded-banner {
  border-color: #c77700;
  background: rgba(199, 119, 0, 0.07);
}

.quota-exceeded-banner .no-key-title {
  color: #e09000;
}

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }

.filter-label {
  font-size: 10px; color: var(--text-3); font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
}

.filter-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px; width: 110px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.filter-input:focus { border-color: var(--accent); }

.btn-apply {
  align-self: flex-end;
  background: var(--accent); color: #000;
  border: none; cursor: pointer;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; font-family: var(--font);
  transition: opacity 0.15s, transform 0.1s;
}

.btn-apply:hover { opacity: 0.9; }
.btn-apply:active { transform: scale(0.97); }

.btn-clear {
  align-self: flex-end;
  background: var(--bg-3); color: var(--text-2);
  border: 1px solid var(--border);
  cursor: pointer; padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; font-family: var(--font);
  transition: background 0.15s;
}

.btn-clear:hover { background: var(--bg-2); }

.filter-status {
  font-size: 11px; color: var(--text-3); font-family: var(--font-mono);
  align-self: flex-end;
  padding-bottom: 9px;
}

.filter-status.active { color: var(--accent); }

/* ============================================================
   FICHE CARD
   ============================================================ */

.fiche-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.avatar {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}

.fiche-name {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}

.fiche-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 500;
}

/* ---- FICHE GRID ---- */

.fiche-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-3); letter-spacing: 1.2px;
  margin-bottom: 16px; text-transform: uppercase;
}

.field {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-3);
}

.field:last-child { border-bottom: none; }

.label {
  font-size: 10px; font-weight: 600;
  color: var(--text-3); letter-spacing: 0.8px;
}

.value {
  font-size: 13px; color: var(--text); font-weight: 500;
  word-break: break-all;
  font-family: var(--font-mono);
}

.value-copy-row {
  display: flex; align-items: center; gap: 8px;
}

.value-copy-row .value {
  flex: 1;
}

.btn-copy {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 7px;
  line-height: 1.5;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--bg-2);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-copy.copied {
  color: var(--success);
  border-color: var(--success);
}

/* IBAN breakdown */

.iban-breakdown {
  margin: 8px 0 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}

.iban-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
}

.iban-dot {
  width: 5px; height: 5px;
  background: var(--border-2);
  border-radius: 50%; flex-shrink: 0;
}

.iban-icon { font-size: 12px; flex-shrink: 0; }

.iban-label { color: var(--text-3); min-width: 90px; font-size: 11px; }

.iban-badge {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 1px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.iban-value { color: var(--text); font-weight: 500; font-size: 12px; }

.iban-banque-row { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; }

/* ---- ACTIONS ---- */

.actions {
  display: flex; gap: 12px; justify-content: center;
  padding: 4px 0 8px;
}

.btn-primary {
  background: var(--accent); color: #000;
  border: none; cursor: pointer;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; font-family: var(--font);
  transition: opacity 0.15s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-2); color: var(--text-2);
  border: 1px solid var(--border); cursor: pointer;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; font-family: var(--font);
  transition: background 0.15s, transform 0.1s;
}

.btn-secondary:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }
.btn-secondary:active:not(:disabled) { transform: scale(0.97); }
.btn-secondary:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-danger {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid rgba(224,80,80,0.2); cursor: pointer;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: var(--font);
  transition: background 0.15s, transform 0.1s;
}

.btn-danger:hover { background: rgba(224,80,80,0.15); }
.btn-danger:active { transform: scale(0.97); }

/* ============================================================
   STATS (DASHBOARD)
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.stat-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-3); letter-spacing: 1px;
  margin-bottom: 10px; text-transform: uppercase;
}

.stat-value {
  font-size: 28px; font-weight: 700; color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
}

.stat-value.small { font-size: 16px; color: var(--text); }

/* ============================================================
   ADMIN
   ============================================================ */

.admin-section {
  margin-bottom: 32px;
}

.admin-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-3); letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.admin-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left; padding: 8px 12px;
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 1px; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-2); color: var(--text); }

.admin-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-btn {
  background: none; border: none;
  font-size: 11px; cursor: pointer;
  padding: 3px 8px; border-radius: 4px;
  font-family: var(--font); font-weight: 600;
  transition: background 0.12s;
}

.admin-btn.reset { color: var(--accent); }
.admin-btn.reset:hover { background: var(--accent-bg); }
.admin-btn.delete { color: var(--danger); }
.admin-btn.delete:hover { background: var(--danger-bg); }

.api-doc {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
}

.api-doc .api-path { color: var(--accent); font-weight: 600; }
.api-doc .api-comment { color: var(--text-3); }

/* ============================================================
   OVERLAY / MOBILE
   ============================================================ */

.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 90;
}

.overlay.show { display: block; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .fiche-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .key-input-row { flex-direction: column; }
}

/* ── ADMIN BADGE ── */
.badge-admin {
  background: var(--accent);
  color: #000;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── ADMIN CONTENT ── */
.admin-content { padding: 20px; max-width: 1100px; }

/* ── ADMIN TABS ── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.admin-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font: 600 .8rem/1 var(--font);
  letter-spacing: .06em;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  border-radius: 6px 6px 0 0;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── ADMIN CARD ── */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.admin-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-title {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.admin-table th {
  text-align: left;
  font-size: .7rem;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,.03); }
.empty-row { color: var(--text-muted); font-style: italic; text-align: center; padding: 24px; }

.user-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .8rem;
  font-weight: 600;
}
.key-level-badge {
  background: rgba(240,165,0,.15);
  color: var(--accent);
  border: 1px solid rgba(240,165,0,.3);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .75rem;
  font-weight: 700;
}
.no-key-tag {
  color: var(--text-muted);
  font-size: .75rem;
}
.date-cell { color: var(--text-muted); font-size: .78rem; }
.actions-cell { display: flex; gap: 6px; }

.status-used {
  background: rgba(220,50,50,.15);
  color: #e05555;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 600;
}
.status-free {
  background: rgba(40,180,100,.12);
  color: #3ec87a;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 600;
}
.token-cell { font-size: .78rem; color: var(--accent); }
.secret-cell { font-size: .7rem; color: var(--text-muted); word-break: break-all; }

.btn-sm {
  border: none;
  border-radius: 6px;
  font: 600 .72rem var(--font);
  padding: 4px 10px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn-sm:active { transform: scale(.96); }
.btn-warn { background: rgba(240,165,0,.15); color: var(--accent); }
.btn-warn:hover { background: rgba(240,165,0,.25); }
.btn-danger { background: rgba(220,50,50,.15); color: #e05555; }
.btn-danger:hover { background: rgba(220,50,50,.25); }

.admin-msg { padding: 10px 0; font-size: .82rem; font-weight: 600; min-height: 24px; }
.admin-msg.ok { color: #3ec87a; }
.admin-msg.err { color: #e05555; }

/* ── CREATE KEY FORM ── */
.create-key-card .admin-card-header { margin-bottom: 0; }
.create-key-form { padding: 20px; }
.form-row { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 400 .9rem var(--font);
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.form-input:focus { border-color: var(--accent); }
.form-hint { font-size: .72rem; color: var(--text-muted); margin-top: 5px; }

.level-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.level-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: 700 .9rem var(--font);
  padding: 8px 14px;
  cursor: pointer;
  transition: all .15s;
  min-width: 52px;
}
.level-btn .level-fiches { font-size: .65rem; font-weight: 500; color: var(--text-muted); }
.level-btn:hover { border-color: var(--accent); color: var(--accent); }
.level-btn.active { background: rgba(240,165,0,.12); border-color: var(--accent); color: var(--accent); }
.level-btn.active .level-fiches { color: var(--accent); opacity: .7; }

.btn-create-key {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font: 700 .85rem var(--font);
  letter-spacing: .05em;
  padding: 12px 28px;
  cursor: pointer;
  transition: all .2s;
  margin-top: 4px;
}
.btn-create-key:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(240,165,0,.25); }
.btn-create-key:active { transform: scale(.97); }

.create-key-result {
  margin-top: 16px;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: .84rem;
  line-height: 1.6;
}
.create-key-result.ok { background: rgba(40,180,100,.1); border: 1px solid rgba(40,180,100,.25); color: var(--text); }
.create-key-result.err { background: rgba(220,50,50,.1); border: 1px solid rgba(220,50,50,.25); color: #e05555; }
.result-row { margin-bottom: 4px; }
.result-label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; margin-right: 8px; }
.result-copy { margin-top: 10px; font-size: .75rem; color: var(--text-muted); font-style: italic; }

/* ── MINI BAR ── */
.usage-bar-cell { min-width: 120px; }
.mini-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* ── API DOC ── */
.api-doc { display: flex; flex-direction: column; gap: 16px; }
.api-endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.api-method {
  display: inline-block;
  font: 700 .7rem var(--font);
  letter-spacing: .1em;
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.api-method.get { background: rgba(40,130,220,.15); color: #5aabff; }
.api-method.post { background: rgba(40,180,100,.12); color: #3ec87a; }
.api-path { font: 600 .9rem/1.4 monospace; color: var(--text); margin-bottom: 6px; }
.api-desc { font-size: .82rem; color: var(--text-muted); margin-bottom: 12px; }
.api-params { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.api-param { font-size: .78rem; color: var(--text); }
.param-name { color: var(--accent); font-weight: 600; font-family: monospace; }
.api-example-title { font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.api-code {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font: .78rem monospace;
  color: var(--accent);
  margin-bottom: 8px;
}
.api-response {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font: .76rem/1.7 monospace;
  color: var(--text-muted);
  margin: 0;
  overflow-x: auto;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-label { font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-value.small { font-size: 1.1rem; }

/* ── SIDEBAR BRAND ── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* ── DISCORD LOGIN ── */
.discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font: 700 .95rem var(--font);
  padding: 14px 24px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .15s, box-shadow .2s;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
}
.discord-btn:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88,101,242,.35);
}
.discord-btn:active { transform: scale(.97); }
.discord-icon { width: 22px; height: 22px; flex-shrink: 0; }
.auth-sub {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
}
