/* Standalone UI refinement layer for SIMMED portal markup */

:root {
  --sim-bg: #f3f6fb;
  --sim-surface: #ffffff;
  --sim-text: #1f2937;
  --sim-muted: #6b7280;
  --sim-primary: #1d4ed8;
  --sim-primary-strong: #1e40af;
  --sim-border: #dbe3ef;
  --sim-success: #166534;
  --sim-success-bg: #dcfce7;
  --sim-danger: #991b1b;
  --sim-danger-bg: #fee2e2;
  --sim-warning: #92400e;
  --sim-warning-bg: #fef3c7;
  --sim-radius: 14px;
  --sim-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body.simmed-standalone {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--sim-text);
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 35%), var(--sim-bg);
}

/* Make the app itself full-page width/height */
.sim-portal-root {
  width: 100%;
  max-width: none !important;
}

.sim-portal {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  min-height: 100dvh;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.sim-portal-app {
  border-radius: 0 !important;
  min-height: 100dvh;
}

.sim-section-card,
.sim-student-panel,
.sim-teacher-panel {
  border: 1px solid var(--sim-border);
}

.sim-message {
  border-width: 1px;
  border-left-width: 5px;
}

.sim-message-success {
  color: var(--sim-success);
  background: var(--sim-success-bg);
}

.sim-message-error {
  color: var(--sim-danger);
  background: var(--sim-danger-bg);
}

.sim-teacher-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.sim-teacher-sidebar-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.28rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.sim-portal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  padding: 1.2rem 1.35rem 1.5rem;
  color: #64748b;
  font-size: 0.83rem;
  line-height: 1.55;
  text-align: center;
}

.sim-portal-footer-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.9;
}

.sim-portal-footer-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  max-width: 760px;
}

.sim-portal-footer-line {
  margin: 0;
}

