:root {
  --teapp-bg: #ffffff;
  --teapp-fg: #111111;
  --teapp-muted: #6b7280;
  --teapp-border: rgba(17, 17, 17, 0.12);
  --teapp-accent: #4c2db8;
  --teapp-accent-soft: #f3d9ff;
  --teapp-accent-warm: #ffef6b;
  --teapp-surface: #f7f5ef;
  --teapp-radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  color: var(--teapp-fg);
  background: var(--teapp-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  color: var(--teapp-fg);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

button {
  font-family: "Segoe UI", sans-serif;
}

.teapp-no-select {
  user-select: none;
}

.rtl {
  direction: rtl;
  text-align: right;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--teapp-border);
  padding: 0;
}

.site-header .container {
  position: relative;
  padding-top: 0 !important;
  padding-bottom: 28px;
}

.header-corner-image {
  position: absolute;
  top: 0;
  left: 24px;
  width: 100px !important;
  height: 100px !important;
  min-width: 100px;
  min-height: 100px;
  max-width: 100px;
  max-height: 100px;
  display: block;
  z-index: 1;
  object-fit: contain;
  -webkit-filter: drop-shadow(0 3px 6px rgba(17, 17, 17, 0.35));
  filter: drop-shadow(0 3px 6px rgba(17, 17, 17, 0.35));
  pointer-events: none;
}

.header-inner {
  padding-top: 28px;
  margin-bottom: 20px;
}

.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  text-align: center;
}

.site-title a {
  font-size: 1.4rem;
}

.site-tagline {
  color: var(--teapp-muted);
  font-size: 0.95rem;
}

.site-logo {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
}

.site-logo img {
  max-height: 80px;
  max-width: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-weight: 600;
  padding-top: 16px;
  border-top: 1px solid var(--teapp-border);
}

.site-main {
  padding: 48px 0 64px;
}

.teapp-messages {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.teapp-message {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--teapp-border);
  background: #f7f7f7;
}

.teapp-message--error {
  background: #ffe7e7;
  border-color: #f4bcbc;
  color: #8a1f1f;
}

.teapp-message--success {
  background: #e7f8ee;
  border-color: #c8ead7;
  color: #1e6b3a;
}

.site-footer {
  border-top: 1px solid var(--teapp-border);
  padding: 24px 0 40px;
  text-align: center;
}

.hero {
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 8px;
}

.teapp-muted {
  color: var(--teapp-muted);
}

.teapp-card {
  border: 1px solid var(--teapp-border);
  border-radius: var(--teapp-radius);
  padding: 24px;
  background: var(--teapp-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.teapp-form {
  display: grid;
  gap: 14px;
}

.teapp-form .teapp-field {
  display: grid;
  gap: 6px;
}

.teapp-field {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 1rem;
  font-family: "Segoe UI", sans-serif;
}

.teapp-field .label {
  font-weight: 600;
  color: var(--teapp-muted);
  font-size: 0.92rem;
}

.teapp-field .value {
  font-weight: 500;
  font-size: 1rem;
}

.teapp-field label {
  font-weight: 600;
  color: var(--teapp-muted);
  font-size: 0.92rem;
  font-family: "Segoe UI", sans-serif;
}

.teapp-field--checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.teapp-field--checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.teapp-field--checkbox label {
  margin: 0;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--teapp-accent);
  flex-shrink: 0;
}

.teapp-form .teapp-field input,
.teapp-form .teapp-field textarea,
.teapp-form .teapp-field select {
  width: 100%;
  border: 1px solid var(--teapp-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: "Segoe UI", sans-serif;
  background: #fcfbf8;
}

/* Account info grid - styled like Student Information card */
.account-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.account-info-item {
  background: var(--teapp-surface);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--teapp-border);
}

.account-info-label {
  font-size: 0.75rem;
  color: var(--teapp-muted);
  margin-bottom: 4px;
}

.account-info-value {
  font-weight: 500;
}

.teapp-input,
.teapp-textarea,
.teapp-select {
  width: 100%;
  border: 1px solid var(--teapp-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: "Segoe UI", sans-serif;
  background: #fcfbf8;
}

select {
  border: 1px solid var(--teapp-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: "Segoe UI", sans-serif;
  background: #fcfbf8;
  cursor: pointer;
}

.teapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--teapp-border);
  background: var(--teapp-fg);
  color: var(--teapp-bg);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 1rem;
  font-family: "Segoe UI", sans-serif;
  cursor: pointer;
}

.teapp-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--teapp-muted);
  border-color: var(--teapp-muted);
  color: var(--teapp-bg);
}

