.admin-header-actions{display:flex;align-items:center;gap:10px}

/* Password show/hide eye button positioning (2026-08-19) — the button
   markup (.password-toggle-btn[data-toggle-target], wired generically
   in admin.js) already existed on 7 of 8 admin password fields, but
   admin.html never loaded any CSS to place it INSIDE the field on the
   right side (that styling only ever existed in application.css, for
   the separate client app) — so it rendered unpositioned. Ports the
   same proven pattern here, scoped to admin.css only; application.css
   is untouched. */
.password-field-wrap{position:relative}
.password-field-wrap input{padding-right:42px}
.password-toggle-btn{
  position:absolute;top:0;right:0;bottom:0;
  width:40px;
  display:flex;align-items:center;justify-content:center;
  background:transparent;
  border:0;
  padding:0;
  color:#666;
  cursor:pointer;
}
.password-toggle-btn:hover,.password-toggle-btn:focus-visible{color:var(--green)}

/* Admin header mobile overflow fix (2026-08-19) — .intake-header is
   shared with intake.html, but only admin.html adds the extra Main
   Website link + Log out button inside .admin-header-actions, which
   pushed the header past narrow viewports since flex items don't wrap
   by default. Scoped entirely to admin.css (loaded only by admin.html,
   after intake.css) so intake.html's own header is completely
   unaffected. */
@media (max-width:480px){
  .intake-header{flex-wrap:wrap;row-gap:8px}
  .admin-header-actions{flex-wrap:wrap;justify-content:flex-end}
}
.admin-btn-ghost{
  border:1px solid rgba(255,255,255,.55);
  border-radius:999px;
  padding:9px 14px;
  background:transparent;
  color:white;
  font:inherit;
  font-size:.8rem;
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}
.admin-shell{max-width:960px}

.admin-auth-form{display:grid;gap:14px;max-width:420px}
.admin-auth-actions{display:flex;gap:10px;flex-wrap:wrap}
.admin-auth-actions button{
  border-radius:999px;
  padding:13px 22px;
  font-weight:900;
  border:1px solid var(--green);
  background:transparent;
  color:var(--green);
  cursor:pointer;
  font:inherit;
}

.admin-btn-ghost-inline{
  border:1px solid var(--green);
  border-radius:999px;
  padding:9px 16px;
  background:transparent;
  color:var(--green);
  font:inherit;
  font-size:.85rem;
  font-weight:900;
  cursor:pointer;
  margin-bottom:18px;
  text-decoration:none;
  display:inline-block;
}
.admin-btn-ghost-inline:hover{background:var(--warm)}

.admin-client-filters{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
  align-items:end;
  margin-bottom:16px;
}
.admin-client-filters .field{margin-bottom:0}
.admin-client-filters button{align-self:end}

.admin-readonly-block{margin-bottom:20px}
.admin-readonly-block .admin-raw-block{white-space:pre-wrap}

.admin-client-list{display:grid;gap:10px}
.admin-client-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border:1px solid #d8e3d3;
  border-radius:12px;
  background:var(--cream);
  cursor:pointer;
  flex-wrap:wrap;
}
.admin-client-row:hover{border-color:var(--green)}
.admin-client-row.selected{border-color:var(--green);background:var(--warm)}
.admin-client-row-name{font-weight:800;color:var(--text)}
.admin-client-row-meta{font-size:.8rem;color:var(--muted)}

