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

:root {
  --bg:           #080808;
  --bg2:          #0F0F0F;
  --bg3:          #141414;
  --bg4:          #1C1C1C;
  --gold:         #C9A870;
  --gold-light:   #E2C898;
  --gold-dim:     rgba(201,168,112,0.08);
  --gold-border:  rgba(201,168,112,0.18);
  --green:        #4ADE80;
  --red:          #F87171;
  --text:         #F5F5F5;
  --text-dim:     rgba(245,245,245,0.55);
  --text-muted:   rgba(245,245,245,0.3);
  --border:       rgba(255,255,255,0.06);
  --border2:      rgba(255,255,255,0.1);
  --sidebar-w:    230px;
  --r:            12px;
  --r-sm:         8px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN ──────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(201,168,112,0.07) 0%, transparent 70%);
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}

.login-logo {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
  overflow: hidden;
  height: 160px;
}

.login-logo img {
  width: 300px;
  margin-top: -20px;
  margin-bottom: -40px;
  mix-blend-mode: screen;
  filter: brightness(1.1);
}

.login-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.6;
}

.btn-discord {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #5865F2; color: #fff; text-decoration: none;
  padding: 13px 24px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px;
  transition: all .2s;
  box-shadow: 0 4px 20px rgba(88,101,242,0.3);
}
.btn-discord:hover { opacity: .9; transform: translateY(-1px); }

.error-msg {
  margin-top: 14px; padding: 11px 16px;
  background: rgba(248,113,113,.07); border: 1px solid rgba(248,113,113,.2);
  border-radius: var(--r-sm); color: var(--red); font-size: 13px;
}

/* ── LOGO & SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo-img {
  width: 115%;
  margin-top: -10%;
  margin-bottom: -18%;
  mix-blend-mode: screen;
  filter: brightness(1.05);
  display: block;
}

.sidebar-nav {
  flex: 1; padding: 20px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.nav-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-muted); padding: 0 10px;
  margin: 18px 0 6px; text-transform: uppercase;
}
.nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-dim); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all .15s; position: relative;
  letter-spacing: -0.1px;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold-light);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 16px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; opacity: .8; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg3); border-radius: var(--r-sm);
  margin-bottom: 10px;
}
.user-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
#user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
  display: block; text-align: center;
  color: var(--text-muted); text-decoration: none;
  padding: 7px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500;
  transition: all .15s;
}
.btn-logout:hover { color: var(--red); background: rgba(248,113,113,.06); }

.btn-back {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-dim); text-decoration: none;
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600;
  transition: all .2s;
  background: var(--bg3);
  border: 1px solid var(--border2);
  margin-bottom: 6px;
  letter-spacing: -0.1px;
}
.btn-back:hover {
  color: var(--gold-light);
  border-color: var(--gold-border);
  background: var(--gold-dim);
}

/* ── SIDEBAR GUILD ──────────────────────────────────────────── */
.sidebar-guild {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 48px;
}

.sidebar-guild-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  object-fit: cover; border: 1px solid var(--border2);
}

.sidebar-guild-initial {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg4); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--gold);
}

.sidebar-guild-info { flex: 1; min-width: 0; }
.sidebar-guild-label {
  font-size: 9px; color: var(--text-muted); letter-spacing: 0.8px;
  text-transform: uppercase; font-weight: 700; line-height: 1;
  margin-bottom: 2px;
}
.sidebar-guild-name {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.2px; color: var(--text);
}

/* ── MAIN ───────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  padding: 48px 44px 40px;
  min-height: 100vh;
}

/* .page / .page.active → définis avec animation en bas du fichier */

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }

.page-header h1 {
  font-size: 30px; font-weight: 800; letter-spacing: -1px;
  color: var(--text);
}
.page-header p { font-size: 13px; color: var(--text-muted); margin-top: 5px; }

/* ── STATS ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  padding: 28px 24px;
  transition: background .2s;
}
.stat-card:hover { background: var(--bg3); }

.stat-icon { font-size: 18px; margin-bottom: 16px; display: block; opacity: .7; }
.stat-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--text); }

/* ── CARDS ──────────────────────────────────────────────────── */
.cards-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 16px;
}

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

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}

.card-body { padding: 8px 0; }
.card-body-pad { padding: 22px; }

/* ── ACTIONS ────────────────────────────────────────────────── */
.actions-grid { display: flex; flex-direction: column; }

