/* ═══════════════════════════════════════════════════════════════════════
   Deuspiratus — pont de commandement D.Majin
   Thème : dark manga high-tech · turquoise néon / jaune / rouge ponéglyphe
   Typos : Bebas Neue (titres) · Outfit (corps) · DM Sans (UI, chiffres)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0b;
  --bg-2: #101014;
  --panel: #141419;
  --panel-2: #1a1a21;
  --line: rgba(255, 255, 255, 0.08);
  --txt: #f4f4f6;
  --txt-2: #9a9aa6;
  --txt-3: #62626e;
  --neon: #00f5d4;
  --neon-dim: rgba(0, 245, 212, 0.14);
  --gold: #fee440;
  --gold-dim: rgba(254, 228, 64, 0.14);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.14);
  --f-title: 'Bebas Neue', sans-serif;
  --f-body: 'Outfit', sans-serif;
  --f-ui: 'DM Sans', sans-serif;
  --side-w: 248px;
  --side-w-min: 68px;
  --r: 14px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(0, 245, 212, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(254, 228, 64, 0.04), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: var(--f-body);
  font-size: 15px;
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden { display: none !important; }

a { color: var(--neon); text-decoration: none; }

::selection { background: var(--neon); color: #06231f; }

/* ── Écran de connexion ─────────────────────────────────────────────── */

.dp-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.dp-login-box {
  width: min(400px, 100%);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 0 0 1px rgba(0, 245, 212, 0.06), 0 24px 70px rgba(0, 0, 0, 0.6);
}

.dp-login-lead { color: var(--txt-2); font-size: 0.9rem; margin-top: -6px; }

.dp-login-error {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: var(--f-ui);
}

/* ── Marque ─────────────────────────────────────────────────────────── */

.dp-brand-kicker {
  font-family: var(--f-ui);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon);
}

.dp-brand-name {
  font-family: var(--f-title);
  font-size: 2.1rem;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--txt);
  text-shadow: 0 0 24px rgba(0, 245, 212, 0.35);
}

/* ── Champs & boutons ───────────────────────────────────────────────── */

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

.dp-field span {
  font-family: var(--f-ui);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-2);
}

.dp-field input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--txt);
  font-family: var(--f-ui);
  font-size: 0.95rem;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dp-field input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-dim);
}

.dp-btn-primary {
  background: linear-gradient(135deg, var(--neon), #00c9ae);
  border: none;
  border-radius: 10px;
  color: #06231f;
  cursor: pointer;
  font-family: var(--f-ui);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 16px;
  transition: transform 0.12s, box-shadow 0.2s;
}

.dp-btn-primary:hover { box-shadow: 0 0 22px rgba(0, 245, 212, 0.45); transform: translateY(-1px); }
.dp-btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }

.dp-btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--txt-2);
  cursor: pointer;
  font-family: var(--f-ui);
  font-size: 0.85rem;
  padding: 9px 14px;
  transition: border-color 0.15s, color 0.15s;
}

.dp-btn-ghost:hover, .dp-btn-ghost.is-active { border-color: var(--neon); color: var(--neon); }

/* ── Shell : sidebar + main ─────────────────────────────────────────── */

.dp-shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  transition: grid-template-columns 0.25s ease;
}

.dp-shell.is-collapsed { grid-template-columns: var(--side-w-min) 1fr; }

.dp-sidebar {
  background: linear-gradient(180deg, var(--bg-2), #0c0c10);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.dp-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
}

.dp-brand-text { overflow: hidden; white-space: nowrap; }

.dp-burger {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 4px;
  justify-content: center;
  height: 36px;
  width: 36px;
  padding: 0 8px;
  transition: border-color 0.15s;
}

.dp-burger span { background: var(--neon); border-radius: 2px; display: block; height: 2px; }
.dp-burger:hover { border-color: var(--neon); }

/* — Navigation — */

.dp-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; }

.dp-nav-section {
  color: var(--txt-3);
  font-family: var(--f-ui);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 16px 8px 6px;
  white-space: nowrap;
}

.dp-nav-link {
  align-items: center;
  border-radius: 10px;
  color: var(--txt-2);
  display: flex;
  gap: 12px;
  font-family: var(--f-ui);
  font-size: 0.88rem;
  padding: 9px 10px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.dp-nav-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--txt); }

