/* ============================================================
   Let's Drive Academy - Learner Portal
   Token-based themes: light (default) + dark (html[data-theme])
   Brand: red #b81b0e / #e31837, black #111217 / #0d0d0f
   Login screen is always light (fixed palette).
   ============================================================ */

/* ---- Brand tokens (theme-independent) ---- */
:root {
  --ld-red: #b81b0e;
  --ld-red-bright: #e31837;
  --ld-black: #111217;
  --ld-black-deep: #0d0d0f;
  --ld-maroon: #1a0d0b;
  --ld-white: #ffffff;
  --ld-font: 'Manrope', sans-serif;
}

/* ---- Light theme (default) ---- */
:root {
  /* page / main backgrounds */
  --ld-page-bg: linear-gradient(160deg, #faf7f6 0%, #fbece9 55%, #fde5e1 135%);
  --ld-main-bg:
    radial-gradient(circle at 12% 0%, rgba(227, 24, 55, 0.08) 0%, rgba(227, 24, 55, 0) 45%),
    radial-gradient(circle at 100% 100%, rgba(184, 27, 14, 0.06) 0%, rgba(184, 27, 14, 0) 50%),
    #f7f6f6;

  /* sidebar */
  --ld-side-bg: linear-gradient(180deg, #ffffff 0%, #fbf4f2 60%, #f6ece9 100%);
  --ld-side-border: rgba(17, 18, 23, 0.06);

  /* surfaces */
  --ld-surface: #ffffff;
  --ld-surface-border: rgba(17, 18, 23, 0.08);
  --ld-surface-shadow: 0 16px 40px rgba(17, 18, 23, 0.07);
  --ld-glass-border: rgba(17, 18, 23, 0.08);

  /* text */
  --ld-text: #1a1b20;
  --ld-text-muted: #6c6f77;
  --ld-text-faint: rgba(17, 18, 23, 0.45);
  --ld-text-inverse: #ffffff;

  /* dividers / hover */
  --ld-divider: rgba(17, 18, 23, 0.08);
  --ld-hover-bg: rgba(184, 27, 14, 0.06);

  /* nav */
  --ld-nav-text: #4b4e55;
  --ld-nav-icon: rgba(17, 18, 23, 0.45);

  /* inputs */
  --ld-input-bg: #ffffff;
  --ld-input-border: rgba(17, 18, 23, 0.15);
  --ld-input-text: #1a1b20;
  --ld-placeholder: rgba(17, 18, 23, 0.4);
  --ld-focus-ring: rgba(227, 24, 55, 0.18);
  --ld-option-bg: #ffffff;
  --ld-option-text: #1a1b20;
  --ld-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2327282c' stroke-opacity='0.6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* tables */
  --ld-table-th-border: rgba(17, 18, 23, 0.1);
  --ld-table-row-border: rgba(17, 18, 23, 0.07);
  --ld-table-text: #3a3d46;
  --ld-table-hover: rgba(184, 27, 14, 0.04);

  /* badges */
  --ld-badge-scheduled-bg: #fff3d1;
  --ld-badge-scheduled-text: #8a5a06;
  --ld-badge-completed-bg: #e3f6e8;
  --ld-badge-completed-text: #1c7c3c;
  --ld-badge-danger-bg: #fde9e9;
  --ld-badge-danger-text: #b81b0e;
  --ld-badge-info-bg: #e2f5fb;
  --ld-badge-info-text: #0b7389;
  --ld-badge-neutral-bg: #efeff1;
  --ld-badge-neutral-text: #6c6f77;

  /* flashes */
  --ld-flash-success-bg: #e6f8ea;
  --ld-flash-success-border: rgba(30, 122, 60, 0.35);
  --ld-flash-success-text: #1e7a3c;
  --ld-flash-error-bg: #fdeaea;
  --ld-flash-error-border: rgba(184, 27, 14, 0.35);
  --ld-flash-error-text: #b81b0e;

  /* calendar */
  --ld-cal-cell-border: rgba(17, 18, 23, 0.08);
  --ld-cal-cell-empty: rgba(17, 18, 23, 0.02);
  --ld-cal-day-text: rgba(17, 18, 23, 0.75);
  --ld-cal-session-bg: #fdf1ef;
  --ld-cal-more-bg: rgba(17, 18, 23, 0.08);

  /* small buttons */
  --ld-cal-btn-bg: rgba(17, 18, 23, 0.04);
  --ld-cal-btn-text: #4b4e55;
  --ld-cal-btn-border: rgba(17, 18, 23, 0.14);
  --ld-ghost-bg: rgba(17, 18, 23, 0.05);
  --ld-ghost-border: rgba(17, 18, 23, 0.12);
  --ld-ghost-hover-bg: rgba(17, 18, 23, 0.08);
}

/* ---- Dark theme ---- */
html[data-theme='dark'] {
  --ld-page-bg: linear-gradient(160deg, var(--ld-black-deep) 0%, var(--ld-maroon) 45%, var(--ld-red) 135%);
  --ld-main-bg:
    radial-gradient(circle at 12% 0%, rgba(227, 24, 55, 0.12) 0%, rgba(227, 24, 55, 0) 45%),
    radial-gradient(circle at 100% 100%, rgba(184, 27, 14, 0.08) 0%, rgba(17, 18, 23, 0) 50%),
    var(--ld-black-deep);

  --ld-side-bg: linear-gradient(180deg, var(--ld-maroon) 0%, var(--ld-black) 55%, var(--ld-black-deep) 100%);
  --ld-side-border: rgba(255, 255, 255, 0.06);

  --ld-surface: rgba(255, 255, 255, 0.06);
  --ld-surface-border: rgba(255, 255, 255, 0.14);
  --ld-surface-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  --ld-glass-border: rgba(255, 255, 255, 0.14);

  --ld-text: var(--ld-white);
  --ld-text-muted: rgba(255, 255, 255, 0.65);
  --ld-text-faint: rgba(255, 255, 255, 0.4);
  --ld-text-inverse: var(--ld-white);

  --ld-divider: rgba(255, 255, 255, 0.1);
  --ld-hover-bg: rgba(255, 255, 255, 0.06);

  --ld-nav-text: rgba(255, 255, 255, 0.72);
  --ld-nav-icon: rgba(255, 255, 255, 0.5);

  --ld-input-bg: rgba(0, 0, 0, 0.35);
  --ld-input-border: rgba(255, 255, 255, 0.1);
  --ld-input-text: var(--ld-white);
  --ld-placeholder: rgba(255, 255, 255, 0.4);
  --ld-focus-ring: rgba(227, 24, 55, 0.18);
  --ld-option-bg: var(--ld-black);
  --ld-option-text: var(--ld-white);
  --ld-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23ffffff' stroke-opacity='0.6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --ld-table-th-border: rgba(255, 255, 255, 0.1);
  --ld-table-row-border: rgba(255, 255, 255, 0.06);
  --ld-table-text: #e8e8ec;
  --ld-table-hover: rgba(255, 255, 255, 0.03);

  --ld-badge-scheduled-bg: rgba(255, 193, 7, 0.14);
  --ld-badge-scheduled-text: #ffd76a;
  --ld-badge-completed-bg: rgba(40, 167, 69, 0.14);
  --ld-badge-completed-text: #7ce094;
  --ld-badge-danger-bg: rgba(227, 24, 55, 0.14);
  --ld-badge-danger-text: #ff9c9c;
  --ld-badge-info-bg: rgba(13, 202, 240, 0.14);
  --ld-badge-info-text: #86e5f5;
  --ld-badge-neutral-bg: rgba(255, 255, 255, 0.1);
  --ld-badge-neutral-text: rgba(255, 255, 255, 0.65);

  --ld-flash-success-bg: rgba(40, 167, 69, 0.14);
  --ld-flash-success-border: rgba(40, 167, 69, 0.4);
  --ld-flash-success-text: #b8f2c4;
  --ld-flash-error-bg: rgba(227, 24, 55, 0.16);
  --ld-flash-error-border: rgba(227, 24, 55, 0.4);
  --ld-flash-error-text: #ffd9d9;

  --ld-cal-cell-border: rgba(255, 255, 255, 0.06);
  --ld-cal-cell-empty: rgba(255, 255, 255, 0.02);
  --ld-cal-day-text: rgba(255, 255, 255, 0.8);
  --ld-cal-session-bg: rgba(0, 0, 0, 0.35);
  --ld-cal-more-bg: rgba(255, 255, 255, 0.1);

  --ld-cal-btn-bg: rgba(255, 255, 255, 0.05);
  --ld-cal-btn-text: rgba(255, 255, 255, 0.65);
  --ld-cal-btn-border: rgba(255, 255, 255, 0.14);
  --ld-ghost-bg: rgba(255, 255, 255, 0.07);
  --ld-ghost-border: rgba(255, 255, 255, 0.14);
  --ld-ghost-hover-bg: rgba(255, 255, 255, 0.12);
}

/* ==================================================================
   Login screen  (ALWAYS LIGHT - fixed palette, theme-independent)
   ================================================================== */
.ld-login {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 190px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 20px;
  background: linear-gradient(160deg, #faf7f6 0%, #fbece9 55%, #fde5e1 135%);
}

.ld-login::before {
  content: '';
  position: absolute;
  top: -180px;
  left: -120px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 24, 55, 0.18) 0%, rgba(227, 24, 55, 0) 70%);
  filter: blur(8px);
  pointer-events: none;
}

.ld-login::after {
  content: '';
  position: absolute;
  bottom: -220px;
  right: -140px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 27, 14, 0.14) 0%, rgba(184, 27, 14, 0) 70%);
  filter: blur(10px);
  pointer-events: none;
}

