/* VISTORA — unified instructor/consultant dashboard.
   WordPress-admin structure (sidebar + topbar + content) with the front-end
   brand: VISTORA colors, Playfair headings, Inter/Cairo body. */
/* Standalone app pages (dashboard + my-account): kill the site header offset. */
body.vd-app { --vp-header-h: 0px; margin: 0; padding-top: 0; background: #f5f4fa; }

.vd {
  --p: var(--primary, #4A3B6B);
  --a: var(--accent, #C9A961);
  --fg: var(--fg, #2D2D2D);
  --mut: var(--muted, #5A5A5A);
  --bd: var(--border, #E5E5E5);
  --sec: var(--secondary, #F5E6D3);
  --app: #f5f4fa;
  --side: linear-gradient(180deg, #4A3B6B 0%, #3a2e57 60%, #2c2244 100%);
  --hh: var(--vp-header-h, 5rem);
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: calc(100vh - var(--hh));
  background: var(--app);
  color: var(--fg);
  font-family: var(--font-inter, 'Inter'), 'Cairo', system-ui, sans-serif;
}
.vd * { box-sizing: border-box; }
.vd a { text-decoration: none; }

/* keep embedded .vlms content (course list, editor, earnings) flush in the panel */
.vd-content .vlms { max-width: none; margin: 0; padding: 0; color: inherit; }

/* ---------- Sidebar ---------- */
.vd-side {
  position: sticky; top: var(--hh); align-self: start;
  height: calc(100vh - var(--hh));
  background: var(--side); color: #fff;
  display: flex; flex-direction: column;
  padding: 1.25rem 0.9rem; z-index: 40;
}
.admin-bar .vd-side { top: calc(var(--hh) + 32px); height: calc(100vh - var(--hh) - 32px); }
.vd-brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .6rem 1.25rem; color: #fff; }
.vd-brand-mark { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .6rem; background: var(--a); color: #2D2D2D; font-family: 'Playfair Display', serif; font-weight: 800; }
.vd-brand-name { font-family: 'Playfair Display', serif; font-weight: 700; letter-spacing: .16em; font-size: 1.1rem; }

.vd-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.vd-nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .75rem; border-radius: .7rem;
  color: rgba(255,255,255,.78); font-size: .92rem; font-weight: 500;
  position: relative; transition: background .15s, color .15s;
}
.vd-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.vd-nav-item.on { background: rgba(255,255,255,.12); color: #fff; }
.vd-nav-item.on::before { content: ""; position: absolute; inset-inline-start: -0.9rem; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--a); }
.vd-nav-ic { flex-shrink: 0; }
.vd-nav-item span { flex: 1; }
.vd-nav-lock { color: var(--a); opacity: .95; }
.vd-nav-sep { height: 1px; background: rgba(255,255,255,.12); margin: .75rem .4rem; }

.vd-side-user { display: flex; align-items: center; gap: .65rem; padding: .85rem .6rem 0; border-top: 1px solid rgba(255,255,255,.12); margin-top: .5rem; }
.vd-avatar { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 999px; background: var(--a); color: #2D2D2D; font-weight: 700; flex-shrink: 0; }
.vd-side-user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.vd-side-user-meta strong { color: #fff; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-side-user-meta a { color: rgba(255,255,255,.6); font-size: .78rem; }
.vd-side-user-meta a:hover { color: var(--a); }

/* ---------- Main ---------- */
.vd-main { min-width: 0; display: flex; flex-direction: column; }
.vd-topbar {
  position: sticky; top: var(--hh); z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.75rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bd);
}
.admin-bar .vd-topbar { top: calc(var(--hh) + 32px); }
.vd-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0; color: var(--fg); display: flex; align-items: center; gap: .5rem; flex: 1; }
.lang-ar .vd-title, .is-rtl .vd-title { font-family: 'Cairo', serif; }
.vd-title-lock { color: var(--a); flex-shrink: 0; }
.vd-top-actions { display: flex; gap: .5rem; }
.vd-burger { display: none; background: none; border: 0; color: var(--fg); cursor: pointer; padding: .25rem; }

.vd-content { padding: 1.75rem; }

/* ---------- Buttons / notices ---------- */
.vd-btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  background: var(--p); color: #fff; border: 0; border-radius: 999px;
  padding: .7rem 1.4rem; font: inherit; font-weight: 600; font-size: .9rem;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.vd-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -14px rgba(74,59,107,.7); color: #fff; }
.vd-btn-sm { padding: .5rem 1.05rem; font-size: .84rem; }
.vd-btn-lg { padding: .9rem 1.9rem; font-size: 1rem; }
.vd-btn-lock { background: #fff; color: var(--p); border: 1px solid var(--bd); }
.vd-note { padding: .8rem 1.1rem; border-radius: 12px; margin-bottom: 1.25rem; font-size: .92rem; }
.vd-note.ok { background: #e9f6ec; border: 1px solid #b6e0c1; color: #1e7e34; }
.vd-note.err { background: #fdecea; border: 1px solid #f3c2bd; color: #b3261e; }

/* ---------- Overview ---------- */
.vd-welcome h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin: 0 0 .25rem; color: var(--fg); }
.lang-ar .vd-welcome h2 { font-family: 'Cairo', serif; }
.vd-welcome p { color: var(--mut); margin: 0 0 1.5rem; }
.vd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.75rem; }
@media (max-width: 900px) { .vd-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .vd-stats { grid-template-columns: 1fr; } }
.vd-stat { display: flex; align-items: center; gap: .9rem; background: #fff; border: 1px solid var(--bd); border-radius: 16px; padding: 1.1rem 1.2rem; box-shadow: 0 10px 26px -22px rgba(74,59,107,.5); }
.vd-stat-ic { font-size: 1.6rem; line-height: 1; }
.vd-stat .n { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.6rem; color: var(--p); line-height: 1.1; }
.vd-stat .l { color: var(--mut); font-size: .8rem; margin-top: .15rem; }

.vd-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 760px) { .vd-cards { grid-template-columns: 1fr; } }
.vd-feature { background: #fff; border: 1px solid var(--bd); border-radius: 18px; padding: 1.6rem; box-shadow: 0 14px 34px -26px rgba(74,59,107,.5); }
.vd-feature-ic { font-size: 2rem; margin-bottom: .6rem; }
.vd-feature h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin: 0 0 .4rem; color: var(--fg); }
.lang-ar .vd-feature h3 { font-family: 'Cairo', serif; }
.vd-feature p { color: var(--mut); font-size: .92rem; margin: 0 0 1.1rem; line-height: 1.55; }

.vd-chip { display: inline-block; font-size: .82rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; }
.vd-chip.ok { background: #e6f4ea; color: #1e7e34; }
.vd-chip.lock { background: #fdecea; color: #b3261e; }
.vd-chip.mut { background: #eee; color: #666; }

/* ---------- Panels / gates ---------- */
.vd-panel { background: #fff; border: 1px solid var(--bd); border-radius: 18px; padding: 1.6rem; }
.vd-panel h3 { font-family: 'Playfair Display', serif; margin: 0 0 .35rem; color: var(--fg); }
.vd-muted { color: var(--mut); }
.vd-consult-actions { margin-top: 1rem; }

.vd-gate { max-width: 30rem; margin: 2rem auto; text-align: center; background: #fff; border: 1px solid var(--bd); border-radius: 20px; padding: 2.5rem 2rem; box-shadow: 0 24px 50px -34px rgba(74,59,107,.5); }
.vd-gate-lock { display: grid; place-items: center; width: 5rem; height: 5rem; margin: 0 auto 1.25rem; border-radius: 999px; background: color-mix(in srgb, var(--a) 18%, #fff); color: var(--a); }
.vd-gate-ic { font-size: 3rem; margin-bottom: .75rem; }
.vd-gate h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin: 0 0 .5rem; color: var(--fg); }
.lang-ar .vd-gate h3 { font-family: 'Cairo', serif; }
.vd-gate p { color: var(--mut); margin: 0 0 1.5rem; line-height: 1.6; }

/* ---------- Availability editor ---------- */
.vd-avail { background: #fff; border: 1px solid var(--bd); border-radius: 18px; padding: 1.4rem 1.5rem; }
.vd-avail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.vd-avail-head h3 { font-family: 'Playfair Display', serif; margin: 0 0 .25rem; color: var(--fg); }
.vd-tz { background: color-mix(in srgb, var(--sec) 45%, #fff); border: 1px solid var(--bd); border-radius: 10px; padding: .5rem .8rem; font-size: .82rem; color: var(--mut); }
.vd-avail-scroll { overflow: auto; max-height: 60vh; border: 1px solid var(--bd); border-radius: 12px; }
.vd-avail-grid { border-collapse: collapse; width: 100%; min-width: 520px; }
.vd-avail-grid th, .vd-avail-grid td { text-align: center; padding: 0; }
.vd-avail-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--p); color: #fff; padding: .55rem .4rem; font-size: .8rem; font-weight: 600; cursor: pointer; }
.vd-avail-grid thead th.vd-avail-time { cursor: default; }
.vd-avail-time { position: sticky; inset-inline-start: 0; background: #faf9fd; z-index: 1; padding: .35rem .6rem !important; font-size: .78rem; font-weight: 600; color: var(--fg); white-space: nowrap; text-align: start !important; border-inline-end: 1px solid var(--bd); }
.vd-avail-local { display: block; font-size: .66rem; font-weight: 400; color: var(--mut); }
.vd-avail-grid tbody tr:nth-child(odd) td { background: #fbfaff; }
.vd-avail-grid td { border: 1px solid color-mix(in srgb, var(--bd) 60%, transparent); }
.vd-slot { display: block; cursor: pointer; padding: .3rem; }
.vd-slot input { position: absolute; opacity: 0; pointer-events: none; }
.vd-slot span { display: block; height: 1.5rem; border-radius: 6px; background: #ececf3; transition: background .12s, transform .1s; }
.vd-slot:hover span { background: #ddd9ea; }
.vd-slot.on span { background: linear-gradient(135deg, var(--p), #6a5891); box-shadow: inset 0 0 0 2px rgba(201,169,97,.4); }
.vd-avail-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

/* ---------- Guest ---------- */
.vd-guest { display: grid; place-items: center; min-height: 50vh; padding: 2rem; }
.vd-guest-card { text-align: center; background: #fff; border: 1px solid #E5E5E5; border-radius: 20px; padding: 2.5rem; max-width: 26rem; }
.vd-guest-card h2 { font-family: 'Playfair Display', serif; color: #4A3B6B; margin: 0 0 .5rem; }
.vd-guest-card p { color: #5A5A5A; margin: 0 0 1.5rem; }

/* ---------- Mobile: off-canvas sidebar ---------- */
.vd-backdrop { display: none; }
@media (max-width: 880px) {
  .vd { grid-template-columns: 1fr; }
  .vd-side {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
    height: 100%; width: 80%; max-width: 18rem; z-index: 120;
    transform: translateX(-105%); transition: transform .25s ease;
  }
  [dir="rtl"] .vd-side { transform: translateX(105%); }
  .vd.open .vd-side { transform: translateX(0); }
  .vd-burger { display: inline-grid; place-items: center; }
  .vd-topbar { top: var(--hh); }
  .vd.open .vd-backdrop { display: block; position: fixed; inset: 0; background: rgba(20,16,30,.5); z-index: 110; }
}

/* Instructor gate — paid seller plan */
.vd-plan-list { list-style:none; margin:1rem auto 1.25rem; padding:0; max-width:22rem; text-align:start; display:grid; gap:.45rem; }
.vd-plan-list li { color:var(--vd-fg,#2D2D2D); font-size:.9rem; }
.vd-gate-fine { color:var(--vd-muted,#5A5A5A); font-size:.78rem; margin-top:.9rem; max-width:24rem; margin-inline:auto; }
