:root{--canvas:#f6f5f1;--surface:#fff;--raised:#f4f8f5;--ink:#203e33;--muted:#526c5d;--line:#e2e0d8;--active:#e1f2e9;--accent:#126b53;--menu-shadow:0 12px 35px #133e3226;color-scheme:light}
:root[data-theme=dark]{--canvas:#070c16;--surface:#0e1726;--raised:#22332c;--ink:#e3efe8;--muted:#b0c5b9;--line:#1f2c44;--active:#1d4539;--accent:#82d7b5;--menu-shadow:0 14px 45px #0008;color-scheme:dark}
html body button.theme-switch{display:inline-grid;place-items:center;background:var(--raised);color:var(--ink);border:1px solid var(--line);width:36px;height:36px;padding:0;border-radius:11px;cursor:pointer;margin-inline-start:0}
.theme-switch span{display:block;width:18px;height:18px;background:currentColor;mask:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' d='M20.5 14.7A9 9 0 0 1 9.3 3.5a9 9 0 1 0 11.2 11.2Z'/%3E%3C/svg%3E")}
[data-theme=dark] .theme-switch span{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 1v3m0 16v3M1 12h3m16 0h3M4 4l2 2m12 12 2 2M4 20l2-2M18 6l2-2'/%3E%3C/svg%3E")}
@supports (appearance:base-select){
  select:not([multiple]):not([size]),select:not([multiple]):not([size])::picker(select){appearance:base-select}
  select::picker(select){margin-block:6px;padding:6px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:13px;box-shadow:var(--menu-shadow);max-height:min(320px,52vh);overflow:auto;font:inherit}
  select option{padding:8px 12px;min-height:35px;gap:10px;border-radius:8px;font:inherit;color:var(--ink);background:var(--surface)}
  select option:checked,select option:hover,select option:focus-visible{background:var(--active);color:var(--accent)}
  select option:disabled{opacity:.55}
  select::picker-icon{color:var(--accent);margin-inline-start:8px}
}
html[data-theme=dark] body,html[data-theme=dark] main.console{background:var(--canvas);color:var(--ink)}
html[data-theme=dark] :is(header,section,aside.rail,.topbar,.panel,.metric:not(:first-child),.ring>div,dialog,textarea,input,select,.card,.column,.public .tile){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.plain,.quicksearch,.userbar select,.userbar a,.userbar button,.quicksearch input,.panelhead button,.panelhead select,.monogram,.bar){background:var(--raised);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.pagehead h1,.panelhead h2,crm-overview,.metric:not(:first-child) .metric-label,.rail .navlink,.railbottom a,.railbottom button){color:var(--ink)}
html[data-theme=dark] :is(small,time,.chartdates,.axis,.pagehead span,.panel p,.panelhead,.metric small){color:var(--muted)}
html[data-theme=dark] :is(.rail .navlink.active,.rail .navlink:hover){background:var(--active);color:var(--accent)}
html[data-theme=dark] :is(a,.previewLink){color:var(--accent)}
html[data-theme=dark] :is(.item,.product,.railbottom,nav,article,th,td){border-color:var(--line)}
html[data-theme=dark] .chart svg path{stroke:var(--line)}
@media(max-width:480px){html .topbar .quicksearch{flex:1;min-width:0}html .topbar .quicksearch input{width:100%;min-width:0}html .userbar select{max-width:84px}}

html body img.crm-signature{display:inline-block;width:164px;height:auto;max-width:100%;object-fit:contain;vertical-align:middle}
html[data-theme=dark] img.crm-signature{content:url('/mahbaan-crm-signature-dark.svg')}
.crm-signature+.theme-switch{margin-inline:14px}
/* Same-origin navigation between the standalone entry points. */
@media(prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  ::view-transition-old(root){animation-duration:120ms}
  ::view-transition-new(root){animation-duration:200ms}
}
html .rail, html .topbar { background: var(--surface); border-color: var(--line); }
html .rail .navlink { border-radius: .875rem; }
html .panel, html .metric { border-radius: 1.125rem; box-shadow: 0 1px 2px rgb(14 23 38 / 6%), 0 8px 24px -12px rgb(14 23 38 / 18%); }
html .primary { border-radius: .875rem; }

/* Mahbaan Cloud console canvas and glass header. */
html .frame .surface {
  background-color: var(--canvas);
  background-image: linear-gradient(color-mix(in srgb, currentColor 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, currentColor 5%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
}
html .frame .topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  box-sizing: border-box;
  height: 4rem;
  min-height: 4rem;
  padding-inline: clamp(1rem, 2vw, 1.5rem);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-block-end: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

@media(min-width:1024px){ html .frame {grid-template-columns:16.5rem minmax(0,1fr);} html .frame.compact {grid-template-columns:4.5rem minmax(0,1fr);} }

.frame .console-toggle {display:none;}
.rail .quicksearch {display:flex;align-items:center;gap:6px;margin:4px 12px 12px;padding:6px 10px;background:var(--raised);border:1px solid var(--line);border-radius:14px;}
.rail .quicksearch input {width:100%;min-width:0;border:0;background:transparent;color:inherit;}
@media(min-width:1024px){.frame .console-toggle {display:grid;place-items:center;width:36px;height:36px;padding:0;background:transparent;color:var(--ink);} .compact .rail .quicksearch {margin-inline:4px;padding-inline:3px;} .compact .rail .quicksearch mb-icon {display:none;}}

@media(max-width:1023px){html .frame .rail {width:min(16.5rem,86vw);}}

html .rail .navlink {
  position: relative;
  gap: .75rem;
  padding: .5rem .75rem;
  border-radius: .875rem;
  font-size: .875rem;
  line-height: 1.25rem;
}
html .rail .navlink.active { font-weight: 600; box-shadow: none; }
html .rail .navlink.active::before {
  content: '';
  position: absolute;
  inset-inline-start: -.75rem;
  inset-block: .5rem;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

/* Physical left alignment also applies in RTL navigation. */
html .rail .product { min-height:64px; }
html .rail .rail-brand { position:absolute; left:8px; top:4px; display:flex; align-items:center; justify-content:flex-start; direction:ltr; width:min(160px, calc(100% - 64px)); height:56px; margin:0; padding:0; }
html .rail .rail-brand img.crm-signature { width:100%; height:100%; max-width:none; object-fit:contain; object-position:left center; }
@media(min-width:1024px){ html .compact .rail .rail-brand {width:calc(100% - 16px);} }

.rail .product .drawer-close {margin-left:auto;margin-right:0;}

html .frame .rail::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: calc(4rem - 1px);
  height: 1px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
  pointer-events: none;
}

html .frame {--header-height:4rem;}
html .frame .rail {padding-block-start:0;}
html .rail .product {box-sizing:border-box;flex:0 0 4rem;height:4rem;min-height:4rem;padding-block:0;border-bottom:0;}

@media (min-width: 1024px) {
  .frame.compact .rail-brand { scale: .85; transform-origin: left center; }
}
