@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #0b0d10;
  --bg-alt: #0f1318;
  --panel: #141a21;
  --panel-soft: rgba(20, 26, 33, 0.85);
  --accent: #fca311;
  --accent-2: #2ec4b6;
  --text: #f5f6f7;
  --muted: #9aa4b2;
  --stroke: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 20%, rgba(252, 163, 17, 0.12), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(46, 196, 182, 0.18), transparent 40%),
    linear-gradient(140deg, #07090c, #0e1218 55%, #0a0d12);
  min-height: 100vh;
}

.page {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  gap: 24px;
  padding: 24px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: var(--panel-soft);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(145deg, rgba(252, 163, 17, 0.9), rgba(255, 214, 102, 0.6));
  color: #111;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.topbar-controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.admin-pill {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(7, 10, 14, 0.7);
  color: var(--text);
  font-size: 13px;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input,
select {
  background: rgba(7, 10, 14, 0.7);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(252, 163, 17, 0.35);
}

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

.nav {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(252, 163, 17, 0.12);
  color: var(--text);
}

.nav-link.active {
  background: rgba(252, 163, 17, 0.2);
  color: var(--text);
  border: 1px solid rgba(252, 163, 17, 0.35);
}

.status-card {
  padding: 16px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--stroke);
}

.status-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.status-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill.success {
  background: rgba(46, 196, 182, 0.15);
  color: var(--accent-2);
}

.pill.error {
  background: rgba(239, 71, 111, 0.2);
  color: #ef476f;
}

.pill.neutral {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 40px;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 22px;
}

.grid {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

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

.card {
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 18px;
}

.kpi {
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(252, 163, 17, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi:hover::after {
  opacity: 1;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
}

.kpi-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

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

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

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

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.toggle input {
  width: 40px;
  height: 20px;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  color: var(--muted);
  font-weight: 600;
}

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #111;
}

.btn.accent {
  background: var(--accent-2);
  color: #0b0d10;
}

.btn.ghost {
  background: transparent;
  border-color: var(--stroke);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.log-card {
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  background: rgba(7, 10, 14, 0.75);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-card {
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

pre {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
}

[data-reveal] {
  animation: rise 0.6s ease both;
}

[data-reveal]:nth-of-type(1) {
  animation-delay: 0.04s;
}
[data-reveal]:nth-of-type(2) {
  animation-delay: 0.08s;
}
[data-reveal]:nth-of-type(3) {
  animation-delay: 0.12s;
}
[data-reveal]:nth-of-type(4) {
  animation-delay: 0.16s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px) {
  .page {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar-controls {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