.ld-login__car {
  position: absolute;
  bottom: -10px;
  left: -40px;
  width: 320px;
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}

.ld-login__card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  padding: 46px 42px 40px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(17, 18, 23, 0.08);
  box-shadow: 0 30px 70px rgba(17, 18, 23, 0.12);
}

.ld-login__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, var(--ld-red), var(--ld-red-bright));
}

.ld-login__logo {
  display: block;
  margin: 0 auto 26px;
  width: 170px;
  height: auto;
}

.ld-login__title {
  margin: 0 0 6px;
  font-family: var(--ld-font);
  font-size: 30px;
  font-weight: 800;
  color: #1a1b20;
  text-align: center;
  letter-spacing: -0.4px;
}

.ld-login__subtitle {
  margin: 0 0 30px;
  font-family: var(--ld-font);
  font-size: 15px;
  line-height: 1.6;
  color: #6c6f77;
  text-align: center;
}

.ld-login__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: #fdeaea;
  border: 1px solid rgba(184, 27, 14, 0.35);
  color: #b81b0e;
  font-family: var(--ld-font);
  font-size: 14px;
  line-height: 1.5;
}

.ld-login__alert i {
  margin-top: 2px;
  font-size: 15px;
}

.ld-login__alert ul {
  margin: 0;
  padding-left: 18px;
}

