:root {
  --bg: #0b1420;
  --panel: #111f31;
  --panel-soft: #17283f;
  --line: rgba(184, 205, 232, 0.12);
  --text: #ecf5ff;
  --muted: #9cb0c8;
  --accent: #9df6ff;
  --accent-2: #69b7ff;
  --danger: #ff8e8e;
  --success: #8bf0bf;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #0b1420 0%, #0d1827 100%);
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
}

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

.admin-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(9, 17, 28, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  color: #07111d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand-text strong,
.topbar h1 {
  font-family: "Manrope", "Noto Sans SC", sans-serif;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text small {
  margin-top: 6px;
  color: var(--muted);
}

.menu {
  display: grid;
  gap: 10px;
}

.menu button,
.toolbar button,
.table-actions button,
.auth-card button,
.editor button {
  border: 0;
  cursor: pointer;
  color: #07111d;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #d5f9ff);
}

.menu button {
  min-height: 46px;
  border-radius: 14px;
}

.menu button.secondary,
.toolbar button.secondary,
.table-actions button.secondary,
.editor button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.logout-btn {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.card,
.panel,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
}

.card strong {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 34px;
}

.card span {
  color: var(--muted);
}

.panel {
  padding: 24px;
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar input {
  width: 100%;
  max-width: 320px;
}

.toolbar button,
.editor button,
.auth-card button,
.table-actions button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
}

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

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

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

.field label {
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field textarea,
.field select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: var(--panel-soft);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.panel-grid {
  display: grid;
  gap: 22px;
}

.hidden {
  display: none !important;
}

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

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

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

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

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

.table-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.status-bar {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.status-bar.success {
  color: var(--success);
}

.status-bar.error {
  color: var(--danger);
}

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

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

.auth-card h1 {
  margin: 0 0 8px;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
}

.auth-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.auth-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

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

  .cards,
  .grid-form {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