.action-btn {
  width: 100%; padding: 14px 22px;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
  font-weight: 500; font-size: 13px;
  transition: all .15s; text-align: left;
  font-family: 'Inter', sans-serif;
  display: flex; align-items: center; gap: 10px;
}
.action-btn:last-child { border-bottom: none; }
.action-btn:hover { background: var(--bg3); color: var(--text); }

.action-btn--red:hover   { color: var(--red); }
.action-btn--green:hover { color: var(--green); }
.action-btn--gold:hover  { color: var(--gold-light); }

/* ── INFO ROWS ──────────────────────────────────────────────── */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 22px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-muted); font-size: 12px; }
.info-row span:last-child  { font-weight: 600; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-green { background: rgba(74,222,128,.08); color: var(--green); border: 1px solid rgba(74,222,128,.15); }
.badge-red   { background: rgba(248,113,113,.08); color: var(--red);   border: 1px solid rgba(248,113,113,.15); }
.badge-gold  { background: var(--gold-dim); color: var(--gold-light); border: 1px solid var(--gold-border); }

/* ── WARNS ──────────────────────────────────────────────────── */
.warns-list { display: flex; flex-direction: column; }

.warn-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.warn-item:last-child { border-bottom: none; }
.warn-item:hover { background: var(--bg3); }

.warn-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.warn-info { flex: 1; min-width: 0; }
.warn-username { font-weight: 700; font-size: 13px; }
.warn-count { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.6; }
.warn-badge {
  background: rgba(201,168,112,.08); border: 1px solid var(--gold-border);
  color: var(--gold); padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}

/* ── MEMBRES ────────────────────────────────────────────────── */
.search-input {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); padding: 6px 12px; border-radius: var(--r-sm);
  font-size: 12.5px; outline: none; width: 180px;
  font-family: 'Inter', sans-serif; transition: border-color .15s;
}
.search-input:focus { border-color: var(--gold-border); }
.search-input::placeholder { color: var(--text-muted); }

.members-list { display: flex; flex-direction: column; }

.member-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.member-item:last-child { border-bottom: none; }
.member-item:hover { background: var(--bg3); }
.member-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.member-info { flex: 1; min-width: 0; }
.member-username { font-weight: 600; font-size: 13px; }
.member-roles { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.member-role {
  padding: 1px 7px; border-radius: 20px; font-size: 10px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}

/* ── CONFIG ─────────────────────────────────────────────────── */
.config-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
}
.form-input {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); padding: 11px 14px; border-radius: var(--r-sm);
  font-size: 13.5px; outline: none; font-family: 'Inter', sans-serif;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--gold-border); }

.btn-save {
  background: var(--gold); color: #000; border: none;
  padding: 12px 24px; border-radius: var(--r-sm); cursor: pointer;
  font-weight: 700; font-size: 13px; align-self: flex-start;
  font-family: 'Inter', sans-serif; letter-spacing: -0.1px;
  transition: all .2s;
}
.btn-save:hover { background: var(--gold-light); transform: translateY(-1px); }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--bg3); border: 1px solid var(--border2);
  padding: 13px 20px; border-radius: var(--r); font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .25s;
  z-index: 1000; max-width: 300px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  transform: translateY(6px);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: rgba(74,222,128,.2); color: var(--green); }
.toast.error   { border-color: rgba(248,113,113,.2); color: var(--red); }

.loading { color: var(--text-muted); font-size: 13px; text-align: center; padding: 32px; }

/* ── LOGS ───────────────────────────────────────────────────── */
.logs-filters {
  display: flex; gap: 4px;
}
.log-filter {
  background: transparent; border: 1px solid var(--border2);
  color: var(--text-muted); padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all .15s;
}
.log-filter:hover { color: var(--text); border-color: var(--border2); }
.log-filter.active {
  background: var(--gold-dim); border-color: var(--gold-border);
  color: var(--gold-light);
}

.logs-list { display: flex; flex-direction: column; }

.log-entry {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 22px; border-bottom: 1px solid var(--border);
  transition: background .15s; position: relative;
  border-left: 3px solid transparent;
}
.log-entry:last-child { border-bottom: none; }
.log-entry:hover { background: var(--bg3); }

