:root {
  color-scheme: light;
  --bg: #f7f9ff;
  --surface: #ffffff;
  --surface-strong: #eef4ff;
  --line: #dbe3f4;
  --text: #1d2b29;
  --muted: #61706d;
  --soft: #eef3fb;
  --brand: #123cf3;
  --brand-strong: #0d2fb2;
  --leaf: #f7c600;
  --sky: #2563eb;
  --amber: #d97706;
  --coral: #dc5f48;
  --danger: #b42318;
  --ok: #15803d;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.08);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

body:has(.modal) {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(18, 60, 243, 0.28);
  outline-offset: 2px;
}

.app {
  min-height: 100vh;
  overflow-x: hidden;
}

.login-shell {
  align-items: center;
  background: #f4f7ff;
  display: flex;
  min-height: 100vh;
  padding: 18px;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--leaf);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  margin: auto;
  max-width: 420px;
  padding: 24px;
  width: 100%;
}

.login-card h1 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.login-heading {
  display: grid;
  gap: 7px;
}

.loading-line {
  background: var(--soft);
  border-radius: 999px;
  height: 4px;
  overflow: hidden;
  position: relative;
}

.loading-line::after {
  animation: loading-line 1.1s ease-in-out infinite;
  background: var(--brand);
  border-radius: inherit;
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 42%;
}

.login-logo {
  display: block;
  justify-self: center;
  max-width: min(280px, 100%);
  width: 72%;
}

.login-form {
  display: grid;
  gap: 12px;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  left: 0;
  padding: 12px 22px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.portal-context {
  display: grid;
  min-width: 0;
}

.portal-context span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.portal-context strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-banner {
  background: #fff7d6;
  border-bottom: 1px solid #efd878;
  color: #6d4c00;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 22px;
  text-align: center;
}

.topbar > * {
  min-width: 0;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 180px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(145deg, #123cf3, #2563eb);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  height: 44px;
  object-fit: contain;
  width: 74px;
}

.brand-copy strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.search-wrap {
  max-width: 540px;
  position: relative;
  width: 100%;
}

.search-wrap input {
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  height: 42px;
  outline: none;
  padding: 0 14px;
  width: 100%;
}

.search-wrap input:focus {
  background: #ffffff;
  border-color: #9db0ff;
  box-shadow: 0 0 0 3px rgba(18, 60, 243, 0.12);
}

.role-switcher,
.status-pill {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
}

.role-switcher {
  min-width: 0;
}

.role-switcher button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  min-height: 32px;
  padding: 0 10px;
}

.role-switcher button.active {
  background: #ffffff;
  color: var(--brand-strong);
  box-shadow: 0 3px 12px rgba(18, 60, 243, 0.14);
}

.role-switcher.locked button:not(.active) {
  color: var(--danger);
}

.status-pill {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-height: 38px;
  padding: 0 12px;
}

.status-dot {
  background: var(--ok);
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.status-dot.offline {
  background: var(--amber);
}

.layout {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: calc(100vh - 67px);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky;
  top: 67px;
  height: calc(100vh - 67px);
}

.nav-section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 2px 10px 10px;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #31413f;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px 1fr auto;
  min-height: 42px;
  padding: 0 10px;
  text-align: left;
  width: 100%;
}

.nav-button.active {
  background: #e8edff;
  color: var(--brand-strong);
  font-weight: 800;
}

.nav-button:hover {
  background: #f1f4fb;
}

.nav-button.active:hover {
  background: #e8edff;
}

.nav-icon {
  align-items: center;
  background: #edf4f2;
  border-radius: 7px;
  display: inline-flex;
  font-size: 14px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.nav-button.active .nav-icon {
  background: #dfe6ff;
}

.nav-count {
  background: #ffe9d8;
  border-radius: 999px;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
  min-width: 22px;
  padding: 3px 7px;
  text-align: center;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.hero-band {
  align-items: center;
  background: #163fd8;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 18px;
  overflow: hidden;
  padding: 22px;
}

.hero-band h1 {
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0 0 8px;
}

.hero-band p {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.5;
  margin: 0;
  max-width: 720px;
}

.hero-actions,
.row-actions,
.panel-actions,
.table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  text-decoration: none;
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.hero-band .button.primary {
  background: var(--leaf);
  border-color: var(--leaf);
  color: #102269;
}

.button.dark {
  background: #20312e;
  border-color: #20312e;
  color: #ffffff;
}

.button.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.button.danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: var(--danger);
}

.button.ghost {
  background: transparent;
}

.button.slim {
  min-height: 32px;
  padding: 0 10px;
}

.button:hover:not(:disabled) {
  border-color: #9eb0ec;
  box-shadow: 0 4px 14px rgba(28, 45, 96, 0.1);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  box-shadow: none;
  transform: translateY(0);
}

.icon-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.04);
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 15px 16px;
}

.panel-header h2,
.section-title {
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0;
}

