/* ===== MTY Revendeur — thème sombre ===== */
:root {
  --bg: #070B16;
  --bg2: #0C1222;
  --card: rgba(255, 255, 255, .035);
  --card2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --text: #E9EEFB;
  --muted: #8592AF;
  --dim: #5B6782;
  --pri: #38BDF8;
  --pri2: #6366F1;
  --grad: linear-gradient(135deg, #38BDF8 0%, #6366F1 100%);
  --ok: #10B981;
  --ok-grad: linear-gradient(135deg, #34D399 0%, #059669 100%);
  --warn: #F59E0B;
  --bad: #F43F5E;
  --r: 18px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .6);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  font-size: 15px; line-height: 1.45; min-height: 100vh;
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(700px 500px at -20% 10%, rgba(56, 189, 248, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg.i { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#app { max-width: 520px; margin: 0 auto; padding: 0 16px calc(96px + var(--safe-b)); }

/* ===== Connexion ===== */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 4px; }
.logo {
  width: 88px; height: 88px; border-radius: 28px; margin: 0 auto 22px; display: grid; place-items: center;
  background: var(--bg2); border: 1px solid var(--line2); position: relative;
  box-shadow: 0 0 0 8px rgba(56, 189, 248, .05), 0 20px 60px -10px rgba(56, 189, 248, .45);
}
.logo svg { width: 42px; height: 42px; color: var(--pri); filter: drop-shadow(0 0 12px rgba(56,189,248,.6)); }
.login h1 { text-align: center; margin: 0; font-size: 26px; letter-spacing: .06em; font-weight: 800; }
.login h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .sub { text-align: center; color: var(--muted); margin: 6px 0 32px; }
.help { text-align: center; margin-top: 24px; color: var(--warn); font-size: 14px; display: flex; gap: 8px; justify-content: center; align-items: center; text-decoration: none; }

/* ===== Champs ===== */
.field {
  display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .2s, background .2s, box-shadow .2s; margin-bottom: 12px;
}
.field:focus-within { border-color: rgba(56, 189, 248, .6); background: rgba(56, 189, 248, .05); box-shadow: 0 0 0 4px rgba(56, 189, 248, .1); }
.field > svg { color: var(--muted); }
.field:focus-within > svg { color: var(--pri); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; height: 100%; font-size: 16px; }
.field input::placeholder { color: var(--dim); }
.field.mono input { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; font-size: 17px; }
.field .ok-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: .2s; }
.field .ok-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); transition: .15s; }
.icon-btn:active { transform: scale(.92); background: var(--card2); }
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 20px 2px 10px; display: flex; align-items: center; gap: 8px; }
.label b { width: 20px; height: 20px; border-radius: 6px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 11px; }

