/* ------------------------------------------------------------------ layout */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 24, 42, 0.92), rgba(9, 16, 29, 0.92));
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body[data-theme="light"] .login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 252, 0.96));
}

.login-card h1 {
  font-size: 22px;
}

.login-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-error {
  color: var(--bad);
  font-size: 13px;
}

/* ----------------------------------------------------------------- buttons */
.primary-btn {
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #49d3ff, #2fb4e0);
  color: #06121f;
  font-weight: 700;
  padding: 11px 18px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.primary-btn:hover {
  box-shadow: 0 6px 24px rgba(73, 211, 255, 0.45);
}

.primary-btn:active {
  transform: scale(0.98);
}

.danger-btn {
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
  color: var(--bad);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.danger-btn:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.7);
}

/* ------------------------------------------------------------------- tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.admin-tabs button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.admin-tabs button:hover {
  color: var(--text);
  border-color: rgba(73, 211, 255, 0.35);
}

.admin-tabs button.active {
  background: rgba(73, 211, 255, 0.14);
  border-color: rgba(73, 211, 255, 0.55);
  color: var(--accent);
}

/* ---------------------------------------------------------------- content */
.admin-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 18px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------------- stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 24, 42, 0.92), rgba(9, 16, 29, 0.92));
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body[data-theme="light"] .stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 252, 0.96));
}

.stat-card strong {
  font-size: 26px;
  color: var(--accent);
}

.stat-card span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ----------------------------------------------------------------- table */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(15, 24, 42, 0.92), rgba(9, 16, 29, 0.92));
  box-shadow: var(--shadow);
}

body[data-theme="light"] .table-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 252, 0.96));
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(73, 211, 255, 0.04);
}

.admin-table .muted {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.empty-note {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ----------------------------------------------------------------- editor */
.editor-panel {
  border: 1px solid rgba(73, 211, 255, 0.35);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 24, 42, 0.95), rgba(9, 16, 29, 0.95));
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body[data-theme="light"] .editor-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 252, 0.98));
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.editor-head h3 {
  font-size: 15px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
}

.editor-field {
  padding: 8px 6px;
}

.editor-field input,
.editor-field select,
.editor-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editor-field input:focus,
.editor-field select:focus,
.editor-field textarea:focus {
  border-color: rgba(73, 211, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(73, 211, 255, 0.12);
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.editor-note {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 2px 0;
}

/* ---------------------------------------------------------------- badges */
.badge-tone {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge-tone.good {
  color: var(--good);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
}

.badge-tone.warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

.badge-tone.bad {
  color: var(--bad);
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.badge-tone.info {
  color: var(--accent);
  border-color: rgba(73, 211, 255, 0.4);
  background: rgba(73, 211, 255, 0.08);
}

.admin-foot {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  border: 1px solid rgba(73, 211, 255, 0.45);
  background: rgba(13, 25, 44, 0.96);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 320px;
}

body[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.97);
}

