:root {
  --bg: #050505;
  --bg2: #0c0505; /* Shifted from yellow-black to red-black */
  --panel: rgba(18, 8, 8, 0.86);
  --panel2: rgba(255,255,255,0.045);
  --red: #e62b2b; /* Replacing --gold */
  --red2: #ff4d4d; /* Replacing --gold2 */
  --red3: #9e1212; /* Replacing --gold3 */
  --text: #f7ecec; /* Shifted off-white to slightly cool/pinkish */
  --muted: #a89f9f;
  --danger: #ff4d4d;
  --success: #38d67a;
  --border: rgba(230, 43, 43, 0.22);
  --shadow: 0 24px 70px rgba(0,0,0,0.55);
  --radius: 22px;
  --sidebar: 280px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(230, 43, 43, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(158, 18, 18, 0.16), transparent 35%),
    linear-gradient(135deg, #030303, #0b0404 55%, #020202);
}

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

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

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.25;
}

.sidebar {
  position: fixed;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: var(--sidebar);
  padding: 18px;
  background: rgba(9, 5, 5, 0.86);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(230, 43, 43, 0.16), rgba(255,255,255,0.03));
  border: 1px solid rgba(230, 43, 43, 0.25);
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--red2), var(--red3));
  color: #ffffff;
  font-size: 25px;
  box-shadow: 0 12px 35px rgba(230, 43, 43, 0.26);
}

.brand h2,
.brand p {
  margin: 0;
}

.brand p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.nav a {
  padding: 12px 14px;
  border-radius: 16px;
  color: #f2dede;
  border: 1px solid transparent;
  transition: 0.18s ease;
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  background: rgba(230, 43, 43, 0.13);
  border-color: rgba(230, 43, 43, 0.25);
  transform: translateX(3px);
}

.nav a.danger-link {
  color: #ffd0d0;
  background: rgba(255,77,77,0.08);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
}

.sidebar-footer p {
  margin: 0;
  font-weight: 800;
}

.sidebar-footer small {
  color: var(--muted);
}

.main {
  margin-left: calc(var(--sidebar) + 36px);
  padding: 18px 24px 32px;
}

.topbar {
  min-height: 86px;
  background: rgba(9, 5, 5, 0.74);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 18px;
  z-index: 10;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar p {
  margin-top: 4px;
}

.mobile-menu {
  display: none;
  border: 0;
  background: rgba(230, 43, 43, 0.14);
  color: var(--red2);
  border-radius: 14px;
  padding: 10px 13px;
  font-size: 20px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.075);
  padding: 10px 12px;
  border-radius: 18px;
}

.user-card img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(230, 43, 43, 0.45);
}

.logout {
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 13px;
}

.content {
  margin-top: 24px;
}

.hero-panel {
  padding: 28px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(230, 43, 43, 0.17), rgba(255,255,255,0.035)),
    rgba(10, 4, 4, 0.75);
  border: 1px solid rgba(230, 43, 43, 0.25);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.hero-panel h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.eyebrow {
  color: var(--red2);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 900;
  font-size: 12px;
  margin: 0 0 10px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

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

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

.card,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card {
  padding: 20px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card.premium {
  background:
    linear-gradient(145deg, rgba(230, 43, 43, 0.08), transparent),
    rgba(15, 8, 8, 0.85);
}

.card.danger,
.danger-card {
  border-color: rgba(255,77,77,0.3);
  background:
    linear-gradient(145deg, rgba(255,77,77,0.11), transparent),
    rgba(15,8,8,0.85);
}

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

.stat-card {
  padding: 18px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(145deg, rgba(230, 43, 43, 0.13), rgba(255,255,255,0.035)),
    rgba(13, 7, 7, 0.84);
}

.stat-card span {
  color: var(--muted);
  font-weight: 800;
}

.stat-card b {
  font-size: 32px;
  color: var(--red2);
}

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

label {
  display: block;
  font-weight: 900;
  color: #f0d8d8;
  font-size: 13px;
  margin-bottom: 6px;
}

.input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(230, 43, 43, 0.26);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 15px;
  outline: none;
  margin-bottom: 14px;
}

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

.input::placeholder,
textarea::placeholder {
  color: rgba(247,236,236,0.45);
}

.input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 77, 77, 0.65);
  box-shadow: 0 0 0 4px rgba(230, 43, 43, 0.08);
}

.btn {
  border: 1px solid rgba(230, 43, 43, 0.35);
  padding: 11px 15px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.18s ease;
  min-height: 44px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

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

/* Kept class as 'gold' to not break your HTML, but styles are RED */
.btn.gold {
  background: linear-gradient(135deg, var(--red2), var(--red3));
  color: #ffffff;
  border: 0;
  box-shadow: 0 14px 35px rgba(230, 43, 43, 0.2);
}

.btn.ghost {
  background: rgba(255,255,255,0.055);
  color: var(--text);
}

.btn.danger {
  background: rgba(255,77,77,0.12);
  border-color: rgba(255,77,77,0.35);
  color: #ffd0d0;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar > div {
  min-width: 240px;
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(230, 43, 43, 0.16);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  vertical-align: top;
}

th {
  color: var(--red2);
  background: rgba(230, 43, 43, 0.08);
  font-size: 13px;
}

tr:hover td {
  background: rgba(255,255,255,0.025);
}

.risk,
.pill,
.badge,
.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

.risk.low,
.pill.success {
  color: #b8ffd4;
  background: rgba(56,214,122,0.12);
  border: 1px solid rgba(56,214,122,0.25);
}

.risk.medium {
  color: #ffe5a3;
  background: rgba(255,204,102,0.12);
  border: 1px solid rgba(255,204,102,0.25);
}

.risk.high,
.risk.critical,
.risk.extreme,
.pill.danger {
  color: #ffd0d0;
  background: rgba(255,77,77,0.13);
  border: 1px solid rgba(255,77,77,0.3);
}

.badge,
.pill {
  color: var(--red2);
  background: rgba(230, 43, 43, 0.13);
  border: 1px solid rgba(230, 43, 43, 0.28);
}

.owner-badge {
  margin-top: 4px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red2), var(--red3));
}

