@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #0b1f2e;
  --muted: #4a5f6e;
  --line: #d7dee4;
  --line-strong: #0b1f2e;
  --accent: #0b1f2e;
  --accent-hover: #16374a;
  --mark: #ff6b35;
  --soft: #f0f3f6;
  --danger: #b42318;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--mark); }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 2px solid var(--line-strong);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: -0.03em;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand span { color: var(--mark); }
.brand:hover { color: var(--mark); text-decoration: none; }
.top-search {
  flex: 1 1 auto;
  max-width: 22rem;
  margin: 0 auto;
}
.top-search input[type="search"] {
  width: 100%;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--ink);
}
.top-search input[type="search"]:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: var(--ink);
}
.top-actions { display: flex; gap: 1rem; align-items: center; font-size: 0.92rem; flex: 0 0 auto; }
.top-actions a { text-decoration: none; font-weight: 500; }
.top-actions a:hover { text-decoration: underline; color: var(--mark); }
.who { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-page-form {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  max-width: 36rem;
}
.search-page-form input[type="search"] {
  flex: 1 1 auto;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.search-page-form input[type="search"]:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: var(--ink);
}
.search-count { margin: 0 0 0.75rem; }
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 46rem;
}
.search-hit {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.search-hit:first-child { border-top: 1px solid var(--line); }
.search-hit-title {
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
}
.search-hit-title:hover { color: var(--mark); text-decoration: underline; }
.search-hit-path {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.search-hit-snippet {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.search-hit-snippet mark {
  background: color-mix(in srgb, var(--mark) 32%, #fff);
  color: inherit;
  padding: 0 0.08em;
}

.flash {
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.flash-ok { background: var(--soft); color: var(--ink); }
.flash-error { background: #fff; color: var(--danger); border-bottom-color: var(--danger); }

.shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 0;
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - 52px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 1.25rem 0.85rem 2rem;
  background: var(--bg);
}
.main { padding: 1.5rem 1.75rem 3rem; }

.nav { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0.1rem 0; }
.nav a {
  display: block;
  padding: 0.28rem 0.45rem;
  border-radius: 0;
  color: var(--ink);
  text-decoration: none;
}
.nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.nav .nav { padding-left: 0.55rem; margin-top: 0.1rem; border-left: 2px solid var(--line); margin-left: 0.4rem; }

.nav-branch > details { margin: 0; }
.nav-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  border-radius: 0;
  user-select: none;
  font-weight: 600;
  padding: 0.28rem 0.25rem;
  color: var(--ink);
}
.nav-summary::-webkit-details-marker { display: none; }
.nav-summary::marker { content: ""; }
.nav-twist {
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 0.12s ease;
}
.nav-twist::before { content: "▸"; font-size: 0.7rem; line-height: 1; }
details[open] > .nav-summary > .nav-twist { transform: rotate(90deg); }
.nav-summary:hover { background: var(--soft); }
.nav-leaf.is-active > a,
.nav-branch.is-active > details > .nav-summary {
  color: var(--ink);
}
.nav-leaf.is-active > a {
  background: var(--soft);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--mark);
}

.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; font-family: var(--mono); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: var(--mark); }
.crumbs .sep { margin: 0 0.35rem; color: var(--line); }
.edit-link { font-size: 0.9rem; margin: 0 0 1rem; }
.doc-updated { margin: -0.35rem 0 1.1rem; color: var(--muted); font-size: 0.85rem; }

.doc-layout.has-toc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13.5rem;
  gap: 1.25rem 2rem;
  align-items: start;
}
.doc-main { min-width: 0; }
.toc {
  position: sticky;
  top: 4.25rem;
  font-size: 0.84rem;
}
.toc-title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 7.5rem);
  overflow: auto;
}
.toc a {
  display: block;
  padding: 0.16rem 0;
  text-decoration: none;
  color: var(--muted);
  line-height: 1.35;
}
.toc a:hover { color: var(--mark); }
.toc-l3 { padding-left: 0.75rem; }
.toc-l4 { padding-left: 1.4rem; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 0.65rem 0.8rem;
  min-width: 0;
}
.pager a:hover { border-color: var(--ink); text-decoration: none; }
.pager-next { text-align: right; align-items: flex-end; }
.pager-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager-title { color: var(--ink); font-weight: 600; }

