/* SocialOps Agent Hub — global stylesheet (no frameworks, no JS) */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #17233b;
  --muted: #6b7794;
  --line: #e3e8f2;
  --brand: #0f4c81;
  --brand-2: #1a936f;
  --danger: #c0392b;
  --warn: #b7791f;
  --ok: #1a7f4b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef1f8; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: #101c33; color: #dfe6f3;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid #1d2c4d; }
.brand-mark { font-size: 22px; color: #7fb3ff; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  color: #c6d2e8; padding: 9px 12px; border-radius: 8px; font-size: 14px;
}
.sidebar nav a:hover { background: #1a2a4a; text-decoration: none; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid #1d2c4d; }
.linklike { background: none; border: none; color: #c6d2e8; cursor: pointer; padding: 0; font-size: 14px; }
.linklike:hover { text-decoration: underline; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 22px;
  position: sticky; top: 0; z-index: 5;
}
.project-picker select { margin-left: 8px; padding: 6px 8px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.notif { font-size: 18px; text-decoration: none; }
.pill { background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; }

.content { padding: 22px; max-width: 1280px; width: 100%; }
.foot { padding: 12px 22px; color: var(--muted); border-top: 1px solid var(--line); }

h1 { font-size: 24px; margin: 0 0 14px; }
h2 { font-size: 18px; margin: 22px 0 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card .num { font-size: 26px; font-weight: 700; }
.card .lbl { color: var(--muted); font-size: 13px; }
.card.warn .num { color: var(--warn); }
.card.bad .num { color: var(--danger); }
.card.good .num { color: var(--ok); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.panel h2 { margin-top: 0; }

.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.tbl th { background: #f0f3fa; font-weight: 600; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .actions { white-space: nowrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.b-gray  { background: #e8ebf2; color: #4b5877; }
.b-sky   { background: #dbeeff; color: #14639e; }
.b-green { background: #d9f3e5; color: #14683f; }
.b-amber { background: #fdeeda; color: #8a5a10; }
.b-red   { background: #fde3e0; color: #93261c; }
.b-violet{ background: #ece4fd; color: #5b34a6; }
.b-teal  { background: #d6f3f0; color: #0d6e63; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert.ok  { background: #e2f6ea; color: #14683f; border: 1px solid #bfe6cf; }
.alert.err { background: #fdecea; color: #93261c; border: 1px solid #f5c6c1; }

.form label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--ink); }
.form input, .form select, .form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.form textarea { min-height: 110px; resize: vertical; }
.form .row { display: flex; gap: 12px; }
.form .row > label { flex: 1; }

.btn {
  display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: 14px;
}
.btn:hover { background: #f3f6fc; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #0d4068; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.block { width: 100%; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* calendar */
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal-head, .cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head div { padding: 8px; background: #f0f3fa; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 96px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; font-size: 12px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell .d { color: var(--muted); }
.cal-cell.out { background: #fafbfe; }
.cal-item { display: block; padding: 3px 6px; border-radius: 6px; margin-top: 4px; background: #eef4ff; color: #14497e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item.st-SCHEDULED { background: #e2f6ea; color: #14683f; }
.cal-item.st-PENDING_ADMIN { background: #fdeeda; color: #8a5a10; }
.cal-item.st-PUBLISHED { background: #d6f3f0; color: #0d6e63; }

/* chat */
.chat-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px; max-height: 55vh; overflow-y: auto; margin-bottom: 12px; }
.msg { margin-bottom: 10px; }
.msg .who { font-size: 12px; color: var(--muted); }
.msg .bubble { padding: 9px 12px; border-radius: 10px; background: #eef1f8; white-space: pre-wrap; }
.msg.agent .bubble { background: #e5f0ff; }
.msg.convo-note { color: var(--muted); font-size: 12px; }

/* wizard steps */
.wizard-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.wizard-steps li { padding: 5px 12px; border-radius: 999px; background: #e8ebf2; color: #4b5877; font-size: 13px; }
.wizard-steps li.current { background: var(--brand); color: #fff; }
.wizard-steps li.done { background: #d9f3e5; color: #14683f; }

/* misc */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt0 { margin-top: 0; }
pre.wrap { white-space: pre-wrap; word-break: break-word; background: #f6f8fc; padding: 10px; border-radius: 8px; }
.kv td:first-child { width: 190px; color: var(--muted); }

/* bare (login/install) */
body.bare { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.bare-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px 30px; width: 400px; max-width: 94vw; }
.brand.center { justify-content: center; display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
body.install { background: var(--bg); }
.install-wrap { max-width: 720px; margin: 40px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px 30px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
