/* Admin */
.admin-body {
  min-height: 100vh;
  background: #f9fafb;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 14px 32px;
}

.admin-brand {
  color: #111827;
  font-family: Outfit, sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-nav a,
.admin-link-button {
  border: 0;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
}

.admin-muted {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 400;
}

.admin-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px;
}

.admin-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-page-title h1,
.admin-card h1,
.admin-form h2 {
  margin: 0;
  color: #111827;
  font-family: Outfit, sans-serif;
}

.admin-form h2 {
  margin-top: 28px;
  font-size: 1.1rem;
}

.admin-card,
.admin-table {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-card {
  margin-bottom: 16px;
  padding: 20px;
}

.admin-login {
  max-width: 420px;
  margin: 80px auto;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
}

.admin-checkbox {
  flex-direction: row !important;
  align-items: center;
}

.admin-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  padding: 10px 12px;
}

.admin-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.admin-code-input-group {
  display: flex;
  align-items: stretch;
  width: 220px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.admin-code-input-group .admin-code-input {
  flex: 1;
  width: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-code-input-group .admin-code-input:focus {
  outline: none;
}

.admin-code-input-group .admin-small-button {
  flex-shrink: 0;
  border: 0;
  border-left: 1px solid #1f2937;
  border-radius: 0;
  padding: 0 16px;
  transition: background-color 0.15s ease;
}

.admin-code-input-group .admin-small-button.is-copied {
  background: #15803d;
  border-left-color: #15803d;
  color: #ffffff;
}

.admin-button,
.admin-small-button,
.admin-secondary-button,
.admin-remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.admin-button,
.admin-small-button {
  border: 0;
  background: #111827;
  color: #ffffff;
}

.admin-button {
  padding: 10px 18px;
}

.admin-small-button {
  padding: 7px 10px;
  font-size: 0.8rem;
}

.admin-secondary-button,
.admin-remove-button {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  padding: 9px 14px;
}

.admin-remove-button {
  width: fit-content;
  border-color: #fecaca;
  color: #991b1b;
}

.admin-form-actions,
.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-form-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.admin-section-title-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.admin-dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-dynamic-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  padding: 16px;
}

.admin-dynamic-row[hidden] {
  display: none;
}

[data-admin-items] > .admin-dynamic-row.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

[data-admin-items] > .admin-dynamic-row {
  transition: transform 0.15s ease;
}

.admin-text-row-label {
  margin: 0;
  color: #111827;
  font-size: 0.875rem;
  font-weight: 700;
}

.admin-drag-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: grab;
  user-select: none;
}

.admin-drag-handle:active {
  cursor: grabbing;
}

.admin-row-kind {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.admin-row-kind-text {
  background: #ede9fe;
  color: #6d28d9;
}

.admin-row-kind-field {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-locale-tabs {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.admin-locale-tab-buttons {
  display: flex;
  gap: 2px;
  background: #f3f4f6;
  padding: 4px;
}

.admin-locale-tab-button {
  flex: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  cursor: pointer;
}

.admin-locale-tab-button.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.admin-locale-tab-panel {
  padding: 12px;
}

.admin-locale-tab-panel[hidden] {
  display: none;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 14px;
  text-align: left;
}

.admin-table th {
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.75rem;
  text-transform: uppercase;
}

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

.admin-table-actions-group {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.admin-flash {
  max-width: 1120px;
  margin: 16px auto 0;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 10px 14px;
}

.admin-flash-alert {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.admin-stat-label {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-stat-value {
  margin-top: 4px;
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

.admin-log-list {
  margin-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.admin-log-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #f3f4f6;
  padding: 12px 0;
  font-size: 0.9rem;
}

.admin-log-row span,
.admin-log-row time {
  color: #6b7280;
}

.admin-danger-button {
  background: #991b1b;
}

@media (max-width: 900px) {
  .admin-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }
}