.log-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}
.log-body { flex: 1; min-width: 0; }
.log-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 3px;
}
.log-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  padding: 2px 8px; border-radius: 20px;
  border: 1px solid; white-space: nowrap;
}
.log-desc {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.5;
}
.log-fields {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.log-field {
  font-size: 11px; background: var(--bg4);
  padding: 2px 8px; border-radius: var(--r-sm);
  color: var(--text-muted);
}
.log-field strong { color: var(--text-dim); }
.log-time {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}

.log-new {
  animation: logIn .3s ease;
}
@keyframes logIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── TICKETS ────────────────────────────────────────────────── */

/* Toggle switch */
.ticket-toggle-row { margin-bottom: 18px; }
.toggle-label {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 500; color: var(--text-dim);
}
.toggle-input { display: none; }
.toggle-track {
  width: 40px; height: 22px; background: var(--bg4);
  border: 1px solid var(--border2); border-radius: 20px;
  position: relative; flex-shrink: 0; transition: background .2s, border-color .2s;
}
.toggle-thumb {
  position: absolute; left: 3px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-muted); transition: left .2s, background .2s;
}
.toggle-input:checked + .toggle-track {
  background: rgba(74,222,128,0.15);
  border-color: var(--green);
}
.toggle-input:checked + .toggle-track .toggle-thumb {
  left: 21px; background: var(--green);
}

/* Hints sous les inputs */
.form-hint {
  display: block; margin-top: 4px;
  font-size: 11px; color: var(--text-muted);
}

/* Textarea */
.form-textarea {
  resize: vertical; min-height: 72px;
  font-family: inherit; line-height: 1.5;
}

/* Actions row (save + publish) */
.ticket-actions {
  display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap;
}

/* Bouton gold */
.btn-gold {
  padding: 9px 18px; border-radius: var(--r-sm);
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  color: var(--gold); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-gold:hover { background: rgba(201,168,112,0.15); border-color: var(--gold); }
.btn-gold:disabled { opacity: .5; cursor: not-allowed; }

/* Filtres */
.ticket-list-filters { display: flex; gap: 6px; }

/* Liste tickets */
.tickets-list { display: flex; flex-direction: column; }

.ticket-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.ticket-item:last-child { border-bottom: none; }
.ticket-item:hover { background: var(--bg3); }

.ticket-num {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  min-width: 52px; font-variant-numeric: tabular-nums;
}

.ticket-info { flex: 1; min-width: 0; }
.ticket-user {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ticket-meta {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.ticket-meta strong { color: var(--text-dim); }

.ticket-status {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap;
}
.ticket-open   { background: rgba(74,222,128,0.1);  color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.ticket-closed { background: rgba(248,113,113,0.1); color: var(--red);   border: 1px solid rgba(248,113,113,0.3); }

.btn-reset-counter {
  padding: 9px 14px; border-radius: var(--r-sm);
  background: none; border: 1px solid var(--border2);
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-reset-counter:hover { border-color: var(--red); color: var(--red); }

.ticket-close-btn {
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 12px;
  background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3);
  color: var(--red); cursor: pointer; font-weight: 600;
  transition: background .15s; white-space: nowrap;
}
.ticket-close-btn:hover { background: rgba(248,113,113,0.2); }

/* ── TICKET CATEGORIES ──────────────────────────────────────── */

.ticket-cat-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px; min-height: 32px;
}

.cat-empty {
  font-size: 12px; color: var(--text-muted);
  padding: 8px 10px; background: var(--bg4);
  border-radius: var(--r-sm); border: 1px dashed var(--border2);
}

.ticket-cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--bg4); border: 1px solid var(--border);
  transition: border-color .15s;
}
.ticket-cat-item:hover { border-color: var(--border2); }

.cat-emoji-badge {
  font-size: 18px; line-height: 1; flex-shrink: 0; width: 24px; text-align: center;
}
.cat-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.cat-info strong { font-size: 13px; font-weight: 600; }
.cat-desc-text   { font-size: 11px; color: var(--text-muted); }

/* Boutons d'action à droite d'un item */
.cat-item-btns {
  display: flex; gap: 4px; flex-shrink: 0;
}

.cat-edit-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 3px 7px; border-radius: 4px;
  color: var(--text-muted); transition: color .15s, background .15s;
}
.cat-edit-btn:hover { color: var(--gold); background: var(--gold-dim); }

.cat-remove-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 3px 7px;
  border-radius: 4px; transition: color .15s, background .15s;
}
.cat-remove-btn:hover { color: var(--red); background: rgba(248,113,113,0.1); }

/* ── Mode édition inline ────────────────────────────────── */
.ticket-cat-editing {
  border-color: var(--gold-border) !important;
  background: var(--bg3); flex-direction: column;
  align-items: stretch; padding: 14px;
}

