:root {
  --ink: #1d272c;
  --ink-soft: #536067;
  --surface: #ffffff;
  --canvas: #f3f5f6;
  --line: #dbe1e4;
  --line-strong: #c8d0d4;
  --green: #167857;
  --green-soft: #e7f4ee;
  --red: #c34f43;
  --red-soft: #faecea;
  --amber: #a66a13;
  --amber-soft: #fff3db;
  --blue: #376fa3;
  --blue-soft: #eaf2f9;
  --admin: #202b30;
  --focus: rgba(55, 111, 163, 0.25);
  --shadow-sm: 0 4px 14px rgba(29, 39, 44, 0.06);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.container-xl {
  width: 100%;
  max-width: 1320px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 12px;
  padding-left: 12px;
}

a {
  color: var(--blue);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1100;
  padding: 8px 12px;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

svg {
  width: 1em;
  height: 1em;
  stroke-width: 2;
}

.btn {
  min-height: 38px;
  border-radius: 5px;
  font-weight: 650;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  --bs-btn-bg: var(--green);
  --bs-btn-border-color: var(--green);
  --bs-btn-hover-bg: #116649;
  --bs-btn-hover-border-color: #116649;
  --bs-btn-active-bg: #0e5a41;
  --bs-btn-active-border-color: #0e5a41;
  --bs-btn-disabled-bg: var(--green);
  --bs-btn-disabled-border-color: var(--green);
}

.btn-outline-secondary {
  --bs-btn-color: #46545b;
  --bs-btn-border-color: #aeb9be;
  --bs-btn-hover-bg: #e8edef;
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: #98a5ab;
  --bs-btn-active-bg: #dfe5e7;
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-border-color: #98a5ab;
}

.form-control,
.form-select {
  min-height: 43px;
  color: var(--ink);
  border-color: var(--line-strong);
  border-radius: 5px;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus);
}

.form-label {
  margin-bottom: 7px;
  color: #334047;
  font-size: 0.875rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.site-header {
  position: relative;
  z-index: 10;
  color: var(--ink);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header .navbar,
.admin-header .navbar {
  min-height: 70px;
  padding: 10px 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup:hover {
  color: var(--ink);
}

.brand-lockup > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-lockup strong {
  font-size: 1.18rem;
  line-height: 1.05;
}

.brand-lockup small {
  margin-top: 4px;
  color: #758188;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--green);
  border-radius: 6px;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 650;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #25a875;
  border: 2px solid #c7eddf;
  border-radius: 50%;
  box-sizing: content-box;
}

.directory-heading {
  padding: 43px 0 35px;
  background: #edf1f2;
  border-bottom: 1px solid var(--line);
}

.heading-row,
.admin-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.heading-row h1,
.admin-titlebar h1 {
  margin: 0;
  color: #172126;
  font-size: 2rem;
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: 0;
}

.heading-copy,
.admin-titlebar > div > p:last-child {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.stats-refresh-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #69767c;
  font-size: 0.78rem;
}

.stats-refresh-state svg {
  width: 15px;
  height: 15px;
}

.stats-refresh-state.is-refreshing svg {
  animation: spin 0.9s linear infinite;
}

.stats-refresh-state.is-error {
  color: var(--red);
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 27px;
}

.stat-card {
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 19px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-card-available { border-left-color: var(--green); }
.stat-card-today { border-left-color: var(--blue); }
.stat-card-unavailable { border-left-color: var(--red); }

.stat-icon {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.stat-icon svg { width: 24px; height: 24px; }
.stat-card-available .stat-icon { color: var(--green); background: var(--green-soft); }
.stat-card-today .stat-icon { color: var(--blue); background: var(--blue-soft); }
.stat-card-unavailable .stat-icon { color: var(--red); background: var(--red-soft); }

.stat-card > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: #657178;
  font-size: 0.8rem;
  font-weight: 650;
}

.stat-card strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.85rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.node-directory {
  padding: 34px 0 58px;
}

.section-toolbar {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-toolbar > div:first-child {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.section-toolbar h2 {
  margin: 0;
  color: #1d282d;
  font-size: 1.14rem;
  font-weight: 760;
  line-height: 1.25;
}

.record-count {
  color: #758188;
  font-size: 0.76rem;
  white-space: nowrap;
}

.table-legend {
  display: flex;
  gap: 15px;
  color: #68747a;
  font-size: 0.76rem;
}

.table-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
}

.legend-online { background: var(--green); }
.legend-offline { background: var(--red); }

.table-shell {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.node-table,
.admin-table {
  min-width: 1120px;
  font-size: 0.84rem;
}

.admin-table {
  min-width: 1020px;
}

.admin-node-table {
  min-width: 1300px;
}

.node-table > :not(caption) > * > *,
.admin-table > :not(caption) > * > * {
  padding: 13px 12px;
  border-color: #e6eaec;
}

.node-table thead th,
.admin-table thead th {
  padding-top: 11px;
  padding-bottom: 11px;
  color: #68747b;
  background: #f7f9f9;
  border-bottom-color: var(--line-strong);
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.node-table tbody tr,
.admin-table tbody tr {
  transition: background-color 0.15s ease;
}

.node-table tbody tr:hover,
.admin-table tbody tr:hover {
  background: #fafcfc;
}

.node-table tbody tr:last-child td,
.admin-table tbody tr:last-child td {
  border-bottom-width: 0;
}

.node-name {
  display: block;
  max-width: 175px;
  overflow: hidden;
  color: #273238;
  font-size: 0.84rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-value {
  max-width: 190px;
  display: inline-block;
  overflow: hidden;
  padding: 3px 5px;
  color: #3d515b;
  background: #edf1f2;
  border-radius: 3px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.77rem;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.numeric-value,
.metric-value,
.date-value {
  color: #46545b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-value {
  font-weight: 700;
}

.metric-value small {
  color: #849096;
  font-size: 0.66rem;
  font-weight: 600;
}

.metric-empty,
.subtle-value {
  color: #849096;
  font-size: 0.78rem;
  white-space: nowrap;
}

.protocol-badge,
.status-badge,
.purity-score,
.source-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.protocol-badge { color: #43606e; background: #e8eff2; }
.protocol-vmess { color: #386d9c; background: var(--blue-soft); }
.protocol-vless { color: #6c4f90; background: #f0eafb; }
.protocol-trojan { color: #8e5426; background: #f8eee5; }
.protocol-ss { color: #2d7360; background: var(--green-soft); }

.status-badge {
  gap: 6px;
}

.status-badge i {
  width: 6px;
  height: 6px;
  display: inline-block;
  background: currentColor;
  border-radius: 50%;
}

.status-badge.is-online { color: var(--green); background: var(--green-soft); }
.status-badge.is-offline { color: var(--red); background: var(--red-soft); }

.purity-score {
  min-width: 35px;
  font-variant-numeric: tabular-nums;
}

.score-good { color: var(--green); background: var(--green-soft); }
.score-fair { color: var(--amber); background: var(--amber-soft); }
.score-risk { color: var(--red); background: var(--red-soft); }

.node-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.node-actions form {
  margin: 0;
}

.btn-action {
  min-height: 31px;
  padding: 5px 7px;
  color: #536168;
  background: #fff;
  border: 1px solid #d2dade;
  font-size: 0.69rem;
}

.btn-action:hover,
.btn-action:focus-visible {
  color: #1f5d80;
  background: #edf5f9;
  border-color: #a9c3d3;
}

.btn-action:disabled {
  color: #98a2a7;
  background: #f5f7f8;
  border-color: #e1e5e7;
}

.btn-action svg {
  width: 14px;
  height: 14px;
}

.btn-action .spinner-border {
  width: 13px;
  height: 13px;
  border-width: 2px;
}

.empty-cell {
  height: 215px;
  color: #7b878d !important;
  text-align: center;
  vertical-align: middle;
}

.empty-cell svg {
  width: 28px;
  height: 28px;
  display: block;
  margin: 0 auto 9px;
  color: #99a5aa;
}

.empty-cell strong,
.empty-cell span {
  display: block;
}

.empty-cell strong {
  color: #59666c;
  font-size: 0.9rem;
}

.empty-cell span {
  margin-top: 4px;
  font-size: 0.75rem;
}

.site-footer {
  padding: 22px 0;
  color: #6d797f;
  background: #e8edef;
  border-top: 1px solid var(--line);
  font-size: 0.73rem;
}

.error-main {
  min-height: calc(100vh - 132px);
  display: flex;
  align-items: center;
  padding: 55px 0;
}

.error-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(280px, 1fr);
  align-items: center;
  gap: 55px;
  max-width: 850px;
}

.error-code {
  color: #cbd3d6;
  font-size: 7rem;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.error-copy {
  padding-left: 42px;
  border-left: 1px solid var(--line-strong);
}

.error-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 760;
}

.error-copy > p:not(.eyebrow) {
  max-width: 470px;
  margin: 11px 0 24px;
  color: var(--ink-soft);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.modal-content {
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 18px 55px rgba(23, 33, 38, 0.2);
}

.modal-header {
  padding: 17px 19px;
  border-bottom-color: var(--line);
}

.modal-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 800;
}

.modal-title {
  font-size: 1.04rem;
  font-weight: 750;
}

.qr-modal-content .modal-body {
  padding: 25px 20px 22px;
  text-align: center;
}

.qr-code {
  width: 216px;
  min-height: 216px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.qr-code img,
.qr-code canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.qr-node-name {
  max-width: 240px;
  margin: 14px auto 0;
  overflow: hidden;
  color: #536168;
  font-size: 0.78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-toast {
  min-width: 270px;
  color: #fff;
  background: #273238;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(29, 39, 44, 0.2);
}

.app-toast.toast-success { background: #176f52; }
.app-toast.toast-error { background: #a64239; }

.app-toast .toast-body {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-toast .toast-body svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

/* Admin shell */
.admin-header {
  color: #fff;
  background: var(--admin);
  border-bottom: 1px solid #334047;
}

.brand-lockup-light,
.brand-lockup-light:hover {
  color: #fff;
}

.brand-lockup-light small {
  color: #aeb9be;
}

.brand-lockup-light .brand-mark {
  color: #d6efe6;
  background: #166d51;
}

.admin-header .navbar-nav {
  gap: 2px;
}

.admin-header .nav-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px !important;
  color: #c5cdd1;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 650;
}

.admin-header .nav-link:hover,
.admin-header .nav-link:focus,
.admin-header .nav-link.active {
  color: #fff;
  background: #344249;
}

.admin-header .nav-link svg {
  width: 16px;
  height: 16px;
}

.admin-account,
.admin-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-account {
  color: #ccd3d6;
  font-size: 0.77rem;
}

.admin-user svg {
  width: 16px;
  height: 16px;
}

.admin-account form {
  margin-left: 4px;
}

.admin-account .btn {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 0.74rem;
}

.admin-main {
  min-height: calc(100vh - 132px);
  padding: 36px 0 58px;
}

.admin-titlebar {
  margin-bottom: 25px;
}

.admin-titlebar h1 {
  font-size: 1.75rem;
}

.admin-quick-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 5px;
  font-size: 0.84rem;
}

.app-alert > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.admin-stats {
  margin: 0 0 33px;
}

.admin-section {
  margin-bottom: 30px;
}

.admin-section-toolbar {
  margin-bottom: 11px;
}

.btn-crawl {
  min-height: 36px;
  color: #21684f;
  background: var(--green-soft);
  border: 1px solid #afd4c5;
  font-size: 0.78rem;
}

.btn-crawl:hover,
.btn-crawl:focus-visible {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.btn-icon {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 5px;
  color: #536168;
  background: #fff;
  border: 1px solid #d2dade;
}

.btn-icon:hover,
.btn-icon:focus-visible {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #adc5d8;
}

.btn-icon-danger:hover,
.btn-icon-danger:focus-visible {
  color: var(--red);
  background: var(--red-soft);
  border-color: #dfb1ac;
}

.btn-icon svg {
  width: 15px;
  height: 15px;
}

.btn-icon .spinner-border {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.admin-node-actions {
  min-width: 217px;
}

.admin-node-toolbar {
  margin-bottom: 12px;
}

.admin-node-toolbar .section-toolbar {
  margin-bottom: 0;
}

.dashboard-refresh {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  flex: 0 0 38px;
}

.dashboard-refresh.is-refreshing svg {
  animation: spin 0.9s linear infinite;
}

.cell-subtext {
  max-width: 180px;
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #849096;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-value {
  color: #69767c;
  font-size: 0.73rem;
}

.admin-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.compact-list {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.source-row,
.run-row {
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid #e8ecee;
}

.source-row:last-child,
.run-row:last-child {
  border-bottom: 0;
}

.source-icon,
.run-state {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #486a78;
  background: #eaf0f2;
  border-radius: 5px;
}

.source-icon svg,
.run-state svg {
  width: 15px;
  height: 15px;
}

.source-copy,
.run-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.source-copy strong,
.run-copy strong {
  overflow: hidden;
  color: #344147;
  font-size: 0.79rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-copy span,
.run-copy span {
  overflow: hidden;
  margin-top: 3px;
  color: #849096;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-state.enabled { color: var(--green); background: var(--green-soft); }
.source-state.disabled { color: #69767c; background: #e9edef; }
.run-state.run-success { color: var(--green); background: var(--green-soft); }
.run-state.run-running { color: var(--blue); background: var(--blue-soft); }
.run-state.run-failed { color: var(--red); background: var(--red-soft); }
.run-state.run-running svg { animation: spin 1s linear infinite; }

.run-count {
  color: #67747a;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compact-empty {
  padding: 37px 20px;
  color: #7e8a90;
  font-size: 0.78rem;
  text-align: center;
}

/* Forms */
.admin-form-width {
  max-width: 970px;
}

.form-titlebar {
  align-items: center;
}

.admin-form {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.form-section {
  padding: 25px 27px 28px;
  border-bottom: 1px solid #e4e9eb;
}

.form-section-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 21px;
}

.form-section-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 5px;
}

.form-section-icon svg {
  width: 17px;
  height: 17px;
}

.form-section-heading h2 {
  margin: 0;
  color: #273238;
  font-size: 0.98rem;
  font-weight: 760;
}

.form-section-heading p {
  margin: 3px 0 0;
  color: #7a868c;
  font-size: 0.7rem;
}

.required-mark {
  color: var(--red);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.code-input {
  color: #34464f;
  background: #fafcfc;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.81rem;
  line-height: 1.65;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 18px 27px;
  background: #f7f9f9;
}

.import-section {
  padding-bottom: 23px;
}

.import-section .form-section-heading {
  flex-wrap: wrap;
}

.import-counter {
  margin-left: auto;
  color: #66737a;
  font-size: 0.73rem;
}

.import-counter strong {
  color: var(--green);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.import-input {
  min-height: 330px !important;
  white-space: pre;
}

.format-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 13px;
  color: #68757b;
  font-size: 0.69rem;
}

.format-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.format-summary i {
  width: 6px;
  height: 6px;
  display: inline-block;
  background: #7594a2;
  border-radius: 50%;
}

.format-summary strong {
  color: #344147;
  font-variant-numeric: tabular-nums;
}

.format-summary .format-invalid i { background: var(--red); }
.format-summary .format-invalid strong { color: var(--red); }

.import-switch {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 10px 7px 47px;
  background: #f5f8f8;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.import-switch .form-check-input {
  width: 34px;
  height: 18px;
  margin-top: 0;
  margin-left: -38px;
}

.import-switch .form-check-input:checked {
  background-color: var(--green);
  border-color: var(--green);
}

.import-switch .form-check-label {
  display: flex;
  flex-direction: column;
  color: #334047;
  font-size: 0.74rem;
}

.import-switch .form-check-label span {
  margin-top: 1px;
  color: #7d898f;
  font-size: 0.65rem;
}

/* Login */
.login-page {
  background: #e8edef;
}

.login-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 18px;
}

.login-panel {
  width: 100%;
  max-width: 420px;
  padding: 33px 35px 30px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--green);
  border-radius: 7px;
  box-shadow: 0 15px 45px rgba(30, 42, 48, 0.12);
}

.login-brand {
  margin-bottom: 37px;
}

.login-heading {
  margin-bottom: 24px;
}

.login-heading h1 {
  margin: 0;
  color: #1c272c;
  font-size: 1.65rem;
  font-weight: 760;
}

.login-heading > p:last-child {
  margin: 8px 0 0;
  color: #6d797f;
  font-size: 0.84rem;
}

.input-with-icon {
  position: relative;
}

.input-with-icon > svg:first-child {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 2;
  width: 17px;
  height: 17px;
  color: #7a878d;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 41px;
}

.input-password .form-control {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  z-index: 3;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #6e7a80;
  background: transparent;
  border: 0;
  border-radius: 4px;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--blue);
  background: var(--blue-soft);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.login-submit {
  min-height: 45px;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  color: #69767c;
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  color: var(--blue);
}

.back-link svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 991.98px) {
  .admin-header .navbar-collapse {
    padding-top: 13px;
  }

  .admin-header .navbar-nav {
    padding: 9px 0;
    border-top: 1px solid #3a474d;
    border-bottom: 1px solid #3a474d;
  }

  .admin-account {
    justify-content: space-between;
    padding-top: 11px;
  }

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

@media (max-width: 767.98px) {
  .site-header .navbar,
  .admin-header .navbar {
    min-height: 62px;
  }

  .header-meta {
    font-size: 0.72rem;
  }

  .directory-heading {
    padding: 31px 0 28px;
  }

  .heading-row,
  .admin-titlebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .heading-row h1,
  .admin-titlebar h1 {
    font-size: 1.62rem;
  }

  .stats-refresh-state {
    align-self: stretch;
    padding: 8px 0 0;
    border-top: 1px solid #d8dfe2;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 21px;
  }

  .stat-card {
    min-height: 82px;
    padding: 14px 16px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .stat-card strong {
    font-size: 1.5rem;
  }

  .node-directory,
  .admin-main {
    padding-top: 27px;
    padding-bottom: 43px;
  }

  .section-toolbar {
    align-items: flex-start;
  }

  .table-legend {
    padding-top: 3px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .admin-titlebar {
    margin-bottom: 20px;
  }

  .admin-quick-actions {
    width: 100%;
  }

  .admin-quick-actions .btn {
    flex: 1;
  }

  .admin-quick-actions .dashboard-refresh {
    flex: 0 0 38px;
  }

  .admin-stats {
    margin-bottom: 27px;
  }

  .form-titlebar .btn {
    align-self: flex-start;
  }

  .form-section {
    padding: 21px 18px 23px;
  }

  .form-actions {
    padding: 16px 18px;
  }

  .import-input {
    min-height: 285px !important;
  }

  .error-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .error-code {
    font-size: 4.5rem;
    text-align: left;
  }

  .error-copy {
    padding: 0;
    border-left: 0;
  }
}

@media (max-width: 479.98px) {
  .header-meta {
    display: none;
  }

  .brand-lockup strong {
    font-size: 1.06rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .section-toolbar {
    flex-wrap: wrap;
  }

  .table-legend {
    display: none;
  }

  .admin-quick-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-quick-actions .dashboard-refresh {
    width: 38px;
    align-self: flex-end;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .login-main {
    padding: 0;
  }

  .login-panel {
    min-height: 100vh;
    max-width: none;
    padding: 29px 22px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand {
    margin-bottom: 48px;
  }

  .import-counter {
    width: 100%;
    margin-left: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
