.admin-root {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 60px);
  background: var(--bg);
}
.admin-root.sidebar-collapsed {
  grid-template-columns: 56px 1fr;
}

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  transition: width 150ms;
}

.admin-sidebar-header {
  padding: 0 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.admin-sidebar-toggle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  transition: background 150ms, color 150ms;
  cursor: pointer;
}
.admin-sidebar-toggle:hover {
  background: var(--bg-card-alt);
  color: var(--white);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  flex: 1;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--light);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}
.admin-nav-item.active {
  background: rgba(255, 74, 28, 0.1);
  color: var(--white);
  font-weight: 600;
}
.admin-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.admin-nav-item.active svg {
  opacity: 1;
  color: var(--accent);
}
.sidebar-collapsed .admin-nav-item span {
  display: none;
}
.sidebar-collapsed .admin-sidebar-title {
  display: none;
}
.sidebar-collapsed .admin-sidebar-header {
  justify-content: center;
}
.sidebar-collapsed .admin-nav-item {
  justify-content: center;
  padding: 10px;
}

.admin-main {
  padding: 32px 40px 64px;
  max-width: 1200px;
  min-width: 0;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}
.admin-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms;
}
.admin-breadcrumb a:hover {
  color: var(--white);
}
.admin-breadcrumb .sep {
  color: var(--border);
}
.admin-breadcrumb .current {
  color: var(--light);
  font-weight: 500;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.admin-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  margin: 0;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.admin-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--stat-accent, var(--accent));
}
.admin-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}
.admin-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table thead {
  background: var(--bg-card-alt);
}
.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 150ms;
}
.admin-table th.sortable:hover {
  color: var(--light);
}
.admin-table th.sortable.active {
  color: var(--white);
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider-subtle);
  font-size: 14px;
  color: var(--light);
  vertical-align: middle;
}
.admin-table tbody tr {
  transition: background 150ms;
}
.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-search {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  width: 240px;
  outline: none;
  transition: border-color 150ms;
}
.admin-search:focus {
  border-color: rgba(255, 74, 28, 0.5);
}
.admin-search::placeholder {
  color: var(--muted);
}

.admin-select {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms;
}
.admin-select:focus {
  border-color: rgba(255, 74, 28, 0.5);
}

.admin-input {
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 150ms;
}
.admin-input:focus {
  border-color: rgba(255, 74, 28, 0.5);
}
.admin-input::placeholder {
  color: var(--muted);
}
.admin-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea.admin-input {
  resize: vertical;
  min-height: 80px;
}

select.admin-input {
  cursor: pointer;
  appearance: auto;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-field-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--light);
}
.admin-field-hint {
  font-size: 12px;
  color: var(--muted);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.admin-form-grid .full-width {
  grid-column: 1 / -1;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms, opacity 150ms;
  white-space: nowrap;
  border: 1px solid transparent;
}
.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-btn-primary {
  background: var(--accent);
  color: #0A0A0A;
  border-color: var(--accent);
}
.admin-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.admin-btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--border);
}
.admin-btn-secondary:hover:not(:disabled) {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.admin-btn-ghost {
  background: transparent;
  color: var(--light);
  padding: 6px 10px;
}
.admin-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

.admin-btn-danger {
  background: transparent;
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.admin-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
}

.admin-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--light);
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.admin-btn-icon:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-color: var(--muted);
}
.admin-btn-icon svg {
  width: 16px;
  height: 16px;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-chip-published {
  background: var(--accent-2-dim);
  color: var(--accent-2);
  border: 1px solid rgba(245, 192, 75, 0.3);
}
.admin-chip-draft {
  background: var(--bg-card-alt);
  color: var(--muted);
  border: 1px solid var(--border);
}
.admin-chip-admin {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(255, 74, 28, 0.3);
}
.admin-chip-member {
  background: var(--bg-card-alt);
  color: var(--light);
  border: 1px solid var(--border);
}
.admin-chip-info {
  background: rgba(122, 167, 255, 0.1);
  color: #7AA7FF;
  border: 1px solid rgba(122, 167, 255, 0.25);
}
.admin-chip-low {
  background: var(--accent-2-dim);
  color: var(--accent-2);
  border: 1px solid rgba(245, 192, 75, 0.3);
}
.admin-chip-high {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(255, 74, 28, 0.3);
}

.admin-progress-bar {
  width: 100%;
  max-width: 140px;
  height: 6px;
  background: var(--bg-card-alt);
  border-radius: 3px;
  overflow: hidden;
}
.admin-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.admin-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color 150ms;
  font-family: inherit;
}
.admin-tab:hover {
  color: var(--light);
}
.admin-tab.active {
  color: var(--white);
  font-weight: 600;
}
.admin-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: adminFadeIn 150ms ease;
}
.admin-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: adminSlideUp 200ms ease;
}
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.admin-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}
.admin-modal-body {
  padding: 24px;
}
.admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.admin-modal.wide {
  max-width: 640px;
}

