:root,
[data-theme="dark"] {
  --bg1: #020617;
  --bg2: #020617;
  --ink: #e5e7eb;
  --muted: #9ca3af;
  --glass: rgba(15, 23, 42, 0.9);
  --outline: rgba(148, 163, 184, 0.4);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  --gold: #fde68a;
  --accent: #facc15;
  --navy: #1e293b;
  --line: rgba(148, 163, 184, 0.35);
  --success: #6ee7b7;
  --error: #fca5a5;
}

[data-theme="light"] {
  --bg1: #f8fafc;
  --bg2: #eef2f7;
  --ink: #0f172a;
  --muted: #64748b;
  --glass: rgba(255, 255, 255, 0.96);
  --outline: rgba(148, 163, 184, 0.55);
  --shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  --gold: #b45309;
  --accent: #ca8a04;
  --navy: #0f172a;
  --line: rgba(148, 163, 184, 0.45);
  --success: #047857;
  --error: #b91c1c;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background-color: #020617;
  background-image:
    radial-gradient(900px 700px at 10% 0, #0f172a 0, transparent 60%),
    radial-gradient(900px 700px at 90% 100%, #0b1120 0, transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  -webkit-tap-highlight-color: transparent;
}

[data-theme="light"] body {
  background:
    radial-gradient(900px 700px at 10% 0, #e2e8f0 0, transparent 60%),
    radial-gradient(900px 700px at 90% 100%, #dbeafe 0, transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

.shell {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px 32px;
}

.site-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hdr-title {
  margin: 0;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
}

.lead {
  color: var(--muted);
  font-size: clamp(12px, 3vw, 14px);
  margin: 6px 0 0;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--glass);
}

.admin-link:hover {
  border-color: #bfdbfe;
}

.switch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6));
  box-shadow: var(--shadow);
}

[data-theme="light"] .switch {
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.switch a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  opacity: 0.55;
  padding: 5px 8px;
  border-radius: 999px;
}

.switch a.active {
  opacity: 1;
  background: rgba(248, 250, 252, 0.1);
}

[data-theme="light"] .switch a.active {
  background: rgba(15, 23, 42, 0.08);
}

.card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
  border-radius: 22px;
  border: 1px solid var(--outline);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 14px;
  backdrop-filter: blur(12px);
}

[data-theme="light"] .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.section-title {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: clamp(18px, 3.6vw, 22px);
  color: var(--gold);
}

.section-sub {
  margin: 0 0 14px;
  color: #cbd5f5;
  font-size: 13px;
}

[data-theme="light"] .section-sub {
  color: var(--muted);
}

.wheel-wrap {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.wheel {
  position: relative;
  width: min(90vw, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(248, 250, 252, 0.15), transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(148, 163, 184, 0.18), transparent 55%),
    #020617;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: var(--shadow);
  --rot: 0deg;
}

.pointer {
  position: absolute;
  inset: -18px 0 auto 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 18px solid #e5e7eb;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
  z-index: 6;
}

.wheel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(var(--rot));
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}

.wheel path {
  cursor: pointer;
  transition: filter 0.3s, opacity 0.25s, stroke-width 0.3s;
  stroke: rgba(15, 23, 42, 0.9);
  stroke-width: 1;
  outline: none;
}

.wheel path:focus,
.wheel path:focus-visible {
  outline: none;
}

.wheel path.dim {
  filter: saturate(0.25) brightness(0.4);
  opacity: 0.4;
}

.wheel path.active {
  filter: brightness(1.12);
  stroke: #fef3c7;
  stroke-width: 3;
  paint-order: stroke fill;
}

.actors {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.slice-cap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(calc(var(--ang) + var(--rot))) translate(var(--r-center)) rotate(calc((var(--ang) + var(--rot)) * -1));
  font-size: 11px;
  color: #e5e7eb;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  text-align: center;
  line-height: 1.4;
  max-width: 90px;
  white-space: normal;
  word-break: break-word;
}

.center-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--outline);
  font-size: 12px;
  font-weight: 800;
  z-index: 5;
  text-align: center;
  min-width: 120px;
  max-width: 130px;
  line-height: 1.35;
}

.wheel-desc {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: #e5e7eb;
}