/* ===== Boutons ===== */
.btn {
  height: 54px; width: 100%; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: #fff; background: var(--grad); position: relative; overflow: hidden;
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, .6); transition: transform .12s, opacity .2s, filter .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; box-shadow: none; filter: grayscale(.6); cursor: not-allowed; }
.btn.green { background: var(--ok-grad); box-shadow: 0 12px 30px -10px rgba(16, 185, 129, .55); }
.btn.ghost { background: var(--card2); box-shadow: none; border: 1px solid var(--line); }
.btn.red { background: linear-gradient(135deg, #FB7185, #E11D48); box-shadow: 0 12px 30px -10px rgba(244, 63, 94, .5); }
.btn.sm { height: 40px; font-size: 14px; border-radius: 12px; width: auto; padding: 0 14px; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== En-tête ===== */
.top { display: flex; align-items: center; gap: 12px; padding: 18px 0 14px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 70%, transparent); }
.avatar { width: 46px; height: 46px; border-radius: 15px; background: var(--grad); display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; flex: none;
  box-shadow: 0 8px 24px -8px rgba(56, 189, 248, .6); }
.top .who { flex: 1; min-width: 0; }
.top .name { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .handle { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.badge { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: rgba(56, 189, 248, .12); color: var(--pri); text-transform: uppercase; }
.badge.gold { background: rgba(245, 158, 11, .14); color: var(--warn); }
.top .icon-btn { background: var(--card); border: 1px solid var(--line); }
.top .icon-btn.out { color: var(--bad); }
.spinning svg { animation: spin .8s linear infinite; }

/* ===== Cartes ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.hero {
  border-radius: 24px; padding: 20px; margin-bottom: 14px; position: relative; overflow: hidden;
  background: linear-gradient(145deg, rgba(56, 189, 248, .16), rgba(99, 102, 241, .14) 55%, rgba(13, 20, 36, .4));
  border: 1px solid rgba(56, 189, 248, .22); box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .35), transparent 70%); pointer-events: none; }
.hero .k { color: #B8C7E8; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 2px; }
.hero .big small { font-size: 18px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.countdown { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); color: #CFE3FF; }
.countdown .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; position: relative; z-index: 1; }
.mini { background: rgba(7, 11, 22, .45); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.mini .v { font-weight: 800; font-size: 16px; }
.mini .l { font-size: 11.5px; color: var(--muted); }

.parent { display: flex; align-items: center; gap: 12px; }
.parent .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(245, 158, 11, .12); color: var(--warn); flex: none; }
.parent .t { flex: 1; min-width: 0; }
.parent .t b { display: block; }
.wa { background: #22C55E; color: #fff; height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 14px; flex: none; }

.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; margin-bottom: 14px;
  background: rgba(244, 63, 94, .07); border: 1px solid rgba(244, 63, 94, .22); font-size: 13px; color: #F7C1CB; }
.alert svg { color: var(--bad); margin-top: 1px; }
.alert b { color: #FDA4AF; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.action { border-radius: 20px; padding: 16px; text-align: left; color: #fff; display: flex; flex-direction: column; gap: 14px; min-height: 120px; justify-content: space-between;
  position: relative; overflow: hidden; transition: transform .12s; }
.action:active { transform: scale(.97); }
.action .ic { width: 42px; height: 42px; border-radius: 13px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
.action b { font-size: 16px; display: block; }
.action span { font-size: 12.5px; opacity: .85; }
.action.test { background: var(--ok-grad); box-shadow: 0 14px 30px -12px rgba(16, 185, 129, .6); }
.action.sell { background: var(--grad); box-shadow: 0 14px 30px -12px rgba(99, 102, 241, .7); }
.action::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .1); }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }
.section-h h2 { margin: 0; font-size: 18px; font-weight: 800; }

/* ===== Segments / puces ===== */
.seg { display: flex; padding: 4px; gap: 4px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.seg button { flex: 1; height: 38px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); transition: .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--card2); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .3), inset 0 0 0 1px var(--line2); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.chip.on { background: rgba(56, 189, 248, .14); border-color: rgba(56, 189, 248, .4); color: var(--pri); }
.chip i { font-style: normal; font-size: 11px; background: rgba(255, 255, 255, .08); padding: 1px 7px; border-radius: 999px; }

/* ===== Listes ===== */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.item .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--card2); color: var(--muted); flex: none; }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; letter-spacing: .03em; }
.item .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item .price { font-weight: 800; }
.pill { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.active { background: rgba(16, 185, 129, .14); color: #34D399; }
.pill.soon { background: rgba(245, 158, 11, .14); color: #FBBF24; }
.pill.expired { background: rgba(148, 163, 184, .12); color: #94A3B8; }
.pill.blocked, .pill.rejected { background: rgba(244, 63, 94, .14); color: #FB7185; }
.pill.pending { background: rgba(56, 189, 248, .14); color: var(--pri); }
.pill.validated { background: rgba(16, 185, 129, .14); color: #34D399; }
.link-btn { font-size: 12.5px; font-weight: 700; color: var(--pri); padding: 4px 0; }
.item-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.item.col { flex-direction: column; align-items: stretch; }
.item.col .head { display: flex; align-items: center; gap: 12px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; background: var(--card); border: 1px dashed var(--line2); display: grid; place-items: center; }
.empty .ic svg { width: 28px; height: 28px; }

.sumbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 16px; margin-bottom: 12px;
  background: rgba(245, 158, 11, .08); border: 1px solid rgba(245, 158, 11, .2); }
.sumbar b { color: var(--warn); font-size: 18px; }

/* ===== Statistiques Boss ===== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.stat .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.stat .v { font-size: 20px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--muted); }
.c-blue { background: rgba(56, 189, 248, .12); color: var(--pri); }
.c-green { background: rgba(16, 185, 129, .12); color: #34D399; }
.c-amber { background: rgba(245, 158, 11, .12); color: #FBBF24; }
.c-red { background: rgba(244, 63, 94, .12); color: #FB7185; }
.c-violet { background: rgba(129, 140, 248, .14); color: #A5B4FC; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar .b { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--grad); min-height: 4px; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.bar .d { font-size: 10.5px; color: var(--muted); }
.bar .a { font-size: 10px; color: var(--text); font-weight: 700; }

/* ===== Barre de navigation ===== */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); width: calc(100% - 24px); max-width: 496px; z-index: 20;
  display: flex; padding: 6px; border-radius: 22px; background: rgba(13, 20, 36, .82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line2); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .7); }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 16px; color: var(--dim); font-size: 11px; font-weight: 700; position: relative; transition: .2s; }
.nav button.on { color: var(--text); background: rgba(56, 189, 248, .1); }
.nav button.on svg { color: var(--pri); }
.nav .count { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

/* ===== Feuilles (bottom sheets) ===== */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(2, 5, 12, .65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.overlay.closing { animation: fade .2s reverse forwards; }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #111A2E, #0B1222);
  border: 1px solid var(--line2); border-bottom: 0; border-radius: 28px 28px 0 0; animation: up .32s cubic-bezier(.2, .9, .25, 1); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); }
.overlay.closing .sheet { animation: up .22s reverse forwards; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 10px auto 0; }
.sheet .sh { display: flex; align-items: center; gap: 14px; padding: 14px 20px 6px; }
.sheet .sh .ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.sheet .sh .ic svg { width: 24px; height: 24px; }
.sheet .sh h3 { margin: 0; font-size: 19px; font-weight: 800; }
.sheet .sh p { margin: 1px 0 0; font-size: 13px; }
.sheet .sh .x { margin-left: auto; background: var(--card2); }
.sheet .body { overflow-y: auto; padding: 4px 20px 16px; overscroll-behavior: contain; }
.sheet .foot { padding: 12px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(11, 18, 34, .95); }
.info { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(56, 189, 248, .07); border: 1px solid rgba(56, 189, 248, .16); font-size: 13px; color: #BFD9F2; margin: 10px 0 14px; }
.info svg { color: var(--pri); }
.info.green { background: rgba(16, 185, 129, .07); border-color: rgba(16, 185, 129, .2); color: #B6F0D9; }
.info.green svg { color: var(--ok); }

.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plat { height: 64px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); display: flex; align-items: center; gap: 12px; padding: 0 14px; font-weight: 700; transition: .2s; text-align: left; }
.plat small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.plat .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--card2); }
.plat.on { border-color: var(--pri); background: rgba(56, 189, 248, .1); box-shadow: 0 0 0 4px rgba(56, 189, 248, .08); }
.plat.on .ic { background: var(--grad); color: #fff; }

.plans { display: flex; flex-direction: column; gap: 10px; }
.plan { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); text-align: left; transition: .2s; width: 100%; }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); flex: none; display: grid; place-items: center; transition: .2s; }
.plan.on { border-color: var(--pri); background: rgba(56, 189, 248, .08); }
.plan.on .radio { border-color: var(--pri); background: var(--pri); box-shadow: inset 0 0 0 4px #0F1A2E; }
.plan .main { flex: 1; min-width: 0; }
.plan .t { font-weight: 800; }
.plan.on .t { color: #8CDCFF; }
.plan .s { font-size: 12.5px; color: var(--muted); }
.plan .p { font-weight: 800; padding: 7px 12px; border-radius: 11px; background: linear-gradient(135deg, #FCD34D, #F59E0B); color: #1A1204; font-size: 14px; flex: none; }
.plan .p.free { background: var(--ok-grad); color: #fff; }

/* ===== Toasts ===== */
#toast-root { position: fixed; top: 14px; left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 480px; width: 100%; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px;
  background: rgba(17, 26, 46, .95); backdrop-filter: blur(14px); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: drop .35s cubic-bezier(.2, .9, .25, 1); font-weight: 600; font-size: 14px; }
.toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--bad); }
.toast.hide { animation: drop .25s reverse forwards; }
@keyframes drop { from { transform: translateY(-120%); opacity: 0; } }

.skeleton { height: 70px; border-radius: 16px; background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in { animation: fade .3s; }

/* Correctifs */
.grid2 > * { min-width: 0; }
a.btn { text-decoration: none; }
.bars { justify-content: center; }
.bar { max-width: 56px; }
.flabel { font-size: 12px; color: var(--muted); font-weight: 600; margin: 4px 2px 6px; }
