/* ================================================================
   POS Cashier by DigitalBnB — Manual Book Stylesheet
   Design: Dark-dramatic cover, gradient accent, glassmorphism
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --cyan:    #06B6D4;
  --blue:    #2563EB;
  --purple:  #7C3AED;
  --purple2: #764ba2;
  --gradient: linear-gradient(135deg, #06B6D4, #2563EB, #7C3AED);
  --gradient-soft: linear-gradient(135deg, #e0f7ff, #ede9fe);
  --cover-bg: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #1a0533 100%);

  --bg:       #ffffff;
  --bg-soft:  #f8f9fb;
  --bg-card:  #ffffff;
  --text:     #111827;
  --text-soft:#6b7280;
  --border:   #e5e7eb;
  --sidebar-w: 288px;
  --radius:   14px;
  --shadow:   0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:0 8px 40px rgba(0,0,0,0.12);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── GLOBAL SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #06B6D4, #7C3AED);
  border-radius: 99px;
  border: 2px solid var(--bg-soft);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2563EB, #7C3AED);
}

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: #7C3AED var(--bg-soft); }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}

/* ── READING PROGRESS BAR ──────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #faf7ff, #f0f9ff);
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
  text-decoration: none;
}

.brand-logo-img {
  width: 100px;
  height: auto;
  display: block;
}

.logo-mark {
  width: 40px; height: 40px;
  flex-shrink: 0;
}

.logo-wordmark {
  font-size: 15px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.sidebar-tagline {
  font-size: 11px;
  color: var(--text-soft);
  padding-left: 50px;
  margin-top: -2px;
}

.sidebar-nav { padding: 10px 0 20px; flex: 1; }

.nav-section {
  padding: 14px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-soft);
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  font-weight: 500;
  gap: 6px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--purple);
  background: linear-gradient(90deg, rgba(124,58,237,0.06), transparent);
  border-left-color: var(--purple);
}

.nav-item.active { font-weight: 700; }

.nav-sub {
  display: block;
  padding: 5px 20px 5px 38px;
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  transition: all 0.15s;
}

.nav-sub:hover { color: var(--purple); }

.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}
.badge-admin { background: #fef3c7; color: #92400e; }
.badge-kasir { background: #d1fae5; color: #065f46; }

/* ── HAMBURGER (mobile) ──────────────────────────────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 300;
  width: 40px; height: 40px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow);
}

.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--purple);
  border-radius: 2px;
  transition: all 0.3s;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 190;
  backdrop-filter: blur(2px);
}

/* ── MAIN CONTENT ──────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ── COVER ──────────────────────────────────────────────── */
.cover {
  background: var(--cover-bg);
  color: white;
  padding: 80px 64px 72px;
  position: relative;
  overflow: hidden;
}

.cover::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.25) 0%, transparent 70%);
  pointer-events: none;
}

.cover::after {
  content: '';
  position: absolute;
  bottom: -30%; left: 5%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.cover-inner { position: relative; z-index: 1; }

.cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
}

.cover-logo {
  margin-bottom: 28px;
}

.cover-logo-img {
  height: 96px;
  width: auto;
  border-radius: 16px;
  padding: 10px 18px;
  background: #fff;
}

.cover h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.cover h1 span {
  display: block;
  background: linear-gradient(135deg, #06B6D4, #60a5fa, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cover-desc {
  font-size: 17px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 40px;
  max-width: 520px;
  line-height: 1.7;
}

.cover-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.cover-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.cover-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-width: 820px;
}

.cover-feature {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.cover-feature .feat-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ── CONTENT AREA ──────────────────────────────────────────── */
.content {
  padding: 56px 64px;
  max-width: 940px;
}

/* ── CHAPTER HEADER ──────────────────────────────────────── */
.chapter-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.chapter-number {
  width: 52px; height: 52px;
  background: var(--gradient);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}

.chapter-header h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.chapter-sub {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 3px;
}

/* ── SECTION ──────────────────────────────────────────────── */
.section { margin-bottom: 52px; }

.section h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h3::before {
  content: '';
  display: block;
  width: 5px; height: 22px;
  background: var(--gradient);
  border-radius: 3px;
  flex-shrink: 0;
}

.section h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}

.section p {
  color: #374151;
  margin-bottom: 14px;
  font-size: 14.5px;
}

/* ── STEPS ──────────────────────────────────────────────── */
.steps { list-style: none; margin: 20px 0; display: flex; flex-direction: column; gap: 14px; }

.steps li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  transition: box-shadow 0.15s;
}

.steps li:hover { box-shadow: var(--shadow); }

.step-num {
  width: 30px; height: 30px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}

.step-content { flex: 1; }
.step-content strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.step-content span { font-size: 13px; color: var(--text-soft); line-height: 1.6; }

/* ── SCREENSHOT BOX ──────────────────────────────────────── */
.screenshot-box {
  border: 2px dashed rgba(124,58,237,0.35);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124,58,237,0.03), rgba(37,99,235,0.03));
  margin: 24px 0;
  overflow: hidden;
  transition: border-color 0.2s;
}

