:root {
  --et-primary:    #1465a6;
  --et-primary-dark: #0f4c86;
  --et-accent:     #ff4500;
  --et-secondary:  #00b5ad;
  --et-bg:         #f8fafc;
  --et-border:     #bdc3c7;
  --et-text:       #0f172a;
  --et-muted:      #6b7280;
  --sidebar-width: 240px;
  --header-height: 48px;
}

* { box-sizing: border-box; }

/* ── Skip navigation link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--et-primary);
  font-weight: 600;
  border: 2px solid var(--et-primary);
  border-radius: 0 0 4px 0;
  z-index: 9999;
  text-decoration: none;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--et-text);
  background: var(--et-bg);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--et-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--et-primary); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; display: block; }

/* ── Header ── */
.docs-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--et-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.docs-header .logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
}

.docs-header .logo-wrap img {
  height: 32px;
  width: auto;
}

.docs-header .logo-wrap span {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.docs-header .header-right {
  font-size: 0.85rem;
  opacity: .85;
}

.docs-header .header-right a {
  color: #fff;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  margin-right: 0.5rem;
}
.hamburger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Layout shell ── */
.docs-layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ── Sidebar ── */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  background: #fff;
  border-right: 1px solid var(--et-border);
  overflow-y: auto;
  padding: 1.25rem 0;
}

.nav-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--et-muted);
  padding: 0 1rem 0.35rem;
  margin-top: 0.5rem;
}

.docs-sidebar hr {
  border: none;
  border-top: 1px solid var(--et-border);
  margin: 0.75rem 0;
}

.nav-link {
  display: block;
  padding: 0.45rem 1rem 0.45rem 1.1rem;
  color: var(--et-text);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}

.nav-link:hover {
  background: var(--et-bg);
  text-decoration: none;
  color: var(--et-primary);
}

.nav-link:focus-visible {
  outline: 2px solid var(--et-primary);
  outline-offset: -2px;
  border-radius: 2px;
}

.nav-link.active {
  border-left-color: var(--et-primary);
  color: var(--et-primary);
  font-weight: 600;
  background: #eef5fb;
}

/* ── Content ── */
.docs-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: calc(var(--sidebar-width) + 780px);
}

.docs-content h1 {
  font-size: 1.75rem;
  color: var(--et-primary);
  margin: 0 0 0.5rem;
  border-bottom: 2px solid var(--et-border);
  padding-bottom: 0.5rem;
}

.docs-content h2 {
  font-size: 1.2rem;
  color: var(--et-primary-dark);
  margin: 2rem 0 0.5rem;
}

.docs-content h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.35rem;
}

.docs-content p { margin: 0.5rem 0 0.9rem; }

.docs-content ul, .docs-content ol {
  padding-left: 1.5rem;
  margin: 0.4rem 0 0.9rem;
}

.docs-content li { margin-bottom: 0.35rem; }

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.75rem 0 1.25rem;
}

.docs-content th {
  background: var(--et-primary);
  color: #fff;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-weight: 600;
}

.docs-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--et-border);
  vertical-align: top;
}

.docs-content tr:nth-child(even) td { background: #f1f5fb; }

/* ── Callouts ── */
.callout {
  border-left: 4px solid var(--et-secondary);
  background: #f0fafa;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 0.35rem 0.35rem 0;
  font-size: 0.9rem;
}

.callout.warning {
  border-left-color: var(--et-accent);
  background: #fff5f0;
}

.callout p { margin: 0.2rem 0; }

.callout strong { display: block; margin-bottom: 0.25rem; }

/* ── Role badges ── */
.role-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.role-badge.admin    { background: #dbeafe; color: #1e40af; }
.role-badge.manager  { background: #dcfce7; color: #166534; }
.role-badge.finance  { background: #fef9c3; color: #854d0e; }
.role-badge.scanner  { background: #f3e8ff; color: #6b21a8; }
.role-badge.viewer   { background: #f1f5f9; color: #475569; }

/* ── Landing cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.audience-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--et-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  background: #fff;
  text-decoration: none;
  color: var(--et-text);
  transition: box-shadow .15s, border-color .15s;
}

.audience-card:hover {
  box-shadow: 0 4px 16px rgba(20,101,166,.15);
  border-color: var(--et-primary);
  text-decoration: none;
}

.audience-card:focus-visible {
  outline: 2px solid var(--et-primary);
  outline-offset: 2px;
  box-shadow: 0 4px 16px rgba(20,101,166,.15);
}

.audience-card .card-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.audience-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--et-primary);
}

.audience-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--et-muted);
  flex: 1;
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--et-muted);
  margin-bottom: 1.25rem;
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.breadcrumb li + li::before {
  content: "›";
  margin: 0 0.4rem;
  color: var(--et-muted);
}

.breadcrumb a { color: var(--et-muted); }
.breadcrumb a:hover { color: var(--et-primary); }

/* ── Step list ── */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--et-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}

/* ── Mobile ── */
@media (max-width: 767px) {
  .hamburger { display: block; }

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 90;
    width: min(var(--sidebar-width), 80vw);
  }

  .docs-sidebar.open { transform: translateX(0); }

  .docs-content {
    margin-left: 0;
    padding: 1.25rem 1rem;
  }
}