.dp-nav-link.is-active {
  background: var(--neon-dim);
  color: var(--neon);
  box-shadow: inset 2px 0 0 var(--neon);
}

.dp-nav-ico {
  display: inline-grid;
  flex-shrink: 0;
  font-size: 1rem;
  place-items: center;
  width: 22px;
}

.dp-side-foot {
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
}

.dp-logout {
  background: transparent;
  border: none;
  color: var(--txt-3);
  cursor: pointer;
  font-family: var(--f-ui);
  font-size: 0.8rem;
  text-align: left;
  padding: 2px;
}

.dp-logout:hover { color: var(--red); }

/* — Sidebar réduite (desktop) — */

.dp-shell.is-collapsed .dp-brand-text,
.dp-shell.is-collapsed .dp-nav-section,
.dp-shell.is-collapsed .dp-nav-label { display: none; }

.dp-shell.is-collapsed .dp-nav-link { justify-content: center; padding: 11px 0; }
.dp-shell.is-collapsed .dp-side-foot { align-items: center; }

/* — Indicateur temps réel — */

.dp-health {
  align-items: center;
  color: var(--txt-2);
  display: flex;
  font-family: var(--f-ui);
  font-size: 0.78rem;
  gap: 8px;
}

.dp-health i, .dp-chip i {
  background: var(--txt-3);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  height: 8px;
  width: 8px;
}

.dp-live-on i { background: var(--neon); box-shadow: 0 0 8px var(--neon); animation: dp-pulse 2s infinite; }
.dp-live-wait i { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dp-live-off i { background: var(--red); }

@keyframes dp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ── Main + topbar ──────────────────────────────────────────────────── */

.dp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 24px 40px;
}

.dp-topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dp-burger-mobile { display: none; }

.dp-page-title {
  font-family: var(--f-title);
  font-size: 1.9rem;
  letter-spacing: 0.05em;
  line-height: 1;
}

.dp-page-sub {
  color: var(--txt-2);
  font-family: var(--f-ui);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.dp-topbar-actions { align-items: center; display: flex; gap: 10px; }

.dp-edit-hint {
  background: var(--gold-dim);
  border: 1px dashed rgba(254, 228, 64, 0.4);
  border-radius: 10px;
  color: var(--gold);
  font-family: var(--f-ui);
  font-size: 0.82rem;
  margin-bottom: 14px;
  padding: 9px 14px;
}

/* ── Chips ──────────────────────────────────────────────────────────── */

.dp-chip {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--txt-2);
  display: inline-flex;
  font-family: var(--f-ui);
  font-size: 0.72rem;
  font-weight: 600;
  gap: 7px;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  white-space: nowrap;
}

.dp-chip-danger { background: var(--red-dim); border-color: rgba(239, 68, 68, 0.4); color: var(--red); }
.dp-chip-warn { background: var(--gold-dim); border-color: rgba(254, 228, 64, 0.35); color: var(--gold); }
.dp-chip-accent { background: var(--neon-dim); border-color: rgba(0, 245, 212, 0.35); color: var(--neon); }

/* ── Grid de widgets ────────────────────────────────────────────────── */

.dp-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.dp-widget {
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.15s;
}

.dp-widget::before {
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  content: '';
  height: 1px;
  left: 10%;
  opacity: 0;
  position: absolute;
  right: 10%;
  top: 0;
  transition: opacity 0.25s;
}

.dp-widget:hover {
  border-color: rgba(0, 245, 212, 0.35);
  box-shadow: 0 0 26px rgba(0, 245, 212, 0.10), 0 12px 32px rgba(0, 0, 0, 0.35);
}

.dp-widget:hover::before { opacity: 1; }

/* Tailles */
.dp-w-live { grid-column: span 7; }
.dp-w-profit { grid-column: span 5; }
.dp-w-alerts { grid-column: span 5; }
.dp-w-pokedex { grid-column: span 3; }
.dp-w-meteo { grid-column: span 4; }
.dp-w-forum { grid-column: span 6; }
.dp-w-quests { grid-column: span 6; }

.dp-w-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 14px 18px 12px;
}

.dp-w-head h3 {
  font-family: var(--f-title);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.dp-w-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 14px 18px 16px; }

.dp-w-center { align-items: center; justify-content: center; text-align: center; }

