:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e7eaf1;
  --text: #16181d;
  --muted: #8a90a0;
  --muted-2: #6b7285;
  --navy: #1f2a44;
  --navy-2: #243049;
  --green: #12b76a;
  --green-soft: #e7f8ef;
  --blue-soft: #eef2ff;
  --sidebar: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  min-width: 1280px;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  min-width: 1280px;
}
.workspace { min-width: 0; background: var(--bg); }
.top-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 28px 0;
}
.group-live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #128a5a;
  font-weight: 600;
  font-size: 13px;
}

.app {
  display: contents;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 14px 24px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 22px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #1a1d27;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.brand b { display: block; font-size: 14px; letter-spacing: 0.04em; }
.brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }

.platform-switch {
  display: flex;
  gap: 6px;
  padding: 0;
}
.pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 13px;
}
.pill.active {
  background: #1a1d27;
  color: #fff;
  border-color: #1a1d27;
}
a.pill { text-decoration: none; }
.project-switch { display: flex; align-items: center; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #4b5160;
  font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; opacity: 0.8; }
.nav a.active {
  background: #eef2fb;
  color: #1f2a44;
  font-weight: 600;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.main {
  padding: 18px 28px 48px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }


.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
  display: inline-block;
}
.dot.warn { background: #f79009; }
.dot.idle { background: #c5cad6; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}
.btn:hover { background: #f8fafc; }
.btn-dark {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-dark:hover { background: var(--navy-2); }
.btn-danger {
  background: #fff;
  color: #b42318;
  border-color: #f5c2c0;
}
.btn-ghost { box-shadow: none; background: transparent; }
.btn svg { width: 16px; height: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-h {
  padding: 16px 18px 12px;
  font-weight: 650;
  font-size: 15px;
}
.card-b { padding: 0 18px 16px; }
.divider { height: 1px; background: var(--line); margin: 4px 0 12px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted-2); font-weight: 600; margin-bottom: 10px; }
.kpi .value { font-size: 34px; font-weight: 650; letter-spacing: -0.04em; line-height: 1; }
.kpi .hint { color: var(--muted); margin-top: 8px; font-size: 13px; }

.dir-row {
  display: grid;
  grid-template-columns: 220px 1fr 1.2fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid #f1f3f7;
}
.dir-row:first-of-type { border-top: 0; }
.uname { font-weight: 700; }
.role { color: var(--muted); }
.pos { color: var(--muted-2); }

.ticker-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.ticker-line b { font-size: 15px; }
.ticker-line span { color: var(--muted-2); display: block; margin-top: 2px; }

.empty-topic {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted-2);
}
.megaphone {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f3f4f8;
  display: grid;
  place-items: center;
}

.status-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #f1f3f7;
}
.status-item:first-child { border-top: 0; padding-top: 0; }
.status-item b { display: block; }
.status-item span { color: var(--muted); font-size: 13px; }

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

.acc-card { padding: 18px; min-height: 100%; display: flex; flex-direction: column; }
.acc-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex: none;
}
.acc-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.meta-k {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
  margin: 12px 0 4px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: #f3f4f8;
  color: #3f4554;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
}
.acc-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.ok { color: var(--green); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.proxy-line {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f7f8fb;
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted-2);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.session-btns { display: flex; gap: 8px; margin-top: 12px; }

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}
.select, .field, textarea, input[type="text"], input[type="number"], input[type="password"], input[type="datetime-local"] {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  outline: none;
}
.select:focus, .field:focus, textarea:focus, input:focus { border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
textarea { width: 100%; min-height: 90px; resize: vertical; }

.post-card { padding: 0; overflow: hidden; margin-bottom: 12px; }
.post-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
  color: var(--muted);
  font-size: 12px;
  align-items: center;
}
.badges { display: flex; gap: 6px; align-items: center; }
.badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 650;
}
.badge.pub { background: #e7f8ef; color: #067647; }
.badge.pending { background: #fef6e7; color: #b54708; }
.badge.queued { background: #eef2ff; color: #3538cd; }
.badge.draft { background: #f2f4f7; color: #475467; }
.badge.tag { background: #f4e8ff; color: #9f1ab1; }
.badge.tag-green { background: #e7f8ef; color: #067647; }
.badge.tag-blue { background: #eef4ff; color: #3538cd; }
.post-body { padding: 10px 16px 14px; font-size: 15px; line-height: 1.5; }
.post-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid #f1f3f7;
  vertical-align: middle;
}
table.data tr:hover td { background: #fafbfe; }
.clip { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stat-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 8px 0 14px;
}
.stat-kpis .card { padding: 16px; }
.stat-kpis .ico {
  width: 28px; height: 28px; border-radius: 8px; background: #f3f4f8;
  display: grid; place-items: center; margin-bottom: 12px; color: #667085;
}
.range-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.range-tabs a, .range-tabs span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted-2);
  font-weight: 600;
}
.range-tabs .on {
  background: var(--navy);
  color: #fff;
}

.chart {
  height: 220px;
  position: relative;
  padding: 8px 8px 0;
}
.chart svg { width: 100%; height: 180px; display: block; }
.legend { display: flex; gap: 16px; justify-content: center; color: var(--muted); font-size: 12px; padding-bottom: 10px; }
.swatch { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 6px; }

.cal-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.cal-head, .cal-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 108px;
  padding: 8px;
}
.cal-head {
  min-height: auto;
  background: #fafbfe;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
}
.cal-cell:nth-child(7n), .cal-head:nth-child(7n) { border-right: 0; }
.cal-event {
  font-size: 11px;
  border-radius: 6px;
  padding: 3px 5px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #eef2ff;
}
.cal-event.pub { background: #e7f8ef; }
.cal-event.queued { background: #eef4ff; }
.cal-today { outline: 2px solid #3538cd; outline-offset: -2px; background: #f8f9ff; }
.cal-more { color: var(--muted); font-size: 11px; margin-top: 4px; }
.cal-daynum { font-weight: 650; font-size: 13px; }

.side-day { padding: 16px; }
.side-day h3 { margin: 0 0 12px; font-size: 16px; }
.side-item {
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f7f8fb;
}
.side-item .t { color: var(--muted); font-size: 12px; margin-bottom: 6px; }

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f3f7;
}
.history-item:last-child { border-bottom: 0; }
.history-ico {
  width: 32px; height: 32px; border-radius: 99px; background: #eef2fb;
  display: grid; place-items: center; flex: none; color: #667085;
}
.history-item .detail { color: var(--muted); font-size: 12px; margin-top: 2px; }
.history-item time { color: var(--muted); white-space: nowrap; font-size: 13px; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .4);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 24px;
}
.modal-bg.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: min(560px, 100%);
  padding: 20px; max-height: 90vh; overflow: auto;
}
.modal h3 { margin: 0 0 14px; }
.form-grid { display: grid; gap: 10px; }
.form-grid label { display: grid; gap: 6px; font-size: 12px; color: var(--muted-2); font-weight: 650; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; background: #1a1d27; color: #fff;
  padding: 12px 14px; border-radius: 12px; display: none; z-index: 70; max-width: 360px;
}
.toast.show { display: block; }

.dropdown { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; min-width: 180px;
  box-shadow: 0 8px 24px rgba(16,24,40,.12); display: none; z-index: 20; overflow: hidden;
}
.menu.show { display: block; }
.menu button, .menu a {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 12px; color: var(--text);
}
.menu button:hover, .menu a:hover { background: #f5f7fb; }

