:root {
  --bg: #0b1020;
  --bg-soft: #111827;
  --panel: rgba(17, 24, 39, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.88);
  --card: rgba(19, 28, 46, 0.82);
  --text: #f8fbff;
  --text-soft: #c1c9db;
  --text-dim: #93a1bf;
  --border: rgba(148, 163, 184, 0.18);
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --pink: #f472b6;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow: 0 22px 45px rgba(15, 23, 42, 0.38);
  --radius: 22px;
}

body.light {
  --bg: #eef4ff;
  --bg-soft: #eaf0fd;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --card: rgba(255, 255, 255, 0.88);
  --text: #111827;
  --text-soft: #475569;
  --text-dim: #64748b;
  --border: rgba(148, 163, 184, 0.25);
  --shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.admin-auth-page,
.admin-dashboard {
  position: relative;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.3;
  pointer-events: none;
}

.orb-1 {
  width: 22rem;
  height: 22rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.7), rgba(6, 182, 212, 0.3));
  top: 5rem;
  left: -4rem;
}

.orb-2 {
  width: 28rem;
  height: 28rem;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.4), rgba(6, 182, 212, 0.2));
  right: -8rem;
  top: 10rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(490px, 100%);
  padding: 2rem;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  font-weight: 700;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.auth-subtitle {
  color: var(--text-soft);
  margin-bottom: 1.6rem;
}

.admin-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text-soft);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.2);
  color: var(--text);
  padding: 0.85rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.light input,
body.light select,
body.light textarea {
  background: rgba(255, 255, 255, 0.72);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(6, 182, 212, 0.7);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.08);
}

.error-text {
  min-height: 1rem;
  color: #fca5a5;
  font-size: 0.76rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 18px 30px rgba(139, 92, 246, 0.35);
}

.btn-secondary {
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
  color: var(--text);
}

.page-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  background: rgba(10, 15, 24, 0.42);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.sidebar-brand h2 {
  margin: 0;
}

.sidebar-nav {
  display: grid;
  gap: 0.65rem;
}

.nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.12));
  border-color: rgba(139, 92, 246, 0.18);
  color: var(--text);
}

.nav-item.danger {
  color: #fca5a5;
}

.main-panel {
  padding: 1.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  margin-bottom: 1.5rem;
  background: rgba(15, 23, 42, 0.3);
}

.theme-toggle {
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.panel-section {
  display: none;
}

.panel-section.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.2rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat-card h3 {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.stat-value {
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--text-soft);
  padding: 0.5rem 0.8rem;
}

.status-tab.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.14));
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--text);
}

.table-wrap {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  color: var(--text-soft);
  text-align: left;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

tbody td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge.new { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border-color: rgba(59,130,246,0.2); }
.badge.in-review { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border-color: rgba(245, 158, 11, 0.2); }
.badge.accepted { background: rgba(52, 211, 153, 0.12); color: #86efac; border-color: rgba(52, 211, 153, 0.2); }
.badge.rejected { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border-color: rgba(248, 113, 113, 0.2); }
.badge.completed { background: rgba(168, 85, 247, 0.12); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.2); }

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.small-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 0.45rem 0.75rem;
}

.small-btn.danger {
  color: #fca5a5;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(2, 6, 23, 0.72);
  z-index: 80;
}

.modal.is-open {
  display: grid;
}

.modal-content {
  position: relative;
  width: min(760px, calc(100% - 2rem));
  max-height: 85vh;
  overflow: auto;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 1.3rem;
}

.request-modal-content {
  width: min(640px, calc(100% - 2rem));
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}

.modal-header {
  margin-bottom: 1rem;
}

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

#projectForm,
.request-detail-content {
  display: grid;
  gap: 1rem;
}

.chip-input-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--text-soft);
  border: 1px solid rgba(139, 92, 246, 0.18);
}

.tech-chip button {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0;
  margin-left: 0.2rem;
}

#techInput {
  flex: 1 1 120px;
  min-width: 120px;
  border: none;
  background: transparent;
  padding: 0.2rem 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-row input {
  width: 1rem;
  height: 1rem;
}

.preview-image {
  margin-top: 0.6rem;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.hidden {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.request-detail-content .meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.meta-box {
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.75rem;
  z-index: 100;
}

.toast {
  min-width: 240px;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  box-shadow: var(--shadow);
}

.toast.success { border-color: rgba(52, 211, 153, 0.5); }
.toast.error { border-color: rgba(248, 113, 113, 0.52); }

.empty-state {
  padding: 1.5rem;
  color: var(--text-soft);
  text-align: center;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .stats-grid,
  .field-grid,
  .meta-row {
    grid-template-columns: 1fr;
  }

  .section-toolbar,
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-card {
    padding: 1.4rem;
  }
}
