/* Attendance Management System – v1.0.8
 * A scoped, reusable visual layer for all attendance portal pages.
 * The location generator also has a purpose-built structured form layout.
 * All styles stay inside the attendance portal / shortcode, not WordPress core.
 */
body.att-portal .att-portal-content,
.att-wrap {
  --ams-edge: var(--att-ui-line, #e1e7ee);
  --ams-surface: var(--att-ui-card, #fff);
  --ams-soft: var(--att-ui-soft, #f7f9fb);
  --ams-ink: var(--att-ui-text, #263243);
  --ams-muted: var(--att-ui-subtle, #617185);
  --ams-accent: var(--att-primary, #2f6b1f);
  --ams-focus: rgba(47, 107, 31, .16);
}
body.att-portal .att-portal-content .att-wrap,
.att-wrap {
  width: 100%;
  min-width: 0;
}
body.att-portal .att-portal-content .att-card,
.att-wrap .att-card {
  border: 1px solid var(--ams-edge) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 18px rgba(25, 44, 63, .035) !important;
}
body.att-portal .att-portal-content :is(.att-card,.att-section,.att-panel,.att-field,.att-grid,.att-grid-2,.att-grid-3,.att-grid-4),
.att-wrap :is(.att-card,.att-section,.att-panel,.att-field,.att-grid,.att-grid-2,.att-grid-3,.att-grid-4) {
  min-width: 0;
}
/* Consistent alignment and readable supporting text across existing forms. */
body.att-portal .att-portal-content .att-wrap :is(.att-input,.att-field input,.att-field select,.att-field textarea),
.att-wrap :is(.att-input,.att-field input,.att-field select,.att-field textarea) {
  max-width: 100%;
  border-radius: 10px !important;
  line-height: 1.4;
}
body.att-portal .att-portal-content :is(.att-field,.att-form) :is(.att-help,.description),
.att-wrap :is(.att-field,.att-form) :is(.att-help,.description) {
  margin-top: 5px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
body.att-portal .att-portal-content :is(.att-table-wrap,.att-table-responsive),
.att-wrap :is(.att-table-wrap,.att-table-responsive) {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 11px;
  -webkit-overflow-scrolling: touch;
}
body.att-portal .att-portal-content :is(.att-table,.att-mini-table) :is(th,td),
.att-wrap :is(.att-table,.att-mini-table) :is(th,td) {
  vertical-align: middle;
  line-height: 1.5;
}
body.att-portal .att-portal-content .att-wrap :is(button,.att-btn,.button):focus-visible,
.att-wrap :is(button,.att-btn,.button):focus-visible {
  outline: 3px solid var(--ams-focus) !important;
  outline-offset: 2px;
}
body.att-portal .att-portal-content :is(.att-actions,.att-card-actions),
.att-wrap :is(.att-actions,.att-card-actions) {
  flex-wrap: wrap;
  gap: 10px;
}
body.att-portal .att-portal-content :is(.att-form,.att-grid) > *,
.att-wrap :is(.att-form,.att-grid) > * {
  min-width: 0;
}
body.att-portal .att-portal-content :is(.att-acc,.att-settings-group),
.att-wrap :is(.att-acc,.att-settings-group) {
  border-radius: 12px;
}

/* Location Check-in – create slot workflow */
.att-wrap.att-location { padding-top: 3px !important; }
.att-location .att-loc-page-heading { margin: 0 0 16px !important; }
.att-location .att-loc-page-heading h1 { margin: 0 0 4px !important; }
.att-location .att-loc-page-heading p { margin: 0 !important; }
.att-location .att-loc-create-shell { padding: 0 !important; overflow: hidden; }
.att-location .att-loc-create-title,
.att-location .att-loc-sessions-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ams-edge);
}
.att-location .att-loc-create-title h2,
.att-location .att-loc-sessions-heading h2 {
  margin: 0 0 4px !important;
  font-size: 19px !important;
  font-weight: 600 !important;
  line-height: 1.35;
  color: var(--ams-ink) !important;
}
.att-location .att-loc-create-title p,
.att-location .att-loc-sessions-heading p {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--ams-muted) !important;
}
.att-location .att-loc-mode-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 6px 11px;
  border: 1px solid rgba(47, 107, 31, .23);
  border-radius: 999px;
  color: #2f6b1f;
  background: #f1f8ef;
  font-size: 12px !important;
  font-weight: 500;
  line-height: 1.3;
}
.att-location .att-loc-new-form { margin: 0 !important; }
.att-location .att-loc-section {
  padding: 22px 24px 24px;
  border-bottom: 1px solid var(--ams-edge);
}
.att-location .att-loc-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 19px;
}
.att-location .att-loc-section-number {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #edf5eb;
  border: 1px solid #d7e7d5;
  color: #276022;
  font-size: 13px !important;
  font-weight: 600;
}
.att-location .att-loc-section-head h3 {
  font-size: 17px !important;
  font-weight: 600 !important;
  margin: 0 0 3px !important;
  line-height: 1.4;
  color: var(--ams-ink) !important;
}
.att-location .att-loc-section-head p {
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--ams-muted) !important;
  margin: 0 !important;
}
.att-location .att-loc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px 20px;
}
.att-location .att-loc-fields > * { min-width: 0; }
.att-location .att-loc-span-full { grid-column: 1 / -1; }
.att-location .att-loc-field { display: flex; flex-direction: column; min-width: 0; }
.att-location .att-loc-field > .att-label {
  margin: 0 0 7px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: var(--ams-ink) !important;
}
.att-location .att-loc-field .att-input {
  height: 46px !important;
  min-height: 46px !important;
  padding: 11px 13px !important;
  font-size: 15px !important;
  border-radius: 10px !important;
  width: 100%;
}
.att-location .att-loc-field select.att-input { padding-right: 38px !important; }
.att-location .att-loc-field .att-help,
.att-location .att-loc-map-help {
  margin: 6px 0 0 !important;
  color: var(--ams-muted) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}
