/* bot.alp.live — design system */
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Barlow+Condensed:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #07090f;
  --bg-2: #0b0f19;
  --panel: rgba(16, 21, 34, .72);
  --panel-solid: #111624;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --txt: #ffffff;
  --txt-2: #c7cedb;
  --txt-3: #8a94a6;
  --accent: #ff6a1a;
  --accent-2: #ffa468;
  --accent-glow: rgba(255, 106, 26, .35);
  --ok: #2fd58a;
  --warn: #ffc247;
  --err: #ff5470;
  --info: #5aa9ff;
  --violet: #9b7bff;
  --r: 18px;
  --r-s: 11px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .04) inset;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh;
  font-family: 'Barlow', system-ui, sans-serif; font-weight: 400; font-size: 15px; line-height: 1.5;
  color: var(--txt); background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 106, 26, .13), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(90, 169, 255, .10), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(155, 123, 255, .08), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #000; }

/* ---------- Typo ---------- */
.cond { font-family: 'Barlow Condensed', 'Barlow', sans-serif; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
.eyebrow { font-family: 'Barlow Condensed'; font-weight: 600; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--txt-3); }
.eyebrow.accent { color: var(--accent); }
h1 { font-family: 'Barlow Condensed'; font-weight: 600; font-size: 40px; letter-spacing: -.01em; line-height: 1.05; margin: 0; }
h2 { font-family: 'Barlow Condensed'; font-weight: 600; font-size: 24px; margin: 0; letter-spacing: -.005em; }
h3 { font-family: 'Barlow Condensed'; font-weight: 500; font-size: 18px; margin: 0; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--txt-3); }
.soft { color: var(--txt-2); }
.small { font-size: 13px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 26px 18px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%), var(--bg-2);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff3d81);
  box-shadow: 0 10px 30px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .35);
  font-family: 'Barlow Condensed'; font-weight: 700; font-size: 20px; color: #fff;
}
.brand .t { font-family: 'Barlow Condensed'; font-weight: 600; font-size: 20px; line-height: 1; }
.brand .s { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-3); margin-top: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--txt-2); font-weight: 500; transition: background .2s var(--ease), color .2s;
}
.nav a svg { width: 18px; height: 18px; opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, .04); color: var(--txt); }
.nav a.on { background: linear-gradient(90deg, rgba(255, 106, 26, .18), rgba(255, 106, 26, .04)); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.nav .badge { margin-left: auto; }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2a3350, #1a2036); font-family: 'Barlow Condensed'; font-weight: 600; border: 1px solid var(--line-2); }

.main { padding: 34px 40px 60px; max-width: 1480px; width: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.top .sub { color: var(--txt-3); margin-top: 6px; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(14px); box-shadow: var(--shadow); padding: 22px 24px;
}
.card.tight { padding: 16px 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; }
.main { min-width: 0; }
.card { min-width: 0; }
@media (max-width: 1240px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .side { position: relative; height: auto; } .main { padding: 22px 18px; } .g3, .g2 { grid-template-columns: 1fr; } }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 180px; height: 180px; border-radius: 50%; background: var(--k, var(--accent)); filter: blur(60px); opacity: .18; }
.kpi .v { font-family: 'Barlow Condensed'; font-weight: 700; font-size: 44px; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--txt-2); margin-top: 6px; }