.teapp-button--ghost {
  background: transparent;
  color: var(--teapp-fg);
}

.teapp-button--ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--teapp-muted);
}

.teapp-button--full {
  display: flex;
  max-width: 300px;
  width: 100%;
}

.teapp-button--nowrap {
  white-space: nowrap;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-error {
  background: #ffe7e7;
  border: 1px solid #f4bcbc;
  color: #8a1f1f;
  padding: 10px 12px;
  border-radius: 10px;
}

.language-switcher {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.teapp-tabs {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.teapp-tabs input[type="radio"] {
  display: none;
}

.tab-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tab-labels label {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--teapp-border);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: "Segoe UI", sans-serif;
}

.tab-panels {
  display: grid;
}

.tab-panel {
  display: none;
}

#tab-account:checked ~ .tab-panels .panel-account,
#tab-tutorials:checked ~ .tab-panels .panel-tutorials,
#tab-users:checked ~ .tab-panels .panel-users,
#tab-schools:checked ~ .tab-panels .panel-schools,
#tab-mentors:checked ~ .tab-panels .panel-mentors,
#tab-vehicles:checked ~ .tab-panels .panel-vehicles,
#tab-options:checked ~ .tab-panels .panel-options,
#tab-reports:checked ~ .tab-panels .panel-reports,
#tab-chat:checked ~ .tab-panels .panel-chat,
#tab-practical:checked ~ .tab-panels .panel-practical {
  display: block;
}

#tab-account:checked ~ .tab-labels label[for="tab-account"],
#tab-tutorials:checked ~ .tab-labels label[for="tab-tutorials"],
#tab-users:checked ~ .tab-labels label[for="tab-users"],
#tab-schools:checked ~ .tab-labels label[for="tab-schools"],
#tab-mentors:checked ~ .tab-labels label[for="tab-mentors"],
#tab-vehicles:checked ~ .tab-labels label[for="tab-vehicles"],
#tab-options:checked ~ .tab-labels label[for="tab-options"],
#tab-reports:checked ~ .tab-labels label[for="tab-reports"],
#tab-chat:checked ~ .tab-labels label[for="tab-chat"],
#tab-practical:checked ~ .tab-labels label[for="tab-practical"] {
  background: var(--teapp-accent);
  color: var(--teapp-bg);
  border-color: var(--teapp-accent);
}

.tutorial-page {
  display: grid;
  gap: 24px;
}

.tutorial-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.tutorial-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  min-width: 280px;
  max-width: 280px;
  background: var(--teapp-bg);
  z-index: 2;
  box-sizing: border-box;
  padding-right: 16px;
}

.rtl .tutorial-sidebar {
  padding-right: 0;
  padding-left: 16px;
}

.tutorial-sidebar::-webkit-scrollbar {
  width: 10px;
  right: 0;
}
/* RTL: Move scrollbar to left in sidebar */
.rtl .tutorial-sidebar {
  direction: rtl;
}
.rtl .tutorial-sidebar::-webkit-scrollbar {
  left: 0;
  right: auto;
}

.tutorial-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.tutorial-sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 6px;
  border: 3px solid var(--teapp-bg);
}

.tutorial-sidebar::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.tutorial-progress-card {
  border: 1px solid var(--teapp-border);
  border-radius: 14px;
  padding: 16px;
  background: var(--teapp-surface);
}

