.admin-body {
  background: #f3f7fa;
  /* --navy-900 / --blue-700 / --teal-400 were referenced throughout this file
     but never defined anywhere in the stylesheets, so any text using them fell
     back (via inheritance) to the page's dark-theme --text color and became
     invisible on the admin dashboard's white/light backgrounds. Defining them
     here — scoped to .admin-body, which only wraps the /admin page — fixes
     every var(--navy-900)/var(--blue-700) usage below without touching the
     dark theme used by the public site or the admin login screen.
     --muted-on-light is a new, admin-only variable: the shared --muted color
     is tuned for dark backgrounds (login screen) and is too low-contrast on
     this page's light panels, so we use a darker value for muted/secondary
     text here instead of redefining --muted globally. */
  --navy-900: #16233a;
  --blue-700: #1d5fae;
  --teal-400: #14b8a6;
  --muted-on-light: #55677c;
}
.admin-main { min-height: calc(100vh - 72px); }

/* Scoped header polish — only affects the admin page, never other pages (styles.css untouched) */
.admin-body .header-inner { justify-content: space-between; min-height: 72px; }
.admin-body .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.admin-body .brand-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; background: #fff; padding: 4px; }
.admin-body .admin-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--border-strong, rgba(96,165,250,.35));
  background: rgba(59, 130, 246, .08);
  font-size: 13px; text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.admin-body .admin-link:hover { color: var(--accent-dim, #1d4ed8); border-color: var(--accent, #2563eb); background: rgba(59, 130, 246, .14); }

/* ---------- Admin login — premium enterprise redesign ---------- */
.admin-login-wrap {
  height: calc(100vh - 72px);
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  grid-template-rows: minmax(0, 1fr);
  background:
    radial-gradient(circle at 12% 8%, rgba(59, 130, 246, .14), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(59, 130, 246, .10), transparent 40%),
    var(--bg, #f4f7fb);
}

.admin-login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 44px;
  overflow: hidden;
  background: var(--panel, #ffffff);
  border-right: 1px solid var(--border, rgba(15,23,42,.08));
}
.visual-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  filter: saturate(1.05) contrast(1.04);
  animation: photo-in 1.1s ease both;
}
@keyframes photo-in { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: none; } }
.visual-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(15,23,42,.02) 55%, rgba(15,23,42,.14) 100%),
    radial-gradient(circle at 88% 10%, rgba(37,99,235,.10), transparent 45%);
}