.dp-w-foot {
  border-top: 1px solid var(--line);
  font-family: var(--f-ui);
  font-size: 0.8rem;
  padding: 10px 18px;
}

.dp-empty { color: var(--txt-3); font-family: var(--f-ui); font-size: 0.85rem; padding: 6px 0; }

.dp-meta { color: var(--txt-3); font-family: var(--f-ui); font-size: 0.75rem; }

.dp-money { font-family: var(--f-ui); font-variant-numeric: tabular-nums; }

/* — Mode réorganisation — */

.dp-grid.is-editing .dp-widget {
  border-style: dashed;
  border-color: rgba(254, 228, 64, 0.45);
  cursor: grab;
}

.dp-grid.is-editing .dp-widget:active { cursor: grabbing; }

.dp-widget.is-dragging { opacity: 0.45; transform: scale(0.98); }

/* ── Widget Live Shift ──────────────────────────────────────────────── */

.dp-shift-list { display: flex; flex-direction: column; gap: 10px; list-style: none; }

.dp-shift {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
}

.dp-shift.is-live { border-left: 3px solid var(--neon); }
.dp-shift.is-done { border-left: 3px solid var(--txt-3); opacity: 0.75; }

.dp-shift-top { align-items: baseline; display: flex; gap: 10px; justify-content: space-between; }

.dp-shift-name { font-size: 1rem; font-weight: 600; }

.dp-shift-cost { color: var(--gold); font-size: 1.05rem; font-weight: 700; }

.dp-shift-mid { display: flex; flex-direction: column; gap: 2px; }

.dp-shift-task { color: var(--neon); font-family: var(--f-ui); font-size: 0.85rem; }
.dp-shift.is-done .dp-shift-task { color: var(--txt-2); }

.dp-shift-meta { color: var(--txt-3); font-family: var(--f-ui); font-size: 0.74rem; }

.dp-shift-pct { color: var(--txt-2); font-family: var(--f-ui); font-size: 0.72rem; }

.dp-shift-total {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--txt-2);
  display: flex;
  font-family: var(--f-ui);
  font-size: 0.85rem;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
}

.dp-shift-total strong {
  color: var(--gold);
  font-size: 1.35rem;
  text-shadow: 0 0 18px rgba(254, 228, 64, 0.35);
}

/* — Barres de progression — */

