:root {
  --bg: #0c0f1a;
  --surface-1: #141826;
  --surface-2: #1a1f33;
  --surface-3: #232940;
  --surface-hi: #2c3450;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --text: #e7e9f3;
  --text-muted: #8a91ad;
  --text-soft: #5b6388;
  --text-on-accent: #0c1023;
  --accent: #9eecdf;
  --accent-700: #6fd8c7;
  --accent-soft: rgba(158, 236, 223, 0.14);
  --c-orange: #ffb15c;
  --c-orange-soft: rgba(255, 177, 92, 0.14);
  --c-blue: #6ea2ff;
  --c-blue-soft: rgba(110, 162, 255, 0.16);
  --c-pink: #f08fc4;
  --c-pink-soft: rgba(240, 143, 196, 0.16);
  --c-green: #6ee7b7;
  --c-green-soft: rgba(110, 231, 183, 0.16);
  --c-red: #ff7b8b;
  --c-red-soft: rgba(255, 123, 139, 0.14);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-1:
    0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 6px 24px rgba(0, 0, 0, 0.18);
  --shadow-2:
    0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 48px rgba(0, 0, 0, 0.32);
  --t-fast: 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-base: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-slow: 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: 252px;
  --gutter: 24px;
  --font:
    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, system-ui,
    sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hi) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: var(--surface-hi);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: #3a4366;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  transition: opacity var(--t-fast);
}
.brand:hover {
  opacity: 0.85;
}
.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.brand__name {
  font-family: var(--font);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand__name-accent {
  color: var(--accent);
  margin-left: 2px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
  transition:
    color var(--t-fast),
    background var(--t-fast);
  border: 1px solid transparent;
}
.menu__item svg {
  flex-shrink: 0;
  opacity: 0.85;
}
.menu__item:hover {
  color: var(--text);
  background: var(--surface-2);
}
.menu__item.is-active {
  color: var(--text-on-accent);
  background: var(--accent);
  font-weight: 600;
}
.menu__item.is-active svg {
  opacity: 1;
  stroke-width: 2;
}
.menu__group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 16px 14px 8px;
}
.menu__badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-pink-soft);
  color: var(--c-pink);
  letter-spacing: 0.04em;
}
.menu__item.is-active .menu__badge {
  background: rgba(12, 16, 35, 0.16);
  color: var(--text-on-accent);
}

.profile-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: -16px;
  margin-right: -16px;
  margin-bottom: -16px;
  padding: 16px;
}
.profile-card__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--surface-1);
}
.profile-card__meta {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}
.profile-card__name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-card__role {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.profile-card__logout {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition:
    color var(--t-fast),
    background var(--t-fast),
    transform var(--t-fast);
}
.profile-card__logout:hover {
  color: var(--c-red);
  background: var(--c-red-soft);
  transform: translateX(1px);
}
.profile-card__logout:active {
  transform: scale(0.92);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.view {
  padding: var(--gutter);
  animation: fade-in var(--t-base) both;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}
.view > :first-child { margin-top: 0; }
.view > :last-child  { margin-bottom: 0; }
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.view__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.view__subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 2px;
}
.view__actions {
  display: flex;
  gap: 10px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-1);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card__title {
  font-size: 15.5px;
  font-weight: 700;
}
.card__sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.section-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 0 0 16px;
}

.section-title--mt { margin-top: 32px; }

