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

:root {
  --dk-purple: #6c2bd9;
  --dk-purple-dark: #4d1ea8;
  --dk-purple-soft: #f3efff;
  --dk-ink: #17131f;
  --dk-muted: #716b7d;
  --dk-border: #e9e4ef;
  --dk-surface: #ffffff;
  --dk-background: #faf9fc;
  --dk-radius: 16px;
  --dk-shadow: 0 14px 40px rgba(35, 20, 58, .08);
  --dk-heading: 'League Spartan', sans-serif;
  --dk-body: 'Quicksand', sans-serif;
}

html, body { font-family: var(--dk-body); }
body { background: var(--dk-background); color: var(--dk-ink); font-weight: 500; }

h1, h2, h3, h4, h5, h6,
.sidebar-brand-text, .sidebar-tree .reference, .toc-title,
button, .btn, .sd-card-title {
  font-family: var(--dk-heading);
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: .98; font-weight: 800; }
h2 { font-size: 2rem; margin-top: 2.5rem; }
h3 { font-size: 1.35rem; }
p, li { line-height: 1.78; }

.sidebar-drawer { border-right: 1px solid var(--dk-border); }
.sidebar-brand-text { font-size: 1.15rem; font-weight: 800; }
.sidebar-tree .reference { font-size: .96rem; font-weight: 600; }
.sidebar-tree .current-page > .reference { color: var(--dk-purple); font-weight: 800; }

.content { max-width: 72rem; }
.main { max-width: 72rem; }

.content-icon-container, .sd-card, .admonition {
  border-radius: var(--dk-radius) !important;
}

.sd-card {
  border: 1px solid var(--dk-border) !important;
  background: var(--dk-surface);
  box-shadow: 0 4px 20px rgba(35,20,58,.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sd-card:hover { transform: translateY(-3px); box-shadow: var(--dk-shadow); border-color: #d8cdf0 !important; }
.sd-card-title { font-weight: 800; font-size: 1.2rem; }

.dk-hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem;
  margin: 0 0 2.5rem;
  border-radius: 24px;
  background: linear-gradient(135deg, #1c1228 0%, #34205a 55%, #6c2bd9 100%);
  color: white;
  box-shadow: var(--dk-shadow);
}
.dk-hero::after {
  content: '';
  position: absolute; width: 320px; height: 320px; right: -90px; top: -110px;
  border-radius: 50%; background: rgba(255,255,255,.09);
}
.dk-eyebrow { font-family: var(--dk-heading); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; opacity: .75; }
.dk-hero h1 { color: white; max-width: 760px; margin: .55rem 0 1rem; }
.dk-hero p { color: rgba(255,255,255,.84); max-width: 720px; font-size: 1.1rem; }
.dk-search-hint { display: inline-flex; margin-top: 1rem; padding: .7rem 1rem; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.08); font-weight: 700; }

.dk-section-title { margin-top: 2.8rem; margin-bottom: 1rem; }
.dk-muted { color: var(--dk-muted); }
.dk-badge { display:inline-block; padding:.25rem .65rem; border-radius:999px; background:var(--dk-purple-soft); color:var(--dk-purple); font-weight:700; font-size:.8rem; }

.highlight, div[class^="highlight-"] { border-radius: 14px; border: 1px solid var(--dk-border); box-shadow: 0 6px 20px rgba(35,20,58,.04); }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code.literal { border-radius: 6px; padding: .12rem .32rem; }

.table-wrapper { border: 1px solid var(--dk-border); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 20px rgba(35,20,58,.04); }
table { width: 100%; }
th { font-family: var(--dk-heading); font-weight: 700; }

.admonition { border-width: 1px; box-shadow: 0 4px 18px rgba(35,20,58,.04); }
.admonition-title { font-family: var(--dk-heading); font-weight: 800; }

.dk-visual { width: 100%; max-height: 390px; object-fit: cover; border-radius: 18px; border: 1px solid var(--dk-border); box-shadow: 0 8px 28px rgba(35,20,58,.06); margin: 1.5rem 0; }

@media (max-width: 900px) {
  .dk-hero { padding: 2rem; border-radius: 18px; }
  h1 { font-size: 2.6rem; }
}

/* --------------------------------------------------------------------------
   DK footer
   -------------------------------------------------------------------------- */
.dk-footer {
  /* This section is now a direct sibling of .page in the body (see
     _templates/page.html), so it's naturally full-width - no vw/negative
     margin breakout needed, and none of the sidebar/TOC-width math that
     broke that trick can affect it here. */
  margin-top: 0;
  background: #f3f2f4;
  border-top: 1px solid var(--dk-border);
  border-bottom: 1px solid var(--dk-border);
}

.dk-footer-inner {
  width: min(100% - 40px, 1680px);
  margin: 0 auto;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, .7fr);
  gap: 4rem;
  padding: 3.5rem 0 3.25rem;
}

.dk-footer-help {
  min-width: 0;
}

.dk-footer-heading {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .65rem;
}

.dk-footer-heading h2 {
  margin: 0;
  color: var(--dk-purple-dark);
  font-family: var(--dk-heading);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.dk-footer-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  color: var(--dk-purple-dark);
}

.dk-footer-help-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.dk-footer-help p {
  max-width: 680px;
  margin: 0 0 1.2rem;
  color: #665f6d;
  font-size: .96rem;
  line-height: 1.65;
}

.dk-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.dk-footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: .55rem .95rem;
  border: 1px solid #80628f;
  border-radius: 6px;
  background: transparent;
  color: var(--dk-purple-dark) !important;
  font-family: var(--dk-body);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: background .16s ease, color .16s ease, transform .16s ease, border-color .16s ease;
}

