﻿:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #f3f4f6;
  --muted: #9aa4b2;
  --accent: #37b3ff;
  --ok: #36c68a;
  --warn: #e6b422;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans", Arial, sans-serif;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.topbar {
  background: #0b0d11;
  border-bottom: 1px solid #1f2633;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 600; }
nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
}
nav a:hover { color: var(--text); }
.card {
  background: var(--panel);
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid #1f2633;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0b0d11;
  padding: 0 12px;
  min-height: 40px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.btn.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid #33415a;
}
.btn.btn-accent {
  background: linear-gradient(135deg, #37b3ff, #58d2ff);
}
.btn.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.page-header .btn {
  height: 44px;
  min-width: 180px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f2633;
  text-align: left;
}
.muted { color: var(--muted); }
.form label { display: block; margin-bottom: 12px; }
.form input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #2a3142;
  background: #11141a;
  color: var(--text);
}
.form select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #2a3142;
  background: #11141a;
  color: var(--text);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.form-actions .btn {
  height: 44px;
}
.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}
.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.oauth-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 8px;
  align-items: stretch;
}
.actions > a,
.actions > form {
  width: 100%;
}
.actions .btn {
  width: 100%;
  height: 44px;
}
.actions .amo-connect-btn {
  margin-left: 10px;
  width: calc(100% - 10px);
}
.action-form {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  grid-column: span 2;
  gap: 8px;
  align-items: stretch;
}
.action-form .btn {
  min-width: 0;
}
.action-form input {
  width: 100%;
  height: 44px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #2a3142;
  background: #11141a;
  color: var(--text);
}
.fetch-limit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fetch-limit-wrap .hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #33415a;
  color: var(--muted);
  font-size: 12px;
  cursor: help;
}
.action-status {
  margin-top: 10px;
  border: 1px solid #33415a;
  border-radius: 6px;
  padding: 8px 10px;
  color: #a9ddff;
  background: rgba(55, 179, 255, 0.08);
}
.btn.is-loading {
  opacity: 0.72;
  pointer-events: none;
}
.notice.ok {
  border-color: #25543e;
  color: #99f0c8;
}
.notice {
  border-color: #4f3d1f;
  color: #ffd9a1;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal {
  width: min(560px, 92vw);
  background: var(--panel);
  border: 1px solid #33415a;
  border-radius: 10px;
  padding: 16px;
}
.modal h3 {
  margin: 0 0 10px;
}
.modal-body {
  white-space: pre-wrap;
  color: var(--text);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.login-card {
  max-width: 420px;
}

@media (max-width: 860px) {
  .grid.two {
    grid-template-columns: 1fr;
  }
  .oauth-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .action-form {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
  .actions .amo-connect-btn {
    margin-left: 0;
    width: 100%;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page-header .btn {
    min-width: 0;
    width: 100%;
  }
}
