body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  margin: 0;
  padding: 24px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.container {
  max-width: 620px;
  margin: 0 auto;
  background: white;
  padding: 28px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.wide-container {
  max-width: 1100px;
}

.wide-form-container {
  max-width: 760px;
}

.banner-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  object-position: center bottom;
  border-radius: 12px;
  display: block;
  margin-bottom: 20px;
}

h1 {
  font-size: 24px;
  text-align: center;
  margin: 0 0 12px 0;
}

.intro-text {
  text-align: center;
  color: #4b5563;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.inline-select {
  min-width: 110px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  font: inherit;
}

.field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.field label {
  width: 120px;
  flex: 0 0 120px;
  font-weight: 700;
  font-size: 15px;
}

.field input,
.field select,
.field textarea {
  flex: 1;
  width: auto;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  font-size: 15px;
}

.language-selector {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  font-size: 15px;
}

.language-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 0 18px 0;
}

.language-option {
  width: 54px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
}

.language-option:hover {
  background: #e0e7ff;
}

.language-option.active {
  background: #eef2ff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px #4f46e5 inset;
}

.flag-icon {
  width: 32px;
  height: 22px;
  display: block;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.flag-il {
  background:
    linear-gradient(#fff 0 18%, #2563eb 18% 30%, #fff 30% 70%, #2563eb 70% 82%, #fff 82% 100%);
  position: relative;
}

.flag-il::before,
.flag-il::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  transform: translate(-50%, -50%);
}

.flag-il::before {
  border-bottom: 12px solid #2563eb;
  margin-top: -4px;
}

.flag-il::after {
  border-top: 12px solid #2563eb;
  margin-top: 4px;
}

.flag-ps {
  background:
    linear-gradient(146deg, #e11d48 0 31%, transparent 31%),
    linear-gradient(#111827 0 33.33%, #fff 33.33% 66.66%, #15803d 66.66% 100%);
}

.flag-us {
  background:
    linear-gradient(#1d4ed8 0 54%, transparent 54%) 0 0 / 43% 54% no-repeat,
    repeating-linear-gradient(#dc2626 0 8%, #fff 8% 15.38%);
}

.phone-input-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.7fr) minmax(0, 1fr);
  gap: 8px;
  flex: 1;
  direction: ltr;
}

.phone-input-row:has(.country-code-input:not([hidden])) {
  grid-template-columns: minmax(145px, 0.7fr) 90px minmax(0, 1fr);
}

.phone-input-row input,
.phone-input-row select {
  width: 100%;
  min-width: 0;
}

.phone-input-row select {
  direction: rtl;
}

html[dir="ltr"] .phone-input-row select {
  direction: ltr;
}

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

.language-level-grid .field {
  min-width: 0;
}

.country-code-input {
  direction: ltr;
  text-align: left;
}

.checkbox-field {
  align-items: flex-start;
}

.checkbox-field input {
  flex: 0 0 auto;
  width: auto;
  margin-top: 4px;
}

.error {
  color: #b91c1c;
  font-size: 14px;
  margin: -6px 0 10px 132px;
}

html[dir="rtl"] .error {
  margin: -6px 132px 10px 0;
}

button {
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: #4f46e5;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background: #4338ca;
}

button.secondary {
  background: #475569;
}

button.secondary:hover {
  background: #334155;
}

button.danger {
  background: #b91c1c;
}

button.danger:hover {
  background: #991b1b;
}

.submit-button {
  width: 100%;
  display: block;
  margin-top: 14px;
  padding: 13px;
}

.success-message {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  display: none;
}

.link-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin: 0 0 16px 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #1e293b;
}

.panel-toggle-button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #1e293b;
  text-align: right;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.link-panel[hidden] {
  display: none;
}

.link-panel a {
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
  color: #1d4ed8;
}

.copy-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
}

.details-actions {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 12px 0;
}

.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  justify-content: center;
  align-items: center;
}

.top-nav select {
  min-width: 190px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
}

.status-filter-label {
  font-weight: 700;
  color: #334155;
}

.mentor-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}

.panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.panel h2 {
  margin: 0 0 12px 0;
  font-size: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  text-align: start;
}

tr {
  cursor: pointer;
}

tr:hover {
  background: #f8fafc;
}

tr.selected {
  background: #eef2ff;
}