.tutorial-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.1);
  overflow: hidden;
  margin-top: 10px;
}

.tutorial-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teapp-accent);
}

.tutorial-lesson-collections {
  display: grid;
  gap: 10px;
}

.tutorial-section-container {
  border: 1px solid var(--teapp-border);
  border-radius: 12px;
  padding: 0;
  background: var(--teapp-surface);
  overflow: hidden;
}

.tutorial-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  background: #f3f4f6;
  border-bottom: 1px solid var(--teapp-border);
}

.tutorial-section-header:hover {
  background: #e9ecf0;
}

.tutorial-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--teapp-fg);
  flex-shrink: 0;
}

.tutorial-section-toggle.collapsed {
  transform: rotate(-90deg);
}

.tutorial-section-title {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teapp-fg);
}

.tutorial-steps-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 0 18px;
  list-style: disc inside;
  background: none;
  border: none;
  box-shadow: none;
  max-height: 1000px;
  overflow: hidden;
  opacity: 1;
}

/* Chat Styles */
.chat-container {
  margin-top: 20px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 500px;
  border: 1px solid var(--teapp-border);
  border-radius: 14px;
  overflow: hidden;
}

.chat-sidebar {
  background: var(--teapp-surface);
  border-right: 1px solid var(--teapp-border);
  padding: 16px;
  overflow-y: auto;
}

.chat-user-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.chat-user-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.chat-user-item.active {
  background: var(--teapp-accent-soft);
}

.chat-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teapp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--teapp-muted);
  flex-shrink: 0;
}

.chat-user-info {
  flex: 1;
  min-width: 0;
}

.chat-user-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-preview {
  font-size: 0.85rem;
  color: var(--teapp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-unread-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--teapp-accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--teapp-bg);
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--teapp-border);
  font-weight: 600;
  background: var(--teapp-bg);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-message {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  position: relative;
}

.chat-message.mine {
  align-self: flex-end;
  background: var(--teapp-accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.theirs {
  align-self: flex-start;
  background: var(--teapp-surface);
  border-bottom-left-radius: 4px;
}

.chat-message-text {
  word-wrap: break-word;
}

.chat-message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.75rem;
  opacity: 0.7;
}

.chat-message-status {
  font-size: 0.7rem;
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--teapp-border);
  background: var(--teapp-bg);
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-form .teapp-input {
  flex: 1;
}

@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  
  .chat-sidebar {
    display: none;
  }
  
  .chat-sidebar.mobile-show {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
  }
}

.tutorial-steps-container.collapsed {
  max-height: 0;
  padding: 0 10px;
  opacity: 0;
}

.lesson-chip {
  background: none;
  border: none;
  border-radius: 0;
  padding: 12px 0 12px 0;
  margin: 0;
  text-align: left;
  font: inherit;
  color: var(--teapp-fg);
  cursor: pointer;
  outline: none;
  box-shadow: none;
  position: relative;
  direction: inherit;
}
/* RTL: Steps alignment and padding */
.rtl .tutorial-steps-container {
  /* switch indentation to right side for RTL languages */
  padding: 0 18px 0 0;
}
.rtl .lesson-chip {
  text-align: right;
  padding: 12px 0 12px 0;
}

.lesson-chip:hover {
  background: #fafaf9;
  border-color: #d1d5db;
}

.lesson-chip.active {
  color: var(--teapp-accent);
  font-weight: 600;
  text-decoration: none;
}

.tutorial-workspace {
  border: 1px solid var(--teapp-border);
  border-radius: 18px;
  padding: 24px;
  background: var(--teapp-bg);
  display: grid;
  gap: 14px;
  min-width: 0;
  z-index: 1;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  .tutorial-shell {
    grid-template-columns: 1fr;
  }
  .tutorial-sidebar {
    position: static;
    height: auto;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }
}

