/* K9R Bots — panel (même DA que k9resell.xyz et K9R Cloud) */
:root {
  --accent: 168, 85, 247; --bg: #0c0716; --card: 24, 16, 38; --text: #f5f3fa; --text2: #d4cde3; --muted: #9b93ad;
  --line: rgba(255, 255, 255, .07); --green: #22c55e; --red: #ef4444; --amber: #f59e0b; --blue: #3b82f6; --r: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text2); font: 14px/1.5 'Montserrat', 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: rgb(var(--accent)); text-decoration: none; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 12.5px; }
::selection { background: rgba(var(--accent), .45); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: rgba(var(--accent), .45) transparent; }

/* fond animé */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(1200px 650px at 50% -15%, rgba(var(--accent), .28), transparent 65%), radial-gradient(900px 500px at 100% 10%, rgba(236, 72, 153, .08), transparent 60%),
    radial-gradient(900px 600px at 0% 40%, rgba(var(--accent), .10), transparent 60%), var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; }
.orb.a { width: 520px; height: 520px; top: -140px; left: 10%; background: rgba(var(--accent), .5); animation: oa 22s ease-in-out infinite; }
.orb.b { width: 420px; height: 420px; top: 35%; right: -100px; background: rgba(217, 70, 239, .3); animation: ob 26s ease-in-out infinite; }
.orb.c { width: 460px; height: 460px; bottom: -180px; left: 35%; background: rgba(124, 58, 237, .35); animation: oa 30s ease-in-out infinite reverse; }
.bg::after { content: ''; position: absolute; inset: -100% -50%; background-image: repeating-linear-gradient(115deg, transparent 0, transparent 180px, rgba(var(--accent), .08) 180px, rgba(var(--accent), .08) 181px, transparent 181px, transparent 420px); animation: rain 14s linear infinite; }
@keyframes oa { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(120px, 60px) scale(1.1); } 66% { transform: translate(-80px, 100px) scale(.95); } }
@keyframes ob { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-160px, -80px) scale(1.15); } }
@keyframes rain { to { transform: translate3d(-200px, 420px, 0); } }
@keyframes up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-3px) rotate(-3deg); } 60% { transform: translateY(-2px) rotate(2deg); } }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes shine { 0%, 55% { background-position: 160% 0, 0 50%; } 100% { background-position: -60% 0, 100% 50%; } }

