/* ===== Astros Bot Service – Dunkelblau & Cyan ===== */
:root {
  --bg: #050d1c;
  --bg2: #0a1730;
  --panel: #0e1f3d;
  --panel2: #12274b;
  --line: #1d3a66;
  --text: #e6f1ff;
  --muted: #8aa4c8;
  --cyan: #22d3ee;
  --cyan2: #67e8f9;
  --blue: #2563eb;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, #0f3a6b 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #073b4c 0%, transparent 55%),
              var(--bg);
  background-attachment: fixed;
}
.stars {
  position: fixed; inset: 0; pointer-events: none; opacity: .35; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #9be7ff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 70%, #9be7ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 35%, #c3f3ff 50%, transparent 51%),
    radial-gradient(1px 1px at 75% 85%, #9be7ff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 15%, #9be7ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 65% 60%, #c3f3ff 50%, transparent 51%);
}
#app { position: relative; z-index: 1; }
.loading { display: grid; place-items: center; height: 100vh; color: var(--muted); }

a { color: var(--cyan); }
h1, h2, h3 { margin: 0 0 .6em; font-weight: 650; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--cyan2); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ----- Buttons & Inputs ----- */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); color: var(--text);
  background: var(--panel2); padding: .6em 1.1em; border-radius: 10px; transition: .15s;
}
button:hover { border-color: var(--cyan); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue)); border: none; color: #031024; font-weight: 650;
  box-shadow: 0 4px 18px rgba(34, 211, 238, .25);
}
button.primary:hover { filter: brightness(1.1); }
button.danger { border-color: #7f1d1d; color: #fecaca; background: #2a0f17; }
button.danger:hover { border-color: var(--err); }
button.ghost { background: transparent; }
button.small { padding: .35em .75em; font-size: .85rem; }

input, select {
  font: inherit; width: 100%; padding: .65em .8em; border-radius: 10px; color: var(--text);
  background: #071327; border: 1px solid var(--line); outline: none;
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
label { display: block; font-size: .85rem; color: var(--muted); margin: .9em 0 .35em; }
.check { display: flex; align-items: center; gap: .6em; margin: .8em 0; color: var(--text); font-size: .95rem; }
.check input { width: auto; accent-color: var(--cyan); }

/* ----- Login ----- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: rgba(14, 31, 61, .85); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand img { width: 44px; height: 44px; }
.brand-title { font-size: 1.35rem; font-weight: 700; letter-spacing: .3px; }
.brand-title span { color: var(--cyan); }
.tabs { display: flex; gap: 6px; background: #071327; padding: 5px; border-radius: 12px; margin-bottom: 8px; }
.tabs button { flex: 1; border: none; background: transparent; color: var(--muted); }
.tabs button.active { background: var(--panel2); color: var(--cyan2); }
.notice {
  border: 1px solid rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .08); color: var(--cyan2);
  padding: .7em .9em; border-radius: 10px; font-size: .9rem; margin: 10px 0;
}
.notice.warn { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); color: #fde68a; }
.notice.err { border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); color: #fecaca; }
.form-error { color: var(--err); font-size: .9rem; min-height: 1.3em; margin-top: .6em; }
.full { width: 100%; margin-top: 1.1em; }

/* ----- Layout ----- */
header.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: rgba(5, 13, 28, .8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
header.top .brand { margin: 0; }
header.top .brand img { width: 36px; height: 36px; }
.user-box { display: flex; align-items: center; gap: 12px; }
.role { font-size: .75rem; padding: .25em .7em; border-radius: 99px; font-weight: 650; letter-spacing: .3px; }
.role.owner { background: linear-gradient(135deg, #22d3ee, #2563eb); color: #031024; }
.role.admin { background: rgba(34, 211, 238, .15); color: var(--cyan2); border: 1px solid rgba(34, 211, 238, .4); }
.role.member { background: #13284d; color: var(--muted); border: 1px solid var(--line); }

nav.main { display: flex; gap: 6px; padding: 14px 24px 0; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
nav.main button { border: none; background: transparent; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 0; padding: .7em 1em; }
nav.main button.active { color: var(--cyan); border-bottom-color: var(--cyan); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(18, 39, 75, .9), rgba(14, 31, 61, .9));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card.span { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }

/* ----- Status ----- */
.status { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #475569; }
.status.online .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status.connecting .dot, .status.reconnecting .dot { background: var(--warn); animation: pulse 1.2s infinite; }
.status.offline { color: var(--muted); }
@keyframes pulse { 50% { opacity: .3; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: #071327; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: .75rem; color: var(--muted); }
.stat .v { font-size: 1.05rem; font-weight: 600; margin-top: 2px; word-break: break-all; }

.mc { display: flex; align-items: center; gap: 14px; }
.mc img { width: 52px; height: 52px; border-radius: 10px; image-rendering: pixelated; background: #071327; border: 1px solid var(--line); }
.mc .name { font-size: 1.1rem; font-weight: 650; }

.code-box { text-align: center; padding: 18px; background: #071327; border: 1px dashed var(--cyan); border-radius: 12px; margin: 12px 0; }
.code { font-family: Consolas, monospace; font-size: 2rem; letter-spacing: 6px; color: var(--cyan2); font-weight: 700; user-select: all; }
ol.steps { padding-left: 1.2em; color: var(--muted); line-height: 1.7; margin: 0; }
ol.steps b { color: var(--text); }

/* ----- Logs ----- */
.log {
  font-family: Consolas, "Cascadia Mono", monospace; font-size: .83rem; background: #040b18; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; height: 380px; overflow-y: auto; line-height: 1.55;
}
.log.tall { height: 560px; }
.log .e { white-space: pre-wrap; word-break: break-word; }
.log .t { color: #4b6a94; margin-right: .5em; }
.log .n { color: var(--cyan); margin-right: .5em; font-weight: 600; cursor: pointer; }
.log .info { color: #c7d7ee; }
.log .success { color: var(--ok); }
.log .warn { color: var(--warn); }
.log .error { color: var(--err); }
.log .chat { color: #93a8c6; }
.log .empty { color: var(--muted); text-align: center; padding: 30px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters input { max-width: 260px; }
.filters select { width: auto; }

/* ----- Tabelle ----- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .5px; }
.table td { padding: 10px; border-bottom: 1px solid rgba(29, 58, 102, .5); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: rgba(34, 211, 238, .05); }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; }
.you { font-size: .7rem; color: var(--cyan); border: 1px solid var(--cyan); border-radius: 99px; padding: 0 .5em; margin-left: .4em; }
.table-wrap { overflow-x: auto; }

/* ----- Modal & Toast ----- */
.modal-bg { position: fixed; inset: 0; background: rgba(2, 6, 15, .7); display: grid; place-items: center; z-index: 50; padding: 20px; backdrop-filter: blur(3px); }
.modal { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.modal.wide { max-width: 900px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--cyan); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: slide .2s; }
.toast.err { border-left-color: var(--err); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

.danger-zone { border-color: #5b1a2a; }
.danger-zone h2 { color: #fca5a5; }
.danger-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid rgba(91, 26, 42, .6); }
.danger-item:first-of-type { border-top: none; }

@media (max-width: 640px) {
  header.top { padding: 10px 14px; }
  .brand-title { font-size: 1.05rem; }
  main, nav.main { padding-left: 14px; padding-right: 14px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
.mt { margin-top: 14px; }
.code-box .row { justify-content: center; margin-top: 12px; }
.mb { margin-bottom: 14px; }
a.btn { text-decoration: none; display: inline-block; }