.tutorial-lesson-video {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 24px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teapp-muted);
}

.tutorial-lesson-video:has(video) {
  padding: 0;
  min-height: auto;
  background: transparent;
}

.tutorial-video-wrapper {
  position: relative;
  width: 100%;
}

.tutorial-lesson-video__player {
  width: 100%;
  height: auto;
  border-radius: 12px;
}


.tutorial-lesson-slideshow {
  border: 1px solid var(--teapp-border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.tutorial-lesson-slideshow__media img {
  width: 100%;
  border-radius: 12px;
  cursor: grab;
}

.tutorial-admin {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* grow with content instead of locking to viewport height so the border
     surrounds everything */
  height: auto;
  position: sticky;
  top: 0;
  /* let the page scroll rather than the panel itself; the builder will grow
     with content so the overall document handles scrolling */
  overflow-y: visible;
  min-width: 220px;
  /* no max-width – allow the panel to flex freely, avoiding squeezed
     sections/steps on wider viewports */
  max-width: none;
  background: var(--teapp-bg);
  z-index: 2;
}

.tutorial-admin__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.tutorial-admin__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tutorial-admin__grid {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 16px;
  /* keep columns independent so the editor height is not forced on the list */
  align-items: start;
}

.tutorial-admin__list {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;        /* fill available height inside the sections wrapper */
  /* remove the internal scrollbar – again rely on document scrolling */
  overflow: visible;
  padding-right: 6px;    /* avoid content getting hidden under scrollbar */
  min-height: 0;        /* allow proper clipping inside grid/flex containers */
  max-height: none;
}

.tutorial-admin__sections {
  display: flex;
  flex-direction: column;
  min-height: 0; /* ensures children can scroll instead of forcing parent to grow */
}

.tutorial-admin__sections .tutorial-admin__sections-header {
  flex: 0 0 auto;
}

.tutorial-admin__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.tutorial-admin__section-row {
  grid-template-columns: 1fr;
}

.tutorial-admin__section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tutorial-admin__insert-step {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.tutorial-admin__section-label-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tutorial-admin__section-label-col {
  flex: 0 0 80px;
}

.tutorial-admin__section-label-spacer {
  flex: 1;
}

.tutorial-admin__section-close {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--teapp-border);
  background: #fff0f0;
  color: #8a1f1f;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tutorial-admin__section-close:hover {
  background: #ffe2e2;
}

.tutorial-admin__row .teapp-button--ghost {
  padding: 6px 12px;
}

.tutorial-admin__steps-toggle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--teapp-border);
  background: transparent;
  color: var(--teapp-fg);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tutorial-admin__steps-toggle:hover {
  background: #f3f4f6;
}

.tutorial-admin__section-container {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--teapp-border);
  border-radius: 16px;
  padding: 16px;
  background: var(--teapp-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tutorial-admin__section-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teapp-muted);
}

.tutorial-admin__steps-nested {
  display: grid;
  gap: 6px;
  padding-left: 16px;
  margin: 0;
  list-style: none;
  border-left: 2px solid var(--teapp-border);
}

.tutorial-admin__steps-nested[hidden] {
  display: none !important;
}

.tutorial-admin__step-row {
  grid-template-columns: 1fr auto;
  border: 1px solid var(--teapp-border);
  border-radius: 10px;
  padding: 0;
  background: #fcfbf8;
  overflow: hidden;
}

.tutorial-admin__step-row .teapp-button--ghost {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  justify-content: flex-start;
}

.tutorial-admin__step-row .teapp-button--ghost:hover {
  background: rgba(17, 17, 17, 0.04);
}

.tutorial-admin__step-row .teapp-button--ghost.is-active {
  background: var(--teapp-accent-soft);
}

.tutorial-admin__row .teapp-button--ghost.is-active {
  background: var(--teapp-accent-soft);
  border-color: var(--teapp-accent);
}

