body {
  margin: 0;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
}

:root {
  --admin-bg: var(--admin-surface, #f1f5f9);
  --admin-text: #0f172a;
  --admin-muted: #475569;
  --admin-card: rgba(255, 255, 255, 0.78);
  --admin-border: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] {
  --admin-bg: rgba(13, 19, 33, 0.94);
  --admin-text: #e2e8f0;
  --admin-muted: #94a3b8;
  --admin-card: rgba(24, 32, 52, 0.78);
  --admin-border: rgba(71, 85, 105, 0.45);
}

.admin-shell {
  display: grid;
  min-height: 100vh;
  background: var(--admin-bg);
  color: var(--admin-text);
  grid-template-columns: minmax(240px, 280px) 1fr;
}

.admin-sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.65));
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--admin-border);
  padding: 32px 24px;
  display: grid;
  gap: 32px;
}

body[data-theme="dark"] .admin-sidebar {
  background: linear-gradient(180deg, rgba(24,32,52,0.92), rgba(24,32,52,0.65));
}

.sidebar-header {
  display: grid;
  gap: 14px;
}

.sidebar-header img {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 16px 28px rgba(15, 23, 42, 0.28));
}

.sidebar-user {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--admin-muted);
}

.sidebar-user__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--admin-text);
}

.sidebar-nav {
  display: grid;
  gap: 24px;
}

.nav-section h2 {
  margin: 0 0 12px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-muted);
}

.nav-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.nav-section a {
  color: var(--admin-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
  display: inline-flex;
  position: relative;
}

.nav-section a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--admin-primary, #015B91);
  transition: width 180ms ease;
}

.nav-section a:hover::after,
.nav-section a:focus-visible::after {
  width: 100%;
}

.admin-main {
  padding: 48px;
  display: grid;
  gap: 32px;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.header-info h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
}

.header-info p {
  margin: 6px 0 0 0;
  color: var(--admin-muted);
  font-size: 15px;
}

.header-actions {
  display: inline-flex;
  gap: 12px;
}


.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-metric {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 6px;
  box-shadow: 0 18px 28px -24px rgba(15, 23, 42, 0.35);
}

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

.admin-metric__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--admin-text);
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 20px;
  display: grid;
  gap: 8px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 36px -28px rgba(15, 23, 42, 0.45);
}

.admin-card__label {
  font-size: 13px;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-card__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--admin-text);
}

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

.admin-card__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-primary, #015B91);
  text-decoration: none;
}

.admin-news {
  display: grid;
  gap: 16px;
}

.admin-news h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--admin-muted);
}

.admin-news__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.admin-quick {
  display: grid;
  gap: 6px;
  padding: 18px;
  text-decoration: none;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  color: var(--admin-text);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.admin-quick:hover,
.admin-quick:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 34px -26px rgba(15, 23, 42, 0.5);
}

.admin-quick__title {
  font-weight: 600;
}

.admin-quick__hint {
  font-size: 13px;
  color: var(--admin-muted);
}


.admin-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.admin-table {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 36px -28px rgba(15, 23, 42, 0.45);
}

.admin-table h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--admin-text);
}

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

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid var(--admin-border);
}

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

.admin-table__empty {
  margin: 0;
  font-size: 13px;
  color: var(--admin-muted);
}

.nav-section a.is-active {
  color: var(--admin-primary, #015B91);
}

.nav-section a.is-active::after {
  width: 100%;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button-primary {
  background: var(--admin-primary, #015B91);
  color: #ffffff;
  box-shadow: 0 16px 32px -24px rgba(1, 91, 145, 0.7);
}

.button-primary:hover,
.button-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -20px rgba(1, 91, 145, 0.75);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.4);
  color: var(--admin-text);
  border-color: var(--admin-border);
}

body[data-theme="dark"] .button-secondary {
  background: rgba(24, 32, 52, 0.5);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -24px rgba(15, 23, 42, 0.35);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

body[data-theme="dark"] .theme-toggle {
  background: rgba(24, 32, 52, 0.5);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -26px rgba(15, 23, 42, 0.45);
}

.theme-toggle__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--admin-text);
  font-weight: 600;
  font-size: 13px;
}

.theme-icon {
  width: 16px;
  height: 16px;
}

.theme-icon--moon {
  display: none;
}

body[data-theme="dark"] .theme-icon--sun {
  display: none;
}

body[data-theme="dark"] .theme-icon--moon {
  display: inline-block;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.list-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.list-toolbar__filters input[type="search"],
.list-toolbar__filters select {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--admin-text);
}