.panel-header p,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.panel-body {
  padding: 16px;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric .label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.metric strong {
  display: block;
  font-size: 26px;
  letter-spacing: 0;
  line-height: 1;
}

.metric .trend {
  color: var(--brand-strong);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
}

.metric.accent-a {
  border-color: #b8c4ff;
}

.metric.accent-b {
  border-color: #c8dafd;
}

.metric.accent-c {
  border-color: #fbd4ba;
}

.metric.accent-d {
  border-color: #fde68a;
}

.filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  margin-bottom: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 38px;
  outline: none;
  padding: 8px 10px;
  width: 100%;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #8dd0c8;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 780px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 11px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.student-cell {
  align-items: center;
  display: flex;
  gap: 10px;
}

.avatar {
  align-items: center;
  background: linear-gradient(145deg, #ccfbf1, #bfdbfe);
  border: 2px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  color: #0f4f49;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  overflow: hidden;
  width: 42px;
}

.avatar.large {
  border-radius: 8px;
  font-size: 24px;
  height: 88px;
  width: 88px;
}

.avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.tag {
  align-items: center;
  background: #edf4f2;
  border-radius: 999px;
  color: #334a46;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 24px;
  padding: 4px 9px;
  white-space: nowrap;
}

.tag.ok {
  background: #dcfce7;
  color: #166534;
}

.tag.pending {
  background: #fef3c7;
  color: #92400e;
}

.tag.bad {
  background: #fee2e2;
  color: #991b1b;
}

.tag.info {
  background: #dbeafe;
  color: #1e40af;
}

.tag.coral {
  background: #ffe4dc;
  color: #9f3f30;
}

.progress {
  background: #e8efed;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress span {
  background: linear-gradient(90deg, var(--brand), var(--leaf));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.profile-head {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr auto;
}

.profile-head h2 {
  font-size: 24px;
  margin: 0 0 6px;
}

.profile-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
}

.tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 16px;
}

.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
}

.tabs button.active {
  border-bottom-color: var(--brand);
  color: var(--brand-strong);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  border-left: 3px solid #bce5df;
  padding-left: 12px;
}

.timeline-item strong {
  display: block;
  font-size: 14px;
}

.timeline-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.opportunity-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.opportunity {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 15px;
}

.opportunity h3 {
  font-size: 16px;
  line-height: 1.25;
  margin: 0;
}

.opportunity p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.opportunity-foot {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.empty {
  align-items: center;
  background: #f8fbfa;
  border: 1px dashed #bed3ce;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  justify-items: center;
  min-height: 130px;
  padding: 20px;
  text-align: center;
}

.drawer {
  background: rgba(11, 29, 27, 0.38);
  inset: 0;
  position: fixed;
  z-index: 50;
}

.drawer-panel {
  background: #ffffff;
  box-shadow: var(--shadow);
  height: 100%;
  margin-left: auto;
  max-width: 720px;
  overflow-y: auto;
  padding: 20px;
  width: min(100%, 720px);
}

.modal {
  align-items: center;
  background: rgba(11, 29, 27, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 60;
}

.modal-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 92vh;
  max-width: 760px;
  overflow: auto;
  width: min(100%, 760px);
}

.modal-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px;
}