.ld-login__field {
  position: relative;
  margin-bottom: 18px;
}

.ld-login__field > i {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  color: rgba(17, 18, 23, 0.45);
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}

.ld-login__field input {
  width: 100%;
  height: 56px;
  padding: 0 46px 0 50px;
  border: 1px solid rgba(17, 18, 23, 0.15);
  border-radius: 12px;
  background: #ffffff;
  color: #1a1b20;
  font-family: var(--ld-font);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.ld-login__field input::placeholder {
  color: rgba(17, 18, 23, 0.4);
}

.ld-login__field input:focus {
  border-color: rgba(227, 24, 55, 0.7);
  box-shadow: 0 0 0 4px rgba(227, 24, 55, 0.18);
}

.ld-login__toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(17, 18, 23, 0.45);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s ease;
}

.ld-login__toggle:hover {
  color: rgba(17, 18, 23, 0.8);
}

.ld-login__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--ld-red), var(--ld-red-bright));
  color: var(--ld-white);
  font-family: var(--ld-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
  box-shadow: 0 10px 26px rgba(184, 27, 14, 0.35);
}

.ld-login__btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 16px 34px rgba(184, 27, 14, 0.5);
}

.ld-login__btn:active {
  transform: translateY(0);
}

.ld-login__divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 18px;
  color: rgba(17, 18, 23, 0.35);
  font-family: var(--ld-font);
  font-size: 13px;
}

.ld-login__divider::before,
.ld-login__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(17, 18, 23, 0.1);
}

.ld-login__foot {
  margin: 0;
  font-family: var(--ld-font);
  font-size: 14px;
  line-height: 1.6;
  color: #6c6f77;
  text-align: center;
}

