/* Paperless Integration Spec — shared styles */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-code: #f4f4f6;
  --border: #e4e6eb;
  --text: #1d2129;
  --text-muted: #6b7280;
  --accent: #0b6cff;
  --accent-soft: #e6efff;
  --success: #0a7d3f;
  --success-soft: #e5f5ec;
  --warn: #a05a00;
  --warn-soft: #fff4e0;
  --danger: #b3261e;
  --danger-soft: #fce8e6;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

aside.sidebar {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text);
}

.sidebar .brand small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.sidebar nav {
  margin-top: 24px;
}

.sidebar .group {
  margin-top: 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 8px 6px;
}

.sidebar a {
  display: block;
  padding: 6px 8px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
}

.sidebar a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

main {
  padding: 48px 56px 96px;
  max-width: 880px;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}

h2:first-of-type { border-top: none; padding-top: 0; }

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
}

h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 18px 0 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p { margin: 8px 0 12px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.subtitle {
  color: var(--text-muted);
  font-size: 16px;
  margin: -4px 0 24px;
}

code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-code);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 12px 0 16px;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

pre.lang-label {
  position: relative;
  padding-top: 32px;
}

pre.lang-label::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 14px;
}

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

th {
  background: var(--bg-alt);
  font-weight: 600;
}

td code, th code { font-size: 12px; }

.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
}

.callout.required { border-color: var(--danger); background: var(--danger-soft); }
.callout.optional { border-color: var(--text-muted); background: var(--bg-alt); }
.callout.tip { border-color: var(--success); background: var(--success-soft); }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.pattern-a { border-color: #6a3dff; background: #f1ecff; }
.callout.pattern-b { border-color: #0a7d3f; background: var(--success-soft); }

.callout-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.callout p:last-child { margin-bottom: 0; }
.callout p:first-child { margin-top: 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  vertical-align: middle;
}

.badge.required { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.optional { background: var(--bg-alt); color: var(--text-muted); }
.badge.pattern-a { background: #f1ecff; color: #5128d8; border-color: transparent; }
.badge.pattern-b { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.method-get    { background: #e5f5ec; color: var(--success); border-color: transparent; }
.badge.method-post   { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.method-delete { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  background: var(--bg);
}

.card h3 { margin-top: 0; }
.card .meta { color: var(--text-muted); font-size: 13px; }

.flow-diagram {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  white-space: pre;
  overflow-x: auto;
}

ul, ol { padding-left: 22px; }
li { margin: 4px 0; }

footer.page-footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  aside.sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  main { padding: 32px 24px 64px; }
}
