:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-soft: #eef2ff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-light: #38bdf8;
  --danger: #b91c1c;
  --border: rgba(148, 163, 184, 0.25);
  --shadow-soft: 0 26px 52px rgba(15, 23, 42, 0.3);
  --radius-card: 24px;
  --radius-input: 12px;
  --transition: 0.18s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: radial-gradient(120% 120% at 50% 0%, #1d4ed8 0%, #0f172a 45%, #0b1120 100%);
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-nav {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  color: #e2e8f0;
  display: flex;
  justify-content: center;
  padding: 18px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.page-nav-inner {
  width: min(1120px, calc(100% - 40px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.page-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.page-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.page-links a {
  color: #e2e8f0;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.page-links a:hover {
  background: rgba(226, 232, 240, 0.18);
}

.page-links a.active {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.35);
}

.admin-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 6vw, 48px);
  padding: clamp(32px, 6vw, 72px) 16px 96px;
  align-items: center;
}

.admin-hero {
  width: min(1120px, calc(100% - 40px));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  color: #e2e8f0;
}

.admin-hero__content {
  max-width: 640px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.admin-hero h1 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
}

.admin-hero p {
  margin: 0;
  font-size: 1rem;
  color: rgba(226, 232, 240, 0.85);
}

.admin-hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.35);
  color: #e2e8f0;
  font-weight: 600;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.ghost-link:hover {
  background: rgba(226, 232, 240, 0.12);
  color: #fff;
  border-color: rgba(226, 232, 240, 0.7);
}

.admin-grid {
  width: min(1120px, calc(100% - 40px));
  display: grid;
  gap: clamp(18px, 2.5vw, 24px);
}

.admin-section {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: clamp(24px, 4vw, 32px);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.admin-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at -20% -10%, rgba(56, 189, 248, 0.18) 0%, transparent 55%),
    radial-gradient(circle at 120% 0%, rgba(37, 99, 235, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.admin-section__header {
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
}

.admin-section__header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-section__header p {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.admin-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(248, 250, 252, 0.65);
  border-radius: 18px;
  padding: 18px 18px 10px;
  margin-bottom: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(240px, 100%);
  flex: 1 1 220px;
}

.field-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.field-row .field-group,
.field-row .checkbox-pill {
  flex: 1 1 220px;
}

input[type='text'],
select {
  padding: 10px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

input[type='text']:focus,
select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.75);
  background: var(--surface-muted);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-pill input[type='checkbox'] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.primary-btn {
  padding: 11px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 48px rgba(37, 99, 235, 0.42);
}

.ghost-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.ghost-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--accent);
}

.feedback {
  position: relative;
  z-index: 1;
  min-height: 20px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.feedback.success {
  color: #0f766e;
}

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

.feedback.info {
  color: var(--text-secondary);
}

.table-wrapper {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.8);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table thead {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.admin-table th,
.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.actions-column {
  text-align: right;
  white-space: nowrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 10px;
  border: none;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  margin-right: 8px;
  transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.action-btn:last-child {
  margin-right: 0;
}

.action-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.action-btn.danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.empty-row {
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
  padding: 18px;
}

@media (max-width: 920px) {
  .admin-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-hero__actions {
    width: 100%;
  }

  .ghost-link {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .page-nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-links {
    width: 100%;
    justify-content: space-between;
  }

  .admin-form {
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .actions .primary-btn,
  .actions .ghost-btn {
    width: 100%;
    justify-content: center;
  }
}
