/* Al-Mizan ERP palette — same turquoise as the app's light theme
   (sidebar brand strip / page headers: #17a2b8 → #0e8a9e → #0a6474, almizanerp/wwwroot/css/nav-modern.css). */
:root,
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #0e8a9e;
  --md-primary-fg-color--light: #17a2b8;
  --md-primary-fg-color--dark: #0a6474;
  --md-accent-fg-color: #a86a12;
  --mz-step-bg: #dcf1f5;
  --mz-head-grad: linear-gradient(135deg, #17a2b8 0%, #0e8a9e 55%, #0a6474 100%);
}
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #17a2b8;
  --md-primary-fg-color--light: #5fd3e3;
  --md-primary-fg-color--dark: #0e8a9e;
  --md-accent-fg-color: #e0a64a;
  --md-default-bg-color: #0c1417;
  --mz-step-bg: #10323a;
  --mz-head-grad: linear-gradient(135deg, #17a2b8 0%, #0e8a9e 55%, #0a6474 100%);
}
/* header + tabs use the same gradient as the ERP header */
.md-header, .md-tabs { background-image: var(--mz-head-grad); }
.md-typeset a { color: var(--md-primary-fg-color); }
[data-md-color-scheme="slate"] .md-typeset a { color: var(--md-primary-fg-color--light); }

/* Inside the ERP help panel the manual takes the app's theme (html[data-mz-theme], set by the embed script in
   overrides/main.html from ?mztheme= / postMessage). Colours = the theme gradients in nav-modern.css. */
