body {
  min-width: 360px;
}
#app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.loading {
  margin: 20vh auto;
  color: var(--muted);
  text-align: center;
}
.manager-header {
  height: 64px;
  padding: 0 28px;
  gap: 18px;
}
.service-select {
  max-width: 270px;
  min-width: 170px;
}
.manager-nav {
  display: flex;
  gap: 8px;
}
.manager-header select {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 7px;
  padding: 8px 12px;
}
.manager-main {
  width: 100%;
  max-width: 1480px;
  padding: 30px 32px 48px;
  margin: 0 auto;
}
.manager-main.panel-view {
  max-width: none;
  padding-bottom: 0;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.manager-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}
.manager-title h1 {
  margin: 0 0 7px;
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  font-weight: 650;
}
.manager-title p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.m-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.m-btn:hover {
  background: var(--line);
}
.m-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.m-btn.primary:hover {
  background: var(--accent-hover);
}
.m-btn.danger {
  color: var(--red);
}
.m-btn.small {
  padding: 6px 10px;
  font-size: 12px;
}
.m-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.summary-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}
.summary-box .label {
  color: var(--muted);
  font-size: 12px;
}
.summary-box .value {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 600;
  margin-top: 7px;
}
.summary-box .value.mono {
  font-size: 19px;
}
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}
.service-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  transition: border-color 0.15s;
  cursor: pointer;
}
.service-card:hover,
.service-card:focus {
  border-color: var(--accent);
  outline: none;
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.card-top h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.service-domain {
  color: var(--accent-text);
  margin: 9px 0 20px;
  font-size: 13px;
}
.service-counts {
  display: flex;
  gap: 40px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.service-counts strong {
  font-size: 23px;
  font-weight: 600;
  display: block;
}
.service-counts span {
  color: var(--muted);
  font-size: 12px;
}
.service-details {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 9px;
  margin: 18px 0 0;
  font-size: 12px;
}
.service-details dt {
  color: var(--muted);
}
.service-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 15px;
  font-size: 12px;
  color: var(--dim);
}
.card-footer .service-domain {
  margin: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  background: #112e28;
  color: var(--green);
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill.bad {
  background: #381b28;
  color: var(--red);
}
.pill.wait {
  background: #342c1b;
  color: var(--amber);
}
.m-muted {
  color: var(--muted);
}
.m-error {
  background: #2e1524;
  border: 1px solid #6b2436;
  color: #fda4af;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.6;
  margin: 14px 0;
}
.m-notice {
  border: 1px solid #164e63;
  background: #082437;
  color: #a5d7ef;
  padding: 13px 16px;
  border-radius: 8px;
  line-height: 1.6;
  margin: 16px 0;
}
.m-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.m-tabs a {
  text-decoration: none;
  padding: 0 2px 12px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.m-tabs a.active {
  color: var(--accent-text);
  border-color: var(--accent-text);
}
.panel-frame {
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: var(--bg);
  width: 100%;
  min-height: 650px;
  flex: 1;
  height: calc(100vh - 245px);
}
.m-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  margin-top: 18px;
}
.m-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.m-table th {
  padding: 12px 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  background: var(--panel-deep);
}
.m-table td {
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
.m-table td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.m-empty {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
}
.m-empty h2 {
  color: var(--text);
  font-size: 18px;
  margin-bottom: 10px;
}
.auth-wrap {
  width: min(440px, calc(100% - 40px));
  margin: 12vh auto 40px;
}
.auth-wrap .brand {
  justify-content: center;
  font-size: 22px;
  margin-bottom: 30px;
}
.auth-card {
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.auth-card h1 {
  font-size: 20px;
  margin: 0 0 10px;
}
.auth-card p {
  color: var(--muted);
  line-height: 1.7;
}
.m-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--soft);
}
.m-field input,
.m-field select,
.m-field textarea {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px 11px;
  width: 100%;
  color: var(--text);
  outline: none;
}
.m-field input:focus,
.m-field select:focus,
.m-field textarea:focus {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 2px #0284c722;
}
.m-field textarea {
  min-height: 85px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 11px;
}
.m-field small {
  color: var(--dim);
  line-height: 1.5;
}
.m-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  font-size: 12px;
  line-height: 1.5;
}
.m-check input {
  accent-color: var(--accent);
  margin-top: 2px;
}
.m-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.m-form-grid .full {
  grid-column: 1/-1;
}
.m-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #020617bb;
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.m-modal {
  width: 760px;
  max-width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 20px 80px #0009;
}
.m-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.m-modal-head h2 {
  font-size: 18px;
  margin: 0;
}
.m-modal-body {
  padding: 22px 24px;
  overflow: auto;
}
.m-modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
}
.m-step {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.m-step span {
  flex: 1;
  padding: 8px 4px;
  border-bottom: 2px solid var(--line);
  color: var(--dim);
  font-size: 11px;
}
.m-step span.active {
  color: var(--accent-text);
  border-color: var(--accent);
}
.m-log {
  font: 12px/1.8 var(--mono);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.m-subtitle {
  color: var(--text);
  font-size: 15px;
  margin: 24px 0 12px;
}
#notifications {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  max-width: 420px;
}
.m-toast {
  padding: 13px 18px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 5px 30px #0008;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
}
.m-toast.error {
  border-color: #9f1239;
}
.fingerprint {
  font: 11px/1.6 var(--mono);
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: 6px;
  background: var(--bg);
}
@media (max-width: 800px) {
  .manager-header {
    padding: 12px 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
  }
  .manager-nav {
    margin-left: auto;
  }
  .manager-main {
    padding: 24px 16px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .manager-title {
    flex-direction: column;
    gap: 16px;
  }
  .fleet-grid {
    grid-template-columns: 1fr;
  }
  .m-form-grid {
    grid-template-columns: 1fr;
  }
  .m-overlay {
    padding: 10px;
  }
  .m-modal-body {
    padding: 18px;
  }
  .manager-header .brand {
    font-size: 14px;
  }
  .manager-header .service-select {
    min-width: 140px;
    max-width: 200px;
  }
}
