/* SomaHub Tutor Panel */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Sora:wght@600;700&display=swap');

body.tutor-app {
  --tp-ink: #0b1726;
  --tp-blue: #1f6ae6;
  --tp-blue-deep: #1554c0;
  --tp-canvas: #eef2f7;
  --tp-surface: #ffffff;
  --tp-line: #d8e0ea;
  --tp-muted: #5f6f82;
  --tp-rail: #ffffff;
  --tp-rail-w: 300px;
  --primary-color: #1f6ae6;

  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--tp-canvas);
  color: var(--tp-ink);
  min-height: 100vh;
  overflow-x: hidden;
}

body.tutor-app h1,
body.tutor-app h2,
body.tutor-app h3,
body.tutor-app .page-title,
body.tutor-app .page-title-sm,
body.tutor-app .box-title .title {
  font-family: 'Sora', 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* Neutralize legacy .sidebar rules if any remnant classes appear */
body.tutor-app .sidebar {
  all: unset;
}

/* ========== New sidebar rail ========== */
body.tutor-app .tp-rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--tp-rail-w);
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--tp-rail);
  border-right: 1px solid var(--tp-line);
  box-shadow: 4px 0 24px rgba(11, 23, 38, 0.04);
}

body.tutor-app .tp-rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--tp-line);
  flex-shrink: 0;
}

body.tutor-app .tp-rail-logo {
  display: block;
  line-height: 0;
}

body.tutor-app .tp-rail-logo img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

body.tutor-app .tp-rail-close {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--tp-line);
  border-radius: 10px;
  background: #fff;
  color: var(--tp-ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body.tutor-app .tp-rail-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 20px;
  -webkit-overflow-scrolling: touch;
}

body.tutor-app .tp-rail-label {
  margin: 14px 10px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a97a8;
}

body.tutor-app .tp-rail-label:first-child {
  margin-top: 4px;
}

body.tutor-app .tp-rail-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 0 0 4px;
  padding: 10px 12px !important;
  border-radius: 12px;
  color: #243447 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

body.tutor-app .tp-rail-item i {
  flex: 0 0 18px;
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #6b7c90;
}

body.tutor-app .tp-rail-item span {
  display: block !important;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible !important;
  white-space: normal !important;
  word-break: break-word;
  color: inherit !important;
}

body.tutor-app .tp-rail-item:hover {
  background: #f3f6fa !important;
  color: var(--tp-ink) !important;
}

body.tutor-app .tp-rail-item:hover i {
  color: var(--tp-blue);
}

body.tutor-app .tp-rail-item.active {
  background: #e8f1ff !important;
  color: var(--tp-blue-deep) !important;
}

body.tutor-app .tp-rail-item.active i {
  color: var(--tp-blue);
}

body.tutor-app .tp-rail-bottom {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--tp-line);
  background: #f8fafc;
}

body.tutor-app .tp-rail-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
}

body.tutor-app .tp-rail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--tp-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

body.tutor-app .tp-rail-user-text {
  min-width: 0;
  flex: 1;
}

body.tutor-app .tp-rail-user-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--tp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.tutor-app .tp-rail-user-text small {
  display: block;
  font-size: 11px;
  color: var(--tp-muted);
}

body.tutor-app .tp-rail-logout {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px !important;
  border-radius: 10px;
  color: #c0392b !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

body.tutor-app .tp-rail-logout:hover {
  background: #fdecea !important;
}

body.tutor-app .tp-rail-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 23, 38, 0.4);
  z-index: 90;
}

/* Main content offset */
body.tutor-app .right-content {
  margin-left: var(--tp-rail-w) !important;
  min-height: 100vh;
  width: auto !important;
  max-width: none !important;
}

body.tutor-app .right-content.right-content-0 {
  margin-left: var(--tp-rail-w) !important;
}

/* Header */
body.tutor-app .header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tp-line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 40;
}

body.tutor-app .header .title-control {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

body.tutor-app .header .tp-page-meta {
  min-width: 0;
}

body.tutor-app .header .tp-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tp-muted);
}

body.tutor-app .header .page-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--tp-ink);
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
}

body.tutor-app .header .side-toggle,
body.tutor-app .tp-menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--tp-line);
  background: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
}

body.tutor-app .header .side-toggle span,
body.tutor-app .tp-menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--tp-ink);
  border-radius: 2px;
}

body.tutor-app .header .head-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.tutor-app .tp-top-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--tp-blue);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

body.tutor-app .tp-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--tp-line);
  background: #fff;
  text-decoration: none;
  color: var(--tp-ink);
  font-weight: 600;
  font-size: 13px;
}

body.tutor-app .header .tp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tp-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.tutor-app .body-content {
  padding: 20px;
}

body.tutor-app .page-title-sm {
  display: none;
}

/* Cards / tables / buttons */
body.tutor-app .earning-cart-bg,
body.tutor-app .cart-bg,
body.tutor-app .border-card,
body.tutor-app .custom-border-card {
  background: var(--tp-surface) !important;
  border: 1px solid var(--tp-line) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 24px rgba(11, 23, 38, 0.04);
}

body.tutor-app .btn-default,
body.tutor-app .edit-delete-btn {
  background: var(--tp-blue) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-weight: 600;
}

body.tutor-app .primary-color {
  color: var(--tp-blue) !important;
}

body.tutor-app .form-control,
body.tutor-app .page-search .form-control,
body.tutor-app .input-group-text {
  border-radius: 10px !important;
  border-color: var(--tp-line) !important;
}

body.tutor-app .table thead th {
  background: #f5f8fc;
  color: var(--tp-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-top: none;
}

body.tutor-app .nav-pills.custom-tabs .nav-link.active {
  background: var(--tp-ink);
  color: #fff;
  border-radius: 999px;
}

/* Dashboard */
body.tutor-app .tp-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

body.tutor-app .tp-hero-card {
  border-radius: 18px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #0b1726, #1f6ae6);
  min-height: 150px;
}

body.tutor-app .tp-hero-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

body.tutor-app .tp-hero-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  max-width: 40ch;
}

body.tutor-app .tp-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.tutor-app .tp-quick a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--tp-line);
  text-decoration: none;
  color: var(--tp-ink);
}

body.tutor-app .tp-quick a i { color: var(--tp-blue); }
body.tutor-app .tp-quick a span { font-weight: 700; font-size: 14px; }
body.tutor-app .tp-quick a small { color: var(--tp-muted); font-size: 12px; }

body.tutor-app .stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

body.tutor-app .tp-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--tp-line);
  min-height: 88px;
}

body.tutor-app .tp-stat .text h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

body.tutor-app .tp-stat .text p {
  margin: 2px 0 0;
  color: var(--tp-muted);
  font-size: 12px;
  font-weight: 600;
}

body.tutor-app .tp-stat .icon-bg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f1ff;
  color: var(--tp-blue);
}

@media (max-width: 1200px) {
  body.tutor-app .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  body.tutor-app .tp-hero {
    grid-template-columns: 1fr;
  }

  body.tutor-app .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.tutor-app .tp-rail {
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  body.tutor-app.tp-rail-open .tp-rail {
    transform: translateX(0);
  }

  body.tutor-app.tp-rail-open .tp-rail-backdrop {
    display: block;
  }

  body.tutor-app .tp-rail-close {
    display: inline-flex;
  }

  body.tutor-app .right-content,
  body.tutor-app .right-content.right-content-0 {
    margin-left: 0 !important;
  }

  body.tutor-app .header .side-toggle,
  body.tutor-app .tp-menu-btn {
    display: inline-flex;
  }
}
