/* Ustaad-X v0.9 — multi-course enrolment and verified tutor marketplace */

.v9-subject-fieldset {
  border-color: rgba(13, 118, 110, .3);
  background: linear-gradient(180deg, rgba(223, 243, 237, .35), rgba(255, 255, 255, .92));
}

.v9-subject-toolbar,
.v9-form-footer,
.v9-card-head,
.v9-tutor-head,
.v9-mode-head,
.v9-admin-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.v9-subject-toolbar { margin-bottom: 10px; }
.v9-subject-toolbar p { margin: 0; display: grid; gap: 4px; }
.v9-subject-toolbar p span { color: var(--teal); font-size: 11px; }

.v9-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.v9-link-button:hover { color: var(--navy); }

.v9-info-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(13, 118, 110, .18);
  border-radius: var(--radius);
  background: linear-gradient(115deg, rgba(223, 243, 237, .95), rgba(255, 255, 255, .92));
  box-shadow: var(--shadow-small);
}
.v9-info-banner strong { color: var(--navy); }
.v9-info-banner p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; font-size: 12px; }
.v9-count-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}

.v9-course-catalogue,
.v9-card-grid,
.v9-tutor-grid,
.v9-mode-grid,
.v9-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 13px;
}

.v9-course-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfb;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.v9-course-choice:hover { transform: translateY(-1px); border-color: rgba(13, 118, 110, .42); }
.v9-course-choice.selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 118, 110, .08); background: rgba(223, 243, 237, .38); }
.v9-course-choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); }
.v9-course-choice strong { display: block; color: var(--navy); font-size: 14px; }
.v9-course-choice span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.v9-course-choice small { display: inline-flex; margin-top: 9px; padding: 4px 7px; border-radius: 999px; background: var(--white); color: var(--teal-dark); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.v9-course-choice.is-paused small { color: #835c12; background: #fff5d9; }
.v9-course-choice.is-completed small { color: #4e498a; background: #eeebff; }

.v9-form-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 850;
}

.v9-enrollment-card,
.v9-tutor-card,
.v9-offering-card,
.v9-review-card,
.v9-admin-card,
.v9-mode-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  box-shadow: var(--shadow-small);
}
.v9-enrollment-card h4,
.v9-tutor-card h4,
.v9-offering-card h4,
.v9-review-card h4,
.v9-admin-card h4,
.v9-mode-card h4 { margin: 0; color: var(--navy); font-size: 15px; }
.v9-enrollment-card p,
.v9-tutor-card p,
.v9-offering-card p,
.v9-review-card p,
.v9-admin-card p,
.v9-mode-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.v9-card-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.v9-card-actions .button { padding: 9px 12px; font-size: 10px; }

.v9-tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.v9-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 800;
}
.v9-tag.neutral { background: #edf1f2; color: #4c5d64; }
.v9-tag.gold { background: #fff3cf; color: #795c0c; }
.v9-tag.alert { background: #fde8e8; color: #8e3434; }

.v9-marketplace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, .42fr);
  gap: 18px;
  align-items: start;
}
.v9-filter-grid,
.v9-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.v9-filter-grid .button { align-self: end; }
.v9-any-tutor-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  background: linear-gradient(120deg, var(--navy), var(--navy-soft));
  color: var(--white);
}
.v9-any-tutor-card small { color: var(--lime); font-weight: 850; letter-spacing: .1em; }
.v9-any-tutor-card h3 { margin: 5px 0 7px; color: var(--white); }
.v9-any-tutor-card p { margin: 0; max-width: 720px; color: rgba(255, 255, 255, .68); font-size: 11px; line-height: 1.55; }
.v9-any-tutor-card .button { flex: 0 0 auto; }
.v9-tutor-grid { margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); }
.v9-tutor-card { cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.v9-tutor-card:hover, .v9-tutor-card.active { transform: translateY(-2px); border-color: var(--teal); }
.v9-tutor-card.active { box-shadow: 0 0 0 3px rgba(13, 118, 110, .08), var(--shadow-small); }
.v9-tutor-head { align-items: flex-start; }
.v9-tutor-identity { display: flex; gap: 11px; align-items: center; min-width: 0; }
.v9-tutor-avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--teal), var(--navy));
  color: var(--white);
  font-weight: 900;
}
.v9-rating { color: #8a6400; font-size: 10px; font-weight: 850; white-space: nowrap; }
.v9-price { margin-top: 12px; color: var(--navy); font-size: 18px; font-weight: 900; }
.v9-price small { color: var(--muted); font-size: 9px; font-weight: 650; }
.v9-sticky-panel { position: sticky; top: 20px; min-height: 350px; }
.v9-detail-profile { display: grid; gap: 15px; }
.v9-detail-profile h3 { margin: 0; color: var(--navy); font-size: 22px; }
.v9-detail-profile h4 { margin: 0; color: var(--navy); }
.v9-detail-profile p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.v9-detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.v9-detail-facts div { padding: 10px; border-radius: 10px; background: #f4f7f6; }
.v9-detail-facts strong { display: block; color: var(--navy); font-size: 13px; }
.v9-detail-facts small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.v9-public-review { padding: 11px 0; border-top: 1px solid var(--line); }
.v9-public-review:first-child { border-top: 0; }
.v9-public-review p { margin-top: 5px; }

.v9-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.v9-form-stack { display: grid; gap: 14px; }

.v9-availability-week { display: grid; gap: 8px; }
.v9-day-row {
  display: grid;
  grid-template-columns: minmax(94px, .7fr) repeat(4, minmax(86px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfb;
}
.v9-day-toggle { display: flex; flex-direction: row; align-items: center; gap: 7px; min-height: 42px; text-transform: capitalize; }
.v9-day-toggle input { width: auto; accent-color: var(--teal); }
.v9-day-row label { font-size: 9px; }
.v9-day-row input:disabled { background: #eef1f0; color: #94a0a5; }

.v9-offering-editor {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 17px;
  border: 1px solid rgba(13, 118, 110, .25);
  border-radius: 15px;
  background: rgba(223, 243, 237, .28);
}
.v9-offering-card[data-status="approved"] { border-left: 4px solid var(--teal); }
.v9-offering-card[data-status="submitted"] { border-left: 4px solid #c69317; }
.v9-offering-card[data-status="rejected"],
.v9-offering-card[data-status="suspended"] { border-left: 4px solid var(--red); }
.v9-quality-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); margin-bottom: 14px; }
.v9-quality-metric { padding: 14px; border-radius: 12px; background: #f4f7f6; }
.v9-quality-metric strong { display: block; color: var(--navy); font-size: 25px; }
.v9-quality-metric small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.v9-review-list, .v9-card-list { display: grid; gap: 10px; }

.v9-mode-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.v9-mode-card select { margin-top: 12px; }
.v9-admin-card { display: grid; gap: 10px; }
.v9-admin-card .v9-admin-actions textarea { flex: 1 1 230px; min-height: 68px; }
.v9-admin-actions { align-items: stretch; }
.v9-admin-actions .button { padding: 9px 12px; font-size: 10px; }
.v9-admin-metadata { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.v9-admin-metadata div { padding: 8px; border-radius: 9px; background: #f4f7f6; }
.v9-admin-metadata strong { display: block; font-size: 10px; color: var(--navy); }
.v9-admin-metadata small { color: var(--muted); font-size: 8px; }

.v9-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 30px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: 0 30px 100px rgba(5, 30, 39, .34);
}
.v9-dialog::backdrop { background: rgba(7, 28, 35, .68); backdrop-filter: blur(3px); }
.v9-dialog-card { position: relative; display: grid; gap: 15px; padding: 28px; background: var(--white); overflow-y: auto; max-height: calc(100vh - 30px); }
.v9-dialog-card h2 { margin: 0; color: var(--navy); }
.v9-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  font-size: 22px;
}
.v9-slot-list { display: flex; gap: 7px; flex-wrap: wrap; min-height: 1px; }
.v9-slot-button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; background: var(--white); color: var(--navy); font-size: 10px; font-weight: 800; }
.v9-slot-button:hover, .v9-slot-button.selected { border-color: var(--teal); background: var(--mint); color: var(--teal-dark); }
.v9-price-preview { padding: 12px 14px; border-radius: 11px; background: var(--navy); color: var(--white); font-size: 11px; line-height: 1.5; }
.v9-price-preview strong { color: var(--lime); font-size: 18px; }
.v9-rating-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.v9-booking-meta { color: var(--teal-dark) !important; font-size: 10px !important; font-weight: 750; }

@media (max-width: 1120px) {
  .v9-marketplace-layout { grid-template-columns: 1fr; }
  .v9-sticky-panel { position: static; }
  .v9-quality-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}

@media (max-width: 820px) {
  .v9-two-column { grid-template-columns: 1fr; }
  .v9-filter-grid, .v9-form-grid { grid-template-columns: 1fr; }
  .v9-day-row { grid-template-columns: 1fr 1fr; }
  .v9-day-toggle { grid-column: 1 / -1; }
  .v9-rating-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v9-info-banner, .v9-any-tutor-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 540px) {
  .v9-course-catalogue, .v9-card-grid, .v9-tutor-grid, .v9-mode-grid { grid-template-columns: 1fr; }
  .v9-day-row { grid-template-columns: 1fr; }
  .v9-day-toggle { grid-column: auto; }
  .v9-rating-grid, .v9-detail-facts, .v9-quality-grid, .v9-admin-metadata { grid-template-columns: 1fr; }
  .v9-dialog-card { padding: 24px 18px 20px; }
}