.screenshot-box:hover { border-color: rgba(124,58,237,0.6); }

.screenshot-label {
  background: var(--gradient);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.screenshot-placeholder {
  height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.screenshot-placeholder .icon { font-size: 36px; opacity: 0.5; }

.screenshot-placeholder .desc {
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
  max-width: 340px;
  line-height: 1.6;
}

.screenshot-placeholder .hint {
  font-size: 11px;
  background: rgba(124,58,237,0.1);
  color: var(--purple);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.screenshot-placeholder .hint code {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background: rgba(124,58,237,0.15);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── SCREENSHOT with actual image ────────────────────────── */
.screenshot-box.has-image { border-style: solid; border-color: rgba(124,58,237,0.2); }

.screenshot-img {
  background: #f0f0f0;
  padding: 12px;
  line-height: 0;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot-img img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}

/* ── INFO BOXES ──────────────────────────────────────────── */
.info-box {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 18px 0;
  font-size: 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-width: 1px;
  border-style: solid;
}

.info-box .info-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.info-box .info-text strong { display: block; margin-bottom: 4px; font-size: 13.5px; font-weight: 700; }
.info-box .info-text span  { font-size: 13px; color: var(--text-soft); line-height: 1.65; }

.info-box.tip     { background: #f0fdf4; border-color: #86efac; }
.info-box.tip     .info-icon { color: #16a34a; }
.info-box.tip     strong { color: #15803d; }

.info-box.warning { background: #fff7ed; border-color: #fdba74; }
.info-box.warning .info-icon { color: #ea580c; }
.info-box.warning strong { color: #c2410c; }

.info-box.info    { background: #eff6ff; border-color: #93c5fd; }
.info-box.info    .info-icon { color: #2563eb; }
.info-box.info    strong { color: #1d4ed8; }

.info-box.admin   { background: #fefce8; border-color: #fde047; }
.info-box.admin   .info-icon { color: #d97706; }
.info-box.admin   strong { color: #b45309; }

/* ── ROLE BANNER ──────────────────────────────────────────── */
.role-banner {
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 36px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-width: 1px;
  border-style: solid;
}

.role-banner.kasir { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.role-banner.admin { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.role-banner.both  {
  background: linear-gradient(135deg, rgba(124,58,237,0.07), rgba(37,99,235,0.05));
  color: var(--purple);
  border-color: rgba(124,58,237,0.25);
}

/* ── TABLE ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin: 18px 0; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

th {
  background: var(--gradient);
  color: white;
  padding: 11px 16px;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #fafafa; }

/* ── TOC ──────────────────────────────────────────────── */
.toc {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.toc-header {
  background: var(--gradient);
  color: white;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 15px;
}

.toc-body { padding: 6px 0; }

.toc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 22px;
  font-size: 13.5px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.toc-item:hover {
  background: linear-gradient(90deg, rgba(124,58,237,0.06), transparent);
  border-left-color: var(--purple);
  color: var(--purple);
}

.toc-item .toc-num { color: var(--text-soft); font-size: 12px; font-weight: 400; }

.toc-sub {
  display: flex;
  padding: 5px 22px 5px 38px;
  font-size: 12.5px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.15s;
}

.toc-sub:hover { color: var(--purple); }

/* ── TAGS / KBD / HIGHLIGHT ──────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.tag-admin { background: #fef3c7; color: #92400e; }
.tag-kasir { background: #d1fae5; color: #065f46; }

kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

.highlight {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

/* ── DIVIDER ──────────────────────────────────────────────── */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
  margin: 56px 0;
}

/* ── PAGE BREAK ──────────────────────────────────────────── */
.page-break { page-break-before: always; margin-top: 64px; }

/* ── BACK TO TOP ──────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px; height: 44px;
  background: var(--gradient);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 100;
}

#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { box-shadow: 0 6px 24px rgba(124,58,237,0.5); transform: translateY(-2px); }

/* ── FOOTER ──────────────────────────────────────────────── */
.page-footer {
  text-align: center;
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.page-footer .footer-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.footer-logo-img {
  height: 52px;
  width: auto;
  border-radius: 10px;
  padding: 6px 12px;
  background: #fff;
}

.page-footer p {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.page-footer a { color: var(--purple); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* ── PRINT ──────────────────────────────────────────────── */
@media print {
  #progress-bar, .hamburger, .overlay, #back-to-top { display: none !important; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 24px 32px; }
  .cover { padding: 48px 32px; }
  .steps li:hover { box-shadow: none; }
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .overlay.open { display: block; }
  .hamburger { display: flex; }
  .main { margin-left: 0; }

  .content { padding: 32px 24px; }
  .cover { padding: 56px 24px 48px; }
  .cover h1 { font-size: 34px; }
  .cover-features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .cover h1 { font-size: 28px; }
  .cover-features { grid-template-columns: 1fr; }
  .cover-meta { flex-direction: column; }
  .content { padding: 24px 16px; }
}