.sim-portal-footer-line-primary {
  color: #334155;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sim-student-mysims-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sim-student-mysims-panel {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
  padding: 1.05rem 1.05rem 1.1rem;
  border-radius: 22px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.sim-student-mysims-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.sim-student-mysims-panel-head p {
  margin: 0.3rem 0 0;
  color: #64748b;
  line-height: 1.55;
}

.sim-student-mysims-table-wrap {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  overflow: hidden;
}

.sim-student-mysims-table {
  margin: 0;
}

.sim-student-mysims-table td .sim-badge,
.sim-student-mysims-panel-head .sim-badge {
  white-space: nowrap;
}

.sim-student-mysims-empty {
  margin: 0;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.sim-btn,
button,
input[type="submit"] {
  border-radius: 10px;
}

table {
  border-collapse: collapse;
}

th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

tr:hover td {
  background: #f8fbff;
}

/* Force teacher month view to remain a true 7-column grid on desktop. */
.sim-teacher-section-calendar .sim-teacher-calendar-wrapper {
  display: block;
  overflow-x: hidden;
}

.sim-student-calendar {
  overflow-x: hidden !important;
}

.sim-student-calendar .sim-calendar-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

.sim-teacher-section-calendar .sim-calendar-table.sim-teacher-calendar {
  display: table !important;
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.sim-teacher-section-calendar .sim-calendar-table.sim-teacher-calendar thead {
  display: table-header-group;
}

.sim-teacher-section-calendar .sim-calendar-table.sim-teacher-calendar tbody {
  display: table-row-group;
}

.sim-teacher-section-calendar .sim-calendar-table.sim-teacher-calendar tr {
  display: table-row;
}

.sim-teacher-section-calendar .sim-calendar-table.sim-teacher-calendar th,
.sim-teacher-section-calendar .sim-calendar-table.sim-teacher-calendar td {
  display: table-cell;
  width: 14.2857%;
  min-width: 0;
  vertical-align: top;
}

.sim-teacher-section-calendar td.sim-calendar-cell.sim-calendar-day {
  display: table-cell !important;
  height: 150px;
  vertical-align: top;
}

.sim-teacher-section-calendar td.sim-calendar-empty {
  display: table-cell !important;
}

.sim-teacher-section-calendar td.sim-calendar-cell .sim-calendar-date-label {
  display: inline-flex;
  margin-bottom: 0.45rem;
}

.sim-teacher-section-calendar td.sim-calendar-cell .sim-calendar-day-events {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.sim-teacher-section-calendar .sim-calendar-table.sim-teacher-calendar td {
  height: 150px;
}

.sim-teacher-sidebar-title {
  max-width: 420px;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: none;
}

.sim-teacher-sidebar-subtitle {
  margin-top: 0.3rem;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.sim-student-overview-header {
  display: flex;
  justify-content: center;
  margin-top: 1.15rem;
  margin-bottom: 1.25rem;
}

.sim-student-overview-identity {
  width: min(100%, 520px);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  position: relative;
  min-width: 0;
  padding: 1.35rem 1.35rem 1.15rem;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.sim-student-overview-pill-label {
  position: absolute;
  top: -0.7rem;
  left: 1.15rem;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sim-student-overview-avatar {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.24);
}

.sim-student-overview-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.sim-student-overview-copy h4 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
  white-space: normal;
}

.sim-student-overview-email {
  min-width: 0;
  font-size: 0.96rem;
  font-weight: 600;
  color: #475569;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-student-overview-metric-grid {
  margin-top: 0.25rem;
}

.sim-student-overview-profile-shell {
  margin-top: 1.3rem;
  padding: 1.1rem;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.sim-student-overview-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 0;
}

.sim-student-overview-summary-head h4 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}

.sim-student-overview-summary-head p {
  margin: 0.22rem 0 0;
  color: #64748b;
  line-height: 1.5;
}

.sim-student-profile-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sim-student-profile-detail-card {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.sim-student-profile-detail-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.sim-student-profile-detail-card strong {
  color: #0f172a;
  font-size: 1.08rem;
  line-height: 1.35;
}

.sim-student-profile-detail-note {
  margin: 0.18rem 0 0;
  color: #64748b;
  font-size: 0.83rem;
  line-height: 1.5;
}

.simmed-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.simmed-status-open {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.simmed-status-full {
  color: var(--sim-danger);
  background: var(--sim-danger-bg);
  border-color: #fecaca;
}

.simmed-status-waitlist {
  color: var(--sim-warning);
  background: var(--sim-warning-bg);
  border-color: #fde68a;
}

.sim-student-event-modal[aria-hidden="false"] {
  align-items: center !important;
  justify-content: center !important;
  overflow-y: auto;
  padding: 1rem;
}

.sim-student-event-modal .sim-event-modal-dialog {
  width: min(680px, 92vw);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow:
    0 30px 70px rgba(15, 23, 42, 0.24),
    0 10px 24px rgba(15, 23, 42, 0.08);
}

.sim-student-event-modal .sim-event-modal-header {
  padding: 1.35rem 1.4rem 1rem;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
}

.sim-student-event-modal .sim-event-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sim-student-event-modal .sim-event-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef6a4c, #d85b45);
  box-shadow: 0 10px 20px rgba(216, 91, 69, 0.22);
}

.sim-student-event-modal .sim-event-modal-close:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #e35c3d, #c94d37);
  transform: translateY(-1px) scale(1.03);
}

.sim-student-event-modal .sim-event-modal-body {
  padding: 1.25rem 1.4rem 1.4rem;
  gap: 1rem;
  overflow-y: auto;
}

.sim-student-event-modal .sim-student-event-modal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.sim-student-event-modal .sim-event-modal-datetime,
.sim-student-event-modal .sim-event-modal-location {
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
  font-size: 0.96rem;
  line-height: 1.5;
}

.sim-student-event-modal .sim-event-modal-datetime {
  color: #0f172a;
  font-weight: 700;
}

.sim-student-event-modal .sim-event-modal-location {
  color: #475569;
  font-weight: 600;
}

.sim-student-event-modal .sim-student-event-modal-policy,
.sim-student-event-modal .sim-student-event-modal-policy-status {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  color: #1e3a8a;
  line-height: 1.55;
}

.sim-student-event-modal .sim-student-event-modal-policy {
  font-weight: 700;
}

.sim-student-event-modal .sim-student-event-modal-policy-status {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.92rem;
}

.sim-student-event-modal .sim-event-modal-description {
  margin: 0;
  min-height: 72px;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  line-height: 1.65;
}

.sim-student-event-modal .sim-event-modal-description:empty {
  display: none;
}

.sim-student-event-modal .sim-event-modal-spots {
  margin: 0;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 34px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
}

.sim-student-event-modal .sim-event-modal-spots:empty {
  display: none;
}

.sim-student-event-modal .sim-event-modal-form {
  margin-top: 0.15rem;
  justify-content: flex-end;
}

.sim-student-event-modal .sim-event-modal-submit {
  min-width: 168px;
  min-height: 50px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.sim-student-event-modal .sim-event-modal-body::-webkit-scrollbar {
  width: 10px;
}

.sim-student-event-modal .sim-event-modal-body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.sim-student-event-modal .sim-event-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.sim-student-event-modal .sim-event-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.9);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Teacher modal refinements:
   - keep dialogs centered
   - move scrolling inside the modal body so rounded corners remain clean
   - make scrollbar visually part of the modal */
.sim-teacher-event-modal .sim-event-modal-dialog,
.sim-teacher-manage-modal .sim-event-modal-dialog {
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  max-height: calc(100dvh - 2rem);
}

.sim-teacher-event-modal .sim-event-modal-dialog {
  width: min(760px, 92vw);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.09), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow:
    0 28px 60px rgba(15, 23, 42, 0.22),
    0 10px 24px rgba(15, 23, 42, 0.08);
}

.sim-teacher-event-modal[aria-hidden="false"] {
  z-index: 10001;
}

.sim-teacher-manage-modal .sim-event-modal-dialog {
  width: min(1120px, 95vw);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow:
    0 30px 70px rgba(15, 23, 42, 0.24),
    0 10px 24px rgba(15, 23, 42, 0.08);
}

.sim-teacher-manage-modal[aria-hidden="false"] {
  z-index: 10000;
}

.sim-teacher-event-modal[aria-hidden="false"],
.sim-teacher-manage-modal[aria-hidden="false"] {
  align-items: center !important;
  justify-content: center !important;
  overflow-y: auto;
  padding: 1rem;
}

.sim-teacher-event-modal .sim-event-modal-header,
.sim-teacher-manage-modal .sim-event-modal-header {
  flex: 0 0 auto;
}

.sim-teacher-event-modal .sim-event-modal-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.sim-teacher-event-modal .sim-event-modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sim-teacher-manage-modal .sim-event-modal-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.sim-teacher-manage-modal .sim-event-modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sim-teacher-event-modal .sim-event-modal-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.sim-teacher-event-modal .sim-event-modal-close:hover {
  background: #eef2ff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.sim-teacher-manage-modal .sim-event-modal-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.sim-teacher-manage-modal .sim-event-modal-close:hover {
  background: #eef2ff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.sim-teacher-event-modal .sim-event-modal-body,
.sim-teacher-manage-modal .sim-event-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 0.4rem;
  margin-right: -0.15rem;
  scrollbar-gutter: stable;
}

.sim-teacher-event-modal .sim-event-modal-body {
  padding-right: 0.65rem;
}

.sim-teacher-manage-modal .sim-event-modal-body {
  padding-right: 0.65rem;
}

.sim-teacher-event-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.sim-teacher-event-form .sim-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.2rem;
  align-items: start;
}

.sim-teacher-event-form label {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
}

.sim-teacher-event-form .sim-form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.sim-teacher-event-form input[type="text"],
.sim-teacher-event-form input[type="number"],
.sim-teacher-event-form input[type="date"],
.sim-teacher-event-form input[type="time"],
.sim-teacher-event-form select,
.sim-teacher-event-form textarea {
  width: 100%;
  max-width: none;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.72rem 0.85rem;
  font-size: 0.92rem;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sim-teacher-event-form textarea {
  min-height: 132px;
  resize: vertical;
}

.sim-teacher-event-form input:focus,
.sim-teacher-event-form select:focus,
.sim-teacher-event-form textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.sim-teacher-event-form .sim-checkbox-inline {
  display: flex;
  align-items: center;
  min-height: 46px;
  margin-top: 1.7rem;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
}

.sim-teacher-event-form .sim-checkbox-inline label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-weight: 700;
}

.sim-teacher-event-form .sim-checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.sim-teacher-event-form .sim-event-modal-form {
  margin-top: 0.3rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end !important;
}

.sim-teacher-event-form .sim-teacher-event-submit {
  min-width: 160px;
  min-height: 48px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.24);
}

/* Teacher manage modal polish */
.sim-teacher-manage-modal .sim-small-note {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #64748b;
}

.sim-teacher-manage-modal p {
  margin-top: 0;
}

.sim-teacher-manage-modal .sim-panel-title,
.sim-teacher-manage-modal h4,
.sim-teacher-manage-modal h5 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.sim-teacher-manage-modal .sim-link-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.08);
}