.dk-footer-button:hover {
  background: var(--dk-purple-dark);
  border-color: var(--dk-purple-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

.dk-footer-button-secondary {
  border-color: #c7becb;
  color: #554c59 !important;
}

.dk-footer-brand {
  align-self: center;
  text-align: right;
}

.dk-footer-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  height: 3.35rem;
  margin-bottom: .65rem;
  border-radius: 12px;
  background: var(--dk-purple-dark);
  color: #fff;
  font-family: var(--dk-heading);
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(76, 30, 168, .2);
}

.dk-footer-brand-name {
  color: #554c59;
  font-family: var(--dk-heading);
  font-size: 1.05rem;
  font-weight: 800;
}

.dk-footer-brand p {
  max-width: 300px;
  margin: .35rem 0 0 auto;
  color: #766f7b;
  font-size: .84rem;
  line-height: 1.55;
}

.dk-footer-bottom {
  /* Also a direct sibling of .page now - naturally full-width. */
  color: #77717b;
  font-size: .78rem;
}

.dk-footer-bottom-inner {
  width: min(100% - 40px, 1680px);
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1.2rem;
}

.dk-footer-bottom-left,
.dk-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
}

.dk-footer-dot {
  opacity: .6;
}

.dk-footer-links a {
  color: #6b6170 !important;
  text-decoration: none !important;
  font-weight: 600;
}

.dk-footer-links a:hover {
  color: var(--dk-purple) !important;
  text-decoration: underline !important;
}

@media (max-width: 900px) {
  .dk-footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 0;
  }

  .dk-footer-brand {
    text-align: left;
  }

  .dk-footer-brand p {
    margin-left: 0;
  }

  .dk-footer-bottom-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

body[data-theme="dark"] .dk-footer {
  background: #19161e;
  border-color: #302a36;
}

body[data-theme="dark"] .dk-footer-heading h2,
body[data-theme="dark"] .dk-footer-help-icon {
  color: #c4a9ff;
}

body[data-theme="dark"] .dk-footer-help p,
body[data-theme="dark"] .dk-footer-brand p,
body[data-theme="dark"] .dk-footer-bottom {
  color: #aaa1b2;
}

body[data-theme="dark"] .dk-footer-brand-name {
  color: #ded7e3;
}

body[data-theme="dark"] .dk-footer-button {
  border-color: #8b73a1;
  color: #d2bdff !important;
}

body[data-theme="dark"] .dk-footer-button:hover {
  background: #6c2bd9;
  border-color: #6c2bd9;
  color: #fff !important;
}

body[data-theme="dark"] .dk-footer-button-secondary {
  border-color: #4a4150;
  color: #c0b6c7 !important;
}

body[data-theme="dark"] .dk-footer-links a {
  color: #b9afc0 !important;
}

/* --------------------------------------------------------------------------
   DK documentation shell: Odoo-inspired top header + wide content canvas
   -------------------------------------------------------------------------- */
:root {
  --dk-header-height: 78px;
  --dk-subbar-height: 40px;
  --dk-shell-height: calc(var(--dk-header-height) + var(--dk-subbar-height));
}

.dk-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--dk-header-height);
  background: rgba(255, 255, 255, .98);
  border-top: 3px solid var(--dk-purple-dark);
  border-bottom: 1px solid #e6e1e8;
  box-shadow: 0 2px 12px rgba(30, 20, 40, .05);
  backdrop-filter: blur(12px);
}

.dk-topbar-inner {
  width: min(100% - 40px, 1680px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(280px, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.dk-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--dk-purple-dark) !important;
  text-decoration: none !important;
}

.dk-topbar-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}

.dk-topbar-brand > span {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--dk-heading);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -.04em;
}

.dk-topbar-brand strong { font-weight: 800; }
.dk-topbar-brand > span span {
  color: #675d70;
  font-weight: 600;
  font-size: 1.1rem;
}

.dk-topbar-search {
  min-width: 0;
}

.dk-search-form {
  position: relative;
  width: 100%;
  margin: 0;
}

.dk-search-input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 52px 0 18px !important;
  border: 1px solid #d9d3dc !important;
  border-radius: 24px !important;
  background: #fff !important;
  color: var(--dk-ink) !important;
  font-family: var(--dk-body) !important;
  font-size: 1rem !important;
  box-shadow: none !important;
}