/* login */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 400px; text-align: center; animation: up .6s ease backwards; }
.login .logo { width: 110px; height: 110px; margin: 0 auto 10px; background: url(/assets/k9r-logo.png) center/contain no-repeat; filter: drop-shadow(0 0 30px rgba(var(--accent), .55)); animation: bob 3.2s ease-in-out infinite; }
.eyebrow { color: rgb(var(--accent)); font-weight: 700; letter-spacing: .3em; font-size: 11px; text-transform: uppercase; }
.login h1 { color: #fff; font-size: 30px; margin: 6px 0 22px; letter-spacing: -.03em; }

/* layout */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 14px; color: #fff; font-weight: 800; letter-spacing: .02em; }
.brand i { width: 34px; height: 34px; background: url(/assets/k9r-logo.png) center/contain no-repeat; filter: drop-shadow(0 0 10px rgba(var(--accent), .6)); animation: bob 3.2s ease-in-out infinite; }
.brand small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .12em; }
.nav { display: flex; flex-direction: column; gap: 3px; overflow: auto; padding-right: 4px; }
.nav button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; transition: .15s; }
.nav button:hover { color: #fff; background: rgba(var(--accent), .1); }
.nav button.on { color: #fff; background: linear-gradient(180deg, color-mix(in srgb, rgb(var(--accent)) 85%, white), rgb(var(--accent))); box-shadow: 0 6px 20px -8px rgba(var(--accent), .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.nav .ico { width: 20px; text-align: center; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.main { padding: 22px 28px 60px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.top h1 { margin: 0; color: #fff; font-size: 26px; letter-spacing: -.03em; }
.top .sub { color: var(--muted); margin-top: 2px; }
.page { animation: up .45s ease backwards; }
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .nav { flex-direction: row; flex-wrap: wrap; } .main { padding: 16px; } }

/* cartes */
.card { position: relative; background: linear-gradient(180deg, rgba(var(--card), .9), rgba(var(--card), .66)); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 16px 40px -26px rgba(0, 0, 0, .9); transition: border-color .25s, box-shadow .25s; }
.card:hover { border-color: rgba(var(--accent), .25); }
.card h2 { margin: 0 0 12px; color: #fff; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h2 .r { margin-left: auto; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.stat .k { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.stat .v { color: #fff; font-size: 26px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .ico { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: radial-gradient(circle at 50% 0, rgba(var(--accent), .4), rgba(var(--accent), .08)); border: 1px solid rgba(var(--accent), .3); }

/* bots */
.bot { display: flex; align-items: center; gap: 14px; }
.bot img { width: 54px; height: 54px; border-radius: 16px; border: 1px solid rgba(var(--accent), .35); }
.bot .n { color: #fff; font-weight: 800; font-size: 16px; }
.dot { position: relative; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); vertical-align: middle; }
.dot.on { background: var(--green); } .dot.on::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.6s ease infinite; }
.dot.warn { background: var(--amber); }

/* formulaires */
input, select, textarea { width: 100%; background: rgba(0, 0, 0, .35); border: 1px solid rgba(var(--accent), .3); border-radius: 12px; color: var(--text); padding: 10px 13px; font: inherit; outline: none; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: rgb(var(--accent)); box-shadow: 0 0 0 4px rgba(var(--accent), .15); }
textarea { min-height: 90px; resize: vertical; }
label.f { display: block; margin-bottom: 12px; } label.f > span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row > * { flex: 1; min-width: 140px; } .row > .shrink { flex: 0 0 auto; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .5); color: var(--text); padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: rgba(var(--accent), .55); background: rgba(var(--accent), .1); }
.btn.p { border-color: transparent; color: #fff; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%) no-repeat, linear-gradient(135deg, color-mix(in srgb, rgb(var(--accent)) 70%, #ec4899), rgb(var(--accent)), color-mix(in srgb, rgb(var(--accent)) 70%, #6366f1)); background-size: 250% 100%, 200% 200%; animation: shine 6s ease-in-out infinite; box-shadow: 0 8px 26px -8px rgba(var(--accent), .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.d { border-color: transparent; color: #fff; background: linear-gradient(180deg, #f87171, #dc2626); }
.btn.g { border-color: transparent; color: #fff; background: linear-gradient(180deg, #4ade80, #16a34a); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.sw { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.sw input { display: none; } .sw i { width: 40px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .12); position: relative; transition: .2s; flex: none; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.sw input:checked + i { background: rgb(var(--accent)); box-shadow: 0 0 14px rgba(var(--accent), .6); } .sw input:checked + i::after { left: 21px; }

/* tableaux / listes */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, .04); vertical-align: middle; }
tr:hover td { background: rgba(var(--accent), .04); }
.scroll { max-height: 520px; overflow: auto; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); white-space: nowrap; }
.pill.a { color: #e9d5ff; background: rgba(var(--accent), .14); border-color: rgba(var(--accent), .35); }
.pill.g { color: #86efac; background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); }
.pill.r { color: #fca5a5; background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); }
.pill.y { color: #fcd34d; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); }
.user { display: flex; align-items: center; gap: 9px; } .user img { width: 30px; height: 30px; border-radius: 50%; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.feed { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.feed div { padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { all: unset; cursor: pointer; padding: 7px 15px; border-radius: 999px; color: var(--muted); font-weight: 700; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); }
.tabs button.on { color: #fff; border-color: rgba(var(--accent), .5); background: rgba(var(--accent), .18); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip { cursor: pointer; } .chip:hover { border-color: rgba(var(--accent), .6); }

/* graphiques */
.chart { width: 100%; height: 180px; } .chart .b { fill: rgba(var(--accent), .75); } .chart .b2 { fill: rgba(239, 68, 68, .6); } .chart .ln { fill: none; stroke: rgb(var(--accent)); stroke-width: 2.5; } .chart .ar { fill: rgba(var(--accent), .15); } .chart text { fill: var(--muted); font-size: 10px; }

/* fiche membre */
.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head img.av { width: 86px; height: 86px; border-radius: 24px; border: 2px solid rgba(var(--accent), .5); }
.profile-head .name { color: #fff; font-size: 22px; font-weight: 800; }
.banner { height: 130px; border-radius: 16px; background-size: cover; background-position: center; margin-bottom: -50px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; } .kv b { color: var(--muted); font-weight: 600; }

/* aperçu embed Discord */
.dpreview { background: #313338; border-radius: 10px; padding: 14px; color: #dbdee1; font-family: 'gg sans', 'Segoe UI', sans-serif; }
.dembed { border-left: 4px solid rgb(var(--accent)); background: #2b2d31; border-radius: 4px; padding: 10px 14px; max-width: 520px; margin-top: 6px; }
.dembed .t { color: #fff; font-weight: 700; } .dembed img { max-width: 100%; border-radius: 6px; margin-top: 8px; }
.dstatus { display: flex; align-items: center; gap: 10px; background: #232428; padding: 10px 14px; border-radius: 10px; }

/* toast & modale */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: linear-gradient(180deg, rgba(var(--card), .98), rgba(14, 9, 25, .98)); border: 1px solid rgba(var(--accent), .45); padding: 12px 18px; border-radius: 14px; color: #fff; box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .9); transform: translateY(150%); transition: .3s; }
.toast.show { transform: none; } .toast.err { border-color: rgba(239, 68, 68, .6); }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(4, 2, 8, .75); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal .card { width: 100%; max-width: 1100px; max-height: 90vh; overflow: auto; }
.modal iframe { width: 100%; height: 75vh; border: 0; border-radius: 12px; background: #0c0716; }
iframe.full { width: 100%; height: calc(100vh - 130px); border: 0; border-radius: 18px; background: transparent; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