.pagination-controls {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.pagination-controls[hidden] {
  display: none;
}

.pagination-summary {
  color: #475569;
  font-size: 14px;
}

.pagination-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pagination-actions label {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pagination-actions select {
  padding: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: white;
}

.pagination-actions button {
  padding: 7px 12px;
}

.details-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 0;
}

html[dir="rtl"] .details-row {
  grid-template-columns: 1fr 140px;
}

.details-label {
  font-weight: 700;
  color: #475569;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.small-note {
  color: #64748b;
  font-size: 14px;
}

.form-link-note {
  text-align: center;
  margin-bottom: 0;
}

.form-section-title {
  grid-column: 1 / -1;
  margin: 24px 0 12px 0;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  color: #1f2937;
  font-weight: 700;
}

.choice-group {
  display: grid;
  gap: 8px;
  margin: 0 0 14px 0;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
}

.choice-group legend {
  padding: 0 6px;
  font-weight: 700;
}

.choice-group label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}

.choice-group input {
  width: auto;
}

.stacked-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 700;
}

.stacked-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
}

.emergency-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (max-width: 800px) {
  .mentor-layout {
    grid-template-columns: 1fr;
  }

  .container, .wide-container {
    padding: 18px;
  }

  .edit-form {
    grid-template-columns: 1fr;
  }

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

  .field label {
    width: auto;
    flex-basis: auto;
  }

  .phone-input-row,
  .phone-input-row:has(.country-code-input:not([hidden])) {
    grid-template-columns: 1fr;
  }

  .language-level-grid {
    grid-template-columns: 1fr;
  }

  .error,
  html[dir="rtl"] .error {
    margin: -6px 0 10px 0;
  }
}
.logo {
    height: 80px;
    display: block;
    margin: 0 auto 10px auto;
}

.history-item {
  border-top: 1px solid #ddd;
  padding: 2px 0;
}

.history-date {
  font-size: 0.85rem;
  color: #666;
}

.history-status {
  font-weight: bold;
  margin-top: 2px;
}

.history-feedback {
  margin-top: 2px;
  white-space: pre-wrap;
}

.actions-panel {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.actions-panel select {
  flex: 1;
  padding: 10px;
}

.actions-panel button {
  width: 120px;
}

.reminders-panel {
  border: 1px solid #facc15;
  border-radius: 8px;
  background: #fefce8;
  color: #713f12;
  padding: 12px;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.reminders-panel h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.reminders-panel ul {
  margin: 0;
  padding-inline-start: 20px;
}

.reminders-panel li {
  margin: 6px 0;
}

.reminder-person-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d4ed8;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.reminder-done-button {
  margin-inline-start: 10px;
  border: 1px solid #15803d;
  border-radius: 999px;
  padding: 4px 10px;
  background: #16a34a;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.reminder-done-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.dialog-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: white;
  padding: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.dialog-card h3 {
  margin: 0 0 14px 0;
  font-size: 20px;
}

.dialog-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 700;
  color: #334155;
  font-size: 14px;
}

.dialog-form input,
.dialog-form select,
.dialog-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

.dialog-help {
  min-height: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
}

.dialog-form .full-width,
.dialog-checkbox,
.dialog-actions {
  grid-column: 1 / -1;
}

.dialog-checkbox {
  flex-direction: row !important;
  align-items: center;
}

.dialog-checkbox input {
  width: auto;
}

.dialog-static {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 10px;
  line-height: 1.4;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.edit-icon {
  cursor: pointer;
  margin-right: 8px;
  opacity: 0.6;
}

.edit-icon:hover {
  opacity: 1;
}

.status-pill {
  display: inline-block;
  color: white;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.person-summary {
  margin: 12px 0;
  color: #334155;
}

.person-summary h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: #111827;
}

.edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.edit-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 700;
  color: #334155;
  font-size: 14px;
}

.edit-form input,
.edit-form select,
.edit-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  background: white;
}

.readonly-field {
  box-sizing: border-box;
  width: 100%;
  min-height: 39px;
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 400;
}

.edit-form .full-width,
.edit-form button {
  grid-column: 1 / -1;
}

.form-section-title {
  grid-column: 1 / -1;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  margin-top: 4px;
  color: #111827;
  font-weight: 700;
}

.system-details {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 14px;
  margin-bottom: 16px;
}

.legacy-data-panel {
  margin: 14px 0 18px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.legacy-data-panel summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: #1e293b;
}

.legacy-data-meta {
  padding: 0 14px 10px;
  color: #64748b;
  font-size: 13px;
}

.legacy-data-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid #e2e8f0;
}

.legacy-data-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.legacy-data-row:last-child {
  border-bottom: 0;
}

.legacy-data-row div {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .legacy-data-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

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