:root {
  --bg-1: #0f1318;
  --bg-2: #1a2026;
  --accent: #f3d34a;
  --accent-2: #ffb21f;
  --ink: #e8edf2;
  --muted: #9aa7b5;
  --card: rgba(18, 22, 26, 0.86);
  --panel: rgba(17, 21, 26, 0.74);
  --border: rgba(255, 255, 255, 0.1);
  --chip: rgba(255, 255, 255, 0.06);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }

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

body.app-body,
body.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 75% 20%, rgba(255, 178, 31, 0.12), transparent 55%),
    radial-gradient(900px 700px at 10% 80%, rgba(80, 110, 140, 0.2), transparent 60%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.beam {
  position: fixed;
  inset: -80px;
  background: linear-gradient(110deg, transparent 40%, rgba(243, 211, 74, 0.16) 52%, transparent 64%);
  pointer-events: none;
  opacity: 0.68;
  z-index: 0;
}

.beam-strong {
  opacity: 0.76;
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 286px 1fr;
  min-height: 100vh;
  gap: 18px;
  padding: 18px;
}

.glass-panel,
.glass-card {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.sidebar {
  padding: 16px;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brand::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(243, 211, 74, 0.22);
}

.app-main {
  padding: 0;
}

.topbar {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-pill {
  border: 1px solid var(--border);
  background: rgba(17, 21, 26, 0.7);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
}

.page-title {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.page-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-nav-link {
  color: var(--muted);
  font-weight: 650;
  border-radius: 999px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.app-nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.app-nav-link.active {
  color: #171717;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(243, 211, 74, 0.22);
}

.metric {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 800;
}

.btn {
  border-radius: 10px;
  font-weight: 700;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #171717;
  border: 0;
}

.btn-accent:hover,
.btn-accent:focus {
  background: linear-gradient(135deg, #f7da57, #ffbd35);
  color: #121212;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-outline-danger {
  border-color: rgba(255, 107, 107, 0.38);
  color: #ffb3b3;
  background: rgba(255, 107, 107, 0.1);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  color: #141414;
  background: rgba(255, 107, 107, 0.58);
  border-color: rgba(255, 107, 107, 0.58);
}

.form-control,
.form-select {
  background: rgba(8, 12, 17, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.form-control:focus,
.form-select:focus {
  background: rgba(8, 12, 17, 0.95);
  color: #fff;
  border-color: rgba(243, 211, 74, 0.55);
  box-shadow: 0 0 0 .18rem rgba(243, 211, 74, .2);
}

.form-check-input {
  background-color: rgba(8, 12, 17, 0.86);
  border-color: rgba(255, 255, 255, 0.24);
}

.form-check-input:checked {
  background-color: #e5c84a;
  border-color: #e5c84a;
}

.alert {
  border-radius: 12px;
  border-width: 1px;
}

.alert-danger {
  color: #ffd1d1;
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.3);
}

.alert-success {
  color: #c8f7db;
  background: rgba(25, 135, 84, 0.18);
  border-color: rgba(25, 135, 84, 0.32);
}

.table-dark {
  --bs-table-color: var(--ink);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.01);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.045);
  --bs-table-border-color: rgba(255,255,255,0.06);
  border-collapse: separate;
  border-spacing: 0 10px;
}

.table-dark thead th {
  color: #f7f9fc;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  letter-spacing: 0.02em;
  font-size: 0.76rem;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.table-dark thead th:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.table-dark thead th:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.table-dark tbody tr {
  background: rgba(18, 22, 28, 0.7);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.table-dark tbody td {
  color: #e7edf4;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.84rem;
  padding-top: 0.82rem;
  padding-bottom: 0.82rem;
  vertical-align: middle;
}

.table-dark tbody tr td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

.table-dark tbody tr td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bg-secondary {
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.1);
}

.text-secondary {
  color: var(--muted) !important;
}

code,
pre {
  color: #f2de89;
}

.auth-wrap {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 2;
}

.auth-card {
  width: 100%;
  max-width: 760px;
  padding: clamp(22px, 3vw, 32px);
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 18, 0.48);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.auth-chip::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(243, 211, 74, 0.2);
}

.auth-title {
  font-size: clamp(1.5rem, 3.8vw, 2.7rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.auth-title-accent {
  color: #f2d04a;
}

.auth-subtitle {
  color: var(--muted);
  font-size: clamp(0.92rem, 1.8vw, 1.12rem);
}

.auth-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-meta-item {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(8, 12, 17, 0.56);
  padding: 14px;
}

.auth-meta-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

.auth-meta-value {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 800;
}

.auth-form-wrap {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: rgba(8, 12, 17, 0.52);
  padding: clamp(16px, 2.2vw, 24px);
}

.auth-form-title {
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.auth-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

  .auth-meta {
    grid-template-columns: 1fr;
  }
}