.stats { margin-bottom: 0; }
.stats__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.stats__head-text { display: flex; flex-direction: column; gap: 4px; }
.stats__title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.stats__sub { color: var(--text-muted); font-size: 12.5px; }
.stats__total {
  display: flex; align-items: baseline; gap: 10px;
  flex-shrink: 0;
}
.stats__total-num {
  font-size: 36px; font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--c-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stats__total-lbl { color: var(--text-muted); font-size: 12.5px; }
.stats__list { display: flex; flex-direction: column; gap: 12px; }
.stat-row {
  display: grid;
  grid-template-columns: 36px minmax(180px, 1fr) 2fr 90px;
  align-items: center;
  gap: 14px;
}
.stat-row__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.stat-row__name {
  font-weight: 600; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-row__bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.stat-row__bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transform-origin: left;
  animation: bar-grow var(--t-slow) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.stat-row__icon--orange { background: var(--c-orange-soft); color: var(--c-orange); }
.stat-row__icon--pink   { background: var(--c-pink-soft);   color: var(--c-pink); }
.stat-row__icon--blue   { background: var(--c-blue-soft);   color: var(--c-blue); }
.stat-row__icon--green  { background: var(--c-green-soft);  color: var(--c-green); }
.stat-row__icon--purple { background: rgba(180, 150, 255, 0.14); color: #b496ff; }
.stat-row__icon--accent { background: var(--accent-soft);   color: var(--accent); }
.stat-row__bar-fill--orange { background: var(--c-orange); }
.stat-row__bar-fill--pink   { background: var(--c-pink); }
.stat-row__bar-fill--blue   { background: var(--c-blue); }
.stat-row__bar-fill--green  { background: var(--c-green); }
.stat-row__bar-fill--purple { background: #b496ff; }
.stat-row__bar-fill--accent { background: var(--accent); }
.stat-row__num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-row__pct {
  display: inline-block;
  margin-left: 6px;
  color: var(--text-soft);
  font-size: 11px;
}

@media (max-width: 720px) {
  .stat-row {
    grid-template-columns: 32px 1fr auto;
    grid-template-areas: "icon name num" "icon bar bar";
    row-gap: 6px;
  }
  .stat-row__icon { grid-area: icon; }
  .stat-row__name { grid-area: name; }
  .stat-row__num { grid-area: num; }
  .stat-row__bar { grid-area: bar; }
  .stats__head { flex-direction: column; align-items: flex-start; }
}

.history { padding: 0; overflow: hidden; }
.history__head {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr 1fr;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.history__body { min-height: 220px; }
.history__row {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr 1fr;
  gap: 16px;
  padding: 14px 18px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.history__row:last-child { border-bottom: 0; }
.history__row:hover { background: var(--surface-2); }
.history__user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.history__user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #9bdfd7, #6c8af6);
  color: #0e1117;
  font-size: 11px;
  font-weight: 700;
}
.history__tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  min-width: 0;
}
.history__file {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: middle;
}
.history__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}
.history__status--ok    { background: var(--c-green-soft);  color: var(--c-green); }
.history__status--err   { background: var(--c-red-soft);    color: var(--c-red); }
.history__status--run   { background: var(--c-blue-soft);   color: var(--c-blue); }
.history__time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.history__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 6px;
}
.history__empty-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text-muted);
  margin-bottom: 6px;
}
.history__empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.history__empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .history__head { display: none; }
  .history__row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "user time" "tool status";
    row-gap: 6px;
  }
  .history__user { grid-area: user; }
  .history__time { grid-area: time; text-align: right; }
  .history__tool { grid-area: tool; }
  .history__status { grid-area: status; justify-self: end; }
}
.section-title h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-title__sub {
  color: var(--text-muted);
  font-size: 12.5px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.dash-grid--bottom {
  grid-template-columns: 1fr 2fr;
  margin-top: 16px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 0 0 12px;
}
.tbl td {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.tbl tr:first-child td {
  border-top: 0;
}
.tbl__index {
  display: inline-block;
  min-width: 26px;
  color: var(--text-muted);
}
.tbl__col-num     { width: 40px; }
.tbl__col-md      { width: 120px; }
.tbl__col-lg      { width: 200px; }
.tbl__placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}
.users-tbl__name  { font-weight: 600; }
.users-tbl__self  { color: var(--text-soft); font-weight: 400; font-size: 11px; }
.users-tbl__login {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}
.tbl__row {
  transition: background var(--t-fast);
}
.tbl__row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}
.bar__fill {
  position: absolute;
  inset: 0;
  right: auto;
  border-radius: inherit;
  transform-origin: left;
  animation: bar-grow var(--t-slow) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.pill--blue {
  background: var(--c-blue-soft);
  color: var(--c-blue);
}
.pill--orange {
  background: var(--c-orange-soft);
  color: var(--c-orange);
}
.pill--green {
  background: var(--c-green-soft);
  color: var(--c-green);
}
.pill--pink {
  background: var(--c-pink-soft);
  color: var(--c-pink);
}
.pill--red {
  background: var(--c-red-soft);
  color: var(--c-red);
}

.status-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--c-orange-soft);
  color: var(--c-orange);
}
.status-card__title {
  font-weight: 700;
  font-size: 15.5px;
}
.status-card__desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}
.status-card__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 12px;
  font-size: 13px;
}
.status-card__list li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.tool-grid .card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tool-grid .card #upload-host {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tool-grid .card #upload-host .drop {
  flex: 1;
  min-height: 380px;
}
.tool-grid .card #log-host {
  flex: 1;
  min-height: 520px;
  max-height: 520px;
  min-width: 0;
}

