* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: #1e293b;
  background: #edf1f6;
}

button,
input {
  font: inherit;
}

[v-cloak] {
  display: none;
}

.admin-shell {
  min-height: 100vh;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.admin-topbar p {
  margin: 6px 0 0;
  color: #64748b;
}

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.map-link:hover {
  background: #115e59;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.login-wrap {
  min-height: 48vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(520px, 100%);
}

.panel {
  border: 1px solid #d7dfea;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading span {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.panel-heading small {
  font-size: 12px;
  color: #64748b;
}

.token-panel,
.history-panel {
  grid-column: 1 / -1;
}

.token-row,
.action-row,
.session-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.session-row {
  align-items: center;
  justify-content: space-between;
}

.session-row span {
  color: #334155;
}

.token-row input {
  flex: 1 1 300px;
  min-width: 0;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  color: #0f172a;
  background: #fff;
}

.token-row input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.token-row button,
.action-row button,
.session-row button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: #2563eb;
  cursor: pointer;
  font-weight: 700;
}

.token-row button:hover,
.action-row button.primary:hover {
  background: #1d4ed8;
}

.session-row button {
  background: #e8eef6;
  color: #334155;
}

.session-row button:hover {
  background: #dbe4ef;
}

.action-row button.danger {
  background: #dc2626;
}

.action-row button.danger:hover {
  background: #b91c1c;
}

.token-row button:disabled,
.action-row button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-strip div {
  padding: 14px;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  background: #f8fafc;
}

.metric-strip span {
  display: block;
  font-size: 12px;
  color: #64748b;
}

.metric-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  color: #0f172a;
}

.schedule-text {
  margin: 0;
  min-height: 28px;
  color: #334155;
}

.status-line {
  margin: 12px 0 0;
  min-height: 20px;
  color: #64748b;
}

.auth-message {
  margin: 12px 0 0;
  min-height: 20px;
  color: #64748b;
}

.auth-message.error {
  color: #b91c1c;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid #e5ebf2;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.badge.done {
  background: #dcfce7;
  color: #166534;
}

.badge.running {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.error {
  background: #fee2e2;
  color: #b91c1c;
}

.empty-row {
  color: #64748b;
}

.empty-row.error,
.error-cell {
  color: #b91c1c;
}

.error-cell {
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-panel,
  .schedule-panel,
  .sync-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    width: calc(100% - 24px);
    padding-top: 12px;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-topbar h1 {
    font-size: 22px;
  }

  .map-link {
    width: 100%;
  }

  .token-row,
  .action-row,
  .session-row {
    flex-direction: column;
  }

  .token-row button,
  .action-row button,
  .session-row button {
    width: 100%;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }
}
