:root {
  --page-bg: #f7f9fc;
  --panel-bg: #ffffff;
  --panel-border: #dfe6f1;
  --section-bg: #ffffff;
  --section-border: #e4eaf3;
  --row-bg: #ffffff;
  --field-border: #d5deeb;
  --text: #1a2b49;
  --muted: #7b889f;
  --primary: #2f6df6;
  --primary-dark: #1f56d2;
  --primary-soft: #e7f0ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  --preview-gap: 28px;
  --input-preview-scale: 0.88;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

body.progress-modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.parking-row .canopy-type-field.hidden {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}

.workspace {
  min-height: 100vh;
  width: min(1880px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  align-items: flex-start;
  gap: var(--preview-gap);
  padding: 28px 24px 36px;
  transition: filter 0.18s ease;
}

body.progress-modal-open .workspace {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

body.progress-modal-open .admin-shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.workspace.has-preview {
  grid-template-columns: minmax(720px, 900px) minmax(820px, 1040px);
}

.input-panel-shell {
  width: min(1260px, 100%);
  margin: 0 auto;
}

.workspace.has-preview .input-panel-shell {
  width: 100%;
  max-width: 900px;
  margin: 0;
}

.input-panel,
.preview-panel {
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.workspace.has-preview .input-panel {
  width: calc(100% / var(--input-preview-scale));
  transform: scale(var(--input-preview-scale));
  transform-origin: top left;
}

.panel-header,
.preview-header {
  padding: 28px 28px 0;
}

.panel-header {
  padding-bottom: 10px;
}

.panel-header h1,
.panel-header h2,
.preview-header h2 {
  margin: 0;
  color: #183a75;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.panel-header p,
.preview-header p,
.section-head p,
.preview-state p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.panel-body {
  padding: 18px 28px 28px;
}

.section {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--section-border);
  border-radius: 18px;
  background: var(--section-bg);
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: #163a78;
}

.section-head {
  margin-bottom: 14px;
}

.basic-form {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field.field-span-2 {
  grid-column: span 2;
}

.field.field-span-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 14px;
  font-weight: 700;
  color: #21416f;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input,
.field select {
  height: 46px;
}

.field textarea {
  min-height: 132px;
  padding: 14px;
  resize: vertical;
}

.field input::placeholder {
  color: #99a6bb;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.14);
  background: #ffffff;
}

.parking-layout-field {
  margin-top: 14px;
}

.upload-dropzone {
  min-height: 132px;
  border: 2px dashed #c9d7ee;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: #35537f;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: linear-gradient(180deg, #f0f6ff 0%, #e4efff 100%);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.10);
}

.upload-dropzone-title {
  font-size: 16px;
  font-weight: 700;
  color: #183a75;
}

.upload-dropzone-hint {
  font-size: 14px;
  color: var(--muted);
}

.upload-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-list-item {
  padding: 10px 12px;
  border: 1px solid #dbe5f3;
  border-radius: 12px;
  background: #f8fbff;
  font-size: 13px;
  color: #35537f;
  word-break: break-all;
}

.parking-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.2fr auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid #e3e9f2;
  border-radius: 16px;
  background: var(--row-bg);
}

.pile-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e3e9f2;
  border-radius: 16px;
  background: var(--row-bg);
}

.pile-row-header {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 12px;
  align-items: end;
}

.pile-row-actions {
  display: flex;
  justify-self: end;
  justify-content: flex-end;
  gap: 10px;
}

.pile-row.is-split-mode {
  border-color: #d6e0f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.pile-mode-card {
  border: 1px solid #dde6f2;
  border-radius: 16px;
  padding: 16px;
}

.integrated-config-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.split-config-card {
  background: linear-gradient(180deg, #fbfcff 0%, #f3f7fd 100%);
  border-color: #d5e0f1;
}

.pile-mode-heading {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 800;
  color: #35537f;
  letter-spacing: 0.08em;
}

.pile-config-grid {
  display: grid;
  gap: 12px;
}

.integrated-config-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(120px, 0.9fr) minmax(120px, 0.9fr);
}

.split-host-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(120px, 0.9fr) minmax(120px, 0.9fr) minmax(170px, 1fr);
}

.split-terminal-group-field {
  margin-top: 16px;
}

.split-terminal-group-shell {
  position: relative;
  padding-left: 58px;
}

.split-terminal-group-shell::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 12px;
  bottom: 26px;
  width: 24px;
  border-left: 2px solid #c6d4ea;
  border-bottom: 2px solid #c6d4ea;
  border-bottom-left-radius: 18px;
}

.split-terminal-group-caption {
  width: min(100%, 76%);
  margin: 0 0 10px auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #35537f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.split-terminal-sublist {
  width: min(100%, 76%);
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.split-terminal-config-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(120px, 0.9fr) minmax(120px, 0.82fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 18px 14px 14px;
  border: 1px solid #dbe5f3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.split-terminal-config-row::before {
  content: "终端";
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: #4a638c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.action-btn {
  height: 46px;
  min-width: 46px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
}

.parking-row > .action-btn {
  width: 46px !important;
  max-width: 46px !important;
  min-width: 46px !important;
  padding: 0 !important;
  flex: 0 0 46px;
  justify-self: start;
  align-self: end;
}

.add-btn,
.primary-button {
  background: linear-gradient(180deg, #3877ff 0%, #2f6df6 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 109, 246, 0.20);
}

.add-btn:hover,
.primary-button:hover {
  background: linear-gradient(180deg, #2868f4 0%, #215bdd 100%);
}

.remove-btn {
  background: #edf2f8;
  color: #6e7d96;
}

.form-actions {
  margin-top: 8px;
}

.primary-button {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
}

.primary-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.progress-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(6px);
}

.progress-modal-dialog {
  width: min(560px, 100%);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.progress-modal-dialog .preview-header {
  padding-bottom: 0;
}

.progress-modal-dialog .preview-state {
  margin: 20px 28px 28px;
}

.download-progress-dialog {
  width: min(520px, 100%);
}

.download-progress-state {
  min-height: auto;
  align-items: stretch;
  gap: 16px;
}

.download-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5edf8;
  overflow: hidden;
  position: relative;
}

.download-progress-fill {
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6df6 0%, #5c8fff 100%);
  transition: width 0.22s ease;
}

.download-progress-indeterminate .download-progress-fill {
  position: relative;
  animation: download-progress-slide 1.2s ease-in-out infinite;
}

.download-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #496181;
  font-size: 13px;
}

.download-progress-meta strong {
  color: #183a75;
  font-size: 18px;
}

.download-progress-success .download-progress-fill {
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
}

.download-progress-error .download-progress-fill {
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}

.error-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  line-height: 1.6;
}

.preview-panel {
  width: 100%;
  min-height: calc(100vh - 64px);
  padding: 0 24px 24px;
  overflow: hidden;
}

.preview-state,
.preview-container {
  margin-top: 20px;
}

.preview-state {
  min-height: 240px;
  border: 1px dashed #d5dfec;
  border-radius: 16px;
  background: #f9fbfe;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
}

.loading-dot {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(47, 109, 246, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.preview-frame {
  width: 100%;
  min-height: calc(100vh - 150px);
  border: 1px solid #dde5f0;
  border-radius: 16px;
  background: #fff;
}

.app-header {
  width: min(1880px, calc(100% - 48px));
  margin: 24px auto 0;
  padding: 18px 24px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-header-brand h1 {
  margin: 0;
  color: #183a75;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
}

.app-header-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #163a78 0%, #2f6df6 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: #edf4ff;
  color: #21416f;
  font-size: 13px;
  font-weight: 700;
}

.secondary-button,
.ghost-button,
.small-button {
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  height: 44px;
  font-size: 14px;
  font-weight: 700;
}

.secondary-button {
  background: #e7f0ff;
  color: #1f56d2;
}

.ghost-button {
  background: #edf2f8;
  color: #51617c;
}

.small-button {
  height: 36px;
  padding: 0 12px;
  background: #e7f0ff;
  color: #1f56d2;
}

.danger-button {
  background: #fde9e9;
  color: #c02626;
}

.compact-button {
  width: auto;
  min-width: 140px;
}

.page-banner {
  width: min(1880px, calc(100% - 48px));
  margin: 16px auto 0;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.info-banner {
  background: #edf4ff;
  border: 1px solid #d4e5ff;
  color: #21416f;
}

.warning-banner {
  background: #fff7e7;
  border: 1px solid #f3d28d;
  color: #8a5a00;
}

.danger-banner {
  background: #fff0f0;
  border: 1px solid #f1b5b5;
  color: #b42318;
}

.success-banner {
  background: #edfdf3;
  border: 1px solid #b7e5c6;
  color: #147a45;
}

.success-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #b7e5c6;
  border-radius: 12px;
  background: #edfdf3;
  color: #147a45;
  font-size: 14px;
  line-height: 1.6;
}

.history-panel {
  margin-top: 18px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  padding: 16px;
  border: 1px solid #dfe8f5;
  border-radius: 16px;
  background: #f9fbff;
}

.history-item-head,
.history-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.history-item-head h3 {
  margin: 0;
  font-size: 16px;
  color: #163a78;
}

.history-item-head p,
.history-foot span {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.history-meta {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
  color: #496181;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-success {
  background: #e7f8ee;
  color: #147a45;
}

.status-danger {
  background: #fde9e9;
  color: #c02626;
}

.status-warning {
  background: #fff4df;
  color: #8a5a00;
}

.status-neutral {
  background: #edf2f8;
  color: #51617c;
}

.text-link {
  color: #1f56d2;
  font-weight: 700;
  text-decoration: none;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #d5dfec;
  border-radius: 16px;
  background: #f9fbfe;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header {
  padding: 24px 24px 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 28px;
  color: #183a75;
}

.modal-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.modal-body {
  padding: 20px 24px 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 109, 246, 0.12), transparent 34%),
    linear-gradient(180deg, #f4f8ff 0%, #eef3fb 100%);
}

.auth-layout {
  min-height: 100vh;
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0;
}

.auth-hero,
.auth-card {
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.auth-hero {
  padding: 34px;
}

.auth-hero h1 {
  margin: 18px 0 0;
  font-size: 46px;
  line-height: 1.1;
  color: #163a78;
}

.auth-hero p {
  margin: 16px 0 0;
  color: #496181;
  font-size: 16px;
  line-height: 1.8;
}

.hero-list {
  margin: 24px 0 0;
  padding-left: 18px;
  color: #35537f;
  font-size: 14px;
  line-height: 1.9;
}

.auth-card {
  width: 100%;
  padding: 24px;
}

.auth-version {
  margin: 16px 0 0;
  text-align: center;
  color: #6c7f99;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-button {
  height: 46px;
  border: none;
  border-radius: 14px;
  background: #edf2f8;
  color: #51617c;
  font-size: 15px;
  font-weight: 800;
}

.tab-button.active {
  background: linear-gradient(180deg, #3877ff 0%, #2f6df6 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 109, 246, 0.20);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form-helper {
  margin-top: -6px;
  display: flex;
  justify-content: flex-end;
}

.text-button {
  padding: 0;
  border: none;
  background: transparent;
  color: #1f56d2;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.admin-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #21416f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.admin-sort-button:hover {
  color: #1f56d2;
}

.admin-page {
  min-height: 100dvh;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(47, 109, 246, 0.12), transparent 24%),
    linear-gradient(180deg, #f3f7fd 0%, #edf3fb 100%);
}

.admin-page.admin-modal-open {
  overflow: hidden;
}

.admin-shell {
  width: min(1880px, 100%);
  height: calc(100dvh - 40px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(18, 51, 108, 0.14);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.admin-app-header {
  width: auto;
  margin: 0;
  padding: 24px 28px;
  border: none;
  border-bottom: 1px solid #e2eaf6;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 255, 0.88) 100%);
  box-shadow: none;
  flex: 0 0 auto;
}

.admin-console {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
}

.admin-page .admin-console .table-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.admin-sidebar-pane {
  position: relative;
  top: auto;
  min-height: 0;
  height: 100%;
  padding: 28px 0;
  border-right: 1px solid #e2eaf6;
  background: linear-gradient(180deg, #f9fbff 0%, #f2f7fd 100%);
  overflow: auto;
}

.admin-page .admin-sidebar-pane .card-header {
  padding: 0 24px 20px;
}

.admin-sidebar-menu {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
}

.admin-sidebar-tab {
  width: 100%;
  min-height: 56px;
  border: 1px solid #d8e3f4;
  border-radius: 18px;
  background: #f7faff;
  color: #26446f;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  padding: 0 18px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.admin-sidebar-tab:hover {
  border-color: #b9cff2;
  background: #eef4ff;
  transform: translateX(2px);
}

.admin-sidebar-tab.active {
  border-color: #2f6df6;
  background: linear-gradient(180deg, #3877ff 0%, #2f6df6 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 109, 246, 0.22);
}

.admin-main-pane {
  min-width: 0;
  min-height: 0;
  padding: 28px;
  background: rgba(255, 255, 255, 0.72);
  overflow: auto;
}

.admin-main-pane .admin-view {
  height: 100%;
}

.admin-main-pane .admin-view > .table-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.admin-main-pane .card-header,
.admin-main-pane .admin-toolbar,
.admin-main-pane .table-shell,
.admin-main-pane .admin-pagination,
.admin-main-pane .simple-list,
.admin-main-pane .inline-form {
  padding-left: 0;
  padding-right: 0;
}

.admin-main-pane .card-header {
  padding-top: 0;
}

.admin-main-pane .admin-pagination {
  padding-bottom: 0;
}

.admin-section-header {
  align-items: center;
}

.admin-header-button {
  width: auto;
  min-width: 120px;
  height: 44px;
  padding: 0 18px;
  flex: 0 0 auto;
}

.admin-view {
  display: none;
}

.admin-view.is-active {
  display: block;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 18px 22px 0;
  flex-wrap: wrap;
}

.admin-toolbar-filters {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  flex: 1 1 860px;
}

.admin-filter-field {
  min-width: 0;
}

.admin-filter-reset {
  width: auto;
  height: 46px;
  padding: 0 18px;
}

.admin-toolbar-summary {
  color: #51617c;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.monitor-toolbar-filters {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
}

.admin-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 22px 22px;
  flex-wrap: wrap;
}

.admin-pagination-actions {
  display: flex;
  gap: 10px;
}

.admin-page-button {
  width: auto;
  height: 40px;
  padding: 0 16px;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
}

.admin-modal-card {
  width: min(620px, 100%);
}

.admin-modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-modal-form .field-span-full {
  grid-column: 1 / -1;
}

.admin-modal-actions {
  margin-top: 6px;
}

.admin-modal-button {
  width: auto;
  min-width: 96px;
  height: 44px;
  padding: 0 18px;
}

.admin-main-pane .table-shell {
  overflow-x: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.table-card {
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  color: #163a78;
  font-size: 34px;
  line-height: 1;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.card-header {
  padding: 22px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.card-header h2 {
  margin: 0;
  color: #163a78;
  font-size: 22px;
}

.card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.table-shell,
.simple-list,
.inline-form {
  padding: 18px 22px 22px;
}

.simple-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simple-list-item {
  padding: 14px;
  border: 1px solid #dfe8f5;
  border-radius: 14px;
  background: #f9fbff;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.simple-list-item strong {
  color: #163a78;
}

.simple-list-item span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e8eef7;
  vertical-align: top;
  text-align: left;
  font-size: 13px;
  line-height: 1.7;
}

.data-table th {
  color: #21416f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.monitor-table {
  min-width: 1292px;
  table-layout: fixed;
}

.monitor-table col.monitor-col-time {
  width: 172px;
}

.monitor-table col.monitor-col-name {
  width: 96px;
}

.monitor-table col.monitor-col-employee {
  width: 112px;
}

.monitor-table col.monitor-col-position {
  width: 120px;
}

.monitor-table col.monitor-col-project {
  width: 220px;
}

.monitor-table col.monitor-col-input {
  width: 126px;
}

.monitor-table col.monitor-col-status {
  width: 112px;
}

.monitor-table col.monitor-col-duration {
  width: 116px;
}

.monitor-table col.monitor-col-result {
  width: 218px;
}

.monitor-table tbody tr {
  height: 72px;
}

.monitor-table th,
.monitor-table td {
  vertical-align: middle;
}

.monitor-cell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-cell--multi {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: initial;
  white-space: normal;
  line-height: 1.5;
  max-height: 3em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.monitor-details {
  width: 100%;
}

.monitor-details summary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-details[open] summary {
  margin-bottom: 10px;
}

.monitor-details pre {
  max-height: 240px;
}

.monitor-status-cell {
  text-align: center;
  white-space: nowrap;
}

.monitor-status-badge {
  min-width: 56px;
}

.monitor-result-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.details-block summary {
  cursor: pointer;
  color: #1f56d2;
  font-weight: 700;
}

.details-block pre {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: #f5f7fb;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes download-progress-slide {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(520%);
  }
}

@media (max-width: 1720px) {
  :root {
    --input-preview-scale: 0.92;
  }

  .workspace.has-preview {
    grid-template-columns: minmax(660px, 820px) minmax(740px, 940px);
  }
}

@media (max-width: 1480px) {
  .workspace,
  .workspace.has-preview {
    grid-template-columns: 1fr;
  }

  .workspace.has-preview .input-panel-shell,
  .input-panel-shell,
  .preview-panel {
    width: 100%;
    max-width: none;
  }

  .workspace.has-preview .input-panel {
    width: 100%;
    transform: none;
  }

  .preview-panel {
    min-height: auto;
  }

  .preview-frame {
    min-height: 760px;
  }
}

@media (max-width: 1200px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .admin-page {
    padding: 16px;
  }

  .admin-shell {
    height: calc(100dvh - 32px);
  }

  .admin-app-header {
    padding: 22px 24px;
  }

  .admin-console {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .admin-sidebar-pane {
    padding: 24px 0;
  }

  .admin-main-pane {
    padding: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-grid,
  .inline-form {
    grid-template-columns: 1fr 1fr;
  }

  .admin-toolbar-filters {
    grid-template-columns: 1fr 1fr;
  }

  .monitor-toolbar-filters {
    grid-template-columns: 1fr 1fr;
  }

  .admin-modal-form {
    grid-template-columns: 1fr 1fr;
  }

  .basic-form {
    grid-template-columns: 1fr 1fr;
  }

  .parking-row,
  .split-terminal-config-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .pile-row-header {
    grid-template-columns: 1fr;
  }

  .pile-row-actions {
    justify-content: flex-start;
  }

  .integrated-config-grid,
  .split-host-grid {
    grid-template-columns: 1fr 1fr;
  }

  .split-terminal-group-caption,
  .split-terminal-sublist {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .app-header,
  .page-banner,
  .admin-shell {
    width: calc(100% - 24px);
  }

  .admin-page {
    padding: 12px;
  }

  .admin-page .admin-shell {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 24px);
  }

  .admin-page .admin-app-header {
    width: auto;
    padding: 18px 18px 20px;
  }

  .app-header,
  .app-header-brand,
  .app-header-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid,
  .admin-grid,
  .inline-form,
  .auth-tabs,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .admin-toolbar,
  .admin-pagination {
    align-items: stretch;
  }

  .admin-toolbar-filters,
  .admin-modal-form {
    grid-template-columns: 1fr;
  }

  .admin-toolbar-summary {
    white-space: normal;
  }

  .admin-toolbar-actions {
    justify-content: stretch;
  }

  .admin-console {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .admin-sidebar-pane {
    position: static;
    min-height: auto;
    height: auto;
    padding: 18px 0;
    border-right: none;
    border-bottom: 1px solid #e2eaf6;
    overflow: visible;
  }

  .admin-sidebar-menu {
    padding-top: 0;
    padding-left: 18px;
    padding-right: 18px;
  }

  .admin-page .admin-sidebar-pane .card-header {
    padding: 0 18px 16px;
  }

  .admin-main-pane {
    padding: 18px;
    overflow: visible;
  }

  .admin-page .app-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-header-button,
  .admin-filter-reset,
  .admin-page-button,
  .admin-modal-button {
    width: 100%;
  }

  .workspace {
    padding: 16px;
  }

  .panel-header,
  .preview-header,
  .panel-body,
  .preview-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel-header h1,
  .preview-header h2 {
    font-size: 28px;
  }

  .basic-form,
  .parking-row,
  .split-terminal-config-row {
    grid-template-columns: 1fr;
  }

  .integrated-config-grid,
  .split-host-grid {
    grid-template-columns: 1fr;
  }

  .split-terminal-group-shell {
    padding-left: 0;
  }

  .split-terminal-group-shell::before {
    display: none;
  }

  .field.field-span-2 {
    grid-column: span 1;
  }

  .pile-row-actions {
    width: 100%;
  }

  .pile-row-actions .action-btn {
    flex: 1 1 0;
  }

  .action-btn {
    width: 100%;
  }
}