.dk-search-input::placeholder { color: #827a87; }
.dk-search-input:focus {
  border-color: var(--dk-purple) !important;
  box-shadow: 0 0 0 3px rgba(108, 43, 217, .10) !important;
  outline: none !important;
}

.dk-search-form::after {
  content: '⌕';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-53%);
  color: #716879;
  font-size: 1.55rem;
  pointer-events: none;
}

.dk-topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.dk-header-theme {
  width: 38px;
  height: 38px;
  border: 1px solid #ddd7e0;
  border-radius: 50%;
  background: #fff;
  color: var(--dk-purple-dark);
  cursor: pointer;
  font-size: 1.05rem;
}

.dk-header-theme:hover {
  border-color: var(--dk-purple);
  background: var(--dk-purple-soft);
}

.dk-header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 5px;
  background: var(--dk-purple-dark);
  color: #fff !important;
  font-family: var(--dk-heading);
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}

.dk-header-button:hover {
  background: var(--dk-purple);
  color: #fff !important;
}

.dk-subbar {
  height: var(--dk-subbar-height);
  background: #f1f0f2;
  border-bottom: 1px solid #ddd9df;
}

.dk-subbar-inner {
  width: min(100% - 40px, 1680px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dk-subbar-title {
  color: #665e6c;
  font-size: .82rem;
  font-weight: 700;
}

.dk-subbar nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.dk-subbar nav a {
  color: #514957 !important;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none !important;
}

.dk-subbar nav a:hover {
  color: var(--dk-purple) !important;
}

/* Furo is intentionally compact by default. For this documentation site,
   let the article use the entire available canvas like the reference design. */
.main,
.content,
.article-container,
article[role="main"] {
  width: 100% !important;
  max-width: none !important;
}

.main {
  min-width: 0;
}

.content {
  min-width: 0;
}

.article-container {
  box-sizing: border-box;
}

article[role="main"] {
  box-sizing: border-box;
}

/* Keep a comfortable reading measure for prose while allowing wide layouts,
   tables, cards and dashboards to actually use the page width. */
article[role="main"] > p,
article[role="main"] > ul,
article[role="main"] > ol,
article[role="main"] > blockquote,
article[role="main"] > .admonition {
  max-width: 100%;
}

/* The sidebar and right-hand page TOC start underneath the two-level header. */
@media (min-width: 800px) {
  .sidebar-drawer,
  .toc-drawer {
    top: var(--dk-shell-height) !important;
    height: calc(100vh - var(--dk-shell-height)) !important;
  }

  .sidebar-sticky,
  .toc-sticky {
    top: calc(var(--dk-shell-height) + 1rem) !important;
  }

  .sidebar-search-container {
    display: none !important;
  }

  .content-icon-container {
    top: calc(var(--dk-shell-height) + 1rem) !important;
  }

  .dk-topbar + .dk-subbar + .page {
    min-height: calc(100vh - var(--dk-shell-height));
  }
}

body[data-theme="dark"] .dk-topbar {
  background: rgba(25, 22, 30, .98);
  border-color: #3b3342;
}

body[data-theme="dark"] .dk-topbar-brand > span span,
body[data-theme="dark"] .dk-subbar-title {
  color: #aaa0b0;
}

body[data-theme="dark"] .dk-search-input,
body[data-theme="dark"] .dk-header-theme {
  background: #242029 !important;
  border-color: #49404f !important;
  color: #eee8f1 !important;
}

body[data-theme="dark"] .dk-subbar {
  background: #211d25;
  border-color: #39323e;
}

body[data-theme="dark"] .dk-subbar nav a {
  color: #c2b8c8 !important;
}

@media (max-width: 1100px) {
  .dk-topbar-inner {
    grid-template-columns: 190px minmax(220px, 1fr) auto;
    gap: 16px;
  }

  .dk-header-button { padding: 0 13px; }
  .dk-subbar nav { gap: .8rem; }
}

@media (max-width: 800px) {
  :root {
    --dk-header-height: 126px;
    --dk-subbar-height: 38px;
  }

  .dk-topbar { height: var(--dk-header-height); }

  .dk-topbar-inner {
    width: min(100% - 24px, 680px);
    grid-template-columns: 1fr auto;
    grid-template-rows: 52px 52px;
    gap: 4px 10px;
  }

  .dk-topbar-brand { grid-column: 1; grid-row: 1; }
  .dk-topbar-brand img { width: 40px; height: 40px; }
  .dk-topbar-brand > span { font-size: 1.25rem; }

  .dk-topbar-actions { grid-column: 2; grid-row: 1; }
  .dk-header-button { display: none; }

  .dk-topbar-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dk-search-input { height: 42px; }

  .dk-subbar-inner {
    width: min(100% - 24px, 680px);
  }

  .dk-subbar-title { display: none; }
  .dk-subbar nav { width: 100%; justify-content: space-between; gap: .4rem; }
  .dk-subbar nav a { font-size: .75rem; }
}

@media (max-width: 560px) {
  .dk-topbar-inner { width: calc(100% - 18px); }
  .dk-subbar-inner { width: calc(100% - 18px); }
  .dk-subbar nav a:nth-child(3) { display: none; }
}