.list-toolbar__filters input[type="search"]:focus-visible,
.list-toolbar__filters select:focus-visible {
  outline: none;
  border-color: var(--admin-primary, #015B91);
  box-shadow: 0 0 0 2px rgba(1, 91, 145, 0.18);
}

body[data-theme="dark"] .list-toolbar__filters input[type="search"],
body[data-theme="dark"] .list-toolbar__filters select {
  background: rgba(24, 32, 52, 0.6);
}

.list-toolbar__toggles {
  display: inline-flex;
  gap: 8px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--admin-text);
  transition: background 140ms ease, color 140ms ease;
}

body[data-theme="dark"] .toggle-pill {
  background: rgba(24, 32, 52, 0.5);
}

.toggle-pill.is-active {
  background: var(--admin-primary, #015B91);
  color: #ffffff;
  border-color: transparent;
}

.toggle-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(1, 91, 145, 0.18);
}

.table-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 36px -28px rgba(15, 23, 42, 0.45);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  text-align: left;
}

.data-table thead {
  background: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .data-table thead {
  background: rgba(24, 32, 52, 0.45);
}

.data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.04);
}

body[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.08);
}

.mono {
  font-family: "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge--active {
  background: rgba(12, 166, 120, 0.18);
  color: #0c8f62;
}

.badge--inactive {
  background: rgba(244, 127, 74, 0.18);
  color: #d97706;
}

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

.action-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--admin-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text);
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

body[data-theme="dark"] .action-chip {
  background: rgba(24, 32, 52, 0.5);
}

.action-chip:hover,
.action-chip:focus-visible {
  transform: translateY(-1px);
  background: var(--admin-primary, #015B91);
  color: #ffffff;
}

.actions-col {
  width: 220px;
}

.empty-state {
  margin: 0;
  padding: 28px;
  font-size: 14px;
  color: var(--admin-muted);
}

.callout {
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--admin-text);
}

body[data-theme="dark"] .callout {
  background: rgba(24, 32, 52, 0.55);
}

.callout--error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(254, 226, 226, 0.65);
  color: #7f1d1d;
}

body[data-theme="dark"] .callout--error {
  background: rgba(127, 29, 29, 0.45);
  color: #fee2e2;
}

.callout--success {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(220, 252, 231, 0.7);
  color: #14532d;
}

body[data-theme="dark"] .callout--success {
  background: rgba(20, 83, 45, 0.45);
  color: #dcfce7;
}

.form-section {
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 18px;
  background: var(--admin-card);
  box-shadow: 0 18px 32px -28px rgba(15, 23, 42, 0.42);
  margin-bottom: 18px;
}

.form-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--admin-text);
  list-style: none;
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section summary::after {
  content: '\25BC';
  font-size: 12px;
  transition: transform 160ms ease;
}

.form-section[open] summary::after {
  transform: rotate(180deg);
}

.form-section[open] summary {
  color: var(--admin-primary, #015B91);
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--admin-text);
}

.toggle-control input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--admin-primary, #015B91);
}

.form-grid .toggle-control {
  justify-content: flex-start;
}

.form-field textarea {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  min-height: 96px;
  resize: vertical;
  color: var(--admin-text);
  background: rgba(255, 255, 255, 0.65);
}

body[data-theme="dark"] .form-field textarea {
  background: rgba(24, 32, 52, 0.6);
}

.form-field textarea:focus-visible {
  outline: none;
  border-color: var(--admin-primary, #015B91);
  box-shadow: 0 0 0 2px rgba(1, 91, 145, 0.2);
}

.form-field select[multiple] {
  min-height: 120px;
}

.form-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 24px;
  display: grid;
  gap: 24px;
  box-shadow: 0 22px 38px -28px rgba(15, 23, 42, 0.45);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px 24px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-muted);
}

.form-field input,
.form-field select {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--admin-text);
  background: rgba(255, 255, 255, 0.65);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

body[data-theme="dark"] .form-field input,
body[data-theme="dark"] .form-field select {
  background: rgba(24, 32, 52, 0.6);
}

.form-field input:focus-visible,
.form-field select:focus-visible {
  outline: none;
  border-color: var(--admin-primary, #015B91);
  box-shadow: 0 0 0 2px rgba(1, 91, 145, 0.2);
}

.field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--admin-muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.field-with-button {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.field-with-button input {
  flex: 1;
}

.sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-muted);
  text-decoration: none;
}

.sort-toggle.is-active {
  color: var(--admin-primary, #015B91);
}

.sort-indicator {
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    grid-template-columns: 1fr;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
  }
}