.cat-edit-form {
  display: flex; flex-direction: column; gap: 8px; width: 100%;
}

.cat-edit-row1 {
  display: flex; gap: 8px;
}

.cat-edit-actions {
  display: flex; gap: 8px; margin-top: 2px;
}

.cat-save-btn {
  padding: 7px 16px; font-size: 12.5px;
}

.cat-cancel-btn {
  padding: 7px 12px; border-radius: var(--r-sm);
  background: none; border: 1px solid var(--border2);
  color: var(--text-muted); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.cat-cancel-btn:hover { border-color: var(--red); color: var(--red); }

/* Row ajout catégorie */
.ticket-cat-add {
  display: flex; flex-direction: column; gap: 7px;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px;
}
.ticket-cat-add-top {
  display: flex; gap: 7px;
}
.cat-emoji-input  { flex: 0 0 52px; text-align: center; font-size: 16px; }
.cat-label-input  { flex: 1; }
.cat-info-textarea { resize: vertical; min-height: 62px; font-size: 12.5px; }
.cat-add-full-btn { width: 100%; justify-content: center; padding: 9px; }

/* Catégorie item — infos */
.cat-info-top {
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.cat-has-msg {
  font-size: 12px; opacity: .85; cursor: default;
}
.cat-info-preview {
  font-size: 11px; color: var(--text-muted);
  margin-top: 4px; line-height: 1.45;
  background: var(--bg); border-left: 2px solid var(--border2);
  padding: 3px 8px; border-radius: 0 4px 4px 0;
  white-space: pre-wrap; word-break: break-word;
}

/* ── TICKET ITEM ACTIONS ────────────────────────────────────── */
.ticket-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.ticket-transcript-btn {
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 12px;
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  color: var(--gold); cursor: pointer; font-weight: 600;
  transition: background .15s; white-space: nowrap;
}
.ticket-transcript-btn:hover { background: rgba(201,168,112,0.15); }

/* ── TRANSCRIPT OVERLAY ─────────────────────────────────────── */
.transcript-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.transcript-overlay.active { opacity: 1; pointer-events: all; }

.transcript-panel {
  width: min(680px, 95vw); height: 100vh;
  background: var(--bg2); display: flex; flex-direction: column;
  border-left: 1px solid var(--border2);
  transform: translateX(40px); transition: transform .2s;
}
.transcript-overlay.active .transcript-panel { transform: translateX(0); }

/* Header */
.transcript-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border2);
  background: var(--bg3); flex-shrink: 0;
}
.transcript-title-block {
  display: flex; align-items: center; gap: 12px;
}
.transcript-title-block > span { font-size: 24px; }
.transcript-num { font-size: 15px; font-weight: 700; }
.transcript-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.transcript-close-x {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: color .15s, background .15s;
}
.transcript-close-x:hover { color: var(--text); background: var(--bg4); }

/* Messages */
.transcript-messages {
  flex: 1; overflow-y: auto; padding: 12px 0;
  scroll-behavior: smooth;
}
.transcript-messages::-webkit-scrollbar { width: 6px; }
.transcript-messages::-webkit-scrollbar-track { background: transparent; }
.transcript-messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* Séparateur de date */
.transcript-date-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 20px 8px; color: var(--text-muted); font-size: 11px;
}
.transcript-date-sep::before,
.transcript-date-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.transcript-date-sep span { white-space: nowrap; }

/* Message */
.transcript-msg {
  display: flex; gap: 12px; padding: 2px 20px;
  transition: background .1s;
}
.transcript-msg:hover { background: var(--bg3); }
.tr-msg-bot { opacity: .7; }

.tr-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0; object-fit: cover; margin-top: 2px;
}
.tr-avatar-gap { width: 36px; flex-shrink: 0; }

.tr-body { flex: 1; min-width: 0; }