.admin-status-badge{
  display:inline-block;
  padding:3px 10px;
  border-radius:999px;
  font-size:.72rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.admin-status-badge.draft{background:#eee;color:#555}
.admin-status-badge.approved{background:rgba(24,199,183,.2);color:#0b6b3d}
.admin-status-badge.published{background:rgba(168,241,45,.35);color:#0b6b3d}
.admin-status-badge.generated_pending_review{background:rgba(217,184,74,.3);color:#7a5b12}

/* BW6 Menu Generator — see admin.html #bw6GeneratorCard. */
.bw6-readonly-field{
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:8px 10px;
  background:#f5f8f1;
  border:1px solid #dfe6d5;
  border-radius:8px;
}
.bw6-readonly-field span{font-size:.72rem;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
.bw6-readonly-field strong{font-size:.95rem;color:var(--text)}
.bw6-validation-summary{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:6px;
  margin:10px 0;
}
.bw6-validation-row{
  display:flex;
  gap:6px;
  align-items:flex-start;
  font-size:.8rem;
  padding:5px 8px;
  border-radius:6px;
  background:#f5f8f1;
}
.bw6-validation-row.fail{background:rgba(217,84,74,.12);color:#8a2a1f}
.bw6-pdf-preview{
  width:100%;
  height:70vh;
  border:1px solid #dfe6d5;
  border-radius:8px;
  margin:10px 0;
}

/* Editable populated menu — see admin.html #bw6MenuEditContainer. One
   compact day-card per generated day, one labeled textarea per meal,
   pre-filled with what BW6 generated (never blank). */
.bw6-menu-edit-container{
  max-height:60vh;
  overflow-y:auto;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:10px;
  padding:10px;
  background:#f5f8f1;
  border:1px solid #dfe6d5;
  border-radius:8px;
  margin:10px 0;
}
.bw6-edit-day{
  background:white;
  border:1px solid #dfe6d5;
  border-radius:8px;
  padding:10px;
}
.bw6-edit-day h4{
  font-size:.85rem;
  color:var(--green);
  margin-bottom:6px;
}
.bw6-edit-meal{margin-bottom:6px}
.bw6-edit-meal label{
  display:block;
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:var(--muted);
  margin-bottom:2px;
}
.bw6-edit-meal textarea{
  width:100%;
  font-size:.78rem;
  font-family:inherit;
  border:1px solid #d8e3d3;
  border-radius:6px;
  padding:5px 7px;
  resize:vertical;
}

.registrations-table{width:100%;border-collapse:collapse}
.registrations-table th,
.registrations-table td{
  border:1px solid #d8e3d3;
  padding:8px;
  vertical-align:middle;
  text-align:left;
  font-size:.82rem;
  white-space:nowrap;
}
.registrations-table th{background:var(--warm);color:var(--green)}
.registrations-table td.registration-id-cell{font-weight:800;color:var(--text)}
.registrations-table td.admin-clickable-cell{cursor:pointer}
.registrations-table td.admin-clickable-cell:hover{background:var(--warm)}
.registrations-table select,
.registrations-table input{
  border:1px solid #d8e3d3;
  border-radius:6px;
  padding:6px;
  font:inherit;
  font-size:.8rem;
}
.registrations-table .registration-save-btn{
  border:1px solid var(--green);
  border-radius:999px;
  padding:6px 14px;
  background:transparent;
  color:var(--green);
  font:inherit;
  font-size:.78rem;
  font-weight:900;
  cursor:pointer;
}
.registrations-table .registration-save-btn:hover{background:var(--warm)}

.admin-preeval-details{margin-bottom:16px}
.admin-preeval-details summary{cursor:pointer;font-weight:800;color:var(--green)}

.admin-private-notes-heading{
  margin-top:28px;
  padding-top:18px;
  border-top:2px dashed var(--gold);
  color:var(--deep);
}
.admin-private-notes-heading + .card-hint{
  margin-top:-4px;
  margin-bottom:18px;
  font-style:italic;
}
.admin-sensitive-heading{
  border-top-color:var(--danger);
}
.admin-sensitive-heading + .card-hint{
  color:var(--danger);
  font-weight:700;
}
.admin-raw-block{
  background:var(--cream);
  border:1px solid #d8e3d3;
  border-radius:10px;
  padding:12px;
  font-size:.78rem;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:320px;
  overflow:auto;
  margin-top:8px;
}

.field-label-standalone{
  display:block;
  font-weight:700;
  font-size:.85rem;
  color:var(--text);
  margin:14px 0 6px;
}
.admin-file-list{display:grid;gap:8px;margin-bottom:16px}
.admin-file-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid #d8e3d3;
  border-radius:10px;
  background:var(--cream);
  flex-wrap:wrap;
}
.admin-file-name{font-size:.85rem;word-break:break-word}
.admin-file-list .admin-btn-ghost-inline{margin-bottom:0;flex-shrink:0}
.admin-file-empty{font-size:.82rem;color:var(--muted)}

.admin-photo-grid{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:16px}
.admin-photo-thumb{
  width:96px;
  height:96px;
  border:1px solid #d8e3d3;
  border-radius:10px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--cream);
  font-size:.7rem;
  color:var(--muted);
  text-align:center;
  cursor:default;
}
.admin-photo-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  cursor:pointer;
}
.admin-photo-thumb.error{color:var(--danger)}

/* Client Photos gallery (2026-08-12) — date-grouped, newest first;
   individual thumbnails reuse .admin-photo-thumb/.admin-photo-grid
   above unchanged. */
.admin-photo-gallery{margin-bottom:16px}
.admin-photo-date-group{margin-bottom:18px}
.admin-photo-date-heading{
  font-weight:800;
  font-size:.85rem;
  color:var(--green);
  margin:0 0 8px;
}
.admin-photo-date-group .admin-photo-grid{margin-bottom:0}

.admin-lightbox{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(3,28,22,.92);
  padding:26px;
}
.admin-lightbox[hidden]{display:none}
.admin-lightbox img{
  max-width:92vw;
  max-height:88vh;
  width:auto;
  height:auto;
  object-fit:contain;
  border-radius:12px;
  box-shadow:0 30px 80px rgba(0,0,0,.5);
}
.admin-lightbox-close{
  position:absolute;
  top:18px;
  right:22px;
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.4);
  background:rgba(255,255,255,.12);
  color:white;
  font-size:26px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.admin-lightbox-close:hover{background:rgba(255,255,255,.28)}

.menu-week-table-wrap{overflow-x:auto;margin-bottom:20px}
.menu-week-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
.menu-week-table th,
.menu-week-table td{
  border:1px solid #d8e3d3;
  padding:6px;
  vertical-align:top;
  text-align:left;
}
.menu-week-table th{
  background:var(--warm);
  color:var(--green);
  font-size:.8rem;
}
.menu-week-table td.menu-day-cell{
  font-weight:800;
  white-space:nowrap;
  width:70px;
}
.menu-week-table td.menu-calories-cell{width:90px}
.menu-week-table td.menu-calories-cell input{
  width:100%;
  border:1px solid #d8e3d3;
  border-radius:6px;
  padding:6px;
  font:inherit;
  font-size:.78rem;
}
.menu-week-table textarea{
  width:100%;
  min-height:70px;
  border:1px solid #d8e3d3;
  border-radius:6px;
  padding:6px;
  font:inherit;
  font-size:.78rem;
  resize:vertical;
}

.clinical-focus-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:8px;
  margin-bottom:16px;
}
.clinical-focus-option{
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border:1px solid #d8e3d3;
  border-radius:10px;
  background:var(--cream);
  font-size:.85rem;
  cursor:pointer;
}
.clinical-focus-option input{width:16px;height:16px;flex-shrink:0}

.calorie-quick-buttons{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.calorie-quick-btn{
  border:1px solid var(--green);
  border-radius:999px;
  padding:9px 16px;
  background:transparent;
  color:var(--green);
  font:inherit;
  font-size:.85rem;
  font-weight:900;
  cursor:pointer;
}
.calorie-quick-btn:hover{background:var(--warm)}
.calorie-quick-btn.selected{background:var(--green);color:white}

.supplement-schedule{display:grid;gap:10px;margin-bottom:14px}
.supplement-row{
  display:grid;
  grid-template-columns:2fr 1fr 1fr 1fr 1fr auto;
  gap:8px;
  align-items:center;
  padding:10px;
  border:1px solid #d8e3d3;
  border-radius:10px;
  background:var(--cream);
}
.supplement-row input,
.supplement-row select{
  border:1px solid #d8e3d3;
  border-radius:8px;
  padding:8px;
  font:inherit;
  font-size:.82rem;
  width:100%;
}
.supplement-row-remove{
  border:1px solid var(--danger);
  border-radius:999px;
  background:transparent;
  color:var(--danger);
  font-weight:900;
  cursor:pointer;
  padding:8px 12px;
}
@media (max-width:700px){
  .supplement-row{grid-template-columns:1fr 1fr}
}

.food-rules-list{display:grid;gap:10px;margin-bottom:14px}
.food-rule-row{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:8px;
  align-items:center;
  padding:10px;
  border:1px solid #d8e3d3;
  border-radius:10px;
  background:var(--cream);
}
.food-rule-row input{
  border:1px solid #d8e3d3;
  border-radius:8px;
  padding:8px;
  font:inherit;
  font-size:.85rem;
  width:100%;
}
@media (max-width:600px){
  .food-rule-row{grid-template-columns:1fr}
}

.admin-editor-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.admin-editor-actions button{
  border-radius:999px;
  padding:13px 22px;
  font-weight:900;
  border:1px solid var(--green);
  background:transparent;
  color:var(--green);
  cursor:pointer;
  font:inherit;
}
.admin-editor-actions button:disabled{opacity:.4;cursor:not-allowed}
.admin-btn-danger{
  border-radius:999px;
  padding:13px 22px;
  font-weight:900;
  border:1px solid var(--danger);
  background:transparent;
  color:var(--danger);
  cursor:pointer;
  font:inherit;
}
.admin-btn-danger:hover{background:rgba(220,53,69,.08)}
.admin-btn-danger:disabled{opacity:.35;cursor:not-allowed}

.admin-publish-row{
  margin-top:20px;
  padding-top:16px;
  border-top:1px solid #eef3ea;
}

.menu-print-only{display:none}

@media print{
  /* #clientDetailCard is the ENTIRE Nutrition Profile section — every
     private/admin-only field lives there (sex at birth, hormone
     therapy, hormone notes, scanner results, supplement info, etc.).
     It must never print, full stop. Everything in #menuEditorCard
     EXCEPT #menuPrintView is the live interactive editor (inputs,
     tables, buttons) — also hidden in print. #menuPrintView is a
     separate, plain, non-editable render of the current editor state
     (see admin.js renderPrintView(), called right before
     window.print()) — it alone becomes the client-facing PDF, and it
     alone is shown here. Using a dedicated print structure instead of
     printing the live <textarea> elements is what keeps the page
     structure reliable: a <textarea> can silently clip overflowing
     text when printed, plain flowed text cannot. */
  .intake-header,.intake-footer,#authCard,#notAdminCard,
  #clientListCard,.admin-client-list,#generateDraftBtn,
  .admin-editor-actions,.admin-publish-row,#menuStatusBadge,
  .admin-preeval-details,select#languageSelector,.admin-btn-ghost,
  #clientDetailCard,#menuListCard,
  #protocolLibraryCard,#protocolEditorCard,#clientRegistrationsCard,
  #menuEditorCard > h2,#menuEditorCard > .card-hint,
  #menuEditorCard > .admin-private-notes-heading,
  #menuEditorCard > .field-grid,#menuEditorCard > label.field,
  #menuEditorCard > label.consent-row,
  #supplementScheduleContainer,#addSupplementBtn,#menuGenerationSettingsBlock,
  #menuWeek1Container,#menuWeek2Container,
  #menuEditorStatus{
    display:none !important;
  }
  body{background:white}

  #menuPrintView{display:block}

  /* Page 1 (Client Summary) prints portrait at the default @page
     size. Page 2/3 (Week 1/2 tables) opt into a named landscape page
     via the "week-landscape" page name + the .print-page-landscape
     class below — more horizontal room for meal text, which is the
     whole point of the table layout. Supported in Chromium-based
     print/PDF (what Firebase Hosting visitors and printToPDF both
     use) via CSS Paged Media named pages. */
  @page{size:letter portrait;margin:0.5in}
  @page week-landscape{size:letter landscape;margin:0.4in}
  .print-page-landscape{page:week-landscape}

  .print-page{page-break-after:always}
  .print-page:last-child{page-break-after:auto}
  .print-page h1{font-size:1.3rem;color:var(--green);margin-bottom:10px}
  .print-page h2{font-size:1.05rem;color:var(--green);margin:14px 0 8px}
  .print-summary-row{margin-bottom:6px;font-size:.92rem}
  .print-summary-row strong{margin-right:4px}
  .print-list{margin:0 0 10px;padding-left:20px;font-size:.92rem}
  .print-week-table{width:100%;border-collapse:collapse;font-size:.85rem}
  .print-week-table th,.print-week-table td{
    border:1px solid #ccc;
    padding:6px 8px;
    text-align:left;
    vertical-align:top;
  }
  .print-week-table th{background:#f3f3f3}
  .print-week-table td.menu-day-cell{font-weight:800;white-space:nowrap}
  .print-week-table td.menu-calories-cell{font-weight:700;white-space:nowrap}
  .print-supplement-table{width:100%;border-collapse:collapse;font-size:.85rem;margin-bottom:10px}
  .print-supplement-table th,.print-supplement-table td{
    border:1px solid #ccc;
    padding:5px 7px;
    text-align:left;
  }
  .print-supplement-table th{background:#f3f3f3}
}

/* Admin-only account-management danger zone (2026-08-11) */
.admin-danger-zone{
  margin-top:28px;
  padding:16px 18px;
  border:1.5px solid var(--danger);
  border-radius:12px;
  background:#fdf3f3;
}
.admin-danger-zone-heading{
  color:var(--danger);
  margin:0 0 6px;
}
.admin-danger-btn{
  background:var(--danger);
  color:#fff;
  border:0;
  border-radius:10px;
  padding:11px 18px;
  font-weight:800;
  cursor:pointer;
}
.admin-danger-btn:hover{opacity:.9}

/* Required-field indicator (2026-08-15) — marks exactly the fields the
   BW6 generator's own missing-field validation already treats as
   mandatory (see admin.js loadBW6Panel's `missing` array), never
   optional fields. */
.required-asterisk{color:#c0392b;font-weight:800;margin-left:2px}

/* Account Management / Staff Authorization (2026-08-17). */
.admin-danger-zone-staffonly{
  color:#c0392b;font-weight:800;letter-spacing:.04em;
  text-transform:uppercase;font-size:.85rem;margin:-4px 0 8px;
}
.admin-account-mgmt-block{
  border-top:1px solid rgba(217,84,74,.25);
  margin-top:16px;padding-top:16px;
}
.admin-account-mgmt-block h4{margin:0 0 6px;color:#8a2a1f}
.app-modal-card{
  background:#fdf6f0;
  border-radius:14px;
  padding:26px 24px;
  max-width:420px;
  width:100%;
  box-shadow:0 18px 40px rgba(0,0,0,.4);
  text-align:left;
}
.app-modal-card h2{margin:0 0 10px;color:#8a2a1f;font-size:1.1rem}
.app-modal-card p{margin:0 0 14px;line-height:1.5;color:#1d1d1d}
.app-modal-card .button-row{display:flex;gap:10px;justify-content:flex-end;margin-top:6px}

/* Persistent Approve & Release success confirmation (2026-08-19) —
   deliberately high-contrast/bold so it can't be missed or mistaken for
   the smaller technical PDF/App/Email breakdown line above it. */
.bw6-approve-success-banner{
  margin-top:10px;padding:14px 16px;
  background:#e4f7e0;border:2px solid #2f7d32;border-radius:10px;
  color:#1e5b21;font-weight:800;font-size:1.02rem;
}
