/* ============================================================
   TANGER #PV — Dashboard admin
   Thème : sombre nocturne + orange coucher de soleil / sable / mer
   ============================================================ */

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

:root {
  /* Fonds */
  --bg:            #0a0c10;
  --bg-soft:       #10131a;
  --surface:       #141821;
  --surface-2:     #1a1f2b;
  --surface-hover: #1f2532;
  --border:        #242b39;
  --border-glow:   #2f3a4d;

  /* Accents Tanger */
  --orange:        #ff8a3d;
  --orange-soft:   #ffa76b;
  --orange-deep:   #e86a1f;
  --sand:          #e8c073;
  --sand-soft:     #f4d9a0;
  --sea:           #38bdd8;
  --sea-deep:      #1a7d94;

  /* Texte */
  --text:          #eef2f8;
  --text-dim:      #9aa6b8;
  --text-faint:    #616d80;

  /* États */
  --ok:            #35d29a;
  --warn:          #ffc043;
  --danger:        #ff5c5c;

  --radius:     14px;
  --radius-lg:  20px;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-glow); }

h1, h2, h3, .display { font-family: 'Sora', sans-serif; letter-spacing: -0.02em; }

.gradient-text {
  background: linear-gradient(110deg, var(--orange) 0%, var(--sand) 55%, var(--sea) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===================== LOGIN ===================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.5;
  animation: float 18s var(--ease) infinite;
}
.aurora span:nth-child(1) { width: 520px; height: 520px; background: var(--orange-deep); top: -12%; left: -8%; }
.aurora span:nth-child(2) { width: 460px; height: 460px; background: var(--sea-deep); bottom: -14%; right: -6%; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 340px; height: 340px; background: var(--sand); top: 42%; left: 52%; opacity: 0.25; animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(46px, -34px) scale(1.09); }
  66%      { transform: translate(-32px, 28px) scale(0.94); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: rgba(20, 24, 33, 0.78);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 46px 40px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: riseIn 0.7s var(--ease);
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-mark {
  width: 62px; height: 62px;
  margin: 0 auto 22px;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--orange), var(--sand));
  display: grid; place-items: center;
  font-size: 30px;
  box-shadow: 0 10px 34px rgba(255, 138, 61, 0.36);
  animation: pulseGlow 3.4s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 10px 34px rgba(255, 138, 61, 0.36); }
  50%      { box-shadow: 0 14px 48px rgba(255, 138, 61, 0.58); }
}

.login-card h1 { font-size: 34px; font-weight: 800; margin-bottom: 8px; }
.login-card .sub { color: var(--text-dim); font-size: 15px; margin-bottom: 32px; line-height: 1.55; }

.feature-row { display: flex; gap: 10px; margin-bottom: 30px; }
.feature-chip {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.feature-chip:hover { transform: translateY(-3px); border-color: var(--orange); }
.feature-chip .ico { font-size: 19px; display: block; margin-bottom: 6px; }
.feature-chip .lbl { font-size: 12px; font-weight: 600; }
.feature-chip .desc { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #12151c;
  background: linear-gradient(120deg, var(--orange), var(--sand));
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
  box-shadow: 0 8px 26px rgba(255, 138, 61, 0.3);
}
.btn-discord:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(255, 138, 61, 0.45); filter: brightness(1.05); }
.btn-discord:active { transform: translateY(0); }

.fine { margin-top: 20px; font-size: 12px; color: var(--text-faint); }

.alert {
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.3);
  color: #ffb3b3;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 22px;
  animation: shake 0.4s var(--ease);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

.hidden { display: none !important; }

/* ===================== SHELL ===================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 262px;
  flex-shrink: 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--orange), var(--sand));
  display: grid; place-items: center; font-size: 19px;
  box-shadow: 0 6px 18px rgba(255, 138, 61, 0.3);
}
.brand-txt strong { font-family: 'Sora', sans-serif; font-size: 15.5px; font-weight: 800; display: block; }
.brand-txt small { font-size: 11px; color: var(--text-faint); }

.nav-group { margin-bottom: 20px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 0 12px 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10.5px 12px;
  margin-bottom: 3px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.22s var(--ease);
}
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: var(--surface); color: var(--text); transform: translateX(3px); }
.nav-item.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--orange), var(--sand));
}

.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.bot-state {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; margin-bottom: 10px;
  background: var(--surface); border-radius: 11px; font-size: 12.5px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.dot.on  { background: var(--ok); box-shadow: 0 0 0 3px rgba(53, 210, 154, 0.16); animation: breathe 2.4s ease-in-out infinite; }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 92, 92, 0.16); }
@keyframes breathe { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.logout {
  width: 100%; padding: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 11px;
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.22s var(--ease);
}
.logout:hover { background: rgba(255, 92, 92, 0.1); border-color: var(--danger); color: #ffb3b3; }

/* ===================== MAIN ===================== */
.main { flex: 1; padding: 30px 38px 70px; max-width: 1400px; }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; gap: 20px; }
.topbar h2 { font-size: 27px; font-weight: 800; margin-bottom: 4px; }
.topbar .crumb { font-size: 13.5px; color: var(--text-dim); }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 15px 7px 7px; border-radius: 100px;
  flex-shrink: 0;
}
.avatar {
  width: 31px; height: 31px; border-radius: 50%;
  background: linear-gradient(140deg, var(--orange), var(--sand));
  display: grid; place-items: center;
  font-weight: 700; color: #12151c; font-size: 13px;
}
.user-chip .name { font-size: 13.5px; font-weight: 600; }
.badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 3px 8px; border-radius: 100px; letter-spacing: 0.04em;
}
.badge.owner { background: rgba(255, 138, 61, 0.16); color: var(--orange-soft); }
.badge.admin { background: rgba(56, 189, 216, 0.16); color: var(--sea); }

