/* EW Inventory — Help documentation (standalone / WordPress-compatible) */
@import url('../css/site.css');

:root {
  --ew-bg: #f7f9fc;
  --ew-surface: #ffffff;
  --ew-border: #e5e5e0;
  --ew-text: #0f172a;
  --ew-muted: #64748b;
  --ew-primary: #0d9488;
  --ew-primary-dim: rgba(13, 148, 136, 0.1);
  --ew-danger: #dc2626;
  --ew-accent: #00c896;
  --ew-accent-dark: #00a07a;
  --ew-navy: #0f1f3d;
  --ew-nav-width: 280px;
  --ew-site-header-h: 68px;
  --ew-header-h: 52px;
  --ew-radius: 12px;
  --ew-font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Help doc layout: marketing header above topic sidebar */
body.ew-training .site-header {
  z-index: 300;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--ew-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ew-text);
  background: var(--ew-bg);
  overflow-x: clip;
}

a {
  color: var(--ew-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Top bar (mobile doc topics) */
.ew-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ew-header-h);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--ew-surface);
  border-bottom: 1px solid var(--ew-border);
}

.ew-menu-btn {
  appearance: none;
  border: 1px solid var(--ew-border);
  background: var(--ew-bg);
  color: var(--ew-text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ew-layout {
  display: flex;
  align-items: flex-start;
}

/* Sidebar */
.ew-nav {
  position: fixed;
  top: var(--ew-site-header-h);
  left: 0;
  width: var(--ew-nav-width);
  height: calc(100vh - var(--ew-site-header-h));
  overflow-y: auto;
  background: var(--ew-surface);
  border-right: 1px solid var(--ew-border);
  z-index: 150;
  padding: 20px 0 32px;
}

.ew-nav-brand {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--ew-border);
  margin-bottom: 12px;
}

.ew-nav-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ew-text);
  letter-spacing: -0.02em;
}

.ew-nav-group {
  margin: 16px 0 8px;
  padding: 0 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ew-muted);
}

.ew-nav a {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ew-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.ew-nav a:hover {
  color: var(--ew-text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.ew-nav a.is-active {
  color: var(--ew-primary);
  border-left-color: var(--ew-primary);
  background: var(--ew-primary-dim);
}

/* Main — offset for fixed marketing header */
.ew-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--ew-nav-width);
  padding: calc(var(--ew-site-header-h) + 24px) 40px 80px;
  max-width: 900px;
}

/* Desktop: sidebar in document flow so footer spans full viewport width */
@media (min-width: 901px) {
  body.ew-training .ew-layout {
    padding-top: var(--ew-site-header-h);
  }

  body.ew-training .ew-nav {
    position: sticky;
    top: var(--ew-site-header-h);
    left: auto;
    flex: 0 0 var(--ew-nav-width);
    align-self: flex-start;
  }

  body.ew-training .ew-main {
    margin-left: 0;
    padding-top: 24px;
  }

  body.ew-training .site-footer {
    position: relative;
    z-index: 160;
    width: 100%;
    clear: both;
  }
}

.ew-hero {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ew-border);
}

.ew-hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
}

.ew-hero .lead {
  margin: 0;
  font-size: 18px;
  color: var(--ew-muted);
}

.ew-training-link {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: var(--ew-radius);
  border: 1px solid var(--ew-border);
  background: var(--ew-surface);
  font-size: 15px;
  color: var(--ew-muted);
  line-height: 1.5;
}

.ew-training-link a {
  font-weight: 700;
  color: var(--ew-primary);
  text-decoration: none;
}

.ew-training-link a:hover {
  text-decoration: underline;
}

.ew-section {
  margin-bottom: 48px;
  scroll-margin-top: calc(var(--ew-site-header-h) + 16px);
}

.ew-section h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  color: var(--ew-text);
  padding-top: 8px;
}

.ew-section h3 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ew-primary);
}

.ew-section h4 {
  margin: 20px 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.ew-section p,
.ew-section li {
  color: var(--ew-text);
}

.ew-muted {
  color: var(--ew-muted);
  font-size: 14px;
}

.ew-callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--ew-radius);
  border: 1px solid var(--ew-border);
  background: var(--ew-surface);
  font-size: 14px;
}

.ew-callout.tip {
  border-color: var(--ew-primary);
  background: var(--ew-primary-dim);
}

.ew-callout.warn {
  border-color: var(--ew-danger);
  background: rgba(248, 113, 113, 0.1);
}

.ew-steps {
  margin: 12px 0;
  padding-left: 1.25rem;
}

.ew-steps li {
  margin-bottom: 8px;
}

.ew-table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

table.ew-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.ew-table th,
table.ew-table td {
  border: 1px solid var(--ew-border);
  padding: 10px 12px;
  text-align: left;
}

table.ew-table th {
  background: var(--ew-surface);
  font-weight: 700;
}

/* Screenshots */
.ew-shot {
  margin: 20px 0;
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  background: #ffffff;
  overflow: hidden;
}

.ew-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* Phone screenshots — keep readable without dominating the page */
.ew-shot--mobile {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
  .ew-shot--mobile {
    max-width: min(280px, 78vw);
  }
}

/* Centered sign-in card (web / desktop) */
.ew-shot--signin {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

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

.ew-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 140;
}

/* Mobile */
@media (max-width: 900px) {
  .ew-topbar {
    display: flex;
    position: fixed;
    top: var(--ew-site-header-h);
    left: 0;
    right: 0;
    z-index: 250;
  }

  .ew-nav {
    top: calc(var(--ew-site-header-h) + var(--ew-header-h));
    height: calc(100vh - var(--ew-site-header-h) - var(--ew-header-h));
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .ew-nav.is-open {
    transform: translateX(0);
  }

  .ew-overlay.is-visible {
    display: block;
  }

  .ew-main {
    margin-left: 0;
    padding: calc(var(--ew-site-header-h) + var(--ew-header-h) + 20px) 20px 60px;
    max-width: none;
  }

  .ew-section {
    scroll-margin-top: calc(var(--ew-site-header-h) + var(--ew-header-h) + 12px);
  }

  .ew-hero h1 {
    font-size: 26px;
  }

  .ew-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Optional dark theme for pages that match the in-app UI */
.ew-training--dark {
  --ew-bg: #0f172a;
  --ew-surface: #1e293b;
  --ew-border: #334155;
  --ew-text: #f1f5f9;
  --ew-muted: #94a3b8;
  --ew-primary: #14b8a6;
  --ew-primary-dim: rgba(20, 184, 166, 0.15);
  --ew-danger: #f87171;
}

.ew-training--dark .ew-shot {
  background: rgba(15, 23, 42, 0.6);
}