.notice {
  padding: 14px;
  border-radius: 17px;
  border: 1px solid rgba(255,204,102,0.3);
  background: rgba(255,204,102,0.08);
  margin: 14px 0;
}

.notice.success {
  border-color: rgba(56,214,122,0.3);
  background: rgba(56,214,122,0.09);
}

.notice.danger {
  border-color: rgba(255,77,77,0.35);
  background: rgba(255,77,77,0.1);
}

.mini-log {
  padding: 12px;
  border-radius: 14px;
  margin: 10px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(230, 43, 43, 0.18);
}

.mini-log.danger {
  border-color: rgba(255,80,80,0.35);
  background: rgba(255,80,80,0.06);
}

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

.login-card {
  width: min(560px, 100%);
  padding: 34px;
  border-radius: 32px;
  background: rgba(9, 5, 5, 0.84);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
}

.login-logo {
  width: 82px;
  height: 82px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--red2), var(--red3));
  display: grid;
  place-items: center;
  font-size: 42px;
  margin: 0 auto 16px;
  color: #ffffff;
}

.skeleton-card {
  height: 112px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(230, 43, 43, 0.08), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border: 1px solid rgba(230, 43, 43, 0.12);
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

code {
  display: block;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  color: var(--red2);
  border: 1px solid rgba(230, 43, 43, 0.22);
  overflow-x: auto;
}

@media (max-width: 1100px) {
  .grid.four,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-115%);
    transition: 0.2s ease;
    left: 12px;
    top: 12px;
    bottom: 12px;
  }

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

  .main {
    margin-left: 0;
    padding: 12px;
  }

  .mobile-menu {
    display: block;
  }

  .user-card {
    display: none;
  }

  .hero-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid.four,
  .grid.three {
    grid-template-columns: 1fr;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DATABASE CLEANER FIX
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.danger-glow {
  border-color: rgba(255, 77, 77, 0.28);
}

.action-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.clean-action {
  width: 100%;
  border: 1px solid rgba(230, 43, 43, 0.22);
  background:
    linear-gradient(135deg, rgba(230, 43, 43, 0.08), rgba(255,255,255,0.035)),
    rgba(15, 8, 8, 0.88);
  color: var(--text);
  border-radius: 18px;
  padding: 15px 16px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  display: block;
  min-height: 74px;
}

.clean-action span {
  display: block;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--text);
}

.clean-action small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.clean-action:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 77, 77, 0.48);
  background:
    linear-gradient(135deg, rgba(230, 43, 43, 0.15), rgba(255,255,255,0.04)),
    rgba(20, 8, 8, 0.92);
}

.clean-action.danger {
  border-color: rgba(255, 77, 77, 0.38);
  background:
    linear-gradient(135deg, rgba(255, 77, 77, 0.13), rgba(255,255,255,0.035)),
    rgba(18, 8, 8, 0.9);
}

.clean-action.danger span {
  color: #ffd6d6;
}

.clean-action.danger:hover {
  border-color: rgba(255, 77, 77, 0.6);
  background:
    linear-gradient(135deg, rgba(255, 77, 77, 0.2), rgba(255,255,255,0.035)),
    rgba(23, 8, 8, 0.95);
}

.clean-action.nuclear {
  border-color: rgba(255, 80, 80, 0.62);
  background:
    linear-gradient(135deg, rgba(255, 77, 77, 0.22), rgba(230, 43, 43, 0.06)),
    rgba(22, 5, 5, 0.95);
}

.clean-action.nuclear span {
  color: #ffb7b7;
}

.warning-box {
  padding: 15px;
  border-radius: 17px;
  border: 1px solid rgba(255, 204, 102, 0.32);
  background: rgba(255, 204, 102, 0.08);
  margin: 16px 0;
  color: var(--text);
}

.warning-box b {
  color: #ffe5a3;
}

.warning-box p {
  color: var(--text);
  margin-bottom: 0;
  line-height: 1.5;
}

.confirm-helper {
  margin-top: 18px;
  background: rgba(0,0,0,0.24);
  padding: 15px;
  border-radius: 17px;
  border: 1px solid rgba(255,255,255,0.08);
}

.confirm-helper p {
  margin: 12px 0 8px;
}

.confirm-helper code {
  margin-bottom: 10px;
}

.danger-input {
  border-color: rgba(255, 77, 77, 0.38) !important;
  background: rgba(255, 77, 77, 0.06) !important;
}

#noticeBox:empty {
  display: none;
}

#noticeBox .notice:empty {
  display: none;
}