:root {
  --bg: #f7f7f5;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --text: #111111;
  --muted: #666666;
  --shadow: 0 20px 60px rgba(17, 17, 17, 0.08);
  --accent: #111111;
  --danger: #c62828;
  --success: #0f7b42;
  --radius: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

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

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.card,
.table-card,
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
  border-radius: 28px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card h1,
.section-head h2,
.topbar h1 {
  margin: 16px 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.auth-card p,
.section-head p,
.auth-tip {
  margin: 0;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

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

input,
textarea,
select,
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(17, 17, 17, 0.35);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.72);
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(198, 40, 40, 0.2);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.app-shell {
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 22px;
}

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

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
}

.sidebar {
  display: grid;
  gap: 10px;
  align-content: start;
}

.nav-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.nav-item.active {
  background: #111111;
  color: #ffffff;
}

.content {
  display: grid;
}

.panel {
  display: none;
  gap: 18px;
}

.panel.active {
  display: grid;
}

.section-head,
.card-head,
.toolbar,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-grid,
.subgrid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.stat-card,
.card,
.table-card {
  border-radius: var(--radius);
  padding: 20px;
}

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

.stat-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.mini-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(17, 17, 17, 0.04);
}

.empty-state {
  color: var(--muted);
  min-height: 120px;
  place-items: center;
}

.toolbar {
  flex-wrap: wrap;
}

.input {
  max-width: 280px;
}

.input-select {
  max-width: 180px;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(17, 17, 17, 0.03);
}

.toggle-field input {
  width: 18px;
  height: 18px;
}

.table-card {
  overflow-x: auto;
}

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

.accounts-table {
  table-layout: fixed;
}

.accounts-table th:nth-child(1),
.accounts-table td:nth-child(1) {
  width: 26%;
}

.accounts-table th:nth-child(2),
.accounts-table td:nth-child(2) {
  width: 8%;
}

.accounts-table th:nth-child(3),
.accounts-table td:nth-child(3),
.accounts-table th:nth-child(4),
.accounts-table td:nth-child(4),
.accounts-table th:nth-child(5),
.accounts-table td:nth-child(5),
.accounts-table th:nth-child(6),
.accounts-table td:nth-child(6) {
  width: 8%;
}

.accounts-table th:nth-child(7),
.accounts-table td:nth-child(7) {
  width: 18%;
}

.accounts-table th:nth-child(8),
.accounts-table td:nth-child(8) {
  width: 24%;
}

th,
td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

.accounts-table td,
.accounts-table th {
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-weight: 500;
}

tbody tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(17, 17, 17, 0.08);
}

.status-active {
  color: var(--success);
  background: rgba(15, 123, 66, 0.1);
}

.status-cooldown {
  color: #8a5a00;
  background: rgba(255, 191, 0, 0.14);
}

.status-banned,
.status-error {
  color: var(--danger);
  background: rgba(198, 40, 40, 0.1);
}

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

.mono {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  word-break: break-all;
}

.accounts-table .mono {
  white-space: normal;
}

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

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  display: grid;
  gap: 10px;
}

.toast {
  padding: 12px 16px;
  border-radius: 16px;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.toast.info {
  background: #111111;
}

.toast.success {
  background: #0f7b42;
}

.toast.error {
  background: #c62828;
}

@media (max-width: 1080px) {
  .layout,
  .stats-grid,
  .subgrid,
  .form-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .section-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr);
    overflow-x: auto;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  td {
    padding-left: 0;
    padding-right: 0;
  }
}