.ld-login__foot a {
  color: var(--ld-red);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ld-login__foot a:hover {
  color: #1a1b20;
}

.ld-login__home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-family: var(--ld-font);
  font-size: 13px;
  color: rgba(17, 18, 23, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.ld-login__home:hover {
  color: #1a1b20;
}

@media (max-width: 575px) {
  .ld-login {
    padding: 60px 16px;
  }

  .ld-login__card {
    padding: 36px 24px 30px;
    border-radius: 18px;
  }

  .ld-login__car {
    display: none;
  }
}

/* ==================================================================
   Learner dashboard - sidebar shell (theme-aware)
   ================================================================== */
.ld-dash {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: calc(100vh - 90px);
  background: var(--ld-main-bg);
  color: var(--ld-text);
}

/* ---- Mobile menu toggle (admin + learner) ---- */
.ld-dash__menu-toggle {
  display: none;
}

.ld-dash__scrim {
  display: none;
}

/* ---- Sidebar ---- */
.ld-dash__side {
  position: sticky;
  top: 90px;
  align-self: start;
  height: calc(100vh - 90px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 30px 18px 22px;
  background: var(--ld-side-bg);
  border-right: 1px solid var(--ld-side-border);
}

@media (min-width: 992px) {
  .ld-dash:not(.ld-dash--cms) .ld-dash__side {
    padding-top: 0;
  }
}

.ld-dash__logo {
  display: block;
  margin: 0 auto 24px;
  width: 150px;
  height: auto;
}

.ld-dash__logo--light {
  display: none;
}

html[data-theme='dark'] .ld-dash__logo--dark {
  display: none;
}

html[data-theme='dark'] .ld-dash__logo--light {
  display: block;
}

.ld-dash__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--ld-surface);
  border: 1px solid var(--ld-surface-border);
}

.ld-dash__avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ld-red), var(--ld-red-bright));
  font-weight: 800;
  font-size: 15px;
  color: var(--ld-white);
}

.ld-dash__profile-body {
  min-width: 0;
}

.ld-dash__profile-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ld-text);
  line-height: 1.25;
  word-break: break-word;
}

.ld-dash__profile-email {
  font-size: 12px;
  color: var(--ld-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ld-dash__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.ld-dash__nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ld-nav-text);
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ld-dash__nav .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--ld-nav-icon);
  transition: color 0.2s ease;
}

.ld-dash__nav .nav-link:hover {
  color: var(--ld-text);
  background: var(--ld-hover-bg);
}

.ld-dash__nav .nav-link:hover i {
  color: var(--ld-red-bright);
}

.ld-dash__nav .nav-link.active {
  color: var(--ld-white);
  background: linear-gradient(90deg, var(--ld-red), var(--ld-red-bright));
  box-shadow: 0 8px 20px rgba(184, 27, 14, 0.35);
}

.ld-dash__nav .nav-link.active i {
  color: var(--ld-white);
}

/* ---- Theme toggle ---- */
.ld-dash__theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--ld-surface-border);
  background: var(--ld-hover-bg);
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-nav-text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ld-dash__theme:hover {
  border-color: rgba(227, 24, 55, 0.5);
}

.ld-dash__theme-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ld-dash__theme-left i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--ld-red-bright);
}

.ld-dash__switch {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(17, 18, 23, 0.22);
  transition: background 0.2s ease;
}

.ld-dash__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

html[data-theme='dark'] .ld-dash__switch {
  background: var(--ld-red);
}

html[data-theme='dark'] .ld-dash__switch::after {
  transform: translateX(18px);
}

.ld-dash__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(227, 24, 55, 0.4);
  background: rgba(227, 24, 55, 0.1);
  color: var(--ld-red);
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.ld-dash__logout:hover {
  background: var(--ld-red);
  color: var(--ld-white);
}

/* ---- Main content ---- */
.ld-dash__main {
  padding: 40px 44px 64px;
  min-width: 0;
}

.ld-dash__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.ld-dash__head h2 {
  margin: 0;
  font-family: var(--ld-font);
  font-size: 26px;
  font-weight: 800;
  color: var(--ld-text);
  letter-spacing: -0.3px;
}

.ld-dash__head p {
  margin: 4px 0 0;
  font-family: var(--ld-font);
  font-size: 14px;
  color: var(--ld-text-muted);
}

.ld-dash:not(.ld-dash--cms) .ld-dash__head {
  padding: 26px 32px;
  border-radius: 18px;
  background: linear-gradient(90deg, var(--ld-red) 0%, var(--ld-maroon) 55%, var(--ld-black-deep) 100%);
  box-shadow: 0 18px 40px rgba(184, 27, 14, 0.28);
}