.tr-header {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px;
}
.tr-author { font-size: 13px; font-weight: 600; }
.tr-author-user  { color: var(--gold); }
.tr-author-bot   { color: #5865F2; }
.tr-time { font-size: 11px; color: var(--text-muted); }

.tr-content {
  font-size: 13.5px; line-height: 1.5;
  color: var(--text-dim); word-break: break-word;
}
.tr-content code {
  background: var(--bg4); padding: 1px 5px;
  border-radius: 3px; font-size: 12px; font-family: monospace;
}

/* Embed */
.tr-embed {
  margin-top: 4px; padding: 8px 12px;
  border-left: 3px solid var(--gold);
  background: var(--bg4); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  max-width: 440px;
}
.tr-embed-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.tr-embed-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* Pièces jointes */
.tr-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tr-attachment {
  font-size: 12px; color: var(--gold); text-decoration: none;
  background: var(--bg4); padding: 3px 10px;
  border-radius: var(--r-sm); border: 1px solid var(--gold-border);
  transition: background .15s;
}
.tr-attachment:hover { background: var(--gold-dim); }

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE — variables overrides
   ════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
  --bg:          #F2F0EC;
  --bg2:         #FAFAF8;
  --bg3:         #EDECEA;
  --bg4:         #E4E2DF;
  --gold:        #8A6914;
  --gold-light:  #6B500E;
  --gold-dim:    rgba(138,105,20,0.09);
  --gold-border: rgba(138,105,20,0.22);
  --green:       #15803D;
  --red:         #B91C1C;
  --text:        #111111;
  --text-dim:    rgba(17,17,17,0.65);
  --text-muted:  rgba(17,17,17,0.42);
  --border:      rgba(0,0,0,0.07);
  --border2:     rgba(0,0,0,0.13);
}

/* Quelques ajustements light qui ne passent pas via variables */
html[data-theme="light"] .login-page {
  background-image: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(138,105,20,0.06) 0%, transparent 70%);
}
html[data-theme="light"] .sidebar-logo-img {
  mix-blend-mode: multiply;
  filter: brightness(0.85) saturate(0.9);
}
html[data-theme="light"] .toast {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
html[data-theme="light"] .transcript-overlay {
  background: rgba(0,0,0,0.45);
}
html[data-theme="light"] .tr-author-bot { color: #4752C4; }

/* ═══════════════════════════════════════════════════════════════
   PAGE TRANSITIONS
   ════════════════════════════════════════════════════════════ */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page { display: none; }
.page.active {
  display: block;
  animation: pageIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE
   ════════════════════════════════════════════════════════════ */
.theme-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 2px 6px;
}
.theme-row-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  letter-spacing: 0.3px;
}
.btn-theme-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text-dim); padding: 4px 10px; border-radius: 20px;
  cursor: pointer; font-size: 11.5px; font-weight: 600;
  font-family: 'Inter', sans-serif; transition: all .15s;
}
.btn-theme-toggle:hover {
  border-color: var(--gold-border); color: var(--gold);
  background: var(--gold-dim);
}

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER (mobile)
   ════════════════════════════════════════════════════════════ */
.sidebar-hamburger {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 200;
  width: 40px; height: 40px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r-sm); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 0; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: background .15s, border-color .15s;
}
.sidebar-hamburger:hover { border-color: var(--gold-border); background: var(--gold-dim); }
.sidebar-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-dim); border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
}
.sidebar-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sidebar-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY
   ════════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar slide-in */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sidebar.open { transform: translateX(0); }

  /* Overlay visible uniquement sur mobile */
  .sidebar-overlay { display: block; }

  /* Hamburger visible */
  .sidebar-hamburger { display: flex; }

  /* Main sans indent */
  .main { margin-left: 0; padding: 72px 18px 32px; }

  /* Grilles adaptées */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cards-row  { grid-template-columns: 1fr; }

  /* Typographie */
  .page-header h1 { font-size: 22px; letter-spacing: -0.5px; }

  /* Toast pleine largeur */
  .toast { bottom: 16px; right: 16px; left: 16px; max-width: none; text-align: center; }

  /* Transcript panel pleine largeur */
  .transcript-panel { width: 100vw; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main { padding: 68px 14px 28px; }
  .ticket-actions { flex-direction: column; }
  .ticket-actions .btn-save,
  .ticket-actions .btn-gold,
  .ticket-actions .btn-reset-counter { width: 100%; text-align: center; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════
   SALONS STATS
   ════════════════════════════════════════════════════════════ */
.stat-channels-list { display: flex; flex-direction: column; }

.stat-channel-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.stat-channel-item:last-child { border-bottom: none; }
.stat-channel-item:hover { background: var(--bg3); }

.stat-ch-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.stat-ch-info { flex: 1; min-width: 0; }
.stat-ch-name { font-size: 13px; font-weight: 600; }
.stat-ch-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-ch-id   { font-size: 11px; color: var(--text-muted); font-family: monospace; }

.stat-ch-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 4px 8px;
  border-radius: 4px; transition: color .15s, background .15s;
}
.stat-ch-remove:hover { color: var(--red); background: rgba(248,113,113,0.08); }

.form-select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   EMBED BUILDER
   ════════════════════════════════════════════════════════════ */

/* Liste embeds */
.embeds-list { display: flex; flex-direction: column; }

.embed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  transition: background .15s; cursor: pointer;
}
.embed-item:last-child { border-bottom: none; }
.embed-item:hover { background: var(--bg3); }
.embed-item.active-edit { background: var(--gold-dim); border-left: 3px solid var(--gold); }

