:root {
  --navy: #06142f;
  --blue: #3e7bff;
  --line: #e0e6ef;
  --muted: #6c788d;
  --bg: #f5f7fb;
  --green: #22a875
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--bg);
  color: #12203a;
  font-family: Inter, Arial, sans-serif
}

.admin-nav {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, calc((100% - 1180px)/2));
  position: sticky;
  top: 0;
  z-index: 5
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--navy)
}

.brand span,
.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800
}

.brand small {
  font-size: 8px;
  letter-spacing: .15em;
  color: #8290a5
}

.admin-nav>div {
  display: flex;
  gap: 20px
}

.admin-nav a {
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: #536077
}

.admin-main {
  max-width: 1180px;
  margin: auto;
  padding: 45px 20px 70px
}

.heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .18em;
  font-weight: 800;
  color: #748198
}

.heading h1 {
  font-size: 42px;
  letter-spacing: -.04em;
  margin: 8px 0
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6
}

.export,
.filters button,
.login-card button {
  border: 0;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 13px 17px;
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 32px 0 18px
}

.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 20px 22px
}

.stats span {
  display: block;
  font-size: 10px;
  color: #7c879a;
  text-transform: uppercase;
  letter-spacing: .08em
}

.stats strong {
  font-size: 30px;
  display: block;
  margin-top: 8px
}

.filters {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 15px;
  display: flex;
  gap: 10px;
  margin-bottom: 18px
}

.filters input,
.filters select {
  border: 1px solid #d9e0eb;
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
  background: #fff
}

.filters input {
  flex: 1
}

.filters a {
  font-size: 12px;
  align-self: center;
  color: #637086;
  text-decoration: none;
  padding: 10px
}

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: auto
}

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

th,
td {
  text-align: left;
  padding: 15px;
  border-bottom: 1px solid #edf0f5;
  font-size: 11px;
  white-space: nowrap
}

th {
  background: #fafbfe;
  color: #7a8699;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em
}

td a {
  color: #315fb8
}

.pill {
  background: #eef3ff;
  color: #3d67c0;
  padding: 6px 9px;
  border-radius: 99px;
  font-weight: 700
}

.empty {
  text-align: center;
  padding: 50px;
  color: #8a95a7
}

.security-note {
  font-size: 10px;
  color: #7c8798;
  margin-top: 18px
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 80% 10%, #dfeaff, transparent 35%), var(--bg)
}

.login-card {
  width: min(420px, calc(100% - 30px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 35px;
  box-shadow: 0 25px 80px rgba(8, 25, 58, .12)
}

.login-card h1 {
  font-size: 32px;
  margin: 8px 0
}

.login-card form {
  display: grid;
  gap: 15px;
  margin: 25px 0
}

.login-card label {
  font-size: 11px;
  font-weight: 800;
  color: #637086
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid #d9e0eb;
  border-radius: 10px
}

.login-card button {
  width: 100%
}

.error {
  padding: 11px;
  border-radius: 9px;
  background: #fff0f0;
  color: #b73b3b;
  font-size: 11px;
  margin-top: 20px
}

.back {
  font-size: 11px;
  color: #66738a;
  text-decoration: none
}

@media(max-width:650px) {
  .heading {
    align-items: start;
    flex-direction: column
  }

  .stats {
    grid-template-columns: 1fr
  }

  .filters {
    flex-wrap: wrap
  }

  .filters input,
  .filters select {
    width: 100%
  }

  .export {
    width: 100%;
    text-align: center
  }
}


/* JIMMIND AI: visible admin login and footer download controls */
.admin-login-top {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 9999;
}

.admin-login-btn,
.footer-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .1px;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.admin-login-btn {
  color: #fff;
  background: rgba(10, 45, 90, .96);
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.admin-login-btn:hover,
.footer-download-btn:hover {
  transform: translateY(-2px);
  opacity: .94;
}

.footer-download-btn {
  color: #fff;
  background: #0a5a3b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
}

.footer-download {
  margin-top: 14px;
}

@media (max-width: 640px) {
  .admin-login-top {
    top: 12px;
    right: 12px;
  }

  .admin-login-btn {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

.db-error-banner{
  background:#fff4e6;
  border:1px solid #f2c98d;
  color:#8a5b12;
  padding:14px 18px;
  border-radius:12px;
  font-size:13px;
  font-weight:600;
  line-height:1.6;
  margin-bottom:20px;
}