:root {
  color-scheme: dark;
  --bg: #090d12;
  --bg-elevated: #0f151d;
  --panel: #111923;
  --panel-soft: #151f2a;
  --panel-hover: #1a2633;
  --border: #243242;
  --border-strong: #33465b;
  --text: #e9f0f7;
  --muted: #8ba0b6;
  --muted-dim: #6d8298;
  --accent: #54c8ff;
  --accent-strong: #1f9fe6;
  --accent-soft: rgba(84, 200, 255, 0.12);
  --green: #43d99b;
  --green-soft: rgba(67, 217, 155, 0.12);
  --amber: #ffb454;
  --amber-soft: rgba(255, 180, 84, 0.12);
  --red: #ff7070;
  --red-soft: rgba(255, 112, 112, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(45, 128, 190, 0.16), transparent 32rem),
    radial-gradient(circle at 92% 0%, rgba(40, 80, 120, 0.16), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
}

::selection {
  background: rgba(84, 200, 255, 0.28);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  word-break: break-all;
}

.muted {
  color: var(--muted);
}

/* ---------- Brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(84, 200, 255, 0.35);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(84, 200, 255, 0.18), rgba(31, 159, 230, 0.04));
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.04em;
  box-shadow: inset 0 0 18px rgba(84, 200, 255, 0.08);
}

.brand-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-sub {
  color: var(--muted-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.brand--login {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.brand--login .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 23px;
}

.brand--login .brand-name {
  font-size: 19px;
}

/* ---------- Login ---------- */

.login-page {
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.025), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}

.login-intro {
  margin: 28px 0 24px;
}

.login-intro h1 {
  margin: 0 0 7px;
  font-size: 25px;
  letter-spacing: -0.02em;
}

.login-intro p {
  margin: 0;
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 17px;
}

.login-note {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted-dim);
  font-size: 11.5px;
  line-height: 1.65;
}

.form-error {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 112, 112, 0.28);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: #ffaaaa;
  font-size: 12.5px;
}

/* ---------- Form controls ---------- */

.field {
  display: grid;
  gap: 7px;
}

.field > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select {
  min-height: 40px;
  padding: 8px 11px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #607488;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(84, 200, 255, 0.12);
  background: #0d141c;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #45c2ff, #239edd);
  border-color: rgba(122, 219, 255, 0.3);
  color: #03131c;
  box-shadow: 0 6px 18px rgba(31, 159, 230, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #70d3ff, #33aceb);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-small {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-tiny {
  min-height: 27px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
}

.btn-block {
  width: 100%;
  min-height: 43px;
}

.btn:focus-visible,
.tab:focus-visible,
.agent-item:focus-visible,
.task-select:focus-visible,
.task-delete:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Dashboard shell ---------- */

.dashboard-page {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 13, 18, 0.9);
  backdrop-filter: blur(14px);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-name {
  color: var(--muted);
  font-size: 12.5px;
}

.admin-name::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 1px;
  box-shadow: 0 0 8px rgba(67, 217, 155, 0.6);
}

.layout {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.sidebar {
  position: sticky;
  top: 68px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - 68px);
  padding: 22px 16px 16px;
  border-right: 1px solid var(--border);
  background: rgba(13, 19, 26, 0.55);
  overflow: hidden;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.sidebar-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  min-width: 24px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.search-input {
  flex: 0 0 auto;
  min-height: 37px;
  font-size: 12.5px;
  background: rgba(15, 21, 29, 0.8) !important;
}

.agent-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 3px;
  margin-right: -3px;
}

.agent-item {
  display: block;
  width: 100%;
  padding: 12px 12px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.agent-item:hover {
  background: var(--panel-soft);
  border-color: var(--border);
}

.agent-item.is-active {
  background: linear-gradient(135deg, rgba(84, 200, 255, 0.12), rgba(84, 200, 255, 0.035));
  border-color: rgba(84, 200, 255, 0.32);
}

.agent-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.agent-hostname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.agent-sub {
  margin-top: 4px;
  padding-left: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-dim);
  font-size: 11.5px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-dim);
}

.status-dot.is-online {
  background: var(--green);
  box-shadow: 0 0 8px rgba(67, 217, 155, 0.65);
}

.status-dot.is-offline {
  background: #566779;
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 112, 112, 0.5);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 12px 6px 0;
  border-top: 1px solid var(--border);
  color: var(--muted-dim);
  font-size: 10.5px;
}

.sidebar-empty {
  padding: 24px 12px;
  color: var(--muted-dim);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.main-panel {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 38px) 44px;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: calc(100vh - 160px);
  color: var(--muted);
  text-align: center;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
}

.empty-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Cards / overview ---------- */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.018), transparent 36%),
    var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.agent-overview {
  padding: 24px 24px 21px;
}

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.overview-title h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 29px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  word-break: break-word;
}