/* Views */
.view { animation: fadeUp 0.42s var(--ease); }
.view.hide { display: none; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover { border-color: var(--border-glow); }
.card.lift:hover { transform: translateY(-3px); }

.card h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.card .hint { font-size: 12.5px; color: var(--text-faint); margin-bottom: 18px; line-height: 1.55; }

.stat .val { font-family: 'Sora', sans-serif; font-size: 32px; font-weight: 800; line-height: 1.1; }
.stat .lbl { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; }
.stat .ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; margin-bottom: 13px; background: var(--surface-2);
}

/* Forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  margin-bottom: 14px;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.13);
}
select option { background: var(--surface); }
textarea { resize: vertical; min-height: 84px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 145px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10.5px 18px;
  border: none; border-radius: 11px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1.5px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(120deg, var(--orange), var(--sand)); color: #12151c; box-shadow: 0 6px 18px rgba(255, 138, 61, 0.26); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(255, 138, 61, 0.4); }
.btn-sea { background: linear-gradient(120deg, var(--sea-deep), var(--sea)); color: #06121a; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-glow); background: var(--surface-hover); }
.btn-danger { background: rgba(255, 92, 92, 0.13); color: #ff9c9c; border: 1px solid rgba(255, 92, 92, 0.3); }
.btn-danger:hover { background: rgba(255, 92, 92, 0.22); }
.btn-sm { padding: 6.5px 12px; font-size: 12px; border-radius: 9px; }
.btn-full { width: 100%; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 10px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint); border-bottom: 1px solid var(--border);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
tbody tr { transition: background 0.18s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px; color: var(--text-dim); }

/* Accordion */
.acc { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 11px; background: var(--surface); }
.acc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 15px 18px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text); font-family: inherit; font-size: 14px; font-weight: 600; text-align: left;
  transition: background 0.22s var(--ease);
}
.acc-head:hover { background: var(--surface-2); }
.acc-head .chev { transition: transform 0.32s var(--ease); color: var(--text-faint); font-size: 12px; }
.acc.open .acc-head .chev { transform: rotate(180deg); }
.acc-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.42s var(--ease), padding 0.32s var(--ease);
  padding: 0 18px;
}
.acc.open .acc-body { max-height: 1400px; padding: 4px 18px 20px; }
.acc-sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }

/* Toggle */
.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; margin-bottom: 15px; }
.switch input { display: none; }
.track {
  width: 42px; height: 24px; border-radius: 100px;
  background: var(--surface-2); border: 1px solid var(--border);
  position: relative; transition: all 0.28s var(--ease); flex-shrink: 0;
}
.track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-faint); transition: all 0.28s var(--ease);
}
.switch input:checked + .track { background: rgba(255, 138, 61, 0.22); border-color: var(--orange); }
.switch input:checked + .track::after { left: 21px; background: var(--orange); }
.switch .txt { font-size: 13.5px; font-weight: 500; }

/* Pills / tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  margin: 0 6px 6px 0;
}
.pill .x { cursor: pointer; color: var(--text-faint); font-size: 14px; line-height: 1; transition: color 0.2s; }
.pill .x:hover { color: var(--danger); }
.pill.lv { background: rgba(255, 138, 61, 0.1); border-color: rgba(255, 138, 61, 0.28); color: var(--orange-soft); }

.tag-ok   { color: var(--ok); }
.tag-off  { color: var(--text-faint); }

/* Module status cards */
.mod-card { display: flex; align-items: flex-start; gap: 14px; }
.mod-ico {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 20px; background: var(--surface-2);
}
.mod-body { flex: 1; min-width: 0; }
.mod-body .t { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.mod-body .d { font-size: 12.5px; color: var(--text-faint); line-height: 1.5; }
.mod-body .m { font-size: 12px; color: var(--text-dim); margin-top: 7px; }

/* Toasts */
.toasts { position: fixed; top: 22px; right: 22px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 250px; max-width: 380px;
  padding: 13px 17px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.34s var(--ease);
  display: flex; align-items: flex-start; gap: 10px;
}
.toast.ok    { border-left: 3px solid var(--ok); }
.toast.err   { border-left: 3px solid var(--danger); }
.toast.info  { border-left: 3px solid var(--sea); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast.out { animation: slideOut 0.28s var(--ease) forwards; }
@keyframes slideOut { to { opacity: 0; transform: translateX(40px); } }

/* Loading */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px; height: 15px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty { text-align: center; padding: 34px 18px; color: var(--text-faint); font-size: 13.5px; }
.empty .ico { font-size: 30px; display: block; margin-bottom: 10px; opacity: 0.5; }

.logline {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11.5px; color: var(--text-dim);
  padding: 6px 10px; border-radius: 7px;
  border-left: 2px solid var(--border);
  margin-bottom: 3px; word-break: break-word;
  transition: background 0.18s;
}
.logline:hover { background: var(--surface-2); }

.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }

.info-box {
  background: rgba(56, 189, 216, 0.07);
  border: 1px solid rgba(56, 189, 216, 0.22);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}
.info-box strong { color: var(--sea); }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .main { padding: 22px 18px 60px; }
  .topbar { flex-direction: column; }
}