.ld-dash:not(.ld-dash--cms) .ld-dash__head h2 {
  color: var(--ld-white);
}

.ld-dash:not(.ld-dash--cms) .ld-dash__head p {
  color: rgba(255, 255, 255, 0.72);
}

.ld-dash__member-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 700;
}

.ld-dash__member-pill--yes {
  background: var(--ld-badge-completed-bg);
  border: 1px solid rgba(40, 167, 69, 0.45);
  color: var(--ld-badge-completed-text);
}

.ld-dash__member-pill--no {
  background: var(--ld-badge-neutral-bg);
  border: 1px solid var(--ld-surface-border);
  color: var(--ld-badge-neutral-text);
}

.ld-dash__flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 22px;
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 500;
}

.ld-dash__flash--success {
  background: var(--ld-flash-success-bg);
  border: 1px solid var(--ld-flash-success-border);
  color: var(--ld-flash-success-text);
}

.ld-dash__flash--error {
  background: var(--ld-flash-error-bg);
  border: 1px solid var(--ld-flash-error-border);
  color: var(--ld-flash-error-text);
}

.ld-dash__card {
  padding: 24px 26px;
  margin-bottom: 22px;
  border-radius: 18px;
  background: var(--ld-surface);
  border: 1px solid var(--ld-surface-border);
  box-shadow: var(--ld-surface-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ld-dash__card-title {
  margin: 0 0 18px;
  font-family: var(--ld-font);
  font-size: 17px;
  font-weight: 700;
  color: var(--ld-text);
}

.ld-dash__card-title i {
  margin-right: 8px;
  color: var(--ld-red-bright);
}

/* ---- Stats ---- */
.ld-dash__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}

.ld-dash__stat {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 16px;
  background: var(--ld-surface);
  border: 1px solid var(--ld-surface-border);
  box-shadow: var(--ld-surface-shadow);
}

.ld-dash__stat::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 24, 55, 0.18) 0%, rgba(227, 24, 55, 0) 70%);
  pointer-events: none;
}

.ld-dash__stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ld-dash__stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ld-red), var(--ld-red-bright));
  color: var(--ld-white);
  font-size: 17px;
  box-shadow: 0 8px 18px rgba(184, 27, 14, 0.35);
}

.ld-dash__stat-num {
  font-family: var(--ld-font);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--ld-text);
}

.ld-dash__stat-label {
  margin-top: 8px;
  font-family: var(--ld-font);
  font-size: 13px;
  color: var(--ld-text-muted);
}

/* ---- Tables ---- */
.ld-dash__table-wrap {
  overflow-x: auto;
}

.ld-dash__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ld-font);
  font-size: 14px;
}

.ld-dash__table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ld-table-th-border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ld-text-muted);
  text-align: left;
  white-space: nowrap;
}

.ld-dash__table td {
  padding: 14px;
  border-bottom: 1px solid var(--ld-table-row-border);
  color: var(--ld-table-text);
  vertical-align: middle;
}

.ld-dash__table tbody tr {
  transition: background 0.15s ease;
}

.ld-dash__table tbody tr:hover {
  background: var(--ld-table-hover);
}

.ld-dash__table tbody tr:last-child td {
  border-bottom: none;
}

/* Learner "My bookings" table polish */
.ld-dash__table--learner tbody tr:nth-child(even) {
  background: rgba(17, 18, 23, 0.025);
}

html[data-theme='dark'] .ld-dash__table--learner tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.ld-dash__table--learner thead th {
  background: rgba(17, 18, 23, 0.03);
  border-bottom: 2px solid var(--ld-table-th-border);
}

html[data-theme='dark'] .ld-dash__table--learner thead th {
  background: rgba(255, 255, 255, 0.04);
}

.ld-dash__table--learner tbody tr:hover {
  box-shadow: inset 3px 0 0 var(--ld-red-bright);
}

.ld-dash__pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 2px 0;
}

.ld-dash__pager-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ld-dash__pager-btn {
  min-width: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--ld-cal-btn-border);
  background: var(--ld-cal-btn-bg);
  color: var(--ld-cal-btn-text);
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ld-dash__pager-btn:hover {
  border-color: rgba(227, 24, 55, 0.6);
  color: var(--ld-text);
}

.ld-dash__pager-btn--active {
  border-color: rgba(227, 24, 55, 0.45);
  background: rgba(227, 24, 55, 0.1);
  color: var(--ld-red);
}