.tool-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.tool-hero__icon {
  width: 56px;
  min-width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
[data-admin-only]:not(.is-allowed) { display: none; }

body.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(158, 236, 223, 0.10), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(110, 162, 255, 0.08), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 92vw);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-2);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-brand__mark {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.login-brand__name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.login-brand__name span {
  color: var(--accent);
  margin-left: 2px;
}
.login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.login-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 22px;
}
.login-form .field { margin-bottom: 14px; }
.login-form .input { width: 100%; padding: 12px 14px; }
.login-error {
  display: none;
  background: var(--c-red-soft);
  color: var(--c-red);
  border: 1px solid rgba(255, 123, 139, 0.25);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.login-error.is-visible { display: block; }
.login-submit {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  margin-top: 6px;
}

.tool-hero__icon--orange { background: var(--c-orange-soft); color: var(--c-orange); }
.tool-hero__icon--blue   { background: var(--c-blue-soft);   color: var(--c-blue); }
.tool-hero__icon--green  { background: var(--c-green-soft);  color: var(--c-green); }
.tool-hero__icon--red    { background: var(--c-red-soft);    color: var(--c-red); }
.tool-hero__icon--pink   { background: var(--c-pink-soft);   color: var(--c-pink); }
.tool-hero__icon--purple { background: rgba(180, 150, 255, 0.14); color: #b496ff; }
.tool-hero__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tool-hero__desc {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 4px;
  max-width: 60ch;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 38px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition:
    background var(--t-fast),
    border-color var(--t-fast);
}
.drop:hover,
.drop.is-dragover {
  background: var(--surface-3);
  border-color: var(--accent);
}
.drop__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  transition: transform var(--t-base);
}
.drop:hover .drop__icon {
  transform: translateY(-2px);
}
.drop__title {
  font-weight: 700;
}
.drop__sub {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 4px;
}
.drop__btn {
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: background var(--t-fast);
}
.drop__btn:hover {
  background: var(--surface-3);
}

.files {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.files:empty {
  display: none;
}
.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.file__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--c-blue-soft);
  color: var(--c-blue);
  display: grid;
  place-items: center;
}
.file__meta {
  flex: 1;
  min-width: 0;
}
.file__name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file__size {
  font-size: 11.5px;
  color: var(--text-muted);
}
.file__rm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition:
    color var(--t-fast),
    background var(--t-fast);
}
.file__rm:hover {
  color: var(--c-red);
  background: var(--c-red-soft);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.options--mb { margin-bottom: 16px; }
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.field__sub {
  color: var(--text-muted);
  font-weight: 400;
}
.field__sub--soft { color: var(--text-soft); }
.field__hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 6px;
}
.field__hint--mt8 { margin-top: 8px; }
.input,
.select,
.textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  transition:
    border-color var(--t-fast),
    background var(--t-fast);
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--surface-3);
}
.textarea {
  min-height: 96px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a91ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  cursor: pointer;
}

