/* Visual Ace control system. Loaded after the pinned Able reference and course layouts.
   One sizing/spacing contract for native fields, Radix controls and existing dialogs. */
:root {
  --control-border: #cbd5df;
  --control-radius: 7px;
  --ui-focus: #5c7995;
  --ui-surface: #fff;
  --ui-soft: #f0f4f7;
}
[hidden] {
  display: none !important;
}
button,
input,
textarea {
  font: inherit;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
}
.settings-content {
  align-self: stretch;
}
.settings-content form {
  min-height: 0;
  height: auto;
  align-content: start;
}
.settings-content form > .form-field {
  margin: 16px 0;
}
.settings-content form.stack > .form-field {
  margin: 0;
}
.settings-content .stack > .field-note {
  margin: 0;
}
.settings-content .card.pad,
.settings-content .card.card-pad {
  padding: 24px;
}
.settings-content .check {
  min-height: 32px;
  margin: 0;
  font-size: 13px;
}
.check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--blue);
}
.settings-content hr {
  margin: 8px 0;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}
.payment-account {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.payment-account legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
}
.payment-active {
  align-self: end;
  display: flex;
  min-height: 40px;
  align-items: center;
}
.add-account {
  align-self: flex-start;
}
.toolbar {
  align-items: flex-end;
  padding: 0;
  gap: 12px;
  margin-bottom: 24px;
}
.toolbar .dates {
  align-items: flex-end;
  gap: 12px;
}
.toolbar .dates .form-field {
  width: 156px;
}
.toolbar > .btn {
  margin: 0;
  align-self: flex-end;
}
.toolbar > .badge {
  margin-bottom: 9px;
}
.toolbar .calendar-trigger {
  width: 100%;
}
.control-host {
  display: block;
  min-width: 0;
  width: 100%;
  margin: 0 !important;
}
.native-control {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.ui-select-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-select-trigger > span:last-child {
  display: flex;
  flex: none;
}
.ui-select-content {
  z-index: 150;
  min-width: var(--radix-select-trigger-width);
  max-width: calc(100vw - 24px);
  max-height: min(320px, var(--radix-select-content-available-height));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 20px #182c401a;
  overflow: hidden;
}
.ui-select-viewport {
  padding: 5px;
}
.ui-select-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 32px 7px 10px;
  border-radius: 4px;
  outline: none;
  font-size: 13px;
  line-height: 22px;
  cursor: default;
  user-select: none;
}
.ui-select-item[data-highlighted] {
  background: var(--ui-soft);
}
.ui-select-item[data-state="checked"] {
  color: var(--blue);
  font-weight: 600;
}
.ui-select-item[data-disabled] {
  opacity: 0.4;
}
.ui-select-indicator {
  position: absolute;
  right: 9px;
  display: flex;
}
.ui-select-scroll {
  display: flex;
  justify-content: center;
  padding: 4px;
  background: #fff;
}
.ui-time-content {
  z-index: 140;
  width: 304px;
  max-width: calc(100vw - 24px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 24px #182c401a;
  padding: 16px;
}
.ui-popover-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.ui-popover-heading span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.ui-time-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.ui-control-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.ui-popover-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.notification-head {
  padding: 16px;
}
.notification-head h2 {
  font-size: 15px;
}
.notification-popover .empty {
  padding: 32px 20px;
}
.notification-popover .empty h3 {
  margin-bottom: 6px;
}
#toasts {
  position: static;
  inset: auto;
  padding: 0;
  transform: none;
  pointer-events: auto;
}
[data-sonner-toaster] {
  font-family: inherit;
}
[data-sonner-toast].va-toast {
  border-color: var(--line) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px #182c4014 !important;
  font-size: 13px !important;
  padding: 16px !important;
}
[data-sonner-toast][data-type="success"] [data-icon] {
  color: var(--green);
}
[data-sonner-toast][data-type="error"] [data-icon] {
  color: var(--red);
}
[data-sonner-toast] [data-close-button] {
  min-width: 22px;
  min-height: 22px;
}
.connection-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.connection-intro .channel-mark {
  width: 40px;
  height: 40px;
  background: var(--ui-soft);
  border-radius: 8px;
}
.connection-intro p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.connection-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.connection-row {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.connection-list {
  gap: 0;
}
.modal-body .settings-section {
  border: 0;
  padding: 0;
  margin: 20px 0;
}
.modal-body .settings-section h2 {
  font-size: 14px;
}
.modal-body .account-approvals {
  margin: 0 0 12px;
}
.setup-checklist {
  padding: 16px;
  background: var(--ui-soft);
  border-radius: 8px;
  margin-bottom: 16px;
}
.setup-checklist ol {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
}











@media (max-width: 800px) {
  :root {
    --control-height: 44px;
  }
  .form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field textarea,
.ui-select-trigger,
.ui-time-trigger {
    font-size: 16px;
  }
  .settings-content .card.pad,
.settings-content .card.card-pad {
    padding: 18px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar {
    gap: 10px;
  }
  .toolbar .dates {
    flex: 1 1 100%;
  }
  .toolbar .dates .form-field {
    flex: 1;
    width: auto;
  }
  .toolbar > .btn {
    min-height: 44px;
  }
  .ui-select-item {
    min-height: 42px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
*::before,
*::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Group related settings so status and actions remain in the same scan line. */
.payment-accounts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.payment-account .form-grid {
  margin: 0;
}
.review-window {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.settings-content .profile-form {
  border-bottom: 0;
  margin-bottom: 0;
}
.settings-editor > [data-action="comparison-upload"] {
  margin-top: 12px;
}
.setting-switch input[role="switch"] {
  appearance: none;
  position: relative;
  width: 36px;
  height: 20px;
  min-width: 36px;
  min-height: 20px;
  border: 1px solid #bac7d3;
  border-radius: 999px;
  background: #d9e1e8;
  padding: 0;
  margin: 0;
  box-shadow: none;
  cursor: pointer;
  flex: none;
}
.setting-switch input[role="switch"]::before {
  content: "";
  display: block;
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px #15243b24;
}
.setting-switch input[role="switch"]:checked {
  border-color: var(--blue);
  background: var(--blue);
}
.setting-switch input[role="switch"]:checked::before {
  left: 18px;
}
.setting-switch input[role="switch"]:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 3px;
}
@media (max-width: 1100px) {
  .payment-accounts-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  .review-window {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .review-window > .form-field:last-child {
    grid-column: 1/-1;
  }
}

.modal-body > form > .connection-intro {
  margin-bottom: 0;
}

/* Button system.
   Compact pills (radius = half the height, side padding about half the height).
   Primary: brand navy with a soft top highlight, one per area.
   Secondary: white with a hairline border and a 1px shadow.
   Link: bold navy text for in-card actions such as Manage or Connect. */
.btn {
  --btn-h: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--btn-h);
  height: auto;
  padding: 0 15px;
  border: 1px solid #d6dce5;
  border-radius: 999px;
  background: #fff;
  color: #1d2b3a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px #1018280d;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
.btn:hover {
  border-color: #c2cbd7;
  background: #f7f9fb;
  color: #0f1b2a;
}
.btn:active {
  background: #eef1f5;
  transform: none;
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px #00045133;
}
.btn.primary:hover {
  border-color: #1a2080;
  background: #1a2080;
  color: #fff;
}
.btn.primary:active {
  background: var(--primary);
}
.btn.ghost,
.modal-actions [data-action="close"] {
  border-color: transparent;
  background: transparent;
  color: #3b4a5c;
  box-shadow: none;
}
.btn.ghost:hover,
.modal-actions [data-action="close"]:hover {
  border-color: transparent;
  background: #f1f3f6;
  color: #0f1b2a;
}
.btn.danger,
.btn.destructive {
  border-color: #c4271b;
  background: #c4271b;
  color: #fff;
  box-shadow: 0 1px 2px #c4271b33;
}
.btn.danger:hover,
.btn.destructive:hover {
  border-color: #a51f15;
  background: #a51f15;
  color: #fff;
}
.btn.small {
  --btn-h: 28px;
  padding: 0 12px;
  font-size: 12px;
}
.btn.full {
  width: 100%;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  box-shadow: none;
  pointer-events: none;
}
/* Link: bold text that acts, without a button frame. */
.btn.link {
  --btn-h: 28px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}
.btn.link:hover {
  background: none;
  color: #2a3399;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.link + .btn.link {
  margin-left: 14px;
}
.btn.icon-btn {
  width: var(--btn-h);
  min-width: var(--btn-h);
  padding: 0;
  border-color: transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn.icon-btn:hover {
  background: #f1f3f6;
  color: var(--primary);
}
/* The remaining Telegram buttons are ordinary secondary buttons. */
.telegram-action.btn {
  border: 1px solid #d6dce5;
  background: #fff;
  color: #1d2b3a;
  font-weight: 600;
  box-shadow: 0 1px 2px #1018280d;
}
.telegram-action.btn:hover {
  border-color: #c2cbd7;
  background: #f7f9fb;
}
.telegram-action.btn.danger {
  border-color: #f1c7c3;
  background: #fff;
  color: #b42318;
}
.telegram-action.btn.danger:hover {
  background: #fef3f2;
}
.telegram-action.btn:disabled {
  opacity: 0.45;
  border-color: #d6dce5;
  background: #fff;
  color: #1d2b3a;
}
/* Page tabs drawn with .btn keep their underline look. */
.tabs > .btn {
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.tabs > .btn.active {
  font-weight: 700;
}
.modal-actions {
  align-items: center;
  gap: 8px;
}
.modal-actions > .btn {
  min-height: 36px;
  padding: 0 18px;
}

/* Inbox: search with a small channel dropdown, then one row of text tabs. */
.inbox-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inbox-search-row .inbox-search {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.channel-menu {
  position: relative;
  flex-shrink: 0;
}
.channel-menu > summary {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 0 6px 0 9px;
  border: 1px solid #d6dce5;
  border-radius: 8px;
  background: #fff;
  color: #4b5c70;
  list-style: none;
  cursor: pointer;
}
.channel-menu > summary::-webkit-details-marker {
  display: none;
}
.channel-menu > summary:hover,
.channel-menu[open] > summary {
  border-color: #c2cbd7;
  background: #fff;
  color: var(--ink);
}
.channel-menu > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.channel-menu > summary .icon,
.channel-menu > summary .channel-mark {
  width: 16px;
  height: 16px;
}
.channel-menu > summary .icon:last-child {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}
.channel-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  width: 200px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px #1018281f;
}
.channel-menu-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.channel-menu-list button > span:not(.channel-mark) {
  flex: 1;
}
.channel-menu-list button .icon,
.channel-menu-list button .channel-mark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.channel-menu-list button:hover,
.channel-menu-list button:focus-visible {
  background: #f3f5f8;
  outline: none;
}
.channel-menu-list button[aria-checked="true"] {
  color: var(--primary);
  font-weight: 700;
}
.channel-menu-list .channel-menu-manage {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  color: var(--muted);
}
.inbox-list-head .inbox-status-filters {
  display: flex;
  gap: 18px;
  margin: 10px 0 -12px;
  padding: 0 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.inbox-list-head .inbox-status-filters::-webkit-scrollbar {
  display: none;
}
.inbox-tab {
  flex-shrink: 0;
  height: 36px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.inbox-tab:hover {
  color: var(--ink);
}
.inbox-tab[aria-pressed="true"] {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.inbox-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
@media (max-width: 800px) {
  .inbox-list-head .inbox-status-filters {
    display: flex !important;
    margin-bottom: -8px;
  }
}

/* Photo dialog: a clear picker first, the crop area only once a photo is chosen. */
.photo-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 170px;
  margin: 4px 0 8px;
  padding: 24px;
  border: 1.5px dashed #c9d1dc;
  border-radius: 14px;
  background: #f8f9fb;
  color: var(--primary);
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.photo-pick:hover {
  border-color: #8f9cc4;
  background: #f2f4fa;
}
.photo-pick .icon {
  width: 28px;
  height: 28px;
}
.photo-pick strong {
  font-size: 14px;
  font-weight: 700;
}
.photo-pick small {
  color: var(--muted);
  font-size: 12px;
}
.photo-pick.chosen {
  flex-direction: row;
  min-height: 34px;
  width: max-content;
  margin: 0;
  padding: 0 15px;
  border: 1px solid #d6dce5;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px #1018280d;
}
.photo-pick.chosen .icon {
  width: 16px;
  height: 16px;
}
.photo-pick.chosen strong {
  font-size: 13px;
  font-weight: 600;
  color: #1d2b3a;
}
.photo-pick.chosen small {
  display: none;
}
#profile-image-file:focus-visible + .photo-pick {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .btn {
    --btn-h: 40px;
  }
  .btn.small,
  .btn.link {
    --btn-h: 34px;
  }
}
.channel-menu .channel-mark {
  flex: none;
  padding: 0;
  border-radius: 0;
  background: none;
}
.team-actions.member-actions {
  flex-wrap: wrap;
  gap: 2px 18px;
}
.team-actions .btn.link {
  min-height: var(--btn-h);
  margin-left: 0;
}
.settings-editor .file-pick {
  margin-bottom: 12px;
}
.photo-pick.chosen strong {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* No layout drift: the page keeps its scrollbar gutter, tabs keep one weight
   in every state, and pages without actions keep the same header height. */
html {
  scrollbar-gutter: stable;
}
.tabs .tab,
.tabs .tab.active,
.tabs > .btn,
.tabs > .btn.active,
.inbox-tab,
.inbox-tab[aria-pressed="true"] {
  font-weight: 600;
}
.actions-reserve {
  visibility: hidden;
}

/* Period select in page headers matches the Export button next to it. */
.page-head .actions .control-host {
  width: auto;
}
.page-head .actions .ui-select-trigger,
.page-head .actions select {
  height: 34px;
  min-height: 34px;
  min-width: 128px;
  padding: 0 12px 0 15px;
  border: 1px solid #d6dce5;
  border-radius: 999px;
  background: #fff;
  color: #1d2b3a;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 2px #1018280d;
}
.page-head .actions .ui-select-trigger:hover {
  border-color: #c2cbd7;
  background: #f7f9fb;
}

/* Needs attention: counts line up in one column next to the arrow. */
.task > .count {
  margin-left: auto;
  min-width: 26px;
}
.task > .count ~ .icon:last-child {
  margin-left: 4px;
}

/* Find Student ID: the same quiet search field as the workspace search. */
.student-lookup {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
}
.student-lookup .search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.student-lookup .search-field > svg.icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.student-lookup .search-field input {
  width: 100%;
}
.student-lookup + .sub {
  margin: 10px 0 0;
}

/* Phone bottom bar keeps its plain icon + label look. */
.mobile-nav .btn,
.mobile-nav .btn:hover,
.mobile-nav .btn:active {
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #656e7b;
  font-size: 10px;
  font-weight: 500;
}
.mobile-nav .btn.active {
  color: var(--primary);
  font-weight: 600;
}

@media (pointer: coarse) {
  .page-head .actions .ui-select-trigger,
  .page-head .actions select {
    height: 40px;
    min-height: 40px;
  }
}