.ld-dash__pager-btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ld-dash__pager-info {
  font-family: var(--ld-font);
  font-size: 13px;
  color: var(--ld-text-muted);
}

.ld-dash__table-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 340px;
  margin-bottom: 14px;
}

.ld-dash__table-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  font-size: 13px;
  color: var(--ld-text-muted);
  pointer-events: none;
}

.ld-dash__table-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--ld-input-border);
  border-radius: 12px;
  background: var(--ld-input-bg);
  color: var(--ld-input-text);
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 500;
}

.ld-dash__table-search-input::placeholder {
  color: var(--ld-placeholder);
}

.ld-dash__table-search-input:focus {
  border-color: rgba(227, 24, 55, 0.7);
  box-shadow: 0 0 0 4px var(--ld-focus-ring);
  outline: none;
}

.ld-dash__table-empty td {
  padding: 18px;
  text-align: center;
  font-family: var(--ld-font);
  font-size: 14px;
  color: var(--ld-text-muted);
}

.ld-dash__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--ld-font);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ld-dash__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ld-dash__badge--scheduled {
  background: var(--ld-badge-scheduled-bg);
  color: var(--ld-badge-scheduled-text);
}

.ld-dash__badge--completed {
  background: var(--ld-badge-completed-bg);
  color: var(--ld-badge-completed-text);
}

.ld-dash__badge--cancelled,
.ld-dash__badge--noshow {
  background: var(--ld-badge-danger-bg);
  color: var(--ld-badge-danger-text);
}

.ld-dash__badge--info {
  background: var(--ld-badge-info-bg);
  color: var(--ld-badge-info-text);
}

.ld-dash__badge--neutral {
  background: var(--ld-badge-neutral-bg);
  color: var(--ld-badge-neutral-text);
}

.ld-dash__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid rgba(227, 24, 55, 0.45);
  background: rgba(227, 24, 55, 0.1);
  color: var(--ld-red);
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.ld-dash__link:hover {
  background: var(--ld-red);
  color: var(--ld-white);
  transform: translateY(-1px);
}

.ld-dash__link--disabled,
.ld-dash__link--disabled:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.14);
  color: var(--ld-text-muted);
  cursor: not-allowed;
  transform: none;
}

.ld-dash__empty {
  margin: 0;
  padding: 18px 0;
  font-family: var(--ld-font);
  font-size: 14px;
  color: var(--ld-text-muted);
}

/* ---- Calendar ---- */
.ld-dash__cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.ld-dash__cal-title {
  margin: 0;
  font-family: var(--ld-font);
  font-size: 17px;
  font-weight: 700;
  color: var(--ld-text);
}

.ld-dash__cal-nav {
  display: flex;
  gap: 8px;
}

.ld-dash__cal-btn {
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--ld-cal-btn-border);
  background: var(--ld-cal-btn-bg);
  color: var(--ld-cal-btn-text);
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ld-dash__cal-btn:hover {
  border-color: rgba(227, 24, 55, 0.6);
  color: var(--ld-text);
}

.ld-dash__cal-btn--primary {
  border-color: rgba(227, 24, 55, 0.45);
  background: rgba(227, 24, 55, 0.1);
  color: var(--ld-red);
}

.ld-dash__cal-btn--primary:hover {
  background: var(--ld-red);
  color: var(--ld-white);
}

.ld-dash__cal-btn--export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ld-dash__cal {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ld-font);
  font-size: 13px;
}

.ld-dash__cal th {
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ld-text-muted);
  border-bottom: 1px solid var(--ld-table-th-border);
}

.ld-dash__cal td {
  border: 1px solid var(--ld-cal-cell-border);
  vertical-align: top;
  min-width: 104px;
  height: 92px;
  padding: 7px;
}

.ld-dash__cal-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ld-cal-day-text);
}

.ld-dash__cal-cell--today .ld-dash__cal-day {
  background: linear-gradient(135deg, var(--ld-red), var(--ld-red-bright));
  color: var(--ld-white);
}

.ld-dash__cal-cell--empty {
  background: var(--ld-cal-cell-empty);
}

.ld-dash__cal-session {
  display: block;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border-left: 3px solid var(--ld-red-bright);
  background: var(--ld-cal-session-bg);
  line-height: 1.35;
  font-size: 12px;
}

