.ca-page {
  --ca-ink: #132947;
  --ca-muted: #506782;
  --ca-blue: #2152d7;
  --ca-line: #d8e4f2;
  display: grid;
  gap: 20px;
  color: var(--ca-ink);
}

.ca-page [hidden] { display: none !important; }
.ca-page h1, .ca-page p { margin: 0; }
.ca-page h1 { font-size: clamp(25px, 2.5vw, 36px); line-height: 1.2; color: var(--ca-ink); }
.ca-header p, .ca-note { color: var(--ca-muted); }
.ca-header p { margin-top: 7px; }
.ca-header, .ca-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ca-header { justify-content: space-between; padding: 5px 0 2px; gap: 14px; }
.ca-actions :is(button, .primary-button, .ghost-button) { min-height: 40px; }
.ca-page .primary-button { background: var(--ca-blue); border-color: var(--ca-blue); color: white; }
.ca-page .primary-button:hover:not(:disabled) { background: #183eb1; }
.ca-page .ghost-button { border-color: #c5d6ec; color: #18407f; }
.ca-page svg { flex: none; }

.ca-metrics { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ca-metrics > div, .ca-card {
  border: 1px solid var(--ca-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px #133c7210;
}
.ca-metrics > div { display: flex; align-items: center; gap: 14px; padding: 13px 17px; min-height: 82px; font-weight: 650; }
.ca-metrics strong { display: block; margin-top: 2px; font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ca-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 10px; color: #1e53d3; background: #e9f1ff; }
.ca-icon svg { height: 24px; width: 24px; }
.ca-metrics > div:last-child :is(strong,.ca-icon) { color: #94550c; }
.ca-metrics > div:last-child .ca-icon { background: #fff2df; }

.ca-card { min-width: 0; }
.ca-tabs { display: flex; gap: 22px; padding-inline: 17px; border-bottom: 1px solid var(--ca-line); }
.ca-tabs button { padding: 10px 8px; min-height: 48px; background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--ca-muted); font-weight: 750; }
.ca-tabs [aria-selected="true"] { border-color: var(--ca-blue); color: var(--ca-blue); }
.ca-panel { min-width: 0; padding: 16px; }
.ca-filters { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(2,minmax(120px,1fr)) auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.ca-filters[data-ca-filter="classes"] { grid-template-columns: minmax(200px, 1.5fr) minmax(120px, 1fr) auto; max-width: 760px; }
.ca-filters label, .ca-dialog label { display: grid; gap: 5px; min-width: 0; color: var(--ca-ink); font-size: 13px; font-weight: 700; }
.ca-filters input, .ca-filters select, .ca-assignment select { min-width: 0; width: 100%; min-height: 40px; }
.ca-page :is(input,select) { border-color: #c8d9ef; border-radius: 7px; }
.ca-note { font-size: 13px; }
.ca-panel > .ca-note { margin: 0 0 13px; }
.ca-table { border: 1px solid var(--ca-line); border-radius: 8px; }
.ca-table table { min-width: 0; }
.ca-table th, .ca-table td { padding: 10px 11px; font-size: 13px; overflow-wrap: anywhere; }
.ca-table th { color: #1b3559; background: #eaf2fc; }
.ca-table th:first-child { border-radius: 8px 0 0 0; }
.ca-table th:last-child { border-radius: 0 8px 0 0; }
.ca-table td small { color: var(--ca-muted); }
.ca-table td strong { color: var(--ca-ink); }
.ca-table tr:last-child td { border-bottom: 0; }
.ca-chips, .ca-assignment { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ca-chip, .ca-pill { display: inline-block; padding: 3px 7px; border: 1px solid #dce6f3; border-radius: 6px; color: #213b5c; background: #eff4fa; font-size: 12px; }
.ca-pill { white-space: nowrap; border: 0; border-radius: 16px; color: #4b6078; font-weight: 700; }
.ca-pill::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 5px; border-radius: 50%; vertical-align: 2px; background: currentColor; }
.ca-pill.is-active { background: #e3f8ea; color: #176238; }
.ca-class-more { max-width: 100%; }
.ca-class-more summary { display: inline; color: #174bc4; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ca-class-more div { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 5px; }
.ca-row-actions { white-space: nowrap; }
.ca-row-actions .ghost-button, .ca-more summary { padding: 6px 8px; min-height: 32px; }
.ca-more { display: inline-block; vertical-align: middle; position: relative; margin-inline-start: 3px; }
.ca-more summary { display: grid; place-items: center; min-width: 34px; border: 1px solid #c5d6ec; border-radius: 7px; color: #18407f; background: #fff; cursor: pointer; font-size: 18px; line-height: 1; }
.ca-more summary::-webkit-details-marker { display: none; }
.ca-more div { position: absolute; z-index: 4; right: 0; top: calc(100% + 4px); padding: 4px; border: 1px solid var(--ca-line); border-radius: 8px; background: #fff; box-shadow: 0 8px 22px #15355928; }
.ca-more button { white-space: nowrap; min-height: 34px; border: 0; border-radius: 5px; padding: 4px 12px; background: #fff; color: #1b3559; }
.ca-more button:hover { background: #edf4ff; }
.ca-assignment { flex-wrap: nowrap; }
.ca-assignment select { max-width: 270px; }
.ca-assignment button { flex: none; white-space: nowrap; }
.ca-page p.ca-count { margin-top: 13px; color: var(--ca-muted); font-size: 13px; }
.ca-count:empty { display: none; }
.ca-empty { padding: 24px 10px; color: var(--ca-muted); text-align: center; }
.ca-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 11px 14px; border: 1px solid #c8ddf7; border-radius: 9px; background: #eef5ff; color: #204875; }
.ca-feedback.is-error, .ca-error { background: #fff2f3; border-color: #f3cfd7; color: #962f43; }
.ca-page .ca-error { margin-top: 12px; padding: 9px; border-radius: 6px; overflow-wrap: anywhere; }
.ca-review .attv2-special-leave { margin: 0; border: 0; padding: 0; background: transparent; }
.ca-review [data-special-panel] > summary { display: none; }
.ca-review select { margin-inline: 5px; }
.ca-dialog { width: min(620px, calc(100% - 24px)); }
.ca-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.ca-dialog label input, .ca-dialog label select { width: 100%; min-width: 0; }
.ca-dialog [data-ca-template] { margin-top: 12px; }
.ca-import-preview { padding: 12px; margin-top: 12px; background: #f1f6fe; border-radius: 8px; }
.ca-import-preview ul { max-height: 160px; overflow: auto; overflow-wrap: anywhere; }
.main-area:has([data-view="counselors"].active) .topbar-tools .search-box { display: none; }

@media (max-width: 1220px) {
  .ca-filters { grid-template-columns: minmax(155px, 1.5fr) repeat(2,minmax(100px,1fr)) auto; }
  .ca-table th, .ca-table td { padding-inline: 8px; }
}

@media (max-width: 760px) {
  .ca-page { gap: 13px; }
  .ca-header .ca-actions { width: 100%; }
  .ca-header .ca-actions button { flex: 1; min-width: 0; white-space: nowrap; }
  .ca-metrics { gap: 6px; }
  .ca-metrics > div { min-height: 60px; padding: 8px; font-size: 12px; }
  .ca-metrics strong { font-size: 21px; }
  .ca-icon { display: none; }
  .ca-tabs { gap: 3px; padding-inline: 7px; }
  .ca-tabs button { min-width: 0; flex: 1; font-size: 13px; padding-inline: 2px; white-space: nowrap; }
  .ca-panel { padding: 10px; }
  .ca-filters, .ca-filters[data-ca-filter="classes"] { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
  .ca-filters label:first-child, .ca-filters .ca-actions { grid-column: 1 / -1; }
  .ca-filters .ca-actions button { flex: 1; }
  .ca-table { border: 0; }
  .ca-table table, .ca-table tbody { display: block; }
  .ca-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .ca-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; border: 1px solid var(--ca-line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
  .ca-table td { display: block; grid-column: 1 / -1; min-width: 0; padding: 0; border: 0; }
  .ca-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--ca-muted); font-size: 12px; }
  .ca-table td.ca-name { grid-column: 1; grid-row: 1; }
  .ca-table td.ca-state { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; }
  .ca-table td.ca-row-actions { justify-self: end; }
  .ca-assignment :is(select,button), .ca-row-actions .ghost-button, .ca-more summary { min-height: 42px; }
  .ca-form-grid { grid-template-columns: 1fr; }
  .ca-dialog form { padding: 16px; }
}