html[data-mz-theme="ocean"] body[data-md-color-scheme] {
  --md-primary-fg-color: #1e6fa8;
  --md-primary-fg-color--light: #3a8cc4;
  --md-primary-fg-color--dark: #14508a;
  --mz-step-bg: #e1edf7;
  --mz-head-grad: linear-gradient(135deg, #1e6fa8 0%, #14508a 60%, #0d3762 100%);
}
html[data-mz-theme="beige"] body[data-md-color-scheme] {
  --md-primary-fg-color: #a07a45;
  --md-primary-fg-color--light: #c9a96e;
  --md-primary-fg-color--dark: #7a5830;
  --md-accent-fg-color: #0e8a9e;
  --md-default-bg-color: #fbf8f2;
  --mz-step-bg: #f3e9d8;
  --mz-head-grad: linear-gradient(135deg, #c9a96e 0%, #a07a45 60%, #7a5830 100%);
}
html[data-mz-theme="dark"] body[data-md-color-scheme] {
  --md-default-bg-color: #1e2425;
  --mz-step-bg: #2d3436;
  --mz-head-grad: linear-gradient(135deg, #3d4446 0%, #2d3436 60%, #1e2425 100%);
}
html[data-mz-theme="dark-neutral"] body[data-md-color-scheme] {
  --md-default-bg-color: #1c1f24;
  --mz-step-bg: #282b31;
  --mz-head-grad: linear-gradient(135deg, #383c44 0%, #282b31 60%, #1c1f24 100%);
}
html[data-mz-theme="dim"] body[data-md-color-scheme] {
  --md-default-bg-color: #15202b;
  --mz-step-bg: #1e2e3e;
  --mz-head-grad: linear-gradient(135deg, #2a3f52 0%, #1e2e3e 60%, #15202b 100%);
}

/* Slightly larger, comfortable Arabic reading */
.md-typeset { font-size: .8rem; line-height: 1.85; }
.md-typeset h1 { font-weight: 700; }

/* Menu path: الملفات › العملاء › ملف العملاء */
.md-typeset .menu-path {
  display: inline-block;
  padding: .1em .6em;
  border-radius: .4em;
  background: var(--mz-step-bg);
  color: var(--md-primary-fg-color);
  font-weight: 600;
  font-size: .9em;
}

/* Numbered steps get round badges */
.md-typeset ol.steps,
.md-typeset .steps > ol { counter-reset: step; list-style: none; padding-inline-start: 0; }
.md-typeset .steps > ol > li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 2.6em;
  margin-bottom: .9em;
}
.md-typeset .steps > ol > li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: .05em;
  width: 1.8em; height: 1.8em;
  border-radius: 50%;
  background: var(--md-primary-fg-color);
  color: #fff;
  font-weight: 700;
  font-size: .85em;
  display: grid; place-items: center;
}

/* Card grid on the home page */
.md-typeset .grid.cards > ul > li { border-radius: .6rem; }

/* Screenshot frame */
.md-typeset img.screen {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: .5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

/* Front-matter screen badge rendered by overrides/main.html */
.mz-screen-badge {
  font-size: .65rem;
  color: var(--md-default-fg-color--light);
  margin: 0 0 .4rem;
  direction: ltr;
  text-align: end;
}
.mz-screen-badge code { font-size: .95em; }

/* ---- Sidebar (mirrors the ERP menu) ---- */
.md-nav--primary .mz-sec-icon {
  width: 1.15rem; height: 1.15rem;
  margin-inline-end: .45rem;
  vertical-align: middle;
  flex: none;
}
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__container > .md-nav__link {
  font-weight: 600;
}
.mz-role-badge {
  margin-inline-start: auto;
  padding: 0 .4em;
  border-radius: .5em;
  font-size: .6rem;
  line-height: 1.5;
  direction: ltr;
  font-family: var(--md-code-font-family);
  color: var(--md-default-fg-color--light);
  background: var(--md-code-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  cursor: help;
  flex: none;
}
.mz-role-badge:hover { color: var(--md-primary-fg-color); border-color: var(--md-primary-fg-color); }
.md-nav__link { display: flex; align-items: center; gap: .25rem; }

/* Role codes inside page text link to the dictionary */
.md-typeset a.mz-role code { border-bottom: 1px dashed currentColor; cursor: help; }

/* Permissions dictionary: highlight the row you jumped to */
.md-typeset code[id]:target {
  background: var(--md-accent-fg-color);
  color: #fff;
  outline: 2px solid var(--md-accent-fg-color);
}
.md-typeset tr:has(code[id]:target) { background: var(--mz-step-bg); }

/* ---- Brand logo in the header (white chip so the gold/blue scales read on teal) ---- */
.md-header__button.md-logo { padding: .2rem; margin: .2rem .4rem; }
.md-header__button.md-logo img {
  height: 2.1rem; width: auto;
  background: #fff; border-radius: .5rem; padding: .1rem .3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.md-nav__title .md-nav__button.md-logo img { height: 2.6rem; width: auto; }

/* ---- Company contact block above the footer ---- */
.mz-company {
  background: var(--md-default-bg-color);
  border-top: 3px solid var(--md-primary-fg-color);
  color: var(--md-default-fg-color--light);
  font-size: .7rem;
}
.mz-company__inner {
  display: grid; gap: 1rem 2rem; padding: 1.2rem .8rem;
  grid-template-columns: minmax(14rem, 1.1fr) 1fr 1.4fr;
  align-items: start;
}
@media (max-width: 60em) { .mz-company__inner { grid-template-columns: 1fr; } }
.mz-company__brand { display: flex; gap: .8rem; align-items: center; }
.mz-company__brand img { width: 5rem; height: auto; }
.mz-company__brand strong { display: block; color: var(--md-default-fg-color); font-size: .85rem; }
.mz-company__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.mz-company__list li { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.mz-company__list .twemoji svg { width: 1rem; height: 1rem; fill: var(--md-primary-fg-color); }
.mz-company a { color: var(--md-primary-fg-color); }
.mz-company a:hover { text-decoration: underline; }

/* ---- Home page hero ---- */
.md-typeset .mz-hero { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.md-typeset .mz-hero img { width: 9rem; height: auto; }
.md-typeset .mz-hero h1 { margin: 0; }

/* Phone numbers always read left-to-right inside Arabic text */
a[href^="tel:"] { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* screen keywords live only in the search index (hooks/mz_hooks.py) — never show them in results */
.md-search-result .md-tags { display: none !important; }

/* ---- Embedded in the ERP help panel (overrides/main.html adds html.mz-embed inside an iframe) ---- */
html.mz-embed .md-header,
html.mz-embed .md-tabs,
html.mz-embed .md-sidebar--primary,
html.mz-embed .md-sidebar--secondary,
html.mz-embed .md-footer,
html.mz-embed .mz-company,
html.mz-embed .md-top,
html.mz-embed .md-path { display: none !important; }
html.mz-embed .md-main__inner { margin-top: 0; }
html.mz-embed .md-content { max-width: none; margin: 0 !important; }
html.mz-embed .md-content__inner { margin: .6rem .9rem 1.2rem; padding-top: 0; }
html.mz-embed .md-content__inner > h1:first-child { margin-top: 0; font-size: 1.35rem; }
html.mz-embed body { background: var(--md-default-bg-color); }
