:root {
  --bg: #0b0d12;
  --surface: #12151c;
  --card: #171a22;
  --card-soft: #1c2029;
  --line: rgba(244, 241, 236, 0.1);
  --line-strong: rgba(244, 241, 236, 0.18);
  --text: #f3efe8;
  --sub: #aaa5a0;
  --muted: #a39ea8;
  --teal: #00d4aa;
  --teal-soft: rgba(0, 212, 170, 0.12);
  --red: #ff625a;
  --shadow: rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.admin {
  min-height: 100vh;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.admin-header,
.brand,
.admin-live-card,
.tabs,
.panel-head,
.row-actions,
.auth-panel {
  display: flex;
  align-items: center;
}

.admin-header {
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  gap: 10px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.brand img {
  width: 32px;
  height: 32px;
}

.button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--text);
  background: var(--card);
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.tab:hover,
.row-actions button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.button.primary,
.tab.active,
.row-actions button.approve {
  border-color: var(--teal);
  background: var(--teal);
  color: #07110f;
}

.button.secondary {
  background: transparent;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: stretch;
  margin: 24px 0 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 30px;
  background: var(--surface);
  box-shadow: 0 18px 54px var(--shadow);
  animation: adminFadeUp 520ms ease both;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: clamp(38px, 5.6vw, 70px);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.admin-hero p,
.metric-card p,
.row p {
  color: var(--sub);
  line-height: 1.5;
}

.admin-live-card {
  min-width: 178px;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--card);
}

.admin-live-card strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--teal);
  animation: adminPulse 1800ms ease-in-out infinite;
}

small,
.muted {
  color: var(--muted);
  font-weight: 750;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--card);
  animation: adminFadeUp 520ms ease both;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.metric-card:nth-child(2) {
  animation-delay: 40ms;
}

.metric-card:nth-child(3) {
  animation-delay: 80ms;
}

.metric-card:nth-child(4) {
  animation-delay: 120ms;
}

.metric-card:nth-child(5) {
  animation-delay: 160ms;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--card-soft);
}

.metric-card.priority {
  border-color: rgba(0, 212, 170, 0.32);
}

.line-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 18px;
  color: var(--teal);
}

.metric-card small {
  display: block;
  min-height: 32px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.metric-card span,
.finance-grid span {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 900;
  letter-spacing: -0.06em;
}

.metric-card p {
  margin: 0;
  font-size: 13px;
}

.auth-panel {
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
  background: var(--surface);
  animation: adminFadeUp 520ms ease 120ms both;
}

.auth-panel input {
  min-width: min(100%, 240px);
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 15px;
  color: var(--text);
  background: var(--bg);
  font-weight: 750;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.auth-panel input:focus {
  border-color: var(--teal);
  background: var(--card);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 0;
  background: rgba(11, 13, 18, 0.88);
  backdrop-filter: blur(14px);
}

.tab,
select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--sub);
  background: var(--surface);
  font-weight: 850;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.panel {
  display: none;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 20px;
  background: var(--surface);
}

.panel.active {
  display: block;
  animation: adminFadeUp 300ms ease both;
}

.panel-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
}

.panel-note {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--sub);
  font-size: 14px;
  line-height: 1.45;
}

.row-list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--card);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.row:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--card-soft);
}

.row strong {
  display: block;
  margin-bottom: 5px;
}

.row p {
  margin: 0;
}

.row-actions {
  gap: 8px;
}

.row-actions button {
  min-width: 74px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 11px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.row-actions button.hide {
  color: var(--red);
}

.row-actions button.danger {
  border-color: rgba(255, 98, 90, 0.34);
  color: var(--red);
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.finance-grid article {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--card);
}

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

@keyframes adminPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1040px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100% - 24px, 1180px);
  }

  .admin-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .dashboard-grid,
  .finance-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .row {
    grid-template-columns: 1fr;
  }
}