.dp-progress {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.dp-progress-fill {
  background: linear-gradient(90deg, #00c9ae, var(--neon));
  border-radius: 999px;
  height: 100%;
  transition: width 0.5s ease;
}

.dp-progress-fill.is-full { background: linear-gradient(90deg, var(--gold), #ffd000); }

/* ── Widget Rentabilité ─────────────────────────────────────────────── */

.dp-profit-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr 1fr; }

.dp-profit-cell {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.dp-profit-cell small {
  color: var(--txt-3);
  font-family: var(--f-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dp-profit-cell b { font-family: var(--f-ui); font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.dp-profit-ratio b { color: var(--neon); }

.dp-gauge {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  height: 10px;
  margin-top: 6px;
  overflow: hidden;
  position: relative;
}

.dp-gauge-fill { border-radius: 999px; height: 100%; transition: width 0.6s ease; width: 0; }
.dp-gauge-fill.is-good { background: linear-gradient(90deg, #00c9ae, var(--neon)); }
.dp-gauge-fill.is-warn { background: linear-gradient(90deg, #d9b900, var(--gold)); }
.dp-gauge-fill.is-bad { background: linear-gradient(90deg, #b91c1c, var(--red)); }

.dp-gauge-label {
  color: var(--txt-3);
  display: block;
  font-family: var(--f-ui);
  font-size: 0.74rem;
  margin-top: 8px;
  position: relative;
}

/* ── Widget Alertes ─────────────────────────────────────────────────── */

.dp-alert-list { display: flex; flex-direction: column; gap: 8px; list-style: none; }

.dp-alert {
  align-items: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.dp-alert.is-read { opacity: 0.55; }

.dp-alert-dot {
  border-radius: 50%;
  flex-shrink: 0;
  height: 9px;
  margin-top: 5px;
  width: 9px;
}

.dp-sev-critical .dp-alert-dot,
.dp-sev-danger .dp-alert-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.dp-sev-warning .dp-alert-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dp-sev-info .dp-alert-dot { background: var(--neon); }

.dp-alert-msg { font-family: var(--f-ui); font-size: 0.85rem; }

/* ── Widget Pokédex ─────────────────────────────────────────────────── */

.dp-big-number {
  color: var(--neon);
  font-family: var(--f-title);
  font-size: 3.4rem;
  line-height: 1;
  text-shadow: 0 0 28px rgba(0, 245, 212, 0.4);
}

.dp-big-number-sm {
  color: var(--gold);
  font-family: var(--f-title);
  font-size: 2rem;
  line-height: 1;
}

.dp-big-label {
  color: var(--txt-2);
  font-family: var(--f-ui);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dp-sparkline {
  align-items: flex-end;
  display: flex;
  gap: 5px;
  height: 44px;
  margin-top: 8px;
  width: 100%;
  max-width: 160px;
}

.dp-spark-bar {
  background: rgba(0, 245, 212, 0.28);
  border-radius: 3px 3px 0 0;
  flex: 1;
  min-height: 3px;
  transition: height 0.5s ease;
}

.dp-spark-bar.is-today { background: var(--neon); box-shadow: 0 0 10px rgba(0, 245, 212, 0.5); }

/* ── Widget Météo ───────────────────────────────────────────────────── */

.dp-meteo-row { align-items: center; display: flex; gap: 16px; }

.dp-meteo-ico {
  color: var(--gold);
  font-size: 2.4rem;
  line-height: 1;
  text-shadow: 0 0 20px rgba(254, 228, 64, 0.35);
}

.dp-meteo-temp { font-family: var(--f-ui); font-size: 1.3rem; font-weight: 700; }

.dp-meteo-covers { margin-left: auto; text-align: right; }

/* ── Feeds (forum, quêtes) ──────────────────────────────────────────── */

.dp-feed-list { display: flex; flex-direction: column; gap: 8px; list-style: none; }

.dp-feed {
  align-items: flex-start;
  display: flex;
  font-family: var(--f-ui);
  font-size: 0.86rem;
  gap: 10px;
  padding: 4px 0;
}

.dp-feed.is-report p:first-child { color: var(--red); }

.dp-feed-ico {
  color: var(--neon);
  flex-shrink: 0;
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
}

.dp-feed-ico.is-gold { color: var(--gold); }

/* ── Dialog contexte du jour ────────────────────────────────────────── */

.dp-dialog {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--txt);
  margin: auto;
  max-width: 420px;
  padding: 0;
  width: calc(100% - 32px);
}

.dp-dialog::backdrop { background: rgba(5, 5, 8, 0.75); backdrop-filter: blur(3px); }

.dp-dialog form { display: flex; flex-direction: column; gap: 14px; padding: 26px 24px; }

.dp-dialog h3 {
  font-family: var(--f-title);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.dp-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* ── Scrim mobile ───────────────────────────────────────────────────── */

.dp-scrim {
  background: rgba(5, 5, 8, 0.7);
  inset: 0;
  position: fixed;
  z-index: 40;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
  .dp-w-live { grid-column: span 12; }
  .dp-w-profit { grid-column: span 6; }
  .dp-w-alerts { grid-column: span 6; }
  .dp-w-pokedex { grid-column: span 5; }
  .dp-w-meteo { grid-column: span 7; }
}

@media (max-width: 900px) {
  .dp-shell, .dp-shell.is-collapsed { grid-template-columns: 1fr; }

  .dp-sidebar {
    height: 100dvh;
    max-width: 300px;
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 82vw;
    z-index: 50;
  }

  .dp-shell.is-nav-open .dp-sidebar { transform: translateX(0); box-shadow: 24px 0 60px rgba(0, 0, 0, 0.6); }

  .dp-burger-mobile { display: inline-flex; }

  .dp-main { padding: 14px 14px 32px; }

  .dp-page-title { font-size: 1.5rem; }

  .dp-w-live, .dp-w-profit, .dp-w-alerts, .dp-w-pokedex,
  .dp-w-meteo, .dp-w-forum, .dp-w-quests { grid-column: span 12; }

  .dp-profit-row { grid-template-columns: 1fr 1fr; }
  .dp-profit-ratio { grid-column: span 2; }
}

@media (max-width: 480px) {
  .dp-topbar-actions .dp-btn-ghost { font-size: 0.78rem; padding: 8px 10px; }
  .dp-big-number { font-size: 2.8rem; }
}