.prose { line-height: 1.65; max-width: 46rem; }
.doc-layout.has-toc .prose { max-width: none; }
.prose h1, .prose h2, .prose h3, .prose h4 { line-height: 1.25; letter-spacing: -0.02em; color: var(--ink); scroll-margin-top: 4.5rem; }
.prose h1 { font-size: 1.85rem; margin-top: 0; font-weight: 700; }
.prose h2 { margin-top: 1.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); }
.prose h2, .prose h3, .prose h4 { position: relative; }
.prose .heading-anchor {
  position: absolute;
  left: -1.15rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  opacity: 0;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor,
.prose .heading-anchor:focus { opacity: 1; color: var(--mark); }
.prose a { color: var(--ink); text-decoration-color: var(--mark); text-underline-offset: 0.2em; }
.prose a:hover { color: var(--mark); }
.prose .heading-anchor:hover { text-decoration: none; }
.prose code, .code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--soft);
  padding: 0.1em 0.35em;
}
.prose pre {
  position: relative;
  background: var(--ink);
  color: #abb2bf;
  padding: 1rem 1rem 1rem 1rem;
  overflow: auto;
  border-radius: 0;
  border-left: 3px solid var(--mark);
}
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose pre button.code-copy {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  align-self: auto;
  background: var(--ink);
  color: #f7f8fa;
  border: 1px solid rgba(247, 248, 250, 0.35);
  padding: 0.12rem 0.45rem;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
}
.prose pre:hover button.code-copy,
.prose pre button.code-copy:focus,
.prose pre button.code-copy:hover {
  opacity: 1;
  background: #16374a;
  color: #fff;
}
.prose blockquote {
  margin: 1rem 0;
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.prose .callout {
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-left-width: 3px;
  padding: 0.7rem 0.9rem 0.2rem;
}
.prose .callout::before {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.prose .callout > :first-child { margin-top: 0; }
.prose .callout > :last-child { margin-bottom: 0.55rem; }
.prose .callout-note { border-left-color: #1d4e89; }
.prose .callout-note::before { content: "Notă"; color: #1d4e89; }
.prose .callout-tip { border-left-color: #1f7a4d; }
.prose .callout-tip::before { content: "Sfat"; color: #1f7a4d; }
.prose .callout-warning { border-left-color: #8a5a00; }
.prose .callout-warning::before { content: "Atenție"; color: #8a5a00; }
.prose .callout-important { border-left-color: var(--mark); }
.prose .callout-important::before { content: "Important"; color: #c4511a; }
.prose .callout-caution { border-left-color: var(--danger); }
.prose .callout-caution::before { content: "Pericol"; color: var(--danger); }
.prose .footnotes {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.45rem 0.65rem; }
.prose th { background: var(--soft); text-align: left; font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.hljs-comment, .hljs-quote { color: #5c6370; font-style: italic; }
.hljs-doctag, .hljs-keyword, .hljs-formula { color: #c678dd; }
.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { color: #e06c75; }
.hljs-literal { color: #56b6c2; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { color: #98c379; }
.hljs-built_in, .hljs-class .hljs-title { color: #e6c07b; }
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type,
.hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { color: #d19a66; }
.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { color: #61aeee; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.dir-list { padding-left: 1.2rem; }
.lib-switch {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--line);
}
.lib-switch a {
  display: block;
  padding: 0.28rem 0.45rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.lib-switch a:hover { background: var(--soft); text-decoration: none; }
.lib-switch a.is-active {
  background: var(--soft);
  box-shadow: inset 3px 0 0 var(--mark);
}

.auth-box {
  max-width: 360px;
  margin: 2.5rem auto;
  background: var(--panel);
  border: 2px solid var(--line-strong);
  border-radius: 0;
  padding: 1.5rem;
}
.auth-box h1 { margin-top: 0; font-size: 1.35rem; }
.form { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.92rem; font-weight: 500; }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form textarea {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: var(--ink);
}
.form button, button {
  align-self: flex-start;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 0;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.form button:hover, button:hover { background: var(--accent-hover); }
.linkish {
  background: none;
  border: 0;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.linkish:hover { color: var(--mark); }
.linkish.danger { color: var(--danger); }
.inline { display: inline; }

.flat-tree { list-style: none; padding: 0; font-size: 0.9rem; max-height: 420px; overflow: auto; border: 1px solid var(--line); }
.flat-tree li { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.flat-tree li:last-child { border-bottom: 0; }
.flat-tree code { font-family: var(--mono); font-size: 0.82rem; }

.admin-browse { margin: 1rem 0 1.5rem; border: 1px solid var(--line); }
.browse-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--line) 35%, transparent);
}
.browse-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.95rem; }
.browse-crumbs .sep { color: var(--muted, #6b7280); }
.browse-crumbs .current { font-weight: 600; }
.browse-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.9rem; }
.browse-list { list-style: none; padding: 0; margin: 0; max-height: min(60vh, 520px); overflow: auto; }
.browse-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--line);
}
.browse-row:last-child { border-bottom: 0; }
.browse-row.empty { justify-content: center; padding: 1rem; }
.browse-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  color: inherit; text-decoration: none; min-width: 0; flex: 1;
}
.browse-main:hover .browse-title { text-decoration: underline; }
.browse-icon {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  color: var(--muted, #6b7280); border: 1px solid var(--line); padding: 0.1rem 0.3rem;
  min-width: 2.1rem; text-align: center;
}
.browse-row.type-dir .browse-icon { color: var(--ink, #111); }
.browse-title { font-weight: 500; }
.browse-name { font-family: var(--mono); font-size: 0.82rem; color: var(--muted, #6b7280); }
.browse-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; font-size: 0.88rem; }
.rename-pop { position: relative; }
.rename-pop summary { cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
.rename-pop summary:hover { color: var(--mark); }
.browse-actions .create-pop[open] > .rename-form {
  position: absolute;
  z-index: 6;
  top: calc(100% + 0.2rem);
  right: 0;
  margin-top: 0;
  padding: 0.45rem 0.55rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(11, 31, 46, 0.12);
  flex-wrap: nowrap;
}
.browse-actions .create-pop input[type="file"] { max-width: 12rem; font-size: 0.8rem; }
.rename-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  margin-top: 0.35rem;
}
.rename-pop .rename-form { margin-top: 0.35rem; }
.editor > .rename-form { margin: 0 0 0.75rem; }
.rename-form input[type="text"] {
  width: 11rem;
  padding: 0.25rem 0.4rem;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.82rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.rename-form label { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }
textarea.code { width: 100%; font-family: var(--mono); font-size: 0.85rem; line-height: 1.45; }

.md-editor { border: 1px solid var(--line); background: #fff; }
.md-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem;
  padding: 0.35rem 0.45rem; border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.md-toolbar-sep { width: 1px; align-self: stretch; margin: 0.15rem 0.25rem; background: var(--line); }
.md-toolbar-gap { flex: 1; }
.form .md-toolbar button {
  background: transparent; color: var(--ink);
  border: 1px solid transparent; border-radius: 0;
  padding: 0.2rem 0.45rem; font-weight: 600; font-size: 0.78rem;
  font-family: var(--font); line-height: 1.3;
}
.form .md-toolbar button:hover { background: #fff; color: var(--ink); }
.form .md-toolbar button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.form .md-toolbar button code { background: transparent; padding: 0; font-size: 0.78rem; }
.md-panes {
  display: grid; grid-template-columns: 1fr 1fr;
  height: min(70vh, 42rem); min-height: 18rem;
}
.md-editor.is-write .md-panes,
.md-editor.is-preview .md-panes { grid-template-columns: 1fr; }
.md-editor.is-write .md-preview-wrap,
.md-editor.is-preview .md-source { display: none; }
.form textarea.md-source {
  width: 100%; height: 100%; min-height: 0; margin: 0; resize: none;
  border: 0; border-right: 1px solid var(--line); border-radius: 0;
  padding: 0.85rem 1rem; font-family: var(--mono); font-size: 0.85rem; line-height: 1.5;
  outline-offset: -2px;
}
.md-editor.is-write .md-source { border-right: 0; }
.md-preview-wrap { min-height: 0; overflow: auto; background: #fff; }
.md-preview-label {
  position: sticky; top: 0; z-index: 1;
  padding: 0.35rem 1rem; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted);
  background: color-mix(in srgb, var(--soft) 80%, #fff); border-bottom: 1px solid var(--line);
}
.md-preview.prose { max-width: none; padding: 0.85rem 1rem 1.5rem; }
.md-status {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.3rem 0.75rem; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  background: var(--soft);
}
@media (max-width: 800px) {
  .md-editor.is-split .md-panes { grid-template-columns: 1fr; height: auto; }
  .md-editor.is-split .md-source { height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .md-editor.is-split .md-preview-wrap { height: 40vh; }
}
.roles { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.users { width: 100%; border-collapse: collapse; }
.users th { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.users td { padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users td:last-child { white-space: nowrap; }
.users input[type="text"],
.users input[type="email"],
.users input[type="password"] { width: 100%; max-width: 16rem; }
.muted { color: var(--muted, #6b7280); font-size: 0.9rem; }
.order-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); }
.order-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line);
  cursor: grab; user-select: none; background: var(--bg, #fff);
}
.order-item:last-child { border-bottom: 0; }
.order-item.is-dragging { opacity: 0.45; cursor: grabbing; }
.order-item.is-drop-target { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; }
.order-handle {
  font-size: 0.85rem; letter-spacing: -0.15em; color: var(--muted, #6b7280);
  padding: 0 0.15rem; line-height: 1;
}
.order-title { font-weight: 500; }
.order-name { font-family: var(--mono); font-size: 0.82rem; }
.order-editor { margin-bottom: 1.5rem; }
.edit-link .sep { margin: 0 0.35rem; color: var(--muted, #6b7280); }

@media (max-width: 960px) {
  .doc-layout.has-toc { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { max-height: 12rem; }
}
@media (hover: none) {
  .prose .heading-anchor,
  .prose pre button.code-copy { opacity: 1; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .top { flex-wrap: wrap; }
  .top-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
}