.tutorial-admin__editor {
  border: 1px solid var(--teapp-border);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 16px;
  background: var(--teapp-surface);
  min-height: 0;      /* allow internal scrolling instead of forcing parent height */
  overflow: auto;     /* scroll editor content when it's taller than available space */
}

.tutorial-admin__editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tutorial-admin__media {
  display: grid;
  gap: 10px;
}

.tutorial-admin__media-list {
  display: grid;
  gap: 12px;
}

.tutorial-admin__image-row {
  display: grid;
  grid-template-columns: 80px auto;
  gap: 10px;
  align-items: center;
}

.tutorial-admin__image-row img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--teapp-border);
}

.tutorial-admin__media-upload {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tutorial-admin__media-preview {
  display: grid;
  gap: 10px;
}

.tutorial-admin__media-preview video {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--teapp-border);
}

.tutorial-admin__status.is-error {
  color: #8a1f1f;
}

.tutorial-admin__status.is-success {
  color: #1e6b3a;
}

.logged-out-hero {
  background: var(--teapp-accent);
  color: var(--teapp-bg);
  padding: 36px;
  border-radius: 32px;
  display: grid;
  gap: 12px;
}

.logged-out-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.logged-out-badge {
  background: var(--teapp-accent-warm);
  color: var(--teapp-accent);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  width: fit-content;
}

.logged-out-card {
  margin-top: 24px;
  border: 1px solid var(--teapp-border);
  border-radius: 18px;
  padding: 24px;
}

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .tutorial-shell {
    grid-template-columns: 1fr;
  }

  .tutorial-admin__grid {
    grid-template-columns: 1fr;
  }

  .tutorial-admin__row {
    grid-template-columns: 1fr;
  }

  .tutorial-admin__image-row {
    grid-template-columns: 1fr;
  }
}

/* Progress Display */
.progress-summary {
  margin-bottom: 2rem;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: var(--teapp-bg-secondary);
  border-radius: var(--teapp-radius);
}

.progress-stat__value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--teapp-accent);
  margin-bottom: 0.25rem;
}

.progress-stat__label {
  font-size: 0.875rem;
  color: var(--teapp-text-muted);
}

.progress-bar {
  width: 100%;
  height: 24px;
  background: var(--teapp-bg-secondary);
  border-radius: var(--teapp-radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar--small {
  height: 8px;
  margin-bottom: 0;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teapp-accent), var(--teapp-accent-dark));
  transition: width 0.3s ease;
  min-width: 2px;
}

.progress-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.progress-section {
  padding: 1rem;
  background: var(--teapp-bg-secondary);
  border-radius: var(--teapp-radius);
}

.progress-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-section__title {
  font-weight: 500;
  color: var(--teapp-text);
}

.progress-section__count {
  font-size: 0.875rem;
  color: var(--teapp-text-muted);
  font-weight: 500;
}

.suggestions-dropdown {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: white;
}

.suggestion-item {
  transition: background-color 0.2s ease;
  padding: 10px 12px;
  border-bottom: 1px solid var(--teapp-border);
}

.suggestion-item:hover {
  background-color: var(--teapp-accent-soft);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:active {
  background-color: var(--teapp-accent);
  color: white;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--teapp-bg);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.option-item:has(input[type="checkbox"]):hover {
  background: var(--teapp-accent-soft);
}

.option-section {
  border: 1px solid var(--teapp-border);
  border-radius: 18px;
  padding: 24px;
  background: var(--teapp-bg);
  display: grid;
  gap: 14px;
  min-width: 0;
  z-index: 1;
}

.option-section h4 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: var(--teapp-fg);
}

/* Practical Training Session Styles */
.active-session-container {
  border: 1px solid var(--teapp-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  background: var(--teapp-bg);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.session-header h4 {
  margin: 0;
  color: var(--teapp-fg);
}

.timer-display {
  font-size: 2rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--teapp-fg);
  background: var(--teapp-surface);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--teapp-border);
}

.session-details {
  margin-bottom: 16px;
}

