:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.06);
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --danger: #d70015;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.admin-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #e8f0ff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f3e8ff 0%, transparent 50%), var(--bg);
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-side {
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.55));
}

.brand.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-logo-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.brand-label {
  min-width: 0;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: transform 0.22s var(--ease-spring), background 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
  will-change: transform;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: #004bad;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.18);
}

.nav-muted {
  color: var(--muted);
}

.side-foot {
  margin-top: 28px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
}

.admin-main {
  padding: 28px 28px 48px;
}

.main-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-heading {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.table-card,
.form-card {
  background: var(--panel-solid);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.02);
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 28px !important;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
  will-change: transform;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 113, 227, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: rgba(0, 0, 0, 0.04);
}

.btn-danger {
  background: rgba(215, 0, 21, 0.1);
  color: #a40012;
}

.press-spring:active {
  transform: scale(0.96);
}

.stack-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.input,
.select,
.textarea {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-spring);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.textarea {
  resize: vertical;
  min-height: 88px;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.form-actions {
  padding-top: 6px;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}

.alert-error {
  background: rgba(215, 0, 21, 0.08);
  color: #7a000d;
  border: 1px solid rgba(215, 0, 21, 0.18);
}

.alert-ok {
  background: rgba(52, 199, 89, 0.12);
  color: #0f5a2d;
  border: 1px solid rgba(52, 199, 89, 0.22);
}

.pager {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.pager-info {
  font-size: 13px;
  color: var(--muted);
}

.inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-search {
  min-width: 220px;
}

.login-body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(900px 500px at 20% 0%, #dfe9ff 0%, transparent 55%),
    radial-gradient(800px 500px at 100% 20%, #f1e6ff 0%, transparent 50%), var(--bg);
}

.login-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px 26px 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(180%);
}

.login-brand-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.login-title {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.login-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-enter .anim-sheet {
  animation: sheetIn 0.55s var(--ease-spring) both;
}

.page-enter .login-card.anim-sheet {
  animation: sheetIn 0.65s var(--ease-spring) both;
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.anim-toast {
  animation: toastIn 0.45s var(--ease-spring) both, toastOut 0.45s var(--ease-out) 2.6s both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.form-hint {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.form-hint code {
  font-size: 12px;
}

.text-preview-line {
  margin: -6px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.field-preview-group {
  margin-bottom: 4px;
}

.url-preview-frame {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 120px;
  justify-content: center;
}

.url-preview-frame--tool {
  min-height: 88px;
}

.url-preview-label {
  align-self: flex-start;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.url-preview-img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.url-preview-frame--tool .url-preview-img {
  max-height: 72px;
}

.url-preview-placeholder {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
