:root {
  --bg: #07111f;
  --bg-2: #0b1728;
  --panel: rgba(11, 20, 36, 0.72);
  --panel-border: rgba(117, 148, 190, 0.18);
  --text: #edf4ff;
  --muted: #9ba8c7;
  --line: rgba(138, 161, 196, 0.16);
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --gray: #94a3b8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(96, 165, 250, 0.1), transparent 28%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 240px;
  height: 240px;
  background: var(--blue);
  top: -50px;
  left: -40px;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: #1d4ed8;
  right: -100px;
  bottom: -80px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(8, 15, 28, 0.7);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(96, 165, 250, 0.08));
  border: 1px solid rgba(96, 165, 250, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  color: var(--muted);
  font-size: 14px;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.with-topbar {
  padding-top: 24px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.panel-login {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  overflow: hidden;
}

.panel-glow {
  position: absolute;
  inset: auto auto -120px -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(59,130,246,0.22), transparent 70%);
  pointer-events: none;
}

.login-header {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

.login-badge,
.section-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: #bcd6ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-header h1,
.section-title {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.05;
}

.login-header p,
.section-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  font-weight: 600;
  color: #c8d4ee;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(120, 145, 182, 0.18);
  background: rgba(8, 15, 28, 0.75);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: rgba(8, 15, 28, 0.9);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.28);
}

.btn-success {
  color: white;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  min-width: 84px;
}

.btn-danger {
  color: white;
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.btn-block {
  width: 100%;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
}

.flash-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.2);
  color: #9ef0b8;
}

.flash-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ffb1b1;
}

.flash-info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.2);
  color: #b8d4ff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sidebar-panel,
.content-panel {
  padding: 22px;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.file-pill {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 20, 36, 0.76);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: 0.15s ease;
}

.file-pill:hover,
.file-pill.active {
  color: var(--text);
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(18, 35, 64, 0.9);
}

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.stats-card {
  min-width: 110px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(10, 20, 36, 0.8);
  border: 1px solid var(--line);
  text-align: center;
}

.stats-number {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stats-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.table-shell {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(8, 15, 28, 0.38);
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.status-table thead th {
  text-align: left;
  padding: 16px 18px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b1bfdc;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 20, 36, 0.88);
}

.status-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(138, 161, 196, 0.08);
}

.status-table tbody tr:hover {
  background: rgba(18, 35, 64, 0.35);
}

.name-cell {
  font-weight: 600;
  color: #eff5ff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.status-undetected {
  color: #b7f7c9;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.2);
}

.status-updating {
  color: #ffe1a6;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.2);
}

.status-detected {
  color: #ffc0c0;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.2);
}

.status-frozen {
  color: #d2dae6;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.2);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-form select {
  min-width: 170px;
}

.empty-box,
.empty-inline {
  color: var(--muted);
  text-align: center;
}

.empty-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(8, 15, 28, 0.55);
  border: 1px dashed rgba(138, 161, 196, 0.16);
}

.empty-inline {
  padding: 24px 0;
}

strong {
  color: #fff;
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .content-header {
    flex-direction: column;
  }

  .topbar-inner {
    padding: 16px 18px;
  }

  .page-shell {
    padding: 18px 14px 30px;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .sidebar-panel,
  .content-panel,
  .panel-login {
    padding: 18px;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form select,
  .btn-success {
    width: 100%;
  }
}