[data-theme="light"] .wheel-desc {
  color: var(--ink);
}

.svc-note {
  font-size: 13px;
  color: #cbd5f5;
  margin-bottom: 10px;
}

[data-theme="light"] .svc-note {
  color: var(--muted);
}

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

.svc-btn {
  border-radius: 14px;
  border: 1px solid var(--outline);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
  color: #e5e7eb;
  font-weight: 700;
  font-family: inherit;
  padding: 11px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  min-height: 54px;
}

[data-theme="light"] .svc-btn {
  background: linear-gradient(180deg, #fff, #f8fafc);
  color: var(--ink);
}

.svc-btn:hover {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 1px rgba(191, 219, 254, 0.5);
}

.svc-btn.active {
  border-color: #fde68a;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.7);
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.9), rgba(15, 23, 42, 0.95));
}

[data-theme="light"] .svc-btn.active {
  background: linear-gradient(180deg, #dbeafe, #eff6ff);
}

.svc-chosen {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  background: rgba(15, 23, 42, 0.9);
  font-size: 14px;
}

[data-theme="light"] .svc-chosen {
  background: #fff;
}

.badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 11px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
  margin-inline-start: 4px;
}

[data-theme="light"] .badge {
  color: var(--ink);
  background: #f1f5f9;
}

.form-grid {
  display: grid;
  gap: 10px;
}

label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 14px;
  font-family: inherit;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="search"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.optional-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.btn-main {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  background: #facc15;
  color: #1e293b;
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.25);
  min-width: 180px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost {
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: transparent;
  color: #e5e7eb;
  padding: 11px 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .btn-ghost {
  color: var(--ink);
}

.table-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 13px;
  color: #cbd5f5;
  font-weight: 800;
}

[data-theme="light"] .table-top {
  color: var(--muted);
}

.small-btn {
  border-radius: 10px;
  border: 1px solid var(--outline);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

[data-theme="light"] .small-btn {
  background: #fff;
  color: var(--ink);
}

.table-scroll {
  overflow: auto;
  max-height: 320px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

thead {
  background: rgba(15, 23, 42, 0.96);
}

[data-theme="light"] thead {
  background: #f1f5f9;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  text-align: center;
}

th {
  font-weight: 800;
  color: #e5e7eb;
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.98);
  z-index: 1;
}

[data-theme="light"] th {
  color: var(--ink);
  background: #f1f5f9;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.85);
}

[data-theme="light"] tbody tr:nth-child(even) {
  background: #f8fafc;
}

.site-footer {
  margin-top: 20px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

.notice {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.notice-success {
  border: 1px solid rgba(110, 231, 183, 0.4);
  background: rgba(6, 78, 59, 0.35);
  color: var(--success);
}

.notice-error {
  border: 1px solid rgba(252, 165, 165, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: var(--error);
}

[data-theme="light"] .notice-success {
  background: #ecfdf5;
}

[data-theme="light"] .notice-error {
  background: #fef2f2;
}

.error-list {
  margin: 0;
  padding-inline-start: 18px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

/* Admin */
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(20px, 3.5vw, 28px);
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.btn,
.btn-light {
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border: 0;
  background: #facc15;
  color: #1e293b;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-light {
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--ink);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  background: var(--glass);
}

.metric span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.metric strong {
  font-size: 24px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-row input,
.filter-row select {
  flex: 1;
  min-width: 160px;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table td,
.admin-table th {
  text-align: start;
}

.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-new {
  background: rgba(56, 189, 248, 0.2);
}

.status-reviewing {
  background: rgba(250, 204, 21, 0.25);
}

.status-approved {
  background: rgba(34, 197, 94, 0.25);
}

.status-rejected {
  background: rgba(248, 113, 113, 0.25);
}

.pagination {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.pagination a {
  color: #93c5fd;
  font-weight: 700;
}

[data-theme="light"] .pagination a {
  color: #2563eb;
}

.theme-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  background: var(--glass);
}

.theme-toggle-label {
  font-weight: 800;
  font-size: 13px;
}

.theme-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.card-inline {
  margin-top: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.detail-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.reference-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  background: var(--glass);
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-main,
  .btn-ghost {
    width: 100%;
  }
}