.att-location .att-optional { margin-left: 5px; font-weight: 400; color: var(--ams-muted); font-size: 12px !important; }
.att-location .att-required { color: #ba3b3b; }
.att-location .att-loc-toggle-field { align-self: stretch; }
.att-location .att-loc-option,
.att-location .att-loc-code-box {
  border: 1px solid var(--ams-edge);
  border-radius: 11px;
  padding: 15px 16px;
  background: var(--ams-soft);
  min-width: 0;
}
.att-location .att-loc-option { height: 100%; }
.att-location .att-loc-option .att-label { margin: 12px 0 6px !important; font-weight: 500 !important; font-size: 14px !important; }
.att-location .att-loc-option .att-help { margin-top: 7px !important; }
.att-location .att-loc-option .att-check,
.att-location .att-loc-code-box .att-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ams-ink) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  width: fit-content;
  max-width: 100%;
}
.att-location :is(.att-loc-option,.att-loc-code-box) .att-check input[type="checkbox"] {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  min-height: 17px !important;
  margin: 0 !important;
  flex: 0 0 17px;
  accent-color: var(--ams-accent);
}
.att-location .att-loc-gps-button { width: 100%; height: 46px !important; min-height: 46px !important; }
.att-location .att-loc-map-wrap { margin-top: 18px; }
.att-location .att-loc-map-title {
  display: flex;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 9px;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--ams-ink);
}
.att-location .att-loc-map-tip { font-size: 13px !important; font-weight: 400; color: var(--ams-muted); }
.att-location #attLocMap {
  height: clamp(275px, 30vw, 390px);
  border: 1px solid var(--ams-edge);
  border-radius: 12px;
  background: #eaf1f3;
}
.att-location .att-loc-feedback { margin-top: 7px; min-height: 0; overflow-wrap: anywhere; }
.att-location .att-loc-code-box { max-width: 780px; }
.att-location .att-loc-code-suboptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ams-edge);
}
.att-location .att-loc-code-suboptions.is-disabled { opacity: .55; }
.att-location .att-loc-code-suboptions .att-check { font-weight: 400 !important; }
.att-location .att-loc-code-suboptions small { font-size: 12px !important; }
.att-location .att-loc-form-actions {
  padding: 18px 24px;
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--ams-soft);
}
.att-location .att-loc-submit { min-height: 46px !important; padding: 11px 20px !important; }
.att-location .att-loc-form-actions #attLocSlotMsg { flex: 1 1 270px; margin: 0; overflow-wrap: anywhere; }
.att-location .att-loc-form-result { padding: 0 24px; }
.att-location .att-loc-form-result:not(:empty) { padding-top: 16px; padding-bottom: 18px; border-top: 1px solid var(--ams-edge); }
.att-location .att-loc-sessions-panel { padding: 0 24px 20px !important; margin-top: 18px !important; }
.att-location .att-loc-sessions-heading { margin: 0 -24px 18px; padding: 19px 24px; }
.att-location .att-archive-year-card,
.att-location .att-auto-close-card {
  margin: 0 0 12px !important;
  box-shadow: none !important;
  padding: 16px 18px !important;
  background: var(--ams-soft) !important;
}
.att-location .att-archive-year-card > div:first-child,
.att-location .att-auto-close-card > div:first-child { min-width: 0; }
.att-location #attLocActiveSlots { min-width: 0; margin-top: 12px; }
.att-location .att-modal-card { max-width: 950px; padding: 24px; }
.att-location #attLocEditForm > .att-grid:first-of-type { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px !important; }
.att-location #attLocEditForm > .att-grid:first-of-type > [style*="grid-column:1 / -1"] { grid-column: 1 / -1; }
.att-location #attLocEditForm .att-card { background: var(--ams-soft) !important; }
.att-location #attLocEditMap { height: 320px; }