.input-wrap { position: relative; display: block; }
.input-wrap .input { width: 100%; padding-right: 44px; }
.input-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color var(--t-fast), background var(--t-fast);
}
.input-eye:hover { color: var(--text); background: var(--surface-3); }
.input-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.row {
  display: flex;
  gap: 10px;
}
.row > * {
  flex: 1;
}
.checkbox-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}
.checkbox-row input {
  accent-color: var(--accent);
  transform: scale(1.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  transition:
    transform var(--t-fast),
    background var(--t-fast),
    box-shadow var(--t-fast),
    opacity var(--t-fast);
  border: 1px solid transparent;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: 0 6px 18px rgba(158, 236, 223, 0.18);
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-700);
}
.btn--ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--surface-3);
}
.btn--danger {
  background: var(--c-red);
  color: #1a0a0e;
  box-shadow: 0 6px 18px rgba(255, 123, 139, 0.22);
}
.btn--danger:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress {
  margin-top: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}
.progress-row .progress { flex: 1; margin-top: 0; }
.progress__fill {
  position: absolute;
  inset: 0;
  right: auto;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--c-blue) 100%);
  transition: width var(--t-base);
}
.progress--idle .progress__fill {
  background: var(--surface-hi);
  width: 0;
}
.progress__pct {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.log {
  margin-top: 12px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: #060814;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.log__line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.log__line > span:last-child {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.log__line.is-info b {
  color: var(--c-blue);
}
.log__line.is-warn b {
  color: var(--c-orange);
}
.log__line.is-error b {
  color: var(--c-red);
}
.log__line.is-ok b {
  color: var(--c-green);
}
.log__time {
  color: var(--text-soft);
  flex-shrink: 0;
}
.log__empty {
  color: var(--text-soft);
  font-style: italic;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.status-line__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-soft);
}
.status-line__text {
  color: var(--text-muted);
  font-size: 12.5px;
}
.status-line.is-running .status-line__dot {
  background: var(--c-blue);
  animation: pulse 1.4s infinite;
}
.status-line.is-done .status-line__dot {
  background: var(--c-green);
}
.status-line.is-error .status-line__dot {
  background: var(--c-red);
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(110, 162, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(110, 162, 255, 0);
  }
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    transform var(--t-base),
    border-color var(--t-base);
  position: relative;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.tool-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}
.tool-card__icon--blue   { background: var(--c-blue-soft);   color: var(--c-blue); }
.tool-card__icon--orange { background: var(--c-orange-soft); color: var(--c-orange); }
.tool-card__icon--pink   { background: var(--c-pink-soft);   color: var(--c-pink); }
.tool-card__icon--green  { background: var(--c-green-soft);  color: var(--c-green); }
.tool-card__icon--purple { background: rgba(180, 150, 255, 0.14); color: #b496ff; }
.tool-card__icon--accent { background: var(--accent-soft);   color: var(--accent); }
.tool-card__title {
  font-weight: 700;
  font-size: 15px;
}
.tool-card__desc {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.tool-card__cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--accent);
}
.tool-card__cta svg {
  transition: transform var(--t-fast);
}
.tool-card:hover .tool-card__cta svg {
  transform: translateX(3px);
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.empty svg {
  margin: 0 auto 8px;
  opacity: 0.5;
}

.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  animation: toast-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  font-size: 13px;
}
.toast.is-leaving {
  animation: toast-out 200ms ease both;
}
@keyframes toast-in {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes toast-out {
  to {
    transform: translateX(20px);
    opacity: 0;
  }
}
.toast__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.toast.is-info .toast__icon {
  background: var(--c-blue-soft);
  color: var(--c-blue);
}
.toast.is-ok .toast__icon {
  background: var(--c-green-soft);
  color: var(--c-green);
}
.toast.is-warn .toast__icon {
  background: var(--c-orange-soft);
  color: var(--c-orange);
}
.toast.is-error .toast__icon {
  background: var(--c-red-soft);
  color: var(--c-red);
}
.toast__title {
  font-weight: 700;
  font-size: 13px;
}
.toast__msg {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
  margin-top: 2px;
}
.toast__close {
  margin-left: auto;
  padding: 4px;
  border-radius: 6px;
  color: var(--text-soft);
  transition:
    color var(--t-fast),
    background var(--t-fast);
}
.toast__close:hover {
  color: var(--text);
  background: var(--surface-3);
}

@media (max-width: 1100px) {
  :root {
    --sidebar-w: 220px;
  }
  .dash-grid,
  .dash-grid--bottom {
    grid-template-columns: 1fr;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .tool-grid .card #upload-host .drop {
    min-height: 280px;
  }
  .tool-grid .card #log-host {
    min-height: 360px;
    max-height: 360px;
  }
}

.topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 800px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 60;
    width: 280px;
    max-width: 86vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
  .sidebar.is-open {
    transform: none;
  }
  .view__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .view__actions {
    width: 100%;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--gutter);
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
  }
  .topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.01em;
  }
  .topbar__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
  }
  .topbar__brand-name { line-height: 1; }
  .topbar__burger {
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
  }
  .topbar__burger:hover { background: var(--surface-3); }
  .topbar__burger:active { transform: scale(0.96); }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 22, 0.6);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base);
    z-index: 50;
  }
  .sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .main { min-height: calc(100vh - 65px); }
  .view { min-height: calc(100vh - 65px); }
}

@media (max-width: 560px) {
  :root {
    --gutter: 16px;
  }
  .card {
    padding: 16px;
  }
  .row {
    flex-direction: column;
    gap: 14px;
  }
  .toasts {
    top: 8px;
    right: 8px;
    left: 8px;
  }
  .toast {
    min-width: 0;
    max-width: none;
  }
  .tool-grid .card #upload-host .drop {
    min-height: 240px;
  }
  .tool-grid .card #log-host {
    min-height: 320px;
    max-height: 320px;
  }
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-top: 14px;
  border: 1px solid var(--surface-3);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-muted);
}
.notice--mt0 { margin-top: 0; }
.notice--mb   { margin-bottom: 14px; }
.notice__icon {
  flex-shrink: 0;
  color: var(--accent);
}
.notice__link {
  color: var(--accent);
  text-decoration: underline;
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

#progress-host { margin-bottom: 6px; }

.lang-input {
  text-transform: uppercase;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.users-tbl td:last-child,
.users-tbl th:last-child {
  text-align: right;
}
.users-tbl td:last-child { white-space: nowrap; }

.row-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: background var(--t-fast), color var(--t-fast);
}
.row-btn:hover { background: var(--surface-3); }
.row-btn--danger:hover {
  background: var(--c-red-soft);
  color: var(--c-red);
}

@media (max-width: 720px) {
  .users-tbl,
  .users-tbl tbody { display: block; width: 100%; }
  .users-tbl thead { display: none; }
  .users-tbl tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "idx  name  role"
      "log  log   log"
      "act  act   act";
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
    padding: 14px 14px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface-2);
  }
  .users-tbl tr:last-child { margin-bottom: 0; }
  .users-tbl td { padding: 0; border: 0; }
  .users-tbl td:nth-child(1) {
    grid-area: idx;
    color: var(--text-muted);
    font-size: 11px;
  }
  .users-tbl td:nth-child(2) { grid-area: name; min-width: 0; }
  .users-tbl td:nth-child(2) > div {
    white-space: normal;
    word-break: break-word;
  }
  .users-tbl td:nth-child(3) {
    grid-area: log;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
    word-break: break-all;
  }
  .users-tbl td:nth-child(4) { grid-area: role; justify-self: end; }
  .users-tbl td:nth-child(5) {
    grid-area: act;
    text-align: left !important;
    display: flex;
    gap: 8px;
    margin-top: 4px;
    white-space: normal;
  }
  .users-tbl td:nth-child(5) .row-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
  }
  .users-tbl td[colspan] {
    grid-column: 1 / -1;
    text-align: center !important;
    color: var(--text-muted);
  }
  .tbl__index { min-width: 0; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fade-in 160ms ease;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  width: min(440px, 92vw);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-2);
}
.modal__title {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 4px;
}
.modal__sub {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 16px;
}
.modal__error {
  display: none;
  margin-bottom: 12px;
  background: var(--c-red-soft);
  color: var(--c-red);
  border: 1px solid rgba(255, 123, 139, 0.25);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12.5px;
}
.modal__error.is-visible { display: block; }
.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}