.session-details p {
  margin: 8px 0;
}

.gps-tracker {
  background: var(--teapp-bg);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.gps-status {
  font-weight: 500;
  margin-bottom: 8px;
}

.gps-status.gps-active {
  color: #22c55e;
}

.gps-status.gps-error {
  color: #ef4444;
}

.location-count {
  font-size: 0.9rem;
  color: var(--teapp-muted);
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 2px solid var(--teapp-accent);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 99999;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  color: #111111;
  font-size: 14px;
  border-bottom: 1px solid var(--teapp-border);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--teapp-accent-soft);
}

.selected-item {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--teapp-surface);
  border-radius: 6px;
  color: var(--teapp-fg);
  font-weight: 500;
}

.form-group {
  position: relative;
  margin-bottom: 20px;
}

.form-group:focus-within {
  z-index: 10;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.previous-sessions {
  margin-top: 32px;
}

.previous-sessions h4 {
  margin-bottom: 16px;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-pending {
  background: #fbbf24;
  color: #92400e;
}

.status-active {
  background: #22c55e;
  color: #14532d;
}

.status-completed {
  background: #3b82f6;
  color: #1e3a8a;
}

.status-expired {
  background: #ef4444;
  color: #7f1d1d;
}

.teapp-table {
  width: 100%;
  border-collapse: collapse;
}

.teapp-table th,
.teapp-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--teapp-border);
}

.teapp-table th {
  font-weight: 600;
  color: var(--teapp-muted);
  font-size: 0.9rem;
}

.teapp-button--danger {
  background: #ef4444;
  color: white;
}

.teapp-button--danger:hover {
  background: #dc2626;
}

/* ========================================
   PRACTICAL MAP STYLES
   ======================================== */

/* Live tracking map container */
#live-tracking-map {
  width: 100%;
  height: 300px;
  border-radius: var(--teapp-radius);
  margin: 16px 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Historical route map container */
.historical-route-map {
  width: 100%;
  height: 250px;
  border-radius: var(--teapp-radius);
  margin-top: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* GPS marker animation */
.gps-marker-inner {
  width: 20px;
  height: 20px;
  background: #2196F3;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #2196F3, 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 2px #2196F3, 0 0 0 4px rgba(33, 150, 243, 0.3);
  }
  50% {
    box-shadow: 0 0 0 2px #2196F3, 0 0 0 8px rgba(33, 150, 243, 0.1);
  }
  100% {
    box-shadow: 0 0 0 2px #2196F3, 0 0 0 4px rgba(33, 150, 243, 0.3);
  }
}

/* Map info overlay */
.map-info-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 12px;
  z-index: 500;
}

.map-info-overlay .stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.map-info-overlay .stat:last-child {
  margin-bottom: 0;
}

.map-info-overlay .stat-label {
  color: var(--teapp-muted);
  margin-right: 12px;
}

.map-info-overlay .stat-value {
  font-weight: 600;
  color: var(--teapp-fg);
}

/* Route modal */
.route-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.route-modal {
  background: white;
  border-radius: var(--teapp-radius);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.route-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--teapp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-modal-header h4 {
  margin: 0;
}

.route-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--teapp-muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.route-modal-close:hover {
  background: var(--teapp-surface);
  color: var(--teapp-fg);
}

.route-modal-body {
  padding: 20px;
}

/* View route button in table */
.view-route-btn {
  background: var(--teapp-surface);
  border: 1px solid var(--teapp-border);
  color: var(--teapp-fg);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-route-btn:hover {
  background: var(--teapp-bg);
  border-color: var(--teapp-fg);
}

/* Leaflet custom styles */
.leaflet-container {
  font-family: "Segoe UI", sans-serif;
}

.leaflet-control-attribution {
  font-size: 10px;
}

/* Loading spinner for map */
.map-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--teapp-muted);
}

.map-loading::before {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid var(--teapp-border);
  border-top-color: var(--teapp-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