.ld-dash__cal-session strong {
  display: block;
  font-weight: 700;
  color: var(--ld-text);
}

.ld-dash__cal-session span {
  display: block;
  color: var(--ld-text-muted);
  font-size: 11px;
}

.ld-dash__cal-session--disabled {
  border-left-color: var(--ld-text-muted);
  background: rgba(0, 0, 0, 0.05);
  cursor: not-allowed;
  opacity: 0.7;
}

.ld-dash__cal-session--disabled strong {
  color: var(--ld-text-muted);
}

.ld-dash__field select option:disabled {
  color: var(--ld-text-muted);
}

.ld-dash__cal-more {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ld-cal-more-bg);
  color: var(--ld-text-muted);
  font-size: 11px;
  font-weight: 600;
}

/* ---- Instructor schedule ---- */
.ld-dash__cal-cell--past {
  opacity: 0.45;
}

.ld-dash__cal-session--busy {
  border-left-color: var(--ld-red);
  background: rgba(227, 24, 55, 0.08);
  cursor: default;
}

.ld-dash__cal-session--busy strong {
  color: var(--ld-text);
}

.ld-dash__cal-status--busy {
  color: var(--ld-red);
  font-style: normal;
  font-weight: 700;
}

.ld-dash__cal-session--available {
  border-left-color: #2fb344;
  background: rgba(47, 179, 68, 0.12);
}

.ld-dash__cal-session--available strong {
  color: #2fb344;
}

.ld-dash__cal-slot strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ld-dash__cal-slot--busy strong {
  color: var(--ld-red);
}

.ld-dash__cal-slot--available strong {
  color: #2fb344;
}

/* ---- Instructor day view ---- */
.ld-dash__cal-day-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.ld-dash__cal-day-view .ld-dash__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ld-dash__cal-day-view .ld-dash__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: none;
  border-radius: 12px;
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 600;
}

.ld-dash__cal-day-view .ld-dash__list span {
  white-space: nowrap;
}

.ld-dash__cal-day-view .ld-dash__cal-slot strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ld-dash__cal-day-view .ld-dash__cal-slot--busy {
  border: 1px solid rgba(227, 24, 55, 0.4);
  background: rgba(227, 24, 55, 0.08);
}

.ld-dash__cal-day-view .ld-dash__cal-slot--busy span,
.ld-dash__cal-day-view .ld-dash__cal-slot--busy strong {
  color: var(--ld-red);
}

.ld-dash__cal-day-view .ld-dash__cal-slot--available {
  border: 1px solid rgba(47, 179, 68, 0.4);
  background: rgba(47, 179, 68, 0.1);
}

.ld-dash__cal-day-view .ld-dash__cal-slot--available span,
.ld-dash__cal-day-view .ld-dash__cal-slot--available strong {
  color: #2fb344;
}

.ld-dash__avail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ld-dash__avail-list li {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(47, 179, 68, 0.35);
  background: rgba(47, 179, 68, 0.1);
  color: #2fb344;
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 600;
}

/* ---- Membership ---- */
.ld-dash__member-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ld-red) 0%, var(--ld-maroon) 130%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 22px;
}

.ld-dash__member-hero h4 {
  margin: 0 0 8px;
  font-family: var(--ld-font);
  font-size: 20px;
  font-weight: 800;
  color: var(--ld-white);
}

.ld-dash__member-hero p {
  margin: 0;
  font-family: var(--ld-font);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 520px;
}

.ld-dash__member-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--ld-white);
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 600;
}

.ld-dash__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--ld-red), var(--ld-red-bright));
  color: var(--ld-white);
  font-family: var(--ld-font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(184, 27, 14, 0.35);
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.ld-dash__btn:hover {
  color: var(--ld-white);
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 16px 34px rgba(184, 27, 14, 0.5);
}

.ld-dash__btn--ghost {
  background: var(--ld-ghost-bg);
  border: 1px solid var(--ld-ghost-border);
  color: var(--ld-text-muted);
  box-shadow: none;
}

.ld-dash__btn--ghost:hover {
  color: var(--ld-text);
  background: var(--ld-ghost-hover-bg);
  filter: none;
}

.ld-dash__btn--sm {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: none;
}

.ld-dash__btn--dark {
  background: linear-gradient(90deg, var(--ld-black-deep) 0%, var(--ld-maroon) 55%, var(--ld-red) 100%);
  color: var(--ld-white);
  box-shadow: 0 8px 20px rgba(17, 18, 23, 0.35);
}

.ld-dash__btn--dark:hover {
  color: var(--ld-white);
  box-shadow: 0 12px 28px rgba(184, 27, 14, 0.45);
}

.ld-dash__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ld-dash__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ld-dash__list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ld-table-row-border);
  font-family: var(--ld-font);
  font-size: 14px;
}