.modal-head h2 {
  font-size: 18px;
  margin: 0;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.modal-foot {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 16px;
}

.split {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.1fr 0.9fr;
}

.quick-list {
  display: grid;
  gap: 9px;
}

.quick-item {
  align-items: center;
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 11px;
}

.quick-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.quick-item span {
  color: var(--muted);
  font-size: 12px;
}

.service-progress-panel {
  margin-bottom: 16px;
}

.report-page > .service-progress {
  background: #f7faf9;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  padding: 14px;
}

.service-progress {
  display: grid;
  gap: 11px;
}

.service-progress-head,
.service-progress-meta {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.service-progress-head div {
  display: grid;
  gap: 4px;
}

.service-progress-head span,
.service-progress-meta {
  color: var(--muted);
  font-size: 12px;
}

.service-progress-head strong {
  font-size: 22px;
  letter-spacing: 0;
}

.service-progress-head > strong {
  color: var(--brand-strong);
  font-size: 18px;
}

.service-progress .progress {
  height: 12px;
}

.service-progress.compact .service-progress-head strong {
  font-size: 16px;
}

.service-progress-meta span:last-child {
  color: #92400e;
  font-weight: 700;
}

.service-active-card {
  align-items: center;
  background: #effaf7;
  border: 1px solid #9fd8d0;
  border-left: 5px solid var(--brand);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
  padding: 18px;
}

.service-active-card.is-paused {
  background: #fff8df;
  border-color: #e8ce72;
  border-left-color: #c58b00;
}

.service-active-card.is-paused .service-active-label {
  color: #7a5200;
}

.service-active-card h2 {
  font-size: 20px;
  letter-spacing: 0;
  margin: 4px 0 6px;
}

.service-active-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.service-active-label {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.service-live-time {
  align-items: flex-end;
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.service-live-time span {
  color: var(--muted);
  font-size: 12px;
}

.service-live-time strong {
  font-size: 20px;
  letter-spacing: 0;
}

.service-timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.service-pause-button {
  background: #ffffff;
  border-color: #b98a00;
  color: #6d4c00;
}

.service-start-button {
  animation: service-start-pulse 2.4s ease-in-out infinite;
  position: relative;
}

@keyframes service-start-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(18, 60, 243, 0); }
  50% { box-shadow: 0 0 0 5px rgba(18, 60, 243, 0.14); }
}

.service-student-grid {
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
}

.service-activity-list {
  display: grid;
  gap: 10px;
}

.service-activity-row,
.service-activity-card {
  align-items: center;
  border: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 13px;
}

.service-activity-row strong,
.service-activity-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.service-activity-row span,
.service-activity-card > div > span,
.service-activity-card small {
  color: var(--muted);
  font-size: 12px;
}

.service-activity-card .progress {
  margin: 10px 0 6px;
}

.service-history-panel {
  margin-top: 16px;
}

.service-admin-stack {
  display: grid;
  gap: 16px;
}

.service-offer-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.service-offer-card {
  align-content: start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 16px;
}

.service-offer-card h3,
.service-offer-card p {
  letter-spacing: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.service-offer-card h3 {
  font-size: 16px;
  line-height: 1.3;
}

.service-offer-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.service-offer-title,
.service-offer-meta,
.service-application-state {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.service-offer-meta {
  color: var(--muted);
  font-size: 12px;
}

.service-offer-meta span:not(:last-child)::after {
  color: #a9b1c5;
  content: "·";
  margin-left: 7px;
}

.service-offer-instructions {
  background: #f5f7fb;
  border-left: 3px solid #f3c500;
  display: grid;
  gap: 4px;
  padding: 10px 11px;
}

.service-offer-instructions strong,
.service-offer-instructions span,
.service-application-state span {
  font-size: 12px;
  line-height: 1.45;
}

.service-application-state {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.certificate-ready {
  align-items: center;
  background: #edf9f1;
  border: 1px solid #9bd0aa;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px;
}

.certificate-ready > div {
  display: grid;
  gap: 3px;
}

.certificate-ready strong {
  color: #176535;
  font-size: 14px;
}

.certificate-ready span {
  color: #3f6950;
  font-size: 12px;
}

.notification-button.is-active {
  background: #edf9f1;
  border-color: #77bf8e;
  color: #176535;
}

.notification-button {
  white-space: nowrap;
}

.notification-short {
  display: none;
}

.service-evidence-copy {
  display: inline-block;
  max-width: 320px;
}

.service-history-list {
  display: grid;
  gap: 10px;
}

.service-history-item {
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 13px;
}

.service-history-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.service-history-head > div,
.service-history-note {
  display: grid;
  gap: 3px;
}

.service-history-head strong,
.service-history-hours strong {
  font-size: 14px;
}

.service-history-head span,
.service-history-hours span,
.service-history-hours small,
.service-history-note span {
  color: var(--muted);
  font-size: 12px;
}

.service-history-hours {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.service-history-hours small {
  margin-left: auto;
}

.service-history-item > p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.service-history-note {
  background: #f7faf9;
  border-left: 3px solid var(--brand);
  padding: 8px 10px;
}

.service-history-note strong {
  color: var(--brand-strong);
  font-size: 11px;
}

.evidence-indicator,
.evidence-file-name {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.service-review-note {
  display: inline-block;
  margin-top: 5px;
  max-width: 260px;
}

.service-session-summary {
  background: #f7faf9;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px;
}

.service-session-summary div {
  display: grid;
  gap: 4px;
}

.service-session-summary span,
.service-session-summary small,
.service-evidence-detail > span {
  color: var(--muted);
  font-size: 12px;
}

.service-session-summary strong {
  font-size: 14px;
}

.service-evidence-detail {
  border-left: 4px solid var(--leaf);
  padding: 4px 0 4px 14px;
}

.service-evidence-detail p {
  line-height: 1.55;
  margin: 5px 0;
}

.service-evidence-image {
  align-items: center;
  border: 1px solid var(--line);
  color: var(--brand-strong);
  display: grid;
  gap: 8px;
  grid-template-columns: 96px 1fr;
  padding: 8px;
  text-decoration: none;
}

.service-evidence-image img {
  height: 72px;
  object-fit: cover;
  width: 96px;
}

.service-evidence-image span {
  font-size: 13px;
  font-weight: 800;
}

.service-review-actions {
  background: #ffffff;
  bottom: 0;
  position: sticky;
  z-index: 2;
}

.empty strong,
.empty span {
  display: block;
}

.empty strong {
  color: var(--text);
  margin-bottom: 4px;
}

.next-step {
  align-items: center;
  background: #fffdf1;
  border: 1px solid #eadb8d;
  border-left: 5px solid var(--leaf);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.next-step.attention {
  background: #fff7ed;
  border-color: #fed7aa;
  border-left-color: var(--coral);
}

.next-step.success {
  background: #effaf3;
  border-color: #bce4c9;
  border-left-color: var(--ok);
}

.next-step .eyebrow {
  color: var(--brand-strong);
  display: block;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.next-step h2 {
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
}

.next-step p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 5px 0 0;
}

.report-page {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  margin-top: 14px;
  padding: 22px;
}

.report-cover {
  align-items: center;
  background: #163fd8;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr;
  padding: 20px;
}

.report-logo {
  background: #ffffff;
  border-radius: 8px;
  display: block;
  height: 88px;
  object-fit: contain;
  padding: 6px;
  width: 120px;
}

.report-cover h2 {
  font-size: 26px;
  line-height: 1.1;
  margin: 0 0 6px;
}

.report-cover p {
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

.notice {
  background: #f1f8ff;
  border: 1px solid #cfe3ff;
  border-radius: 8px;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
}

.notice.warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #92400e;
}

.toast {
  animation: toast-in 180ms ease-out;
  background: #20312e;
  border-radius: 8px;
  bottom: 18px;
  box-shadow: var(--shadow);
  color: #ffffff;
  font-weight: 800;
  left: 50%;
  max-width: min(90vw, 480px);
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 80;
}

@keyframes loading-line {
  from { transform: translateX(-110%); }
  to { transform: translateX(350%); }
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.workspace > .hero-band,
.workspace > .next-step,
.workspace > .panel,
.workspace > .grid,
.workspace > .split,
.workspace > .metric-grid {
  animation: enter-up 180ms ease-out both;
}

.modal-card {
  animation: enter-up 180ms ease-out both;
}

.hidden {
  display: none !important;
}

.login-role-tabs {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
}

.login-role-tabs button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  min-height: 38px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

.login-role-tabs button.active {
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(18, 60, 243, 0.12);
  color: var(--brand-strong);
}

.login-submit {
  min-height: 48px;
}

.login-trust {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 8px;
  justify-content: center;
}

.login-trust span {
  color: var(--ok);
  font-size: 10px;
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
}

.pagination .row-actions {
  align-items: center;
}

.attendance-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attendance-controls .field,
.month-field {
  min-width: 150px;
}

.attendance-actions {
  flex-wrap: wrap;
}

.button.active-status {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.attendance-status {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  min-height: 28px;
  padding: 4px 9px;
}

.attendance-status.present {
  background: #e9f8ef;
  border-color: #b8e2c7;
  color: #12632f;
}

.attendance-status.late {
  background: #fff7df;
  border-color: #f3d287;
  color: #8a4d04;
}

.attendance-status.absent {
  background: #fff0ee;
  border-color: #efb8af;
  color: #9f261b;
}

.attendance-status.excused {
  background: #eaf3ff;
  border-color: #b7d3fb;
  color: #174f9d;
}

.attendance-status.unmarked {
  background: var(--soft);
  color: var(--muted);
}

.attendance-calendar {
  min-width: 0;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 7px;
  text-align: center;
}

.calendar-day {
  aspect-ratio: 1;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 6px;
  position: relative;
}

.calendar-day > span {
  font-size: 12px;
  font-weight: 800;
}

.calendar-day i {
  align-self: center;
  border-radius: 999px;
  height: 8px;
  justify-self: center;
  width: 8px;
}

.calendar-day small {
  font-size: 9px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day.present {
  background: #f1fbf5;
  border-color: #b8e2c7;
}

.calendar-day.present i { background: var(--ok); }
.calendar-day.late { background: #fff9e9; border-color: #f3d287; }
.calendar-day.late i { background: var(--amber); }
.calendar-day.absent { background: #fff3f1; border-color: #efb8af; }
.calendar-day.absent i { background: var(--danger); }
.calendar-day.excused { background: #eff6ff; border-color: #b7d3fb; }
.calendar-day.excused i { background: var(--sky); }
.calendar-day.weekend:not(.present):not(.late):not(.absent):not(.excused) { background: #f5f6f8; color: #8b9492; }
.calendar-day.empty-day { background: transparent; border-color: transparent; }

.appointment-list {
  display: grid;
  gap: 10px;
}

.appointment-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  padding: 10px 0 16px;
}

.appointment-item:last-child {
  border-bottom: 0;
}

.appointment-date {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 54px;
  justify-content: center;
}

.appointment-date strong { font-size: 20px; line-height: 1; }
.appointment-date span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.appointment-item h3 { font-size: 15px; margin: 2px 0 5px; overflow-wrap: anywhere; }
.appointment-item p { color: var(--muted); font-size: 12px; margin: 0; }
.appointment-side { align-items: flex-end; display: flex; flex-direction: column; gap: 8px; }
.eyebrow { color: var(--brand-strong); font-size: 10px; font-weight: 850; text-transform: uppercase; }

.check-field {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check-field input {
  accent-color: var(--brand);
  height: 18px;
  width: 18px;
}

@media (max-width: 1120px) {
  .grid.four,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .opportunity-grid,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    overflow: hidden;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand-copy span,
  .search-wrap,
  .portal-context,
  .status-pill {
    display: none;
  }

  .topbar-actions {
    overflow: hidden;
  }

  .role-switcher {
    justify-self: end;
  }

  .role-switcher button {
    font-size: 12px;
    padding: 0 8px;
  }

  .layout {
    display: block;
    padding-bottom: 72px;
  }

  .sidebar {
    border-right: 0;
    border-top: 1px solid var(--line);
    bottom: 0;
    height: auto;
    left: 0;
    overflow-x: auto;
    padding: 8px;
    position: fixed;
    right: 0;
    scrollbar-width: none;
    top: auto;
    z-index: 30;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .nav-section-title {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    width: max-content;
  }

  .sidebar.role-parent .nav-list {
    width: 100%;
  }

  .sidebar.role-parent .nav-button {
    flex: 1 1 0;
    min-width: 70px;
  }

  .nav-button {
    flex: 0 0 84px;
    gap: 4px;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 54px;
    padding: 5px;
    text-align: center;
  }

  .nav-button span:nth-child(2) {
    font-size: 11px;
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-count {
    display: none;
  }

  .workspace {
    padding: 14px;
  }

  .hero-band {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .next-step {
    grid-template-columns: 1fr;
  }

  .next-step .button {
    width: 100%;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .hero-actions .button {
    flex: 1 1 150px;
  }

  .metric-grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .opportunity-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .profile-head {
    align-items: start;
    grid-template-columns: auto 1fr;
  }

  .profile-head .row-actions {
    grid-column: 1 / -1;
  }

  .service-active-card {
    grid-template-columns: 1fr;
  }

  .service-student-grid {
    grid-template-columns: 1fr;
  }

  .service-live-time {
    min-width: 0;
  }

  .service-timer-actions {
    justify-content: stretch;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .brand {
    min-width: 58px;
    width: 58px;
  }

  .brand-copy {
    display: none;
  }

  .install-button {
    display: none;
  }

  .notification-button {
    font-size: 11px;
    min-height: 34px;
    padding-inline: 8px;
  }

  .notification-wide {
    display: none;
  }

  .notification-short {
    display: inline;
  }

.brand-mark {
    height: 34px;
    width: 34px;
  }

  .brand-logo {
    height: 36px;
    width: 58px;
  }

  .login-logo {
    max-width: 230px;
  }

  .login-card {
    padding: 18px;
  }

  .login-card h1 {
    font-size: 26px;
  }

  .login-role-tabs button {
    font-size: 11px;
    padding: 5px 3px;
  }

  .role-switcher {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .role-switcher::-webkit-scrollbar {
    display: none;
  }

  .workspace {
    padding: 12px;
  }

  .hero-band {
    margin-bottom: 12px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-actions .button {
    min-width: 0;
    width: 100%;
  }

  .hero-band h1 {
    font-size: 24px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-actions,
  .row-actions,
  .table-actions {
    width: 100%;
  }

  .button,
  .panel-actions .button,
  .row-actions .button,
  .table-actions .button {
    min-height: 42px;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  td {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr);
    padding: 10px;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.3;
    text-transform: uppercase;
  }

  td.table-actions {
    grid-template-columns: 1fr;
  }

  td.table-actions::before {
    display: none;
  }

  td.table-actions .button {
    flex: 1 1 100%;
  }

  .student-cell {
    align-items: flex-start;
  }

  .report-cover {
    grid-template-columns: 1fr;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .attendance-controls,
  .attendance-controls .field,
  .month-field {
    width: 100%;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 3px;
  }

  .calendar-day {
    min-height: 42px;
    padding: 4px;
  }

  .calendar-day small {
    display: none;
  }

  .calendar-day i {
    height: 7px;
    width: 7px;
  }

  .appointment-item {
    align-items: start;
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .appointment-side {
    align-items: flex-start;
    grid-column: 2;
  }

  .drawer-panel {
    padding: 14px;
  }

  .modal {
    align-items: stretch;
    padding: 10px;
  }

  .modal-card {
    max-height: none;
  }

  .service-progress-head {
    align-items: flex-start;
  }

  .service-progress-head strong {
    font-size: 18px;
  }

  .service-progress-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .service-activity-row,
  .service-activity-card,
  .service-session-summary {
    grid-template-columns: 1fr;
  }

  .service-activity-row .row-actions,
  .service-activity-card .row-actions {
    justify-content: stretch;
  }

  .service-review-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-review-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .service-review-actions .button,
  .service-live-time .button {
    width: 100%;
  }

  .certificate-ready {
    align-items: stretch;
    flex-direction: column;
  }

  .certificate-ready .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .sidebar,
  .hero-band,
  .panel-actions,
  .filters,
  .button,
  .icon-button,
  .toast {
    display: none !important;
  }

  .layout,
  .workspace {
    display: block;
    padding: 0;
  }

  .panel,
  .report-page {
    border: 0;
    box-shadow: none;
  }
}

.access-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-band h1[tabindex="-1"]:focus {
  outline: none;
}

.access-card .panel-header {
  min-height: 96px;
}

.switch-field {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
}

.switch-field input {
  accent-color: var(--blue);
  height: 20px;
  width: 20px;
}

.home-review-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-review {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
}

.home-review.missing {
  background: #f8fafc;
  justify-content: center;
  min-height: 220px;
}

.evidence-image,
.opportunity-image {
  aspect-ratio: 16 / 10;
  background: #eef2f7;
  display: block;
  object-fit: cover;
  width: 100%;
}

.home-review .evidence-image {
  border-radius: 6px;
}

.evidence-image.large {
  max-height: 520px;
}

.home-submission {
  margin: 0 auto;
  max-width: 860px;
  overflow: hidden;
}

.home-note {
  font-size: 16px;
  line-height: 1.65;
}

.rating-display {
  align-items: center;
  background: #fff7d6;
  border: 1px solid #f2ce58;
  border-radius: 6px;
  color: #745400;
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  padding: 7px 10px;
  white-space: nowrap;
}

.row-between {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.process-steps {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-steps > div {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.process-steps > div + div {
  border-left: 1px solid var(--line);
}

.process-steps span {
  color: var(--muted);
  line-height: 1.5;
}

.camera-modal {
  max-width: 720px;
}

.camera-stage,
.camera-preview {
  aspect-ratio: 4 / 3;
  background: #111827;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.camera-stage video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.camera-status {
  bottom: 0;
  color: #fff;
  left: 0;
  padding: 18px;
  position: absolute;
  right: 0;
  text-align: center;
}

.camera-shutter {
  margin-top: 12px;
  width: 100%;
}

.home-followup-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.rating-picker {
  border: 0;
  margin: 0;
  padding: 0;
}

.rating-picker legend {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.rating-picker > div {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(10, minmax(38px, 1fr));
}

.rating-picker label {
  cursor: pointer;
  position: relative;
}

.rating-picker input {
  opacity: 0;
  position: absolute;
}

.rating-picker label > span {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #9ca3af;
  display: flex;
  font-size: 20px;
  height: 42px;
  justify-content: center;
}

.rating-picker input:checked + span,
.rating-picker label:hover > span {
  background: #fff4bf;
  border-color: #e8bf33;
  color: #a87600;
}

.rating-picker small {
  display: block;
  margin-top: 3px;
  text-align: center;
}

.privacy-copy {
  font-size: 12px;
  text-align: center;
}

.opportunity {
  overflow: hidden;
  padding: 0 !important;
}

.opportunity-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.opportunity-details {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.opportunity-details div {
  border-left: 3px solid #21a179;
  min-width: 0;
  padding-left: 9px;
}

.opportunity-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.opportunity-details dd {
  font-weight: 700;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.opportunity-image-preview img {
  aspect-ratio: 16 / 7;
  border-radius: 6px;
  object-fit: cover;
  width: 100%;
}

.portal-opportunities {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.conversation-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  min-height: 620px;
}

.conversation-list,
.conversation-detail {
  min-width: 0;
  overflow: hidden;
}

.conversation-items {
  display: grid;
  max-height: 650px;
  overflow-y: auto;
}

.conversation-item {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}

.conversation-item.active {
  background: #eef3ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.conversation-item > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.conversation-head {
  border-bottom: 1px solid var(--line);
}

.message-thread {
  background: #f7f9fc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  min-height: 330px;
  overflow-y: auto;
  padding: 18px;
}

.message {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: min(82%, 680px);
  padding: 12px;
}

.message.mine {
  align-self: flex-end;
  background: #eaf8f2;
  border-color: #b5dfcf;
}

.message > div:first-child {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.message > div:first-child span {
  color: var(--muted);
  font-size: 11px;
}

.message p {
  line-height: 1.55;
  margin-bottom: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-reference {
  background: #fff;
  border: 1px solid #9bb4ff;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.message-reference span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.message-compose {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 16px;
}

.compose-actions {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 1050px) {
  .home-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 800px) {
  .access-grid,
  .home-review-grid,
  .portal-opportunities,
  .conversation-layout,
  .process-steps {
    grid-template-columns: 1fr;
  }

  .process-steps > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .conversation-layout {
    min-height: 0;
  }

  .conversation-items {
    max-height: 260px;
  }

  .message-thread {
    min-height: 280px;
  }

  .message {
    max-width: 94%;
  }

  .compose-actions,
  .row-between {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .rating-picker > div {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
  }

  .opportunity-details {
    grid-template-columns: 1fr;
  }
}

/* Formularios */
.forms-workspace {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.forms-list {
  display: grid;
  max-height: 680px;
  overflow-y: auto;
}

.form-list-item {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  min-height: 72px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.form-list-item:hover,
.form-list-item.active {
  background: #f5f8ff;
}

.form-list-item.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.form-color {
  align-self: stretch;
  border-radius: 3px;
}

.form-list-copy {
  min-width: 0;
}

.form-list-copy strong,
.form-list-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-list-copy strong {
  font-size: 13px;
}

.form-list-copy small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.form-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475569;
  font-size: 10px;
  font-weight: 850;
  padding: 4px 7px;
  white-space: nowrap;
}

.form-status.status-published { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.form-status.status-closed { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.form-status.status-draft { background: #f8fafc; color: #475569; }
.form-status.status-archived { background: #f1f5f9; color: #64748b; }

.form-admin-heading {
  align-items: flex-start;
  border-top: 4px solid var(--form-color);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.form-admin-heading h2 {
  font-size: 20px;
  margin: 10px 0 4px;
  overflow-wrap: anywhere;
}

.form-admin-heading p,
.responses-heading p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.form-share-row {
  align-items: center;
  background: #f8fafc;
  border-block: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px 18px;
}

.form-share-row div {
  min-width: 0;
}

.form-share-row span,
.form-share-row strong {
  display: block;
}

.form-share-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  margin-bottom: 4px;
}

.form-share-row strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 0;
}

.responses-heading {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 20px 18px 12px;
}

.responses-heading h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.responses-tools {
  align-items: center;
  display: flex;
  gap: 8px;
}

.compact-search input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 7px 10px;
  width: min(230px, 28vw);
}

.form-response-list {
  border-top: 1px solid var(--line);
}

.form-response-row {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr) auto;
  padding: 13px 18px;
  text-align: left;
  width: 100%;
}

.form-response-row:hover { background: #f8fafc; }
.response-number { color: var(--brand-strong); font-size: 11px; font-weight: 850; }
.response-summary { min-width: 0; }
.response-summary strong,
.response-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.response-summary strong { font-size: 13px; }
.response-summary small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.response-open { color: var(--brand-strong); font-size: 12px; font-weight: 800; }

.empty-forms-state .panel-body {
  align-items: center;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 260px;
  text-align: center;
}

.empty-forms-state p { color: var(--muted); margin: 0 0 8px; }

.form-builder-modal {
  display: flex;
  flex-direction: column;
  max-width: 1040px;
  overflow: hidden;
  width: min(100%, 1040px);
}

.form-builder-modal .modal-head p,
.response-modal .modal-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.form-builder-body {
  display: block;
  overflow-y: auto;
  padding: 0;
}

.builder-section {
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.builder-section:last-child { border-bottom: 0; }

.builder-section-heading {
  align-items: flex-start;
  display: flex;
  gap: 11px;
  margin-bottom: 16px;
}

.builder-section-heading > span {
  align-items: center;
  background: var(--brand);
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 28px;
  font-size: 12px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
}

.builder-section-heading h3 { font-size: 16px; margin: 1px 0 3px; }
.builder-section-heading p { color: var(--muted); font-size: 12px; margin: 0; }
.builder-check { align-self: center; min-height: 58px; padding-top: 17px; }

.builder-fields {
  display: grid;
  gap: 10px;
}

.builder-field {
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px;
}

.builder-field-index span {
  align-items: center;
  background: #e8edff;
  border-radius: 6px;
  color: var(--brand-strong);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.builder-field-content { display: grid; gap: 10px; min-width: 0; }
.builder-field-actions { display: flex; flex-direction: column; gap: 6px; }
.builder-field-actions .icon-button { height: 32px; width: 32px; }
.danger-icon { color: var(--danger); }

.builder-add-field {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #b8c4d8;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
}

.builder-add-field select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 7px 10px;
}

.form-theme-controls input[type="color"] { cursor: pointer; padding: 4px; }

.response-modal { max-width: 680px; }
.response-detail-list { gap: 0; padding: 0; }
.response-detail { border-bottom: 1px solid var(--line); padding: 15px 18px; }
.response-detail > span { color: var(--muted); display: block; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.response-detail p { line-height: 1.5; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.response-file { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; display: block; padding: 11px; text-align: left; width: 100%; }
.response-file + .response-file { margin-top: 7px; }
.response-file strong,
.response-file small { display: block; overflow-wrap: anywhere; }
.response-file small { color: var(--brand-strong); font-size: 11px; margin-top: 4px; }

/* Formulario público */
.public-form-shell {
  --form-primary: #123cf3;
  --form-accent: #ffd400;
  --form-on-primary: #ffffff;
  background: #f3f6fb;
  color: #17211f;
  min-height: 100vh;
  padding: 22px 16px 34px;
}

.public-form-shell::before {
  background: var(--form-accent);
  content: "";
  display: block;
  height: 5px;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 2;
}

.public-form-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 auto 20px;
  max-width: 760px;
}

.public-form-brand img { height: 43px; object-fit: contain; width: 82px; }
.public-form-brand span { border-left: 1px solid #cbd5e1; color: #46544f; font-size: 12px; font-weight: 750; line-height: 1.25; padding-left: 12px; }

.public-form-layout {
  background: #ffffff;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(25, 38, 60, 0.08);
  margin: auto;
  max-width: 760px;
  overflow: hidden;
}

.public-form-intro {
  border-top: 7px solid var(--form-primary);
  padding: 28px 30px 25px;
}

.form-reference {
  color: var(--form-primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 9px;
  text-transform: uppercase;
}

.public-form-intro h1 {
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

.public-form-description {
  color: #52615d;
  line-height: 1.65;
  margin: 14px 0 0;
}

.public-form-deadline {
  border-left: 3px solid var(--form-accent);
  color: #364540;
  font-size: 12px;
  font-weight: 750;
  margin: 18px 0 0;
  padding-left: 10px;
}

.public-form { border-top: 1px solid #e2e8f0; }
.public-fields { display: grid; }

.public-field {
  border: 0;
  border-bottom: 1px solid #e7ebf1;
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 22px 30px;
}

.public-field legend {
  float: left;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 2px;
  padding: 0;
  width: 100%;
}

.required-mark { color: #b42318; }
.public-field > p { clear: both; color: #687772; font-size: 12px; line-height: 1.45; margin: 0; }

.public-field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.public-field select,
.public-field textarea {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #17211f;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

.public-field textarea { min-height: 110px; resize: vertical; }
.public-field input:focus,
.public-field select:focus,
.public-field textarea:focus { border-color: var(--form-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--form-primary) 17%, transparent); outline: 0; }

.public-choice-list { display: grid; gap: 8px; }
.public-choice-list label { align-items: center; background: #f8fafc; border: 1px solid #dfe5ee; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; min-height: 46px; padding: 10px 12px; }
.public-choice-list label:has(input:checked) { background: color-mix(in srgb, var(--form-primary) 7%, white); border-color: var(--form-primary); }
.public-choice-list input { accent-color: var(--form-primary); flex: 0 0 auto; height: 18px; width: 18px; }

.public-file-control {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #9daaba;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  min-height: 78px;
  padding: 14px;
  text-align: center;
}

.public-file-control:hover { border-color: var(--form-primary); }
.public-file-control input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.public-file-control span { color: var(--form-primary); font-size: 13px; font-weight: 850; }
.public-file-control small { color: #64748b; font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; }

.public-honeypot { left: -10000px; position: absolute; }

.public-form-submit {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 20px 30px;
}

.public-form-submit > p { color: #687772; font-size: 11px; line-height: 1.45; margin: 0; max-width: 420px; }
.public-submit-button { background: var(--form-primary); border: 1px solid var(--form-primary); border-radius: 8px; color: var(--form-on-primary); font-weight: 850; min-height: 46px; padding: 0 22px; }
.public-submit-button:hover:not(:disabled) { filter: brightness(0.94); }
.public-form-error { background: #fff1f2; border: 1px solid #fecdd3; border-radius: 8px; color: #9f1239; flex-basis: 100%; font-size: 12px; line-height: 1.45; padding: 10px 12px; }
.public-form-unavailable { border-top: 1px solid #e2e8f0; padding: 30px; }
.public-form-unavailable h2 { font-size: 18px; margin: 0 0 8px; }
.public-form-unavailable p { color: #64748b; margin: 0; }
.public-form-footer { color: #7a8783; font-size: 11px; margin: 18px auto 0; max-width: 760px; text-align: center; }

.public-form-status {
  background: #ffffff;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(25, 38, 60, 0.08);
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 12vh auto 0;
  max-width: 520px;
  padding: 34px;
  text-align: center;
}

.public-form-status img { height: 72px; object-fit: contain; width: 160px; }
.public-form-status h1 { font-size: 25px; letter-spacing: 0; margin: 8px 0 0; }
.public-form-status > p:not(.form-reference) { color: #64748b; line-height: 1.55; margin: 0; }
.success-state { border-top: 6px solid var(--form-primary); }
.success-mark { align-items: center; background: #dcfce7; border: 1px solid #86efac; border-radius: 50%; color: #15803d; display: flex; font-size: 24px; font-weight: 900; height: 54px; justify-content: center; width: 54px; }
.response-receipt { background: #f8fafc; border: 1px solid #dfe5ee; border-radius: 8px; margin-top: 8px; padding: 12px 18px; }
.response-receipt span,
.response-receipt strong { display: block; }
.response-receipt span { color: #64748b; font-size: 10px; font-weight: 750; margin-bottom: 4px; }
.response-receipt strong { color: var(--form-primary); font-size: 14px; }

@media (max-width: 1120px) {
  .forms-workspace { grid-template-columns: 1fr; }
  .forms-list { max-height: 330px; }
}

@media (max-width: 700px) {
  .form-admin-heading,
  .form-share-row,
  .responses-heading,
  .responses-tools { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .compact-search input { width: 100%; }
  .form-response-row { grid-template-columns: 1fr auto; }
  .response-number { grid-column: 1 / -1; }
  .builder-field { grid-template-columns: 1fr; }
  .builder-field-index { display: none; }
  .builder-field-actions { flex-direction: row; justify-content: flex-end; order: -1; }
  .builder-add-field { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .modal:has(.form-builder-modal) { padding: 0; }
  .form-builder-modal { border-radius: 0; height: 100vh; max-height: 100vh; }
  .public-form-shell { padding: 14px 10px 28px; }
  .public-form-brand { margin-bottom: 12px; }
  .public-form-brand img { height: 38px; width: 72px; }
  .public-form-intro { padding: 22px 18px; }
  .public-form-intro h1 { font-size: 24px; }
  .public-field { padding: 19px 18px; }
  .public-form-submit { align-items: stretch; display: grid; padding: 18px; }
  .public-submit-button { width: 100%; }
  .public-form-status { margin-top: 8vh; padding: 26px 20px; }
}
