/* Claude Cockpit — Dark Theme, kompakt zum Andocken neben Termius */
:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel2: #1d212d;
  --border: #2a2f3e;
  --text: #d7dae3;
  --dim: #8b91a3;
  --accent: #d97757;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;
  --blue: #60a5fa;
  font-size: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
button { cursor: pointer; font: inherit; }
.ghost {
  background: none; border: none; color: var(--dim);
  font-size: 1rem; padding: 2px 6px; border-radius: 6px;
}
.ghost:hover { color: var(--text); background: var(--panel2); }

/* ---------- Login ---------- */
.login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login form {
  background: var(--panel); border: 1px solid var(--border);
  padding: 36px 40px; border-radius: 14px; text-align: center;
  display: flex; flex-direction: column; gap: 14px; width: 300px;
}
.login-logo { font-size: 2.2rem; color: var(--accent); }
.login h1 { font-size: 1.15rem; font-weight: 600; }
.login input {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.login button {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 10px; font-weight: 600;
}
.login-error { color: var(--red); font-size: .85rem; min-height: 1em; }

/* ---------- Header / Usage ---------- */
header {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { font-weight: 700; white-space: nowrap; }
.brand-dot { color: var(--accent); }
.usage { display: flex; gap: 22px; flex: 1; min-width: 260px; }
.usage-item { flex: 1; max-width: 280px; }
.usage-label { font-size: .72rem; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.bar {
  height: 8px; background: var(--bg); border-radius: 4px;
  overflow: hidden; margin: 3px 0; border: 1px solid var(--border);
}
.bar-fill {
  height: 100%; width: 0; border-radius: 4px;
  background: var(--green); transition: width .6s, background .6s;
}
.usage-info { display: flex; justify-content: space-between; font-size: .78rem; }
.usage-info .pct { font-weight: 600; }
.usage-info .reset { color: var(--dim); }
.header-right { display: flex; align-items: center; gap: 10px; }
.stale { font-size: .75rem; color: var(--yellow); }
.conn { font-size: .8rem; color: var(--green); }
.conn.off { color: var(--red); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
}
.toolbar input {
  flex: 1; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
.counts { color: var(--dim); font-size: .8rem; white-space: nowrap; }
.banner {
  margin: 0 16px 10px; padding: 10px 14px; border-radius: 8px;
  background: #3a2a2a; color: var(--red); border: 1px solid var(--red);
  font-size: .85rem;
}

/* ---------- Session-Karten ---------- */
main {
  display: grid; gap: 12px; padding: 0 16px 24px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.card.working { border-left: 3px solid var(--green); }
.card.waiting { border-left: 3px solid var(--yellow); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); } }
.card-head { display: flex; align-items: center; gap: 8px; }
.status-dot { font-size: .95rem; }
.status-dot.working { color: var(--green); }
.status-dot.waiting { color: var(--yellow); }
.status-dot.idle { color: var(--blue); }
.status-dot.shell { color: var(--dim); }
.card-name { font-weight: 700; }
.card-attached { font-size: .68rem; color: var(--dim); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.status-text { margin-left: auto; font-size: .72rem; color: var(--dim); }
.card-title {
  font-size: .88rem; color: var(--accent); border: none; background: none;
  width: 100%; font-weight: 600;
}
.card-desc {
  font-size: .8rem; color: var(--dim); border: none; background: none;
  width: 100%; resize: none; font-family: inherit; line-height: 1.35;
}
.card-title:focus, .card-desc:focus {
  outline: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text);
}
.card-title::placeholder, .card-desc::placeholder { color: #555b6e; }
.preview {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-family: Consolas, "Cascadia Mono", monospace;
  font-size: .72rem; line-height: 1.4; color: var(--dim);
  white-space: pre; overflow: hidden; height: 7.2em; cursor: zoom-in;
}
.preview:hover { color: var(--text); border-color: var(--dim); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: min(950px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border); font-weight: 700;
}
.modal-box pre {
  margin: 0; padding: 14px 16px; overflow: auto;
  font-family: Consolas, "Cascadia Mono", monospace; font-size: .78rem;
  line-height: 1.45; color: var(--text);
}
