:root {
  --vf-red: #e60000;
  --vf-dark-red: #b80000;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --success: #12805c;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(230, 0, 0, 0.12), transparent 28%),
    var(--bg);
}

a {
  color: var(--vf-red);
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

/* LOGIN PAGE */

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

.login-card,
.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.10);
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
}

.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
  text-align: center;
}

.login-logo {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 50px !important;
  object-fit: contain !important;
  display: block !important;
}

.login-title,
.login-title-center {
  text-align: center !important;
  width: 100% !important;
  display: block !important;
  font-size: 30px !important;
  font-weight: 900 !important;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 10px auto 0 auto;
}

.text-center {
  text-align: center;
}

.subtitle {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

.form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

label {
  display: block;
  font-weight: 650;
  font-size: 14px;
  margin-bottom: 7px;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  outline: none;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--vf-red);
  box-shadow: 0 0 0 4px rgba(230, 0, 0, 0.10);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--vf-red);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(230, 0, 0, 0.18);
}

.btn-primary:hover {
  background: var(--vf-dark-red);
}

.btn-light {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.error {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #ffccc7;
  padding: 12px 14px;
  border-radius: 14px;
  margin-top: 18px;
}

.success {
  background: #ecfdf3;
  color: var(--success);
  border: 1px solid #abefc6;
  padding: 12px 14px;
  border-radius: 14px;
}

/* OLD LOGO CLASSES - safe to keep if used elsewhere */

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 850;
  font-size: 28px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--vf-red);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

/* TOPBAR / ADMIN */

.topbar {
  background: var(--vf-red);
  color: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 10px;
  padding: 6px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
}

.nav-actions,
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Default topbar links */

.topbar-actions a,
.nav-actions a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.topbar-actions a:hover,
.nav-actions a:hover {
  text-decoration: underline;
}

/* Important: fixes Back / Logout buttons on red topbar */

.nav-actions a.btn-light,
.topbar-actions a.btn-light,
.nav-actions a.logout-link,
.topbar-actions a.logout-link,
a.logout-link {
  background: #ffffff !important;
  color: var(--vf-red) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  text-decoration: none !important;
  font-weight: 800 !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.nav-actions a.btn-light:hover,
.topbar-actions a.btn-light:hover,
.nav-actions a.logout-link:hover,
.topbar-actions a.logout-link:hover,
a.logout-link:hover {
  background: #fff1f1 !important;
  color: var(--vf-dark-red) !important;
  text-decoration: none !important;
}

/* MAIN LAYOUT */

.main {
  padding: 30px 0 60px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: start;
}

.card {
  padding: 22px;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge-on {
  background: #ecfdf3;
  color: var(--success);
}

.badge-off {
  background: #fef3f2;
  color: var(--danger);
}

.url-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 5px 7px;
  display: inline-block;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.stat strong {
  font-size: 26px;
  display: block;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  border-left: 4px solid var(--vf-red);
  padding: 12px 14px;
  background: #fafafa;
  border-radius: 12px;
}

.footer-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 18px;
}

/* RESPONSIVE */

@media (max-width: 860px) {
  .grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-row {
    flex-direction: column;
  }

  .login-card {
    padding: 28px 22px;
  }

  .login-logo {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 44px !important;
  }

  .login-title,
  .login-title-center {
    font-size: 26px !important;
  }

  .nav-actions,
  .topbar-actions {
    flex-wrap: wrap;
  }
}