.visual-badge {
  position: relative; z-index: 1;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; border-radius: 16px;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--border, rgba(15,23,42,.08));
  box-shadow: 0 18px 40px rgba(15,23,42,.14);
  backdrop-filter: blur(14px);
}
.visual-badge-icon { flex: none; width: 22px; height: 22px; color: var(--accent, #2563eb); }
.visual-badge-icon svg { width: 100%; height: 100%; }
.visual-badge strong { display: block; color: var(--text, #0f172a); font-size: 14px; margin-bottom: 4px; }
.visual-badge p { margin: 0; color: var(--muted, #64748b); font-size: 13px; line-height: 1.5; }

.admin-login-card-wrap { display: grid; place-items: center; padding: 40px 24px; min-height: 0; overflow-y: auto; }
.admin-login-card {
  position: relative;
  width: min(100%, 460px);
  padding: 38px 34px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--border, rgba(15,23,42,.08));
  box-shadow: 0 30px 80px rgba(15, 23, 42, .12);
  backdrop-filter: blur(18px);
  animation: card-in .5s ease both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.admin-login-card .eyebrow { display: block; margin-bottom: 6px; }
.admin-login-card h1 { margin: 8px 0 10px; color: var(--text, #f1f5f9); font-size: 32px; line-height: 1.15; }
.admin-login-card > p { color: var(--muted, #8b98ab); margin: 0; }
.admin-login-card form { display: grid; gap: 18px; margin-top: 26px; }
.input-icon-wrap { position: relative; display: block; }
.input-icon-wrap .input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted, #8b98ab); pointer-events: none; }
.input-icon-wrap input { padding-left: 40px; }
.admin-login-card .btn-large { width: 100%; margin-top: 4px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin-top: 26px; color: var(--muted-2, #64748b); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border, rgba(148,163,184,.14)); }
.login-footnote { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; color: var(--muted, #8b98ab); }
.login-footnote svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--accent-2, #60a5fa); }
.login-footnote small { display: block; color: var(--muted, #8b98ab); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .visual-photo, .admin-login-card { animation: none; }
}
@media (max-width: 980px) {
  .admin-login-wrap { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 72px); }
  .admin-login-visual { display: none; }
  .admin-login-card-wrap { padding: 32px 18px; }
}
@media (max-width: 480px) {
  .admin-login-card { padding: 28px 22px; }
  .admin-login-card h1 { font-size: 27px; }
}
.admin-dashboard { padding-block: 42px 80px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.admin-heading h1 { margin: 7px 0 5px; color: var(--navy-900); font-size: 46px; }
.admin-heading p { color: var(--muted-on-light); margin: 0; }
.admin-heading .eyebrow { color: var(--blue-700); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.admin-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.admin-kpi { padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(20,54,83,.05); }
.admin-kpi span { display: block; color: var(--muted-on-light); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.admin-kpi strong { display: block; margin-top: 7px; color: var(--navy-900); font-size: 29px; line-height: 1.15; }
.admin-panel { overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 32px rgba(20,54,83,.06); }
.admin-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 22px; border-bottom: 1px solid var(--line); }
.admin-panel-heading h2 { margin: 0; color: var(--navy-900); }
.admin-panel-heading p { margin: 3px 0 0; color: var(--muted-on-light); font-size: 13px; }
.admin-filters { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 1fr)); gap: 8px; width: min(100%, 860px); }
.admin-filters input, .admin-filters select { padding: 9px 10px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 1100px; }
.admin-table th, .admin-table td { padding: 13px 14px; border-bottom: 1px solid #edf2f6; text-align: left; vertical-align: top; font-size: 12px; }
.admin-table th { background: #f7fafc; color: var(--muted-on-light); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.admin-table tbody tr:hover { background: #fbfefe; }
/* Base readable color for plain table-cell text (e.g. Industry, Mode, Date,
   Name, Company, Message) that isn't wrapped in <strong>/<small> and was
   previously left to inherit the page's light --text color. Applies to both
   the Assessments and Enquiries tables since they share this markup. */
.admin-table td { color: var(--navy-900); }
.admin-table strong { display: block; color: var(--navy-900); font-size: 13px; }
.admin-table small { color: var(--muted-on-light); }
.score-chip, .priority-chip, .status-chip { display: inline-flex; border-radius: 999px; padding: 5px 8px; font-weight: 800; font-size: 10px; white-space: nowrap; }
.score-chip { background: #e9f7fb; color: #075d8a; }
.priority-chip.high { background: #fff0f2; color: #a21d37; }
.priority-chip.medium { background: #fff7e8; color: #9a5b04; }
.priority-chip.nurture { background: #eef3f6; color: #4e6070; }
.status-chip { background: #eaf8f8; color: #08766f; }
.view-button { border: 1px solid #aac0d2; border-radius: 9px; background: #fff; color: var(--blue-700); padding: 6px 9px; cursor: pointer; font-weight: 750; }
.empty-state { padding: 45px; text-align: center; color: var(--muted-on-light); }
.detail-dialog { width: min(920px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 35px 100px rgba(5,24,50,.35); }
.detail-dialog::backdrop { background: rgba(3,17,39,.62); backdrop-filter: blur(4px); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 22px 25px; background: #fff; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 5px 0 0; color: var(--navy-900); }
.dialog-header .eyebrow { color: var(--blue-700); }
.dialog-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy-900); font-size: 25px; cursor: pointer; }
/* Base readable color for the dialog body: fixes plain text nodes that have
   no color of their own (e.g. the email/date text next to each detail-item's
   <strong>, the dimension-score numbers, and the "Next-best action" text) —
   they previously inherited the page's light --text color. More specific
   rules below (.detail-item span, .detail-list) still override this. */
.detail-content { padding: 25px; background: #f7fafc; color: var(--navy-900); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.detail-item { padding: 13px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.detail-item span { display: block; color: var(--muted-on-light); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.detail-item strong { display: block; margin-top: 4px; color: var(--navy-900); }
.detail-section { margin-top: 22px; }
.detail-section h3 { color: var(--navy-900); }
.detail-bars { display: grid; gap: 10px; }
.detail-bar { display: grid; grid-template-columns: 240px 1fr 45px; gap: 12px; align-items: center; font-size: 12px; }
.detail-bar-track { height: 7px; background: #e5edf3; border-radius: 999px; overflow: hidden; }
.detail-bar-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-700), var(--teal-400)); }
.detail-list { margin: 0; padding-left: 18px; color: var(--muted-on-light); }
.detail-list li { margin-bottom: 7px; }
.detail-update-form { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 25px; background: #fff; border-top: 1px solid var(--line); }
.detail-update-form label { color: var(--navy-900); }
.dialog-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; }
.danger-button { color: #a21d37; border-color: #e3aab4; background: #fff; }

@media (max-width: 1050px) {
  .admin-heading, .admin-panel-heading { align-items: stretch; flex-direction: column; }
  .admin-filters { width: 100%; grid-template-columns: repeat(2, 1fr); }
  .admin-filters input { grid-column: 1 / -1; }
  .admin-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .admin-heading h1 { font-size: 36px; }
  .admin-kpis, .admin-filters, .detail-grid, .detail-update-form { grid-template-columns: 1fr; }
  .detail-update-form .dialog-actions { grid-column: 1; }
  .detail-bar { grid-template-columns: 1fr 42px; }
  .detail-bar-track { grid-column: 1 / -1; grid-row: 2; }
}
