﻿:root {
  --red: #ef4444;
  --red-dark: #dc2626;
  --red-glow: rgba(239, 68, 68, 0.35);
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-light: #273449;
  --border: rgba(239, 68, 68, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --ok: #4ade80;
  --warn: #facc15;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Outfit", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

#sidebar::-webkit-scrollbar {
  display: none;
}

#sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
}

.page-wrap {
  position: relative;
  z-index: 2;
}

.logo-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 4px 16px var(--red-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.08em;
}

.brand-title {
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--red);
}

.brand-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.card-glow:hover {
  border-color: var(--border);
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.1);
}

.red-line {
  height: 2px;
  width: 74px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), transparent);
}

.inp,
select,
textarea {
  width: 100%;
  background: #0d172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-family: "DM Mono", monospace;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.inp:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.inp::placeholder {
  color: var(--muted);
}

.btn-shimmer,
.btn-ghost {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-shimmer {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 4px 18px var(--red-glow);
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  transition: left 0.45s;
}

.btn-shimmer:hover::after {
  left: 100%;
}

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

.btn-shimmer:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.btn-ghost:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--red);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-locked {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-paused {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.25);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 34px;
}

.login-halo {
  position: fixed;
  width: 640px;
  height: 640px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, transparent 72%);
  pointer-events: none;
}

.login-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.google-host {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.google-fallback {
  text-align: center;
  color: #fca5a5;
  font-size: 0.85rem;
  display: none;
}

#app-layout {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: 252px;
  background: var(--surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  transition: transform 0.25s ease;
}

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
}

#main {
  margin-left: 252px;
  width: calc(100% - 252px);
}

.nav-item {
  margin: 3px 8px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.2s;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.24);
}

.nav-item.logout {
  color: #f87171;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 22px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-inner {
  padding: 26px;
  max-width: 1080px;
}

.section-panel {
  display: none;
}

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

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

.stat-card {
  padding: 18px;
  background: linear-gradient(135deg, var(--surface), var(--surface-light));
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

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

.quick-item {
  padding: 16px;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface);
}

.quick-item:hover {
  border-color: var(--border);
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 0.43fr;
  gap: 18px;
}

.sid-box {
  background: #0d172a;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 14px;
  font-family: "DM Mono", monospace;
  color: #fca5a5;
  font-size: 0.9rem;
  word-break: break-word;
}

.code-help {
  background: #101a2f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  font-family: "DM Mono", monospace;
  color: #e2e8f0;
  font-size: 0.82rem;
  word-break: break-all;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

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

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.small-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.84rem;
  border: 1px solid;
  max-width: 300px;
}

.toast.ok {
  color: #86efac;
  background: #14532d;
  border-color: #4ade80;
}

.toast.err {
  color: #fecaca;
  background: #450a0a;
  border-color: #f87171;
}

.toast.info {
  color: #93c5fd;
  background: #1e3a5f;
  border-color: #60a5fa;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #sidebar-overlay.open {
    display: block;
  }

  #main {
    margin-left: 0;
    width: 100%;
  }

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

  .desktop-only {
    display: none !important;
  }

  .mobile-show {
    display: inline-flex !important;
  }
}

.mobile-show {
  display: none;
}