.sim-teacher-manage-modal .sim-link-small:hover {
  background: #dbeafe;
  text-decoration: none;
}

.sim-teacher-manage-modal .sim-event-modal-body > p:first-child,
.sim-teacher-manage-modal .sim-event-modal-body > p:nth-child(2) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.sim-teacher-manage-modal .sim-event-modal-body > p:nth-child(2) {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.sim-teacher-manage-modal form.sim-form-vertical {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sim-teacher-manage-modal form.sim-form-vertical label {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
}

.sim-teacher-manage-modal form.sim-form-vertical textarea,
.sim-teacher-manage-modal form.sim-form-vertical input[type="number"],
.sim-teacher-manage-modal form.sim-form-vertical input[type="text"] {
  width: 100%;
  max-width: none;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.72rem 0.85rem;
  font-size: 0.92rem;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sim-teacher-manage-modal form.sim-form-vertical textarea {
  min-height: 124px;
  resize: vertical;
}

.sim-teacher-manage-modal form.sim-form-vertical textarea:focus,
.sim-teacher-manage-modal form.sim-form-vertical input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.sim-teacher-manage-modal .sim-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.2rem;
}

.sim-teacher-manage-modal .sim-event-modal-body .sim-btn-primary,
.sim-teacher-manage-modal .sim-event-modal-body .sim-btn-danger,
.sim-teacher-manage-modal .sim-event-modal-body .sim-btn-secondary {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 800;
}

.sim-teacher-manage-modal .sim-event-modal-body .sim-btn-primary {
  min-width: 150px;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.24);
}

.sim-teacher-manage-modal .sim-event-modal-body > form:last-of-type {
  margin-top: 1rem;
  display: inline-flex;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid #fee2e2;
  background: linear-gradient(180deg, #fff7f7 0%, #fef2f2 100%);
}

.sim-teacher-manage-modal .sim-event-modal-body > form:last-of-type .sim-btn-danger,
.sim-teacher-manage-modal .sim-event-modal-body > form:last-of-type .sim-btn-ghost-small,
.sim-teacher-manage-modal .sim-event-modal-body > form:last-of-type button {
  min-width: 170px;
}

.sim-teacher-manage-modal .sim-teacher-table,
.sim-teacher-manage-modal .sim-student-table,
.sim-teacher-manage-modal .sim-table {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.sim-teacher-manage-modal .sim-table-responsive {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.sim-teacher-manage-modal .sim-empty-state,
.sim-teacher-manage-modal .sim-event-modal-body > p:has(+ h4),
.sim-teacher-manage-modal .sim-event-modal-body > p:has(+ h3) {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.sim-teacher-event-modal .sim-event-modal-body::-webkit-scrollbar,
.sim-teacher-manage-modal .sim-event-modal-body::-webkit-scrollbar {
  width: 10px;
}

.sim-teacher-event-modal .sim-event-modal-body::-webkit-scrollbar-track,
.sim-teacher-manage-modal .sim-event-modal-body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.sim-teacher-event-modal .sim-event-modal-body::-webkit-scrollbar-thumb,
.sim-teacher-manage-modal .sim-event-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.sim-teacher-event-modal .sim-event-modal-body::-webkit-scrollbar-thumb:hover,
.sim-teacher-manage-modal .sim-event-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.9);
  border: 2px solid transparent;
  background-clip: padding-box;
}

@media (max-width: 700px) {
  .sim-portal-footer {
    flex-direction: column;
    align-items: center;
  }

  .sim-student-mysims-grid {
    grid-template-columns: 1fr;
  }

  .sim-student-mysims-panel-head {
    flex-direction: column;
  }

  .sim-student-event-modal .sim-event-modal-dialog {
    width: min(96vw, 96vw);
    max-height: calc(100dvh - 1rem);
    border-radius: 24px;
  }

  .sim-student-event-modal .sim-student-event-modal-meta {
    grid-template-columns: 1fr;
  }

  .sim-student-event-modal .sim-event-modal-body {
    padding: 1rem 1rem 1.15rem;
  }

  .sim-teacher-event-modal .sim-event-modal-dialog,
  .sim-teacher-manage-modal .sim-event-modal-dialog {
    width: min(96vw, 96vw);
    max-height: calc(100dvh - 1rem);
  }

  .sim-teacher-event-modal .sim-event-modal-body,
  .sim-teacher-manage-modal .sim-event-modal-body {
    padding-right: 0.2rem;
  }

  .sim-teacher-event-form .sim-form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .sim-teacher-manage-modal .sim-form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .sim-teacher-event-form .sim-checkbox-inline {
    margin-top: 0;
  }

  .sim-teacher-manage-modal .sim-event-modal-body > p:first-child,
  .sim-teacher-manage-modal .sim-event-modal-body > p:nth-child(2) {
    align-items: stretch;
  }

  .sim-student-overview-identity {
    width: 100%;
    flex-direction: column;
    border-radius: 24px;
    text-align: center;
    padding-top: 1.7rem;
  }

  .sim-student-overview-pill-label {
    left: 50%;
    transform: translateX(-50%);
  }

  .sim-student-overview-summary-head {
    align-items: stretch;
  }

  .sim-student-profile-details-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive calendar behavior:
   - Desktop: keep true month grid without horizontal scrolling
   - Narrow screens: switch to the built-in mobile event list */
@media (max-width: 1120px) {
  .sim-student-calendar .sim-calendar-table td,
  .sim-teacher-section-calendar .sim-calendar-table td {
    min-height: 120px;
    height: 120px;
    padding: 0.3rem;
  }

  .sim-student-calendar .sim-calendar-pill,
  .sim-teacher-section-calendar .sim-calendar-pill,
  .sim-teacher-section-calendar .sim-calendar-pill-teacher {
    font-size: 0.68rem;
    padding: 0.24rem 0.34rem;
  }

  .sim-student-calendar .sim-calendar-pill-title,
  .sim-teacher-section-calendar .sim-calendar-pill-title,
  .sim-teacher-section-calendar .sim-calendar-teacher-pill-title {
    font-size: 0.7rem;
    line-height: 1.15;
  }

  .sim-student-calendar .sim-calendar-pill-time,
  .sim-teacher-section-calendar .sim-calendar-pill-time,
  .sim-teacher-section-calendar .sim-calendar-teacher-pill-meta {
    font-size: 0.62rem;
  }
}

@media (max-width: 900px) {
  .sim-student-calendar,
  .sim-teacher-calendar-wrapper {
    display: none !important;
  }

  .sim-student-shell .sim-mobile-only,
  .sim-teacher-section-calendar .sim-mobile-only {
    display: block !important;
  }

  .sim-mobile-event-list {
    grid-template-columns: 1fr;
  }

  .sim-mobile-event-card {
    width: 100%;
  }
}

.sim-lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.sim-lang-switcher-caption {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  padding-inline: 0.25rem;
}

.sim-lang-switcher-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease;
}

.sim-lang-switcher-link:hover {
  background: #e2e8f0;
}

.sim-lang-switcher-link.is-active {
  background: #0f172a;
  color: #fff;
}

.sim-lang-switcher-inline {
  width: auto;
  justify-content: flex-end;
  margin-bottom: 0;
}

.sim-lang-switcher-auth {
  margin-top: 0.35rem;
}

.sim-portal-header-auth .sim-lang-switcher-auth {
  margin-left: auto;
}

.sim-teacher-sidebar-actions .sim-lang-switcher-inline {
  margin-left: auto;
}