/* ---------- Status ---------- */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent), 0 0 14px var(--c); background: var(--c); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; border-radius: 999px; font-family: 'Barlow Condensed'; font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); color: #fff; }
.st-ok { --c: var(--ok); } .st-running { --c: var(--info); } .st-error { --c: var(--err); } .st-paused { --c: var(--txt-3); } .st-new { --c: var(--violet); } .st-done { --c: var(--txt-3); }
.st-running .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .6; } }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; font-family: 'Barlow Condensed'; font-weight: 700; font-size: 13px; background: var(--accent); color: #000; }
.badge.grey { background: rgba(255, 255, 255, .12); color: #fff; }
.badge.red { background: var(--err); color: #fff; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 7px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 12px; color: var(--txt-2); }
.tag.a { background: rgba(255, 106, 26, .12); border-color: rgba(255, 106, 26, .3); color: var(--accent-2); }
.tag.v { background: rgba(155, 123, 255, .14); border-color: rgba(155, 123, 255, .35); color: #c9b8ff; }

/* ---------- Bot list ---------- */
.bots { display: grid; gap: 10px; }
.bot {
  display: grid; grid-template-columns: 14px 1.6fr 1.3fr 1fr 1fr auto; align-items: center; gap: 18px;
  padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025);
  transition: transform .25s var(--ease), background .2s, border-color .2s;
}
.bot:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-2); transform: translateY(-1px); }
.bot .n { font-weight: 400; font-size: 16px; color: #fff; }
.bot .meta { color: var(--txt-3); font-size: 13px; margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bot .when { color: #fff; min-width: 0; }
.bot > a { min-width: 0; }
.bot .when small { display: block; color: var(--txt-3); font-size: 12px; }
.bot .star { color: var(--txt-3); background: none; border: 0; cursor: pointer; font-size: 18px; padding: 4px; line-height: 1; }
.bot .star.on { color: var(--warn); text-shadow: 0 0 12px rgba(255, 194, 71, .6); }
.list-h { display: grid; grid-template-columns: 14px 1.6fr 1.3fr 1fr 1fr auto; gap: 18px; padding: 0 18px 8px; }
@media (max-width: 1100px) { .bot, .list-h { grid-template-columns: 14px 1.6fr 1fr auto; } .bot .c-last, .bot .c-sched, .list-h .c-last, .list-h .c-sched { display: none; } }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--txt-2); font-family: 'Barlow Condensed'; font-weight: 500; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; transition: all .2s; }
.chip:hover { border-color: var(--line-2); color: #fff; }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.search { position: relative; }
.search input { width: 300px; padding: 10px 14px 10px 38px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--txt-3); }

/* ---------- Forms ---------- */
input, textarea, select {
  font: inherit; color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); border-radius: var(--r-s);
  padding: 11px 13px; width: 100%; outline: none; transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: #68718a; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 106, 26, .18); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
textarea.mono { min-height: 320px; }
label.f { display: block; font-family: 'Barlow Condensed'; font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-3); margin: 0 0 7px 2px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .fix { flex: 0 0 auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--r-s);
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-weight: 500; cursor: pointer;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.p { background: linear-gradient(135deg, var(--accent), #ff4d4d); border-color: transparent; color: #fff; box-shadow: 0 10px 28px -10px var(--accent-glow); }
.btn.p:hover { box-shadow: 0 14px 36px -10px var(--accent-glow); filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 84, 112, .4); color: #ffb3c0; }
.btn.danger:hover { background: rgba(255, 84, 112, .14); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 8px; }
.btn svg { width: 16px; height: 16px; }
.hint { font-size: 13px; color: var(--txt-3); margin-top: 6px; }

/* Flash */
.flash { position: fixed; right: 26px; top: 22px; z-index: 50; display: grid; gap: 8px; }
.flash div { padding: 12px 16px; border-radius: 12px; border: 1px solid; backdrop-filter: blur(12px); font-weight: 500; animation: slide .4s var(--ease); box-shadow: var(--shadow); }
.flash .ok { background: rgba(47, 213, 138, .14); border-color: rgba(47, 213, 138, .4); }
.flash .error { background: rgba(255, 84, 112, .16); border-color: rgba(255, 84, 112, .45); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Bot page ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; margin-bottom: 22px; }
.hero .acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 22px; overflow-x: auto; }
.tabs a { padding: 12px 16px; color: var(--txt-3); font-family: 'Barlow Condensed'; font-weight: 600; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a.on { color: #fff; border-color: var(--accent); }
.panel { display: none; }
.panel.on { display: block; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.timeline { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.timeline i { flex: 0 1 14px; min-width: 4px; border-radius: 3px; background: rgba(255, 255, 255, .08); height: 30%; }
.timeline i.ok { background: var(--ok); height: 100%; box-shadow: 0 0 10px rgba(47, 213, 138, .5); }
.timeline i.error { background: var(--err); height: 100%; box-shadow: 0 0 10px rgba(255, 84, 112, .5); }
.timeline i.running { background: var(--info); height: 70%; }

.consigne { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.consigne:first-of-type { border-top: 0; }
.consigne .idx { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-family: 'Barlow Condensed'; font-weight: 700; background: rgba(255, 106, 26, .16); color: var(--accent-2); border: 1px solid rgba(255, 106, 26, .3); }
.consigne.off .idx { background: rgba(255, 255, 255, .06); color: var(--txt-3); border-color: var(--line); }
.consigne.off .tx { color: var(--txt-3); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
.consigne .tx { white-space: pre-wrap; line-height: 1.55; }
.consigne .by { color: var(--txt-3); font-size: 12px; margin-top: 5px; }
.consigne .acts { display: flex; gap: 6px; }

.prev { display: grid; gap: 8px; }
.prev > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.prev > div > a:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev > div > .num { flex: 0 0 auto; }
.prev div:last-child { border: 0; }

.runs { width: 100%; border-collapse: collapse; }
.runs th { text-align: left; font-family: 'Barlow Condensed'; font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-3); padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.runs td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.runs tr:hover td { background: rgba(255, 255, 255, .025); }
pre.out { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; color: #e8ecf3; max-height: 520px; overflow: auto; padding: 18px; border-radius: 12px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); }
.md { line-height: 1.65; color: #e8ecf3; max-height: 560px; overflow: auto; padding: 4px 6px 4px 0; }
.md h1, .md h2, .md h3 { font-family: 'Barlow Condensed'; font-weight: 600; margin: 18px 0 8px; color: #fff; }
.md h1 { font-size: 24px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; color: var(--accent-2); }
.md p { margin: 8px 0; } .md ul, .md ol { margin: 6px 0; padding-left: 22px; } .md li { margin: 3px 0; }
.md strong { font-weight: 600; color: #fff; } .md code { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; }
.md pre { background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow: auto; } .md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; } .md th, .md td { border: 1px solid var(--line-2); padding: 7px 10px; text-align: left; } .md th { color: var(--txt-3); font-family: 'Barlow Condensed'; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; } .md blockquote { margin: 8px 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--txt-2); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; }
.kv dt { color: var(--txt-3); } .kv dd { margin: 0; color: #fff; }
details summary { cursor: pointer; color: var(--txt-2); }
.people { display: grid; gap: 8px; }
.person .row { flex-wrap: nowrap; }
.person { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.person .pn { display: flex; align-items: center; gap: 12px; }
.person .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: 'Barlow Condensed'; font-weight: 600; background: linear-gradient(135deg, #243052, #1a2238); border: 1px solid var(--line-2); }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 60; }
.modal-bg.on { display: grid; }
.modal { width: min(520px, 92vw); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { width: min(420px, 100%); padding: 38px 36px; position: relative; overflow: hidden; }
.login .box::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(255, 106, 26, .6), transparent 40%, transparent 60%, rgba(90, 169, 255, .5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.login .brand { padding: 0 0 26px; }
.orb { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(40px, -30px); } }
.err { padding: 10px 12px; border-radius: 10px; background: rgba(255, 84, 112, .14); border: 1px solid rgba(255, 84, 112, .4); margin-bottom: 14px; font-size: 14px; }
.sched-mode { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); width: fit-content; }
.sched-mode label { padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--txt-2); font-family: 'Barlow Condensed'; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.sched-mode input { display: none; }
.sched-mode input:checked + span { color: #000; }
.sched-mode label:has(input:checked) { background: #fff; color: #000; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.presets button { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--txt-2); font: inherit; font-size: 12px; cursor: pointer; }
.presets button:hover { color: #fff; border-color: var(--line-2); }
.live { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(90, 169, 255, .08); border: 1px solid rgba(90, 169, 255, .25); }
.live .h { font-weight: 500; color: #fff; }
.live ul { margin: 6px 0 0; padding-left: 18px; color: var(--txt-2); }
.empty { padding: 40px; text-align: center; color: var(--txt-3); }