.agent-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.is-online {
  border-color: rgba(67, 217, 155, 0.25);
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.is-offline {
  background: rgba(110, 130, 148, 0.08);
  color: var(--muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
}

.meta {
  min-width: 0;
  padding: 11px 13px;
  background: var(--panel-soft);
}

.meta-os {
  grid-column: span 2;
}

.meta-wide {
  grid-column: span 3;
}

.meta-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.meta strong {
  display: block;
  overflow: hidden;
  color: #cfdae5;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.meta strong.mono {
  font-size: 11px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 12px;
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.tab {
  min-width: 90px;
  padding: 7px 15px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--panel-hover);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.tab-panel {
  padding: 22px 22px 21px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-head--row {
  align-items: center;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.hint {
  margin: 4px 0 0;
  color: var(--muted-dim);
  font-size: 11.5px;
}

.panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.panel-subhead h3,
.task-output-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Terminal ---------- */

.exec-form {
  display: grid;
  gap: 11px;
}

.exec-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 11px;
}

.field-inline {
  gap: 5px;
}

.field-inline select {
  width: 156px;
}

.field-timeout input {
  width: 112px;
}

.exec-controls .btn {
  min-width: 88px;
  min-height: 40px;
}

.command-input {
  width: 100%;
  min-height: 86px;
  max-height: 260px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  tab-size: 4;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.7fr);
  gap: 16px;
  margin-top: 20px;
}

.task-history,
.task-output-wrap {
  min-width: 0;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 370px;
  min-height: 184px;
  padding: 2px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--panel-soft);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.task-item:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

.task-item.is-active {
  border-color: rgba(84, 200, 255, 0.36);
  background: var(--accent-soft);
}

.task-select {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 8px 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.task-delete {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 6px 0 0;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-dim);
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}

.task-delete:hover {
  border-color: rgba(255, 112, 112, 0.25);
  background: var(--red-soft);
  color: var(--red);
}

.task-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.task-kind {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.task-time {
  margin-left: auto;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.task-command {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #b9c8d6;
  font-family: var(--mono);
  font-size: 10.5px;
}

.task-sub {
  margin-top: 3px;
  color: var(--muted-dim);
  font-size: 10px;
}

.empty-copy {
  margin: 0;
  padding: 20px 8px;
  color: var(--muted-dim);
  font-size: 11.5px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.6;
  white-space: nowrap;
}

.badge.status-pending {
  border-color: rgba(255, 180, 84, 0.23);
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.status-running {
  border-color: rgba(84, 200, 255, 0.23);
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.status-completed {
  border-color: rgba(67, 217, 155, 0.22);
  background: var(--green-soft);
  color: var(--green);
}

.badge.status-failed {
  border-color: rgba(255, 112, 112, 0.25);
  background: var(--red-soft);
  color: var(--red);
}

.task-output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.task-output-head > div {
  min-width: 0;
}

.task-output-head .btn {
  flex: 0 0 auto;
}

.output-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 9.5px;
}

.task-command-line {
  max-height: 110px;
  margin: 0 0 9px;
  padding: 7px 10px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: #a9bdcc;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-output {
  min-height: 218px;
  max-height: 480px;
  margin: 0;
  padding: 14px 15px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #080c11;
  color: #c6d6e4;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.task-output.is-error {
  border-color: rgba(255, 112, 112, 0.25);
  color: #ffbaba;
}

/* ---------- Screen ---------- */

.screen-status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 12px;
}

.screen-status.is-error {
  border-color: rgba(255, 112, 112, 0.25);
  background: var(--red-soft);
  color: #ffb2b2;
}

.screen-status.is-busy {
  border-color: rgba(84, 200, 255, 0.22);
  background: var(--accent-soft);
  color: #b7e8ff;
}

.screen-frame {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #05080c;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.28);
}

.screen-frame a {
  display: block;
}

.screen-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #000;
}

/* ---------- Toast / misc ---------- */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(400px, calc(100vw - 44px));
  padding: 11px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #17222e;
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease-out;
}

.toast.is-error {
  border-color: rgba(255, 112, 112, 0.35);
  background: #29181c;
  color: #ffc0c0;
}

.toast.is-success {
  border-color: rgba(67, 217, 155, 0.3);
  background: #12241e;
  color: #b7f4d9;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #2a3b4d;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a5067;
  background-clip: padding-box;
}

/* ---------- Responsive ---------- */

@media (max-width: 1060px) {
  .layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meta-os {
    grid-column: auto;
  }

  .meta-wide {
    grid-column: span 2;
  }

  .task-layout {
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  }
}

@media (max-width: 820px) {
  .topbar {
    height: 62px;
    padding: 0 15px;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    padding: 15px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .agent-list {
    flex: none;
    max-height: 31vh;
  }

  .sidebar-footer {
    padding-top: 9px;
  }

  .main-panel {
    padding: 18px 14px 32px;
  }

  .empty-state {
    min-height: 42vh;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-layout {
    grid-template-columns: 1fr;
  }

  .task-list {
    max-height: 240px;
    min-height: 90px;
  }

  .task-output {
    max-height: 52vh;
  }

  .panel-head,
  .panel-head--row {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-card {
    padding: 26px 22px;
  }
}

@media (max-width: 520px) {
  .brand-sub {
    display: none;
  }

  .admin-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    gap: 8px;
  }

  .agent-overview {
    padding: 18px 16px;
  }

  .overview-head {
    flex-direction: column;
    gap: 11px;
  }

  .tab-panel {
    padding: 17px 14px;
  }

  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .meta-wide {
    grid-column: span 2;
  }

  .field-timeout input {
    width: 98px;
  }

  .exec-controls .btn {
    flex: 1;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .toast {
    right: 14px;
    bottom: 14px;
  }
}
