:root {
  --bg: #090d0d;
  --panel: #101716;
  --panel-hover: #131b1a;
  --text: #f5f7f5;
  --muted: #98a3a0;
  --muted-2: #708078;
  --accent: #77dfbf;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(119, 223, 191, .45);
  --shadow: 0 24px 70px rgba(0, 0, 0, .46);
  --success: #77dfbf;
  --danger: #ff7d7d;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, a { font: inherit; }
a { color: inherit; text-decoration: none; }

.home-view {
  position: relative;
  min-height: 100vh;
  padding: 28px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 18%, rgba(119, 223, 191, .10), transparent 20%),
    radial-gradient(circle at 78% 20%, rgba(119, 223, 191, .06), transparent 18%),
    linear-gradient(180deg, #0d1413 0%, #090d0d 55%, #06090a 100%);
  overflow: hidden;
}

.background-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 22%, rgba(119, 223, 191, .07), transparent 22%),
    radial-gradient(circle at 74% 24%, rgba(119, 223, 191, .05), transparent 20%),
    linear-gradient(180deg, rgba(4, 7, 7, .10), rgba(4, 7, 7, .22));
  filter: blur(4px);
  pointer-events: none;
}

.page-topbar,
.hero-wrap,
.entry-grid { position: relative; z-index: 1; }

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .32));
}

.studio-link {
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #07110f;
  border: 1px solid var(--accent);
  font-weight: 600;
  font-size: .85rem;
  transition: .2s ease;
}
.studio-link:hover {
  background: transparent;
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.studio-link.icon-only {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
}

.hero-wrap {
  display: flex;
  justify-content: center;
  padding: 4vh 0 0;
}
.hero-title {
  margin: 0;
  font-size: clamp(64px, 8vw, 100px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.065em;
  color: var(--text);
  text-shadow: 0 16px 30px rgba(0, 0, 0, .42);
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  max-width: 1160px;
  width: 100%;
  margin: 18vh auto 6vh;
}

.entry-card {
  position: relative;
  padding: 30px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: .25s ease;
}
.entry-card::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -110px;
  bottom: -110px;
  border: 1px solid rgba(119, 223, 191, .17);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(119, 223, 191, .025), 0 0 0 60px rgba(119, 223, 191, .015);
  pointer-events: none;
}
.entry-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.card-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.card-kicker {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-header h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: -.04em;
  font-weight: 500;
}

.entry-form {
  position: relative;
  display: grid;
  gap: 14px;
}
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.entry-form label {
  display: grid;
  gap: 8px;
}
.entry-form label > span {
  font-size: .8rem;
  font-weight: 600;
  color: #c9d0ce;
}
.entry-form input {
  height: 52px;
  width: 100%;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #09100f;
  color: var(--text);
  outline: none;
  transition: .18s ease;
}
.entry-form input::placeholder { color: #63716e; }
.entry-form input:focus {
  background: #0b1312;
  border-color: rgba(119, 223, 191, .4);
  box-shadow: 0 0 0 4px rgba(119, 223, 191, .08);
}
.message {
  min-height: 18px;
  font-size: .82rem;
  color: var(--danger);
}
.primary-button {
  height: 52px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #07110f;
  background: var(--accent);
  transition: .2s ease;
}
.primary-button:hover {
  background: transparent;
  color: var(--accent);
  transform: translateY(-1px);
}
.primary-button:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}

@media (max-width: 980px) {
  .home-view { padding: 18px; }
  .brand-logo { width: 70px; height: 70px; }
  .hero-title { font-size: clamp(54px, 12vw, 84px); }
  .entry-grid { margin-top: 8vh; }
  .entry-grid,
  .inline-fields { grid-template-columns: 1fr; }
}

.utility-bar {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.utility-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ghost-button {
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(16, 23, 22, .55);
  color: var(--muted);
  font-weight: 600;
  font-size: .8rem;
  transition: .2s ease;
}
.ghost-button:hover {
  border-color: var(--line-strong);
  color: var(--accent);
}

.home-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: .74rem;
  letter-spacing: .02em;
}
.footer-logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  opacity: .85;
}

/* Connexion Discord */
.hidden { display: none !important; }
.user-wrap { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 6px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(16, 23, 22, .8);
  color: var(--text); cursor: pointer; font-weight: 600; font-size: .85rem; transition: .2s ease;
}
.user-chip:hover { border-color: var(--accent); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #5865F2; }
.user-menu {
  position: absolute; right: 0; top: 52px; min-width: 210px; padding: 8px; z-index: 5;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.user-menu .who { padding: 10px 12px; font-size: .75rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu button {
  width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 6px;
  background: transparent; color: var(--danger); cursor: pointer; font-weight: 600; font-size: .85rem;
}
.user-menu button:hover { background: rgba(255, 125, 125, .08); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  padding: 12px 18px; border-radius: 8px; background: var(--panel);
  border: 1px solid var(--line-strong); color: var(--accent); font-size: .85rem; font-weight: 600;
}

/* Espace connecté (staff / client / utilisateur) */
.badge { padding: 3px 8px; border-radius: 5px; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; background: rgba(119, 223, 191, .14); color: var(--accent); }
.app-panel { position: relative; z-index: 1; max-width: 1000px; width: 100%; margin: 7vh auto 4vh; }
.app-panel .entry-card:hover { transform: none; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; font-size: .8rem; }
.tab.on { border-color: var(--accent); color: var(--accent); }
.note { font-size: .8rem; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.scroll { overflow-x: auto; }
.app-panel table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 560px; }
.app-panel th { text-align: left; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); padding: 0 10px 10px; }
.app-panel td { padding: 12px 10px; border-top: 1px solid var(--line); }
.app-panel code { font-size: .78rem; color: #c9d0ce; word-break: break-all; }
.pill { padding: 3px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.pill.ok { background: rgba(119, 223, 191, .14); color: var(--accent); }
.pill.off { background: rgba(255, 125, 125, .14); color: var(--danger); }
.mini { padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: .78rem; font-weight: 600; }
.mini:hover { border-color: var(--line-strong); color: var(--accent); }
.mini.del:hover { border-color: var(--danger); color: var(--danger); }
.addrow { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.addrow input { flex: 1; min-width: 150px; height: 46px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line); background: #09100f; color: var(--text); outline: none; }
.addrow input:focus { border-color: rgba(119, 223, 191, .4); }
.addrow .primary-button { height: 46px; padding: 0 18px; }
.center { text-align: center; padding: 20px 0; }
