
/* Minimalist Retail Training Portal
   - Light/Dark theme
   - RTL support
*/

:root{
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);

  --navy: #0a1326;
  --navy-2:#0e1b36;
  --navy-3:#15284f;
  --gold:#caa24a;
  --gold-2:#e4c675;

  --success:#16a34a;
  --danger:#dc2626;
  --warn:#d97706;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --sidebar-w: 290px;
  --sidebar-collapsed: 84px;
  --header-h: 68px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

body.theme-dark{
  --bg: #050b16;
  --surface: #0b142a;
  --surface-2: #0e1b36;
  --text: #e6edf7;
  --muted: rgba(230,237,247,0.70);
  --border: rgba(230,237,247,0.10);
  --shadow: 0 14px 45px rgba(0,0,0,0.35);
}

/* Scrollbars (sleek, theme-aware) */
:root{
  --scrollbar-size: 10px;
  --scrollbar-track: rgba(15, 23, 42, 0.08);
  --scrollbar-thumb: rgba(15, 23, 42, 0.22);
  --scrollbar-thumb-hover: rgba(15, 23, 42, 0.32);
  --scrollbar-thumb-webkit: rgba(15, 23, 42, 0.22);
  --scrollbar-thumb-webkit-hover: rgba(15, 23, 42, 0.32);
}
body.theme-dark{
  --scrollbar-size: 10px;
  /* Keep the track nearly invisible so the UI doesn't get a bright “white rail” in dark mode */
  --scrollbar-track: rgba(255, 255, 255, 0.02);
  --scrollbar-thumb: rgba(202, 162, 74, 0.36);
  --scrollbar-thumb-hover: rgba(202, 162, 74, 0.58);
  --scrollbar-thumb-webkit: linear-gradient(180deg, rgba(202, 162, 74, 0.62), rgba(202, 162, 74, 0.22));
  --scrollbar-thumb-webkit-hover: linear-gradient(180deg, rgba(202, 162, 74, 0.78), rgba(202, 162, 74, 0.32));
}
*{
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar{
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track{
  background: var(--scrollbar-track);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb{
  background: var(--scrollbar-thumb-webkit);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover{
  background: var(--scrollbar-thumb-webkit-hover);
  background-clip: content-box;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow:hidden;
}

a{ color: inherit; }
button, input, select, textarea{
  font-family: var(--font);
}

.app{
  height:100%;
  display:flex;
}

.sidebar{
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  display:flex;
  flex-direction:column;
  gap: 14px;
  transition: width 220ms ease;
  position: relative;
  overflow: visible;
}

.sidebar.collapsed{
  width: var(--sidebar-collapsed);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor:pointer;
}

.brand:hover{ background: var(--surface-2); }

.brand img{
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand .brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}

.brand .brand-title{
  font-weight: 800;
  letter-spacing: 0.4px;
}
.brand .brand-sub{
  font-size: 12px;
  color: var(--muted);
}

.sidebar.collapsed .brand-text{ display:none; }

.side-actions{
  display:flex;
  gap: 10px;
  padding: 0 8px;
}

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.icon-btn:hover{ background: var(--surface-2); }

.nav{
  display:flex;
  flex-direction:column;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(202,162,74,0.06), transparent);
}

.nav a{
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid transparent;
}
.nav a:hover{ background: var(--surface-2); }
.nav a.active{
  border-color: rgba(202,162,74,0.35);
  background: linear-gradient(90deg, rgba(202,162,74,0.18), transparent);
}
.nav .nav-icon{
  width: 22px;
  height: 22px;
  display:inline-grid;
  place-items:center;
  opacity: 0.9;
}

.sidebar.collapsed .nav a span.label{ display:none; }

.sidebar-foot{
  margin-top:auto;
  padding: 10px 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.main{
  flex:1;
  display:flex;
  flex-direction:column;
  height:100%;
}

.header{
  height: var(--header-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px);
}

body.theme-dark .header{
  background: rgba(11,20,42,0.75);
}

.header .left{
  display:flex;
  align-items:center;
  gap: 12px;
}

.header .crumb{
  color: var(--muted);
  font-size: 13px;
}

.header .right{
  display:flex;
  align-items:center;
  gap: 10px;
}

.pill{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(202,162,74,0.10);
  color: var(--text);
  font-size: 13px;
}

.pill strong{ color: var(--gold); }

.toggle{
  display:flex;
  align-items:center;
  gap: 8px;
}
.toggle button{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor:pointer;
}
.toggle button.active{
  border-color: rgba(202,162,74,0.5);
  background: rgba(202,162,74,0.14);
}

.lang-toggle{
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.lang-toggle button{
  border: 0;
  background: transparent;
  padding: 6px 8px;
}
.lang-toggle button.active{
  border: 0;
  background: rgba(202,162,74,0.18);
}
.lang-toggle .slash{
  color: var(--muted);
  font-weight: 900;
}

.content{
  flex:1;
  overflow:auto;
  padding: 18px;
  scrollbar-gutter: stable;
}

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 18px;
}
.clickable-card{
  cursor:pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}
.clickable-card:hover{
  transform: translateY(-2px);
  border-color: rgba(202,162,74,0.35);
}

h1,h2,h3,h4{ margin: 0 0 10px 0; }
p{ margin: 0 0 10px 0; color: var(--muted); line-height:1.6; }
ul,ol{ margin: 8px 0 10px 18px; color: var(--muted); line-height:1.6; }
li{ margin: 3px 0; }

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

@media (max-width: 1000px){
  .sidebar{ display:none; }
  .header{ position: sticky; top:0; z-index:10; }
}
@media (max-width: 720px){
  .header{
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    gap: 8px;
  }
  .header .right{
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Buttons */
.btn{
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  cursor:pointer;
}
.btn:hover{ background: var(--surface-2); }
.btn.primary{
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: rgba(202,162,74,0.55);
  color: #0a1326;
  font-weight: 800;
}
.btn.danger{
  background: rgba(220,38,38,0.12);
  border-color: rgba(220,38,38,0.35);
}
.btn.ghost{
  background: transparent;
}
.btn.small{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
}

.input, select, textarea{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline:none;
}
textarea{ min-height: 140px; resize: vertical; }

/* Dashboard */
.stat-row{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat{
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(202,162,74,0.08), transparent);
}
.stat .k{
  font-size: 12px;
  color: var(--muted);
}
.stat .v{
  font-size: 22px;
  font-weight: 900;
  margin-top: 6px;
}
.progress{
  height: 12px;
  border-radius: 999px;
  background: rgba(100,116,139,0.20);
  overflow:hidden;
}
.progress > div{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  width: 0%;
}

/* Course */
.course-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.course-top .title{
  display:flex;
  flex-direction:column;
  gap: 4px;
  align-items: flex-start;
}
.chapter-tabs{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin: 10px 0 14px 0;
}
.tab{
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor:pointer;
}
.tab.active{
  border-color: rgba(202,162,74,0.55);
  background: rgba(202,162,74,0.14);
}
.tab.done{
  border-color: rgba(22,163,74,0.5);
  background: rgba(22,163,74,0.10);
}
.slide-card{
  position: relative;
  padding: 18px;
}
.slide-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}
.slide-title h2{
  margin:0;
  font-size: 20px;
}
.slide-body{
  color: var(--muted);
}
.slide-body .callout{
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(202,162,74,0.25);
  background: rgba(202,162,74,0.08);
  margin: 10px 0;
  color: var(--text);
}
.slide-body .hint{
  font-size: 13px;
  color: var(--muted);
  opacity: 0.95;
}
.slide-nav{
  position:absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.slide-nav .navbtn{
  display:flex;
  gap: 10px;
}
.slide-footer{
  position:absolute;
  left: 18px;
  right: 18px;
  bottom: 46px;
}
.toast{
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 50;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.80);
  color: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  max-width: 420px;
}

/* Product library */
.filters{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin: 12px 0 16px 0;
}
.filters-row{
  display:flex;
  align-items:flex-end;
  gap: 12px;
  flex-wrap:wrap;
  margin-top: 12px;
}
.filters-row .field{
  flex: 1 1 260px;
}
.chip{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor:pointer;
  white-space:nowrap;
}
.chip.active{
  border-color: rgba(202,162,74,0.55);
  background: rgba(202,162,74,0.14);
}
.product-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.product-grid.five-col{
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.product-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow:hidden;
  cursor:pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}
.product-card:hover{
  transform: translateY(-2px);
  border-color: rgba(202,162,74,0.35);
}
.product-thumb{
  aspect-ratio: 1/1;
  background: linear-gradient(180deg, rgba(202,162,74,0.10), transparent);
  display:grid;
  place-items:center;
}
.product-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-info{
  padding: 10px 10px 12px 10px;
}
.product-info .collection{
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--gold);
  font-weight: 800;
  text-transform: uppercase;
}
.product-info .name{
  font-weight: 800;
  margin-top: 6px;
}
.product-info .meta{
  margin-top: 8px;
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  font-size: 12px;
  color: var(--muted);
}
.launch-tag{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
}
.price{
  margin-top: 10px;
  font-weight: 900;
}

/* Quick view modal */
.modal-overlay{
  position: fixed;
  inset:0;
  background: rgba(3,6,14,0.55);
  backdrop-filter: blur(10px);
  z-index: 80;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px;
}
.modal{
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow:auto;
  overflow-x: hidden;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 30px 90px rgba(0,0,0,0.35);
  position:relative;
  scrollbar-gutter: stable;
}
.modal .close{
  position:absolute;
  top: 14px;
  right: 14px;
}
.modal-inner{
  display:grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  padding: 18px;
  min-width: 0;
}
@media (max-width: 980px){
  .modal-inner{ grid-template-columns: 1fr; }
}
/* Chapter-modal override: single column, long-form reading surface */
.modal-inner:has(.chapter-md),
.modal-inner:has(#chapterLoading){ grid-template-columns: 1fr; }
.chapter-md{
  line-height: 1.58;
  font-size: 14.5px;
  color: var(--ink);
  padding: 4px 8px 24px;
  overflow-wrap: anywhere;
}
.chapter-md h1{ font-size: 22px; margin: 18px 0 10px; }
.chapter-md h2{ font-size: 18px; margin: 28px 0 10px; padding-top: 14px;
                border-top: 1px solid var(--border); }
.chapter-md h3{ font-size: 16px; margin: 20px 0 8px; }
.chapter-md h4{ font-size: 14px; margin: 16px 0 6px; text-transform: uppercase;
                letter-spacing: 0.03em; color: var(--muted); }
.chapter-md table{ width: 100%; border-collapse: collapse; margin: 10px 0;
                    font-size: 13px; }
.chapter-md th, .chapter-md td{ border: 1px solid var(--border);
                                  padding: 6px 9px; text-align: left;
                                  vertical-align: top; }
.chapter-md th{ background: var(--surface-2); font-weight: 600; }
.chapter-md img{ max-width: 260px; border-radius: 10px; margin: 8px 0;
                 display: block; }
.chapter-md code{ font-family: "SF Mono", Menlo, monospace; font-size: 12px;
                   background: var(--surface-2); padding: 1px 5px;
                   border-radius: 4px; }
.chapter-md ul{ padding-left: 22px; margin: 8px 0; }
.chapter-md li{ margin: 4px 0; }
.chapter-md blockquote{ border-left: 3px solid var(--accent);
                         margin: 8px 0; padding: 4px 10px;
                         background: var(--surface-2); color: var(--muted); }
.chapter-md p{ margin: 8px 0; }
.chapter-md strong{ color: var(--ink); }
.modal-gallery{
  background: var(--surface-2);
  border-radius: 18px;
  padding: 14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  min-width: 0;
}
.big-img{
  aspect-ratio: 1/1;
  border-radius: 16px;
  background: rgba(0,0,0,0.06);
  display:grid;
  place-items:center;
  overflow:hidden;
  width: 100%;
  max-width: 360px;
  max-height: 360px;
}
.big-img img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.thumbs{
  display:flex;
  gap: 10px;
  margin-top: 10px;
  overflow:auto;
  width: 100%;
  padding-bottom: 4px;
}
.thumbs.expanded{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow: auto;
}
.thumb{
  width: 60px;
  height: 60px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow:hidden;
  cursor:pointer;
  flex:0 0 auto;
}
.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb.active{
  border-color: rgba(202,162,74,0.65);
}
.modal-details h2{
  margin:0;
  font-size: 28px;
}
.modal-details{
  min-width: 0;
}
.tag-row{
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  margin: 12px 0 10px 0;
}
.badge{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(202,162,74,0.10);
  font-size: 12px;
}
.badge.subtle{
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}
.badge.danger{
  background: rgba(220,38,38,0.12);
  border-color: rgba(220,38,38,0.45);
  color: var(--danger);
  font-weight: 900;
}

.sku-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sku-pill.wrap{
  white-space: normal;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  word-break: break-all;
}
.product-card .sku-pill{
  white-space: normal;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  word-break: break-all;
}
.sku-pill.big{
  padding: 6px 12px;
  font-size: 13px;
  background: var(--surface);
  max-width: 260px;
}
.sku-primary{
  margin-top: 8px;
}
.sku-pill.big.wrap{
  display: inline-block;
  max-width: 100%;
}

.product-badges{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}

.modal-title-row{
  display:flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

ul.benefits{
  margin: 8px 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.spec-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 8px;
}
.collection-info-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 12px;
}
.collection-info-grid .card{
  box-shadow:none;
  background: var(--surface-2);
}
.collection-overview{
  margin-top: 16px;
}
.spec{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 10px 12px;
}
.spec .k{
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 900;
}
.spec .v{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.spec-details{
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  background: var(--surface);
}
.spec-details summary{
  cursor:pointer;
  font-weight: 900;
}

.quiz-controls{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.quiz-btns{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.quiz-counter{
  color: var(--muted);
  font-weight: 800;
}
.answer.selected{
  border-color: rgba(202,162,74,0.55);
  box-shadow: 0 0 0 3px rgba(202,162,74,0.16);
}

.slide-controls{
  position: sticky;
  top: 0;
  z-index: 8;
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 10px 0 12px;
}
.slide-controls-mid{ flex: 1; min-width: 160px; }

.editor-toolbar{
  display:flex;
  gap: 6px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}
.editor-btn{
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor:pointer;
}
.editor-btn:hover{ background: var(--surface-2); }
.editor-area{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  min-height: 160px;
  background: var(--surface);
  color: var(--text);
}
.editor-area[dir="rtl"]{
  text-align: right;
}
.editor-area:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(202,162,74,0.18);
}
.editor-area:empty:before{
  content: attr(data-placeholder);
  color: var(--muted);
}

.slide-image-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.slide-image-grid figure{
  margin:0;
}
.slide-image-grid img{
  width:100%;
  height:auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.slide-image-grid figcaption{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Watch terminology walkthrough */
.watch-terms{
  display:grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items:center;
}
.watch-diagram{
  position: relative;
  width: 180px;
  height: 260px;
  margin: 0 auto;
}
.watch-strap{
  position:absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 76px;
  height: 70px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}
.watch-strap.strap-top{ top: 0; }
.watch-strap.strap-bottom{ bottom: 0; }
.watch-face{
  position:absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 3px solid rgba(202,162,74,0.6);
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--surface-2));
  box-shadow: 0 16px 28px rgba(15,23,42,0.12);
}
.watch-hand{
  position:absolute;
  left: 50%;
  top: 50%;
  transform-origin: bottom center;
  background: var(--navy);
  border-radius: 999px;
}
.watch-hand.hour{
  width: 4px;
  height: 30px;
  transform: translate(-50%, -100%) rotate(20deg);
}
.watch-hand.minute{
  width: 3px;
  height: 42px;
  transform: translate(-50%, -100%) rotate(110deg);
}
.watch-center{
  position:absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(202,162,74,0.18);
}
.watch-crown{
  position:absolute;
  top: 122px;
  right: 18px;
  width: 16px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.watch-label{
  position:absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.terms-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}
.term-card{
  position: relative;
  text-align:left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 12px 12px 44px;
  display:flex;
  flex-direction:column;
  gap: 6px;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.term-card:hover{
  transform: translateY(-2px);
  border-color: rgba(202,162,74,0.35);
}
.term-card.opened{
  border-color: rgba(22,163,74,0.45);
}
.term-arrow{
  position:absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 2px;
  background: var(--gold);
  transform: translateY(-50%);
}
.term-arrow::after{
  content:"";
  position:absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 7px solid var(--gold);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.term-text{
  font-weight: 800;
}
.term-status{
  font-size: 12px;
  color: var(--muted);
}
.term-pop{
  display:none;
  position:absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(340px, 80vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 16px 30px rgba(15,23,42,0.12);
  z-index: 5;
}
.term-pop-title{
  font-weight: 800;
  margin-bottom: 4px;
}
.term-pop-body{
  color: var(--muted);
  font-size: 13px;
}
.term-card.expanded .term-pop{
  display:block;
}
.terms-footer{
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--surface-2);
}
.terms-hint{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.terms-progress{
  font-weight: 800;
}
.btn.locked{
  opacity: 0.6;
  cursor: not-allowed;
}
body.rtl .watch-terms{
  direction: rtl;
}
body.rtl .term-card{
  text-align: right;
  padding: 12px 44px 12px 12px;
}
body.rtl .term-arrow{
  left: auto;
  right: 14px;
}
body.rtl .term-arrow::after{
  right: auto;
  left: -2px;
  border-left: none;
  border-right: 7px solid var(--gold);
}
body.rtl .term-pop{
  left: auto;
  right: 0;
}
@media(max-width: 880px){
  .watch-terms{
    grid-template-columns: 1fr;
  }
  .watch-diagram{
    height: 220px;
  }
  .terms-grid{
    grid-template-columns: 1fr;
  }
  .term-pop{
    position: static;
    width: 100%;
    margin-top: 8px;
  }
}

/* Sidebar toggle button sits between sidebar and content */
#collapseBtn{
  position:absolute;
  right: -14px;
  top: 16px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  z-index: 50;
}

@media(max-width: 780px){
  .spec-grid{ grid-template-columns: 1fr; }
  .collection-info-grid{ grid-template-columns: 1fr; }
}
.section-title{
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 900;
}
.table{
  width:100%;
  border-collapse: collapse;
  margin-top: 8px;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  table-layout: fixed;
}
.table th, .table td{
  padding: 10px 12px;
  font-size: 13px;
  text-align:left;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}
.table th:nth-child(1),
.table td:nth-child(1){ width: 12%; }
.table th:nth-child(2),
.table td:nth-child(2){ width: 28%; }
.table th:nth-child(3),
.table td:nth-child(3){ width: 30%; }
.table th:nth-child(4),
.table td:nth-child(4){ width: 18%; }
.table th:nth-child(5),
.table td:nth-child(5){ width: 12%; }

.variant-thumb{
  width: 54px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.variant-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.table th{
  color: var(--muted);
  font-weight: 900;
}
.table tr:last-child td{ border-bottom:none; }
.spec-chips{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 10px;
}
.spec-chip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-width: 180px;
}
.spec-chip .k{ color: var(--muted); font-size: 12px; }
.spec-chip .v{ font-weight: 800; }

.modal-actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  margin-top: 14px;
}

/* Calendar */
.calendar-top{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
}
.calendar-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-day{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  min-height: 110px;
  padding: 10px;
}
.cal-day .d{
  font-size: 12px;
  color: var(--muted);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.event{
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(202,162,74,0.35);
  background: rgba(202,162,74,0.12);
  font-size: 12px;
  cursor: grab;
}
.event.branch{
  border-color: rgba(22,163,74,0.35);
  background: rgba(22,163,74,0.12);
}

/* Quiz */
.quiz-wrap{
  max-width: 920px;
  margin: 0 auto;
}
.quiz-q{
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 12px;
}
.answer{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor:pointer;
  background: var(--surface);
}
.answer:hover{ background: var(--surface-2); }
.answer.correct{ border-color: rgba(22,163,74,0.5); background: rgba(22,163,74,0.12); }
.answer.wrong{ border-color: rgba(220,38,38,0.5); background: rgba(220,38,38,0.10); }
.expl{
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(202,162,74,0.28);
  background: rgba(202,162,74,0.10);
}

/* Video embeds */
.video-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.video-embed{
  position: relative;
  padding-top: 56.25%;
  border-radius: 16px;
  overflow:hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.video-embed iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

/* RTL */
body.rtl{ direction: rtl; }
body.rtl .app{ flex-direction: row-reverse; }
body.rtl .header, body.rtl .sidebar{ direction: rtl; }
body.rtl .header{ flex-direction: row-reverse; }
body.rtl .header .left,
body.rtl .header .right{ flex-direction: row-reverse; }
body.rtl .brand,
body.rtl .nav a,
body.rtl .side-actions{ flex-direction: row-reverse; }
body.rtl .nav a{ justify-content: flex-end; }
body.rtl .sidebar{ border-right: 0; border-left: 1px solid var(--border); }
body.rtl .table th, body.rtl .table td{ text-align: right; }
body.rtl .slide-body, body.rtl .course-top .title{ text-align: right; }
body.rtl .course-top{ flex-direction: row-reverse; }
body.rtl .course-top .title{ align-items: flex-end; }
body.rtl .chapter-tabs{ justify-content: flex-end; }
body.rtl .slide-controls{ flex-direction: row-reverse; }
body.rtl .slide-title{ flex-direction: row-reverse; }
body.rtl .modal-actions{ flex-direction: row-reverse; }
body.rtl .tag-row{ flex-direction: row-reverse; }
body.rtl .product-info,
body.rtl .modal-details,
body.rtl .quiz-wrap,
body.rtl .collection-overview,
body.rtl .filters-row,
body.rtl .filters,
body.rtl .stat,
body.rtl .card,
body.rtl .calendar-top{ text-align: right; }
body.rtl .toggle{ flex-direction: row-reverse; }
body.rtl .toggle .slash{ margin: 0 6px; }


/* Slide images (for admin WYSIWYG blocks) */
.slide-body::after{ content:""; display:block; clear:both; }
.slide-body figure{
  margin: 12px 0;
  padding: 0;
}
.slide-body figure img{
  width:100%;
  height:auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.slide-body figure.left{ float:left; width: 46%; margin-right: 14px; }
.slide-body figure.right{ float:right; width: 46%; margin-left: 14px; }
.slide-body figure.full{ width: 100%; }
.slide-body figcaption{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
body.rtl .slide-body figure.left{ float:right; margin-left: 14px; margin-right: 0; }
body.rtl .slide-body figure.right{ float:left; margin-right: 14px; margin-left: 0; }

/* Product hover hint */
.product-thumb{ position: relative; }
.product-thumb .quick{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  opacity: 0;
  transition: opacity 120ms ease;
  background: linear-gradient(180deg, rgba(10,19,38,0.05), rgba(10,19,38,0.22));
}
body.theme-dark .product-thumb .quick{
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.35));
}
.product-card:hover .product-thumb .quick{ opacity: 1; }
.product-thumb .quick span{
  background: rgba(202,162,74,0.9);
  color: #0a1326;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

/* Print styles for collection PDF export */
@media print{
  body{ overflow: visible !important; }
  .sidebar, .header, #modalRoot, .no-print{ display:none !important; }
  .content{ padding: 0 !important; }
  .card{ box-shadow: none !important; }
}

body.theme-dark img[src$="logo.svg"]{ filter: invert(1); }