/* Dark mode: let the new design panels follow the existing user preference. */
html.att-dark-mode body.att-portal .att-location .att-loc-mode-pill,
html.att-dark-mode body.att-portal .att-location .att-loc-section-number {
  color: #b8e0b9; background: #223c31; border-color: #466f53;
}
html.att-dark-mode body.att-portal .att-location :is(.att-loc-option,.att-loc-code-box,.att-loc-form-actions,.att-archive-year-card,.att-auto-close-card) {
  background: var(--att-dark-raised, #1e2d43) !important;
  border-color: var(--att-dark-edge, #32435c) !important;
}
html.att-dark-mode body.att-portal .att-location :is(.att-loc-create-title,.att-loc-sessions-heading,.att-loc-section,.att-loc-code-suboptions) {
  border-color: var(--att-dark-edge, #32435c) !important;
}
html.att-dark-mode body.att-portal .att-location :is(.att-loc-create-title h2,.att-loc-sessions-heading h2,.att-loc-section-head h3,.att-loc-map-title,.att-loc-option .att-check,.att-loc-code-box .att-check) {
  color: var(--att-dark-text, #eaf0fa) !important;
}
html.att-dark-mode body.att-portal .att-location :is(.att-loc-section-head p,.att-loc-create-title p,.att-loc-sessions-heading p,.att-loc-map-tip,.att-loc-field .att-help,.att-loc-map-help,.att-optional) {
  color: var(--att-dark-secondary, #adbed3) !important;
}

@media (max-width: 900px) {
  .att-location .att-loc-fields { gap: 15px; }
  .att-location .att-loc-create-title, .att-location .att-loc-sessions-heading, .att-location .att-loc-section { padding-left: 18px; padding-right: 18px; }
  .att-location .att-loc-sessions-panel { padding-left: 18px !important; padding-right: 18px !important; }
  .att-location .att-loc-sessions-heading { margin-left: -18px; margin-right: -18px; }
  .att-location .att-loc-form-actions { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 700px) {
  .att-location .att-loc-fields, .att-location .att-loc-code-suboptions { grid-template-columns: minmax(0, 1fr); }
  .att-location .att-loc-span-full { grid-column: auto; }
  .att-location .att-loc-section { padding-top: 18px; padding-bottom: 20px; }
  .att-location .att-loc-section-head { gap: 10px; margin-bottom: 15px; }
  .att-location .att-loc-section-number { width: 30px; height: 30px; flex-basis: 30px; }
  .att-location .att-loc-create-title h2 { font-size: 18px !important; }
  .att-location .att-loc-map-tip { width: 100%; }
  .att-location #attLocMap { height: 310px; }
  .att-location .att-loc-form-actions .att-loc-submit { width: 100%; }
  .att-location #attLocEditForm > .att-grid:first-of-type { grid-template-columns: minmax(0, 1fr) !important; }
  .att-location .att-modal-card { width: calc(100% - 20px); padding: 16px; }
  body.att-portal .att-portal-content :is(.att-actions,.att-card-actions) > *, .att-wrap :is(.att-actions,.att-card-actions) > * { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .att-location * { scroll-behavior: auto !important; }
}
/* The slot-opening action is the single primary action on this page. */
body.att-portal .att-portal-content .att-location .att-loc-submit,
.att-wrap.att-location .att-loc-submit {
  border-color: var(--ams-accent) !important;
  background: var(--ams-accent) !important;
  color: #fff !important;
  font-weight: 500 !important;
}
body.att-portal .att-portal-content .att-location .att-loc-submit:hover:not(:disabled),
.att-wrap.att-location .att-loc-submit:hover:not(:disabled) {
  background: #245b19 !important;
  border-color: #245b19 !important;
  color: #fff !important;
}
html.att-dark-mode body.att-portal .att-location .att-loc-submit {
  background: #397849 !important;
  border-color: #64a577 !important;
  color: #fff !important;
}
html.att-dark-mode body.att-portal .att-location .att-loc-submit:hover:not(:disabled) {
  background: #4a915d !important;
  border-color: #80c291 !important;
  color: #fff !important;
}
/* Guard against older theme styles reverting boxes to content-box. */
.att-wrap.att-location,
.att-wrap.att-location .att-loc-create-shell,
.att-wrap.att-location .att-loc-sessions-panel,
.att-wrap.att-location .att-loc-sessions-heading,
.att-wrap.att-location .att-loc-section,
.att-wrap.att-location .att-loc-form-actions,
.att-wrap.att-location .att-loc-fields,
.att-wrap.att-location .att-loc-field,
.att-wrap.att-location .att-loc-option {
  box-sizing: border-box !important;
}
.att-wrap.att-location .att-loc-create-shell,
.att-wrap.att-location .att-loc-sessions-panel {
  width: 100%;
  max-width: 100%;
}
/* Match the high-specificity historical button reset without affecting other buttons. */
body.att-portal .att-portal-content .att-location #attLocationSlotForm button.att-loc-submit,
.att-wrap.att-location #attLocationSlotForm button.att-loc-submit {
  background: var(--ams-accent, #2f6b1f) !important;
  border-color: var(--ams-accent, #2f6b1f) !important;
  color: #fff !important;
}
body.att-portal .att-portal-content .att-location #attLocationSlotForm button.att-loc-submit:hover:not(:disabled),
.att-wrap.att-location #attLocationSlotForm button.att-loc-submit:hover:not(:disabled) {
  background: #245b19 !important;
  border-color: #245b19 !important;
  color: #fff !important;
}
html.att-dark-mode body.att-portal .att-location #attLocationSlotForm button.att-loc-submit {
  background: #397849 !important;
  border-color: #64a577 !important;
  color: #fff !important;
}


/* v1.0.15 — Location Check-in page tabs (scoped to this shortcode). */
.att-wrap.att-location .att-loc-tabs {
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 6px;
  margin: 0 0 16px;
  width: 100%;
  min-width: 0;
  border-radius: 13px;
  border: 1px solid var(--ams-edge, #dce5e9);
  background: var(--ams-soft, #f3f6f8);
  box-sizing: border-box;
}
.att-wrap.att-location .att-loc-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: var(--ams-muted, #64748b) !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.att-wrap.att-location .att-loc-tab:hover:not(.is-active) {
  color: var(--ams-ink, #16212f) !important;
  background: rgba(47, 107, 31, .06) !important;
}
.att-wrap.att-location .att-loc-tab.is-active,
.att-wrap.att-location .att-loc-tab[aria-selected="true"] {
  color: var(--ams-primary, #2f6b1f) !important;
  background: var(--ams-panel, #fff) !important;
  border-color: var(--ams-edge, #dce5e9) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08) !important;
  font-weight: 600 !important;
}
.att-wrap.att-location .att-loc-tab:focus-visible {
  outline: 3px solid rgba(47, 107, 31, .45) !important;
  outline-offset: 2px;
}
.att-wrap.att-location .att-loc-tab-panel { min-width: 0; }
.att-wrap.att-location #attLocTabPanelCreate[hidden],
.att-wrap.att-location #attLocTabPanelActive[hidden],
.att-wrap.att-location .att-loc-tab-notice[hidden] { display: none !important; }
.att-wrap.att-location .att-loc-sessions-panel { margin-top: 0 !important; }
.att-wrap.att-location .att-loc-tab-notice:not([hidden]) {
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(47, 107, 31, .25);
  border-radius: 10px;
  color: var(--ams-primary, #2f6b1f);
  background: rgba(47, 107, 31, .06);
  font-size: 15px;
  line-height: 1.5;
}
html.att-dark-mode body.att-portal .att-location .att-loc-tabs {
  background: var(--att-dark-raised, #1e2d43) !important;
  border-color: var(--att-dark-edge, #32435c) !important;
}
html.att-dark-mode body.att-portal .att-location .att-loc-tab { color: var(--att-dark-secondary, #adbed3) !important; }
html.att-dark-mode body.att-portal .att-location .att-loc-tab.is-active,
html.att-dark-mode body.att-portal .att-location .att-loc-tab[aria-selected="true"] {
  background: var(--att-dark-panel, #192638) !important;
  color: #b8e0b9 !important;
  border-color: var(--att-dark-edge, #32435c) !important;
}
html.att-dark-mode body.att-portal .att-location .att-loc-tab-notice:not([hidden]) {
  color: #b8e0b9;
  background: #223c31;
  border-color: #466f53;
}
@media (max-width: 560px) {
  .att-wrap.att-location .att-loc-tabs { gap: 4px; padding: 4px; }
  .att-wrap.att-location .att-loc-tab { padding: 11px 8px; min-height: 48px; font-size: 14px !important; }
}