.embed-item-color {
  width: 10px; height: 36px; border-radius: 3px; flex-shrink: 0;
}
.embed-item-info { flex: 1; min-width: 0; }
.embed-item-name { font-size: 13px; font-weight: 600; }
.embed-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.embed-item-sent { color: var(--green); font-size: 10px; font-weight: 700; }

.embed-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.embed-item-send-btn {
  padding: 4px 10px; border-radius: var(--r-sm); font-size: 11px; font-weight: 600;
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  color: var(--gold); cursor: pointer; transition: background .15s;
}
.embed-item-send-btn:hover { background: rgba(201,168,112,0.15); }
.embed-item-edit-btn {
  padding: 4px 10px; border-radius: var(--r-sm); font-size: 11px; font-weight: 600;
  background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.2);
  color: var(--green); cursor: pointer; transition: background .15s;
}
.embed-item-edit-btn:hover { background: rgba(74,222,128,0.15); }
.embed-item-del-btn {
  padding: 4px 8px; border-radius: var(--r-sm); font-size: 12px;
  background: none; border: 1px solid var(--border2);
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.embed-item-del-btn:hover { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.3); color: var(--red); }

/* Color picker row */
.embed-preview-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--r-sm); padding: 10px 14px;
}
.embed-color-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border2);
}
.embed-color-input {
  width: 36px; height: 28px; border: 1px solid var(--border2);
  border-radius: 4px; cursor: pointer; background: none; padding: 2px;
}

/* Fields */
.emb-fields-list { display: flex; flex-direction: column; gap: 8px; }

.emb-field-item {
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.emb-field-row1 { display: flex; gap: 6px; }
.emb-field-name { flex: 1; }
.emb-field-value { width: 100%; }
.emb-field-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.emb-field-inline-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted); cursor: pointer;
}
.emb-field-del {
  background: none; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; transition: color .15s;
}
.emb-field-del:hover { color: var(--red); }

/* Discord embed preview */
.discord-msg-preview {
  background: #36393f;
  border-radius: 8px; padding: 16px 20px;
  font-family: 'Inter', sans-serif;
}
html[data-theme="light"] .discord-msg-preview { background: #F2F3F5; }

.discord-embed-preview {
  display: flex; gap: 0;
  border-radius: 4px; overflow: hidden;
  background: #2f3136; max-width: 520px;
}
html[data-theme="light"] .discord-embed-preview { background: #FFFFFF; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

.dep-color-bar { width: 4px; flex-shrink: 0; background: #C9A870; }
.dep-body      { flex: 1; padding: 10px 12px 10px 12px; min-width: 0; }
.dep-thumbnail {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 4px; margin: 10px 12px 10px 8px;
  flex-shrink: 0; display: none;
}
.dep-thumbnail.visible { display: block; }

.dep-author { font-size: 12px; font-weight: 600; color: #dcddde; margin-bottom: 4px; }
html[data-theme="light"] .dep-author { color: #4e5058; }

.dep-title  { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; }
html[data-theme="light"] .dep-title { color: #060607; }

.dep-desc   { font-size: 13px; color: #dcddde; line-height: 1.5; white-space: pre-wrap; margin-bottom: 8px; }
html[data-theme="light"] .dep-desc { color: #4e5058; }

.dep-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dep-field  { min-width: 100px; flex: 1; }
.dep-field-name  { font-size: 11px; font-weight: 700; color: #dcddde; margin-bottom: 2px; }
html[data-theme="light"] .dep-field-name { color: #060607; }
.dep-field-value { font-size: 12px; color: #b9bbbe; }
html[data-theme="light"] .dep-field-value { color: #4e5058; }

.dep-image-wrap { display: none; margin-top: 8px; }
.dep-image-wrap.visible { display: block; }
.dep-image { width: 100%; border-radius: 4px; max-height: 300px; object-fit: contain; }

.dep-footer { font-size: 11px; color: #72767d; margin-top: 4px; }
html[data-theme="light"] .dep-footer { color: #87898c; }