.ld-dash__list li:last-child {
  border-bottom: none;
}

.ld-dash__list span {
  color: var(--ld-text-muted);
}

.ld-dash__list strong {
  color: var(--ld-text);
  font-weight: 600;
  text-align: right;
}

.ld-dash__benefits {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ld-dash__benefits li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--ld-table-row-border);
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text);
}

.ld-dash__benefits li:last-child {
  border-bottom: none;
}

.ld-dash__benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(227, 24, 55, 0.1);
  color: var(--ld-red);
  font-size: 16px;
}

/* ==================================================================
   Full-width gradient page wrapper (sub-pages: reschedule, etc.)
   Follows the active theme (light default / dark toggle)
   ================================================================== */
.ld-page {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px 80px;
  background: var(--ld-page-bg);
}

.ld-page__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
}

.ld-page__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

.ld-page__back:hover {
  color: var(--ld-text);
}

/* ---- Reschedule form ---- */
.ld-dash__field {
  margin-bottom: 20px;
}

.ld-dash__field label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--ld-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-muted);
}

.ld-dash__field input,
.ld-dash__field select,
.ld-dash__field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--ld-input-border);
  border-radius: 12px;
  background: var(--ld-input-bg);
  color: var(--ld-input-text);
  font-family: var(--ld-font);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ld-dash__field input:focus,
.ld-dash__field select:focus,
.ld-dash__field textarea:focus {
  border-color: rgba(227, 24, 55, 0.7);
  box-shadow: 0 0 0 4px var(--ld-focus-ring);
}

.ld-dash__field input[type='date']::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.55;
  cursor: pointer;
}

html[data-theme='dark'] .ld-dash__field input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
}

.ld-dash__field select {
  background-image: var(--ld-select-arrow);
  background-repeat: no-repeat;
  background-position: right 16px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
}

.ld-dash__field select option {
  background: var(--ld-option-bg);
  color: var(--ld-option-text);
}

.ld-dash__field textarea {
  resize: vertical;
  min-height: 110px;
}

.ld-dash__hint {
  margin: 6px 0 0;
  font-family: var(--ld-font);
  font-size: 12px;
  color: var(--ld-text-faint);
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .ld-dash {
    grid-template-columns: 1fr;
  }

  .ld-dash__side {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--ld-side-border);
    padding: 22px 18px;
  }

  .ld-dash__logo {
    margin-bottom: 16px;
  }

  .ld-dash__nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .ld-dash__nav .nav-link {
    width: auto;
  }

  .ld-dash__theme {
    width: auto;
    align-self: flex-start;
  }

  .ld-dash__logout {
    margin-top: 12px;
  }

  .ld-dash__main {
    padding: 28px 20px 48px;
  }

  .ld-dash__stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 575px) {
  .ld-dash__main {
    padding: 22px 14px 40px;
  }

  .ld-dash__card {
    padding: 18px 16px;
  }
}

/* ---- Mobile menu drawer (admin + learner) ---- */
@media (max-width: 991px) {
  .ld-dash--menu .ld-dash__side {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--ld-side-border);
    border-bottom: none;
    padding: 22px 18px;
  }

  .ld-dash--menu.ld-dash--menu-open .ld-dash__side {
    transform: translateX(0);
  }

  .ld-dash--menu .ld-dash__nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .ld-dash--menu .ld-dash__nav .nav-link {
    width: 100%;
  }

  .ld-dash--menu .ld-dash__menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 14px;
    left: 14px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--ld-red), var(--ld-red-bright));
    color: var(--ld-white);
    font-size: 18px;
    z-index: 1200;
    box-shadow: 0 8px 20px rgba(184, 27, 14, 0.35);
    cursor: pointer;
  }

  .ld-dash--menu:not(.ld-dash--cms) .ld-dash__menu-toggle {
    top: 64px;
  }

  .ld-dash--menu .ld-dash__scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1050;
  }

  .ld-dash--menu.ld-dash--menu-open .ld-dash__scrim {
    display: block;
  }
}
