/**
 * NCPA dashboard shell — shared layout matching collegiate profile (.main / .menu / .page).
 * Used by junior shell; collegiate profile.css duplicates these (legacy) — keep in sync when editing shell.
 */
@import url('ncpa-dash-tokens.css');

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--ncpa-font-chrome);
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  background-color: var(--ncpa-page-bg);
}

button,
input,
select,
textarea {
  font-family: var(--ncpa-font-chrome);
}

/* ----- App shell ----- */
.main {
  width: 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  transition: ease-in-out 0.3s;
}

.profile-main-column {
  flex: 1 1 0%;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-main-column .page {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  box-sizing: border-box;
  padding: var(--ncpa-page-padding);
  overflow-y: auto;
  overflow-x: hidden;
}

.ncpa-dash-content {
  max-width: var(--ncpa-content-max);
}

/* ----- Sidebar (.menu) ----- */
.menu {
  height: 100%;
  width: var(--ncpa-menu-width);
  flex: 0 0 var(--ncpa-menu-width);
  min-width: 0;
  background-color: var(--ncpa-menu-bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

.menu .header {
  width: 100%;
  flex-shrink: 0;
  min-height: 5em;
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem 0.75rem;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu .header div.logo {
  width: 100%;
  min-height: 3.5rem;
  max-height: 4.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.menu .header div.logo img {
  width: 65%;
  max-height: 4rem;
  object-fit: contain;
  cursor: pointer;
}

.menu .header .jr-dash-view-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.35rem;
  margin: 0;
  padding: 0.5rem 0.45rem 0.5rem 0.7rem;
  box-sizing: border-box;
  font-family: var(--ncpa-font-chrome);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.015em;
  color: var(--ncpa-menu-text);
  text-align: left;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.03) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.menu .header .jr-dash-view-select[hidden] {
  display: none !important;
}

.menu .header .jr-dash-view-select:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    rgba(126, 173, 237, 0.16) 0%,
    rgba(126, 173, 237, 0.08) 100%
  );
  border-color: rgba(126, 173, 237, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 10px rgba(0, 0, 0, 0.18);
}

.menu .header .jr-dash-view-select:active:not(:disabled) {
  transform: scale(0.985);
}

.menu .header .jr-dash-view-select[aria-expanded='true'] {
  background: linear-gradient(
    180deg,
    rgba(126, 173, 237, 0.2) 0%,
    rgba(126, 173, 237, 0.1) 100%
  );
  border-color: rgba(126, 173, 237, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(126, 173, 237, 0.15);
}

.menu .header .jr-dash-view-select:focus-visible {
  outline: 2px solid var(--ncpa-accent);
  outline-offset: 2px;
}

.menu .header .jr-dash-view-select:focus:not(:focus-visible) {
  outline: none;
}

.menu .header .jr-dash-view-select:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.menu .header .jr-dash-view-select__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: rgba(250, 250, 250, 0.95);
}

.menu .header .jr-dash-view-select__chevron {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ncpa-accent);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.menu .header .jr-dash-view-select__chevron svg {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.menu .header .jr-dash-view-select:hover:not(:disabled) .jr-dash-view-select__chevron {
  background: rgba(126, 173, 237, 0.18);
  border-color: rgba(126, 173, 237, 0.35);
  color: rgb(186, 214, 250);
}

.menu .header .jr-dash-view-select[aria-expanded='true'] .jr-dash-view-select__chevron svg {
  transform: rotate(180deg);
}

.menu .stuff {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.menu .items {
  padding: 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
  overflow-y: auto;
  flex: 1 1 0;
  min-height: 0;
}

.menu .items button {
  width: 100%;
  background-color: transparent;
  color: var(--ncpa-menu-text);
  font-family: var(--ncpa-font-chrome);
  font-size: 1em;
  font-weight: 700;
  border: none;
  height: 3em;
  text-align: left;
  padding: 0 0 0 1em;
  cursor: pointer;
  transition: ease-in-out 0.2s;
}

.menu .items button.selected {
  background-color: var(--ncpa-menu-selected);
}

.menu .items button:hover {
  background-color: var(--ncpa-menu-hover);
}

.menu .menu-bottom-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ncpa-space-sm);
  width: 100%;
  margin-top: auto;
  padding: 0.85rem 0.75rem 1rem;
  box-sizing: border-box;
}

.menu .menu-bottom-actions .signout-btn {
  margin-bottom: 0.35rem;
}

.signout-btn {
  color: var(--ncpa-menu-text);
  border: none;
  background-color: transparent;
  font-family: var(--ncpa-font-chrome);
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  padding: 0 0 0 1em;
  height: 2.5em;
}

.signout-btn:hover {
  color: rgb(222, 222, 222);
}

.menu .menu-bottom-actions .jr-dash-foot {
  margin: 0.35rem 0 0;
  text-align: center;
  width: 100%;
}

.menu .menu-bottom-actions .jr-dash-foot a {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(250, 250, 250, 0.55);
  text-decoration: none;
  font-family: var(--ncpa-font-chrome);
}

.menu .menu-bottom-actions .jr-dash-foot a:hover {
  color: var(--ncpa-accent);
}

/* Mobile drawer toggle */
.menu .span-div {
  display: none;
  justify-content: center;
  align-items: center;
  position: absolute;
  background-color: var(--ncpa-menu-bg);
  height: 2em;
  width: 2em;
  cursor: pointer;
  top: 0.5em;
  right: -2.5em;
  border-radius: 1.5em;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transform: scaleX(-1);
}

.menu .span-div div {
  width: 100%;
  height: 100%;
  background-image: url('/images/arrow.png');
  background-size: 50%;
  background-position: center;
  background-repeat: no-repeat;
}

.main.slid-over .menu .span-div div {
  transform: scaleX(-1);
}

/* View switch modal ----- */
.jr-dash-view-modal {
  position: fixed;
  inset: 0;
  z-index: 101000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.jr-dash-view-modal[hidden] {
  display: none !important;
}

.jr-dash-view-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.jr-dash-view-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border-radius: var(--ncpa-radius-modal);
  box-shadow: 0 0.5rem 2.5rem rgba(22, 32, 44, 0.22);
  padding: 1.25rem 1.2rem 1.1rem;
  max-height: min(90vh, 28rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.jr-dash-view-modal__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ncpa-menu-bg);
  letter-spacing: 0.02em;
}

.jr-dash-view-modal__options {
  display: flex;
  flex-direction: column;
  gap: var(--ncpa-space-md);
}

.jr-dash-view-modal__section {
  display: flex;
  flex-direction: column;
  gap: var(--ncpa-space-sm);
}

.jr-dash-view-modal__section-title {
  margin: 0;
  font-family: var(--ncpa-font-chrome);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(22, 32, 44, 0.55);
}

.jr-dash-view-modal__section-options {
  display: flex;
  flex-direction: column;
  gap: var(--ncpa-space-sm);
}

.jr-dash-view-modal__option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--ncpa-font-chrome);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ncpa-text-body);
  background: rgb(248, 249, 251);
  border: 1px solid var(--ncpa-border-strong);
  border-radius: 0.5rem;
  padding: 0.85rem 0.9rem;
  min-height: 2.9rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.jr-dash-view-modal__option:hover:not(:disabled) {
  background: rgba(126, 173, 237, 0.14);
  border-color: rgba(126, 173, 237, 0.45);
}

.jr-dash-view-modal__option.is-current {
  background: rgba(126, 173, 237, 0.2);
  border-color: rgba(126, 173, 237, 0.55);
  color: rgb(31, 55, 85);
  cursor: default;
}

.jr-dash-view-modal__cancel {
  margin-top: var(--ncpa-space-md);
  width: 100%;
  font-family: var(--ncpa-font-chrome);
  font-size: 0.88rem;
  font-weight: 700;
  color: #5c6570;
  background: transparent;
  border: 1px solid rgba(22, 32, 44, 0.15);
  border-radius: 0.45rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

/* Action / redirect prompts (required next step) */
.jr-action-prompt__message {
  margin-bottom: 1rem;
}

.jr-action-prompt__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.jr-action-prompt__actions .jr-btn {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.jr-action-prompt__actions .jr-dash-view-modal__cancel {
  margin-top: 0;
}

.jr-dash-view-modal__panel--wide {
  max-width: min(26rem, 100%);
  max-height: min(90vh, 36rem);
}

/* ----- Payment receipt modals (junior) ----- */
.jr-pay-modal-body .jr-modal-lead {
  margin-bottom: 1rem;
}

.jr-pay-receipt-summary {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.05rem;
  margin-bottom: 1.1rem;
  background: rgb(248, 249, 251);
  border: 1px solid var(--ncpa-border-strong, #e4e4e7);
  border-radius: var(--ncpa-radius-control, 8px);
}

.jr-pay-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.92rem;
}

.jr-pay-receipt-row__label {
  color: var(--ncpa-text-muted, #71717a);
  flex-shrink: 0;
}

.jr-pay-receipt-row__value {
  font-weight: 600;
  color: var(--ncpa-text-body, #212529);
  text-align: right;
}

.jr-pay-receipt-row__value--status {
  color: rgb(22, 100, 70);
}

.jr-pay-receipt-footnote {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.jr-pay-modal-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(22, 32, 44, 0.55);
}

.jr-pay-timeline {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.jr-pay-timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(22, 32, 44, 0.06);
}

.jr-pay-timeline-item:last-child {
  border-bottom: none;
}

.jr-pay-timeline-item__label {
  font-weight: 600;
}

.jr-pay-modal-actions {
  margin-top: 0.25rem;
}

/* ----- Content controls (dashboard pages) ----- */
.ncpa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: var(--ncpa-space-md);
  align-items: center;
}

.ncpa-input,
.ncpa-select,
.jr-input,
.jr-select {
  border: 1px solid var(--ncpa-border-strong);
  border-radius: var(--ncpa-radius-control);
  padding: 0.45rem 0.65rem;
  font-family: var(--ncpa-font-chrome);
  font-weight: 400;
  font-size: 0.875rem;
  min-height: 2.25rem;
  background: var(--ncpa-card-bg);
  color: var(--ncpa-text-body);
}

.ncpa-btn,
.jr-btn {
  border-radius: var(--ncpa-radius-control);
  border: 1px solid var(--ncpa-border-strong);
  background: var(--ncpa-card-bg);
  padding: 0.45rem 0.85rem;
  font-family: var(--ncpa-font-chrome);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ncpa-btn:hover,
.jr-btn:hover {
  background: rgb(248, 249, 251);
}

.ncpa-btn--primary,
.jr-btn--primary {
  background: var(--ncpa-accent);
  border-color: transparent;
  color: #fff;
}

.ncpa-btn--primary:hover,
.jr-btn--primary:hover {
  background: rgb(106, 153, 217);
}

/* Async actions: lock region + loading trigger button (see scripts/shared/action-busy.js) */
.jr-action-region--busy {
  pointer-events: none;
}

.jr-btn.is-loading {
  position: relative;
  cursor: wait;
  pointer-events: none;
  color: transparent;
}

.jr-btn--primary.is-loading::after {
  border-color: #fff;
  border-right-color: transparent;
}

.jr-btn.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ncpa-btn-spin 0.65s linear infinite;
}

.jr-btn:disabled:not(.is-loading) {
  opacity: 0.55;
  cursor: not-allowed;
}

@keyframes ncpa-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jr-btn.is-loading::after {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.5;
  }
}

/* Toast */
.jr-dash-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-family: var(--ncpa-font-chrome);
  z-index: 101500;
}

.jr-dash-toast--ok {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.jr-dash-toast--err {
  background: linear-gradient(135deg, #ea580c, #f97316);
}

body.dashboard-loading [data-dashboard-shell] {
  visibility: hidden;
}

.jr-setup-tour-modal__panel {
  max-width: 28rem;
}

.jr-setup-tour-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  color: var(--col-text-body, #212529);
  line-height: 1.45;
}

.jr-setup-tour-modal__body p {
  margin: 0;
}

.jr-setup-tour-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.jr-setup-tour-tabs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.jr-setup-tour-tabs__item {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  background: rgba(250, 250, 250, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.jr-setup-tour-tabs__item strong {
  font-size: 0.95rem;
}

.jr-setup-tour-tabs__item span {
  font-size: 0.88rem;
  color: #52525b;
}

.jr-setup-tour-persona {
  margin-top: 0.35rem;
}

.jr-setup-tour-invite {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.jr-setup-tour-note {
  margin: 0;
  font-size: 0.88rem;
  color: #52525b;
}

.jr-setup-tour-highlight {
  box-shadow: 0 0 0 3px rgba(126, 173, 237, 0.55);
  border-radius: 10px;
}

@media screen and (max-width: 1000px) {
  .menu .span-div {
    display: flex;
  }

  .main {
    width: calc(100% + var(--ncpa-menu-width));
  }

  .main.slid-over {
    margin-left: calc(-1 * var(--ncpa-menu-width));
  }
}

@media screen and (max-width: 800px) {
  .main {
    font-size: 0.8em;
  }

  .profile-main-column .page {
    padding: 1.5rem 1.25rem;
  }
}

@media screen and (max-width: 600px) {
  .main {
    font-size: 0.75em;
  }
}