@keyframes adminFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes adminSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.admin-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  color: var(--white);
  min-width: 280px;
  max-width: 420px;
  animation: adminToastIn 200ms ease;
}
.admin-toast.success {
  border-color: rgba(245, 192, 75, 0.3);
}
.admin-toast.success svg {
  color: var(--accent-2);
}
.admin-toast.error {
  border-color: rgba(239, 68, 68, 0.3);
}
.admin-toast.error svg {
  color: #ef4444;
}
.admin-toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
@keyframes adminToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-skeleton {
  background: linear-gradient(90deg, var(--bg-card-alt) 25%, var(--border) 50%, var(--bg-card-alt) 75%);
  background-size: 200% 100%;
  animation: adminShimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes adminShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.admin-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.admin-drop-zone:hover,
.admin-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(255, 74, 28, 0.04);
  color: var(--light);
}
.admin-drop-zone svg {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  opacity: 0.5;
}

.admin-upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 8px;
}
.admin-upload-preview img {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.admin-block-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-block-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 150ms;
}
.admin-block-item:hover {
  border-color: var(--muted);
}
.admin-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  cursor: grab;
}
.admin-block-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.admin-block-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.admin-block-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-block-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-block-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--light);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: background 150ms, color 150ms;
}
.admin-block-menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}
.admin-block-menu-item svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.admin-list-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-list-row .admin-input {
  flex: 1;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.admin-pagination-btns {
  display: flex;
  align-items: center;
  gap: 2px;
}
.admin-page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--light);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.admin-page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}
.admin-page-btn.active {
  background: var(--accent);
  color: #0A0A0A;
  border-color: var(--accent);
  font-weight: 600;
}
.admin-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.admin-switch {
  position: relative;
  width: 36px;
  height: 20px;
  appearance: none;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  flex-shrink: 0;
}
.admin-switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 150ms, background 150ms;
}
.admin-switch:checked {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.admin-switch:checked::after {
  transform: translateX(16px);
  background: var(--accent);
}

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

.admin-form-section {
  margin-bottom: 32px;
}
.admin-form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .admin-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .admin-nav-item.active {
  background: rgba(255, 74, 28, 0.08);
}
[data-theme="light"] .admin-sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .admin-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .admin-btn-secondary:hover:not(:disabled) {
  border-color: var(--muted);
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .admin-btn-ghost:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .admin-btn-icon:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--muted);
}
[data-theme="light"] .admin-page-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .admin-block-header {
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .admin-block-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .admin-modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .admin-modal {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .admin-toast {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .admin-drop-zone:hover,
[data-theme="light"] .admin-drop-zone.dragover {
  background: rgba(255, 74, 28, 0.04);
}
[data-theme="light"] .admin-chip-published {
  background: rgba(245, 192, 75, 0.1);
  border-color: rgba(245, 192, 75, 0.3);
}
[data-theme="light"] .admin-chip-admin {
  background: rgba(255, 74, 28, 0.08);
  border-color: rgba(255, 74, 28, 0.25);
}
[data-theme="light"] .admin-chip-info {
  background: rgba(59, 130, 246, 0.08);
  color: #2563EB;
  border-color: rgba(59, 130, 246, 0.25);
}
[data-theme="light"] .admin-chip-high {
  background: rgba(255, 74, 28, 0.08);
  border-color: rgba(255, 74, 28, 0.25);
}
[data-theme="light"] .admin-chip-low {
  background: rgba(245, 192, 75, 0.1);
  border-color: rgba(245, 192, 75, 0.3);
}
[data-theme="light"] .admin-btn-danger {
  border-color: rgba(239, 68, 68, 0.25);
}
[data-theme="light"] .admin-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.06);
}
[data-theme="light"] .admin-toast.success {
  border-color: rgba(245, 192, 75, 0.4);
}
[data-theme="light"] .admin-toast.error {
  border-color: rgba(239, 68, 68, 0.35);
}
