:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #18223a;
  background: #f4f6fb;
  --ink: #18223a;
  --muted: #59657b;
  --line: #e1e7f1;
  --accent: #244ddf;
  --accent-hover: #193cbe;
  --nav: #131c34;
  --success: #11654e;
  --warning: #875218;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
:focus-visible { outline: 3px solid #6484ff; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.45rem); line-height: 1.2; letter-spacing: -.045em; }
h2 { font-size: 1.17rem; line-height: 1.4; }
h3 { font-size: 1rem; line-height: 1.45; }
.quiet, .hint { color: var(--muted); }
.quiet { line-height: 1.6; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 218px;
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding: 28px 20px 22px;
  background: var(--nav);
  color: #fff;
}
.brand { display: inline-flex; gap: 12px; align-items: center; font-size: 1.04rem; font-weight: 750; letter-spacing: .01em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #4569ef;
  box-shadow: 0 0 0 1px #fff2 inset;
}
.brand-mark span { height: 9px; width: 15px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-2px) rotate(-45deg); }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar nav a { padding: 11px 12px; border-radius: 8px; color: #bfc9e1; font-size: .92rem; }
.sidebar nav a:hover, .sidebar nav .selected { background: #253454; color: #fff; }
.sign-out { margin-top: auto; border-top: 1px solid #32415d; padding-top: 16px; }
.sign-out button { background: transparent; color: #c3cce1; border: none; padding: 7px 10px; font-size: .88rem; }
.sign-out button:hover { color: white; }

.workspace { margin-left: 218px; padding: clamp(28px, 4vw, 53px); max-width: 1540px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 25px; }
.page-heading .quiet { margin-top: 9px; font-size: .93rem; }
.back-link { display: inline-block; color: var(--accent); font-size: .9rem; margin-bottom: 11px; font-weight: 630; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .89rem;
  font-weight: 660;
  white-space: nowrap;
}
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { border-color: #dce4f2; background: #f7f9ff; color: #2d4274; }
.button.secondary:hover { background: #ecf1ff; }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
.button.danger { color: #9d2834; border-color: #f1c8ce; background: #fff3f4; }
.text-link { color: var(--accent); font-size: .88rem; font-weight: 660; }
.text-link:hover, .back-link:hover { text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(175px, 1.25fr); gap: 14px; margin-bottom: 22px; }
.stat { min-height: 114px; padding: 17px 18px; }
.stat span { color: var(--muted); font-size: .87rem; }
.stat strong { display: block; margin-top: 11px; font-size: 1.9rem; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.schedule-stat { background: #eef2ff; border-color: #dce5ff; }
.schedule-stat div { display: flex; justify-content: space-between; gap: 8px; }
.schedule-stat a { color: var(--accent); font-weight: 660; font-size: .83rem; }
.schedule-stat strong { color: #243f9c; font-size: clamp(1.12rem, 2vw, 1.55rem); }
.schedule-stat small { display: block; margin-top: 8px; color: #4e5f8c; font-size: .77rem; }

.table-panel { margin-bottom: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; }
.section-head .quiet { margin-top: 5px; font-size: .83rem; }
.section-head .quiet:empty { display: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th { background: #f7f9fd; color: #53617a; font-size: .8rem; text-align: left; font-weight: 680; white-space: nowrap; }
th, td { padding: 13px 15px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td { overflow-wrap: anywhere; }
.target-name { min-width: 126px; display: flex; align-items: center; gap: 9px; }
.target-name strong { font-size: .9rem; }
.target-name small, .table-detail { display: block; margin-top: 4px; color: var(--muted); font-size: .77rem; }
.target-icon { width: 33px; height: 33px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; font-size: .7rem; font-weight: 750; }
.target-icon.telegram { background: #edf3ff; color: #285bba; }
.target-icon.forum { background: #eaf6f0; color: #1b6d54; }
.status-pill { display: inline-block; max-width: 100%; padding: 4px 8px; border-radius: 6px; font-size: .77rem; line-height: 1.45; font-weight: 640; background: #eff2f8; color: #546078; }
.state-done { background: #e6f5ed; color: var(--success); }
.state-pending { background: #fff1db; color: var(--warning); }
.state-submitted { background: #eaf0ff; color: #254aa2; }
.row-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.empty { text-align: center; padding: 38px 17px 43px; border-top: 1px solid var(--line); }
.empty p { color: var(--muted); font-size: .9rem; margin: 9px 0 15px; }
.empty .button { margin-top: 10px; }
.events { border-top: 1px solid var(--line); }
.event { display: grid; grid-template-columns: 67px minmax(72px, 138px) minmax(0, 1fr); gap: 10px; padding: 11px 20px; align-items: start; font-size: .84rem; line-height: 1.55; }
.event + .event { border-top: 1px solid var(--line); }
.event time { color: var(--muted); font-variant-numeric: tabular-nums; }
.event strong, .event span { min-width: 0; overflow-wrap: anywhere; }
.no-events { padding: 16px 20px; font-size: .87rem; }

.form-panel { padding: 23px; max-width: 800px; }
.form-panel h2 { margin-bottom: 12px; }
.form-panel .quiet { font-size: .89rem; }
.form-panel > p { margin-bottom: 15px; }
.form-stack { display: grid; gap: 17px; }
.form-stack > button, .follow-up > button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: block; font-size: .89rem; font-weight: 640; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 41px;
  margin-top: 6px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fcfdff;
  border: 1px solid #cbd6e8;
  border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: #687791; }
textarea { resize: vertical; }
.hint { display: block; margin-top: 6px; font-size: .8rem; font-weight: 450; line-height: 1.45; }
.checkline { display: flex; align-items: center; gap: 8px; min-height: 29px; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 9px; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { margin-bottom: 9px; font-size: .89rem; font-weight: 640; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); padding: 12px; border-radius: 9px; }
.choice:has(input:checked) { border-color: #7592ff; background: #f4f6ff; }
.choice small { display: block; margin-top: 4px; color: var(--muted); font-size: .77rem; font-weight: 450; }
summary { color: #3e527f; font-weight: 630; font-size: .87rem; }
details .form-grid, details .checkline { margin-top: 12px; }
details button { margin-top: 8px; }
.remove-panel, .password-panel { margin-top: 16px; }
.section-inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-inline h2 { margin-bottom: 0; }
.connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.follow-up { margin-top: 11px; }
.forum-entry { border-top: 1px solid var(--line); padding: 15px 0; }
.forum-entry:last-child { padding-bottom: 0; }
.forum-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 11px; margin-bottom: 7px; }
.upload { gap: 9px; }
.notice, .error { padding: 11px 13px; margin-bottom: 15px; border-radius: 8px; font-size: .9rem; }
.notice { color: var(--success); background: #e9f5ec; border: 1px solid #cfebd8; }
.error { color: #912b3a; background: #fff0f2; border: 1px solid #f3d1d7; }
.prose { padding: 24px; max-width: 720px; }
.prose p { margin: 13px 0 17px; color: var(--muted); }
.entry { min-height: 100vh; display: grid; justify-items: center; align-content: center; padding: 28px 17px; }
.entry > .notice { width: min(100%, 420px); }
.login-card { width: min(100%, 420px); padding: 29px; box-shadow: 0 14px 36px #1c316812; }
.login-brand { margin-bottom: 21px; }
.login-card h1 { font-size: 1.88rem; }
.login-card p { margin-top: 10px; font-size: .9rem; }
.login-card form { margin-top: 20px; }
.login-card .primary { justify-self: stretch; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1010px) {
  .sidebar { width: 183px; padding-inline: 14px; }
  .workspace { margin-left: 183px; padding: 25px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connection-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .sidebar { position: static; width: 100%; padding: 13px 15px 10px; gap: 10px; }
  .sidebar nav { display: flex; flex-direction: row; overflow-x: auto; white-space: nowrap; }
  .sidebar nav a { padding: 8px 9px; font-size: .82rem; }
  .sign-out { position: absolute; right: 15px; top: 13px; margin: 0; border: 0; padding: 0; }
  .workspace { margin-left: 0; padding: 22px 13px; }
  .page-heading { margin-bottom: 18px; }
  .section-head { padding: 13px 12px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 12px; }
  .event { grid-template-columns: 61px minmax(57px, 84px) minmax(0, 1fr); padding: 10px 12px; gap: 7px; }
  .form-panel { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
}

.remote-panel { overflow: hidden; }
.remote-toolbar { flex-wrap: wrap; }
.remote-location { min-width: 0; overflow-wrap: anywhere; }
.remote-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.remote-screen { display: grid; justify-items: center; min-height: 260px; padding: 12px; background: #e9eef8; }
.remote-screen img { width: 100%; max-width: 1040px; height: auto; border-radius: 6px; cursor: crosshair; }
.remote-screen > p { align-self: center; text-align: center; }
.remote-entry { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 15px 20px; }
.remote-entry > div { flex: 1 1 280px; }
.remote-entry > button { margin-top: 25px; }
.forum-entry details { margin-top: 10px; }
.forum-entry details form { margin-top: 9px; }
