.admin-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(700px 320px at 100% 0%, rgba(15, 118, 110, 0.12), transparent 55%),
    linear-gradient(180deg, #eef4f7, #f5f7fa 40%);
  font-family: "Outfit", system-ui, sans-serif;
  color: #12304a;
}
.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.admin-sidebar {
  background: linear-gradient(180deg, #0b3d4f, #0f5c6e);
  color: #c5e8ef;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-brand strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  color: #fff;
}
.admin-brand small { color: #9ec8d4; }
.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.admin-nav a {
  color: #c5e8ef;
  text-decoration: none;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-weight: 600;
}
.admin-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,0.14); color: #fff; }
.admin-side-foot {
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 0.85rem;
}
.admin-side-foot a { color: #9ec8d4; }
.admin-main { padding: 1.25rem 1.5rem 2rem; }
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.admin-top h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.65rem;
}
.admin-content { max-width: 1280px; }
.admin-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.admin-login-card {
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid #d7e3ef;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 18px 40px rgba(18, 48, 74, 0.08);
}
.admin-login-card h1 {
  margin: 0 0 0.25rem;
  font-family: "Fraunces", Georgia, serif;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.admin-stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.admin-stat {
  background: #fff;
  border: 1px solid #d7e3ef;
  border-radius: 14px;
  padding: 0.95rem 1rem;
}
.admin-stat.warn { border-color: #fcd34d; background: #fffbeb; }
.admin-stat.danger { border-color: #fda4af; background: #fff1f2; }
.admin-stat .label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #6a8094; }
.admin-stat .value { font-size: 1.35rem; font-weight: 800; margin-top: 0.2rem; }
.admin-stat .meta { font-size: 0.78rem; color: #6a8094; margin-top: 0.15rem; }
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}
.admin-alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.admin-alert.danger { background: #fff1f2; border: 1px solid #fda4af; color: #9f1239; }
.admin-alert.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.admin-alert a { font-weight: 700; }
.admin-attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.admin-attention-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e8eef4;
}
.admin-attention-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.admin-inline-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.admin-bars { display: flex; flex-direction: column; gap: 0.55rem; }
.admin-bar-row { display: grid; grid-template-columns: 42px 1fr 72px; gap: 0.5rem; align-items: center; }
.admin-bar-label { font-size: 0.78rem; font-weight: 700; color: #6a8094; }
.admin-bar-track { height: 10px; background: #e8eef4; border-radius: 999px; overflow: hidden; }
.admin-bar-fill { height: 100%; background: linear-gradient(90deg, #0f5c6e, #14b8a6); border-radius: 999px; }
.admin-bar-val { font-size: 0.78rem; font-weight: 700; text-align: right; }
.admin-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, 0.85fr)) auto auto;
  gap: 0.55rem;
  align-items: center;
}
.admin-filters input,
.admin-filters select {
  width: 100%;
  min-width: 0;
}
@media (max-width: 900px) {
  .admin-filters {
    grid-template-columns: 1fr 1fr;
  }
  .admin-filters input[type="search"] {
    grid-column: 1 / -1;
  }
}
.admin-centre-hero {
  background: #fff;
  border: 1px solid #d7e3ef;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-left: 5px solid #14b8a6;
}
.admin-centre-hero.health-expired,
.admin-centre-hero.health-suspended { border-left-color: #e11d48; }
.admin-centre-hero.health-expiring { border-left-color: #f59e0b; }
.admin-centre-hero.health-trial { border-left-color: #0284c7; }
.admin-centre-title { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.admin-centre-title h2 { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 1.35rem; }
.admin-stat-mini { display: flex; gap: 1.25rem; }
.admin-stat-mini .label { display: block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: #6a8094; }
.admin-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.admin-action-card {
  border: 1px solid #e2eaf2;
  border-radius: 12px;
  padding: 0.85rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-action-card h3 { margin: 0; font-size: 0.95rem; }
.admin-action-card label { font-size: 0.78rem; font-weight: 700; color: #6a8094; }
.admin-action-card input,
.admin-action-card select { width: 100%; }
.admin-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.admin-plan-card {
  background: #fff;
  border: 1px solid #d7e3ef;
  border-radius: 16px;
  padding: 1.1rem;
}
.admin-plan-card.is-inactive { opacity: 0.72; }
.admin-plan-card-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: start; }
.admin-plan-card h3 { margin: 0; font-family: "Fraunces", Georgia, serif; }
.admin-plan-price { font-size: 1.6rem; font-weight: 800; margin: 0.35rem 0; color: #0f5c6e; }
.admin-feature-list { margin: 0.5rem 0; padding-left: 1.1rem; font-size: 0.88rem; }
.admin-plan-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-suspended { background: #ffe4e6; color: #9f1239; }
.badge-trial { background: #e0f2fe; color: #0369a1; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-failed { background: #ffe4e6; color: #9f1239; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-expiring { background: #fef3c7; color: #b45309; }
.badge-expired { background: #ffe4e6; color: #9f1239; }
.admin-body .badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
}
.health-row-expired td:first-child,
.health-row-suspended td:first-child { box-shadow: inset 3px 0 0 #e11d48; }
.health-row-expiring td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }

/* CAD Centres list */
.admin-centres-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.admin-centres-head,
.admin-centre-row {
  display: grid;
  grid-template-columns: 36px minmax(160px, 1.5fr) minmax(90px, 0.7fr) minmax(110px, 0.85fr) minmax(90px, 0.7fr) minmax(100px, 0.75fr) auto;
  gap: 1rem 1.1rem;
  align-items: center;
  padding: 0.95rem 1.15rem;
}
.admin-centres-head {
  padding: 0.35rem 1.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6a8094;
}
.admin-centres-head .num,
.admin-centres-head .actions-col { text-align: right; }
.admin-centre-row {
  background: #fff;
  border: 1px solid #d7e3ef;
  border-radius: 14px;
  border-left: 4px solid #14b8a6;
  box-shadow: 0 8px 20px rgba(18, 48, 74, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-centre-row:hover {
  border-color: #b7cfe0;
  box-shadow: 0 10px 24px rgba(18, 48, 74, 0.07);
}
.admin-centre-row.health-expired,
.admin-centre-row.health-suspended { border-left-color: #e11d48; }
.admin-centre-row.health-expiring { border-left-color: #f59e0b; }
.badge-grace { background: #ffedd5; color: #c2410c; }
.admin-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  background: #fff;
  border: 1px solid #d7e3ef;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.75rem;
}
.admin-bulk-checkall {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.35rem;
}
.admin-quick-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.admin-tool-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.admin-tool-actions > * {
  border: 1px solid #e2eaf2;
  border-radius: 12px;
  padding: 0.85rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-tool-actions h3 { margin: 0; font-size: 0.95rem; }
.admin-tool-actions input { width: 100%; }
.hidden-form { display: none; }
.acr-check { display: flex; align-items: center; justify-content: center; }
.admin-centre-row.health-grace { border-left-color: #f97316; }

@media (max-width: 1100px) {
  .admin-tool-actions { grid-template-columns: 1fr; }
  .admin-centre-row {
    grid-template-columns: 36px 1fr 1fr;
  }
  .acr-centre { grid-column: 2 / -1; }
  .acr-check { grid-row: 1; }
}
.acr-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.acr-name {
  font-weight: 800;
  font-size: 1.02rem;
  color: #0f5c6e;
  text-decoration: none;
}
.acr-name:hover { text-decoration: underline; }
.acr-meta,
.acr-days,
.acr-status {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.8rem;
  color: #6a8094;
  line-height: 1.35;
}
.acr-plan strong,
.acr-expires strong,
.acr-paid strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #12304a;
}
.acr-days.is-soon { color: #b45309; font-weight: 700; }
.acr-days.is-late { color: #e11d48; font-weight: 700; }
.acr-health {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.acr-paid.num { text-align: right; font-variant-numeric: tabular-nums; }
.acr-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.acr-actions form { margin: 0; }
.badge-primary {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}
.admin-body .badge-ok { background: #d1fae5; color: #065f46; }
.admin-body .badge-primary { text-transform: none; letter-spacing: 0.02em; }

/* Shared admin tables (dashboard / payments) */
.admin-body table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.admin-body table.data-table th,
.admin-body table.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e8eef4;
}
.admin-body table.data-table th {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6a8094;
  background: #f4f8fb;
}
.admin-body table.data-table tbody tr:last-child td { border-bottom: 0; }
.admin-body table.data-table tbody tr:hover td { background: #f7fcfb; }

@media (max-width: 1100px) {
  .admin-stats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-action-grid { grid-template-columns: 1fr; }
  .admin-centres-head { display: none; }
  .admin-centre-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
  }
  .acr-centre { grid-column: 1 / -1; }
  .acr-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 0.35rem;
    border-top: 1px dashed #e2eaf2;
  }
  .acr-paid.num { text-align: left; }
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .admin-stats, .admin-stats-6 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .admin-centre-row { grid-template-columns: 1fr; }
}
