/* MitaBase Pro — a product of ETMITA · https://etmita.com
   Copyright © ETMITA. All rights reserved. */
/* public/sidebar.css — the sidebar v2 "the road rail" (markup + behavior
   in /js/shell/sidebar.js, emitted from src/features/shell/). Loaded
   AFTER style.css so it wins. The rail is ink in BOTH themes. Tokens
   only; motion = --mb-ease-out, 150–320 ms, no loops. */

/* the mount participates in .layout-body's flex as if it weren't there */
#app-sidebar-root { display: contents; }

.sidebar {
  position: relative;
  z-index: var(--mb-z-sidebar);
  width: 272px;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--mb-font-sans);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(164, 240, 58, 0.07), transparent 60%),
    linear-gradient(180deg, var(--mb-ink) 0%, color-mix(in srgb, var(--mb-ink) 72%, black) 100%);
  color: var(--mb-ondark);
  transition: width 0.45s var(--mb-ease-out);
  overflow: visible;
}
html[lang="fa"] .sidebar { font-family: var(--mb-font-fa); }

/* the outer edge: hairline + the brand's dashed road, one-shot sweep on toggle */
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: 2px;
  background:
    repeating-linear-gradient(to bottom, rgba(164, 240, 58, 0.35) 0 8px, transparent 8px 22px),
    rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.sidebar.sweep::after { animation: sb-sweep 0.7s var(--mb-ease-out); }
@keyframes sb-sweep {
  0% { background-position: 0 -60px, 0 0; filter: brightness(2.2); }
  100% { background-position: 0 60px, 0 0; filter: brightness(1); }
}

svg.sb-ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  position: relative;
  z-index: 1;
}

/* ── Head: OUR official lockup ─────────────────────────────────────── */
.sidebar-head {
  padding: 18px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sb-lockup { height: 55px; width: auto; align-self: flex-start; }
.sb-mark { display: none; height: 30px; width: auto; align-self: center; }
.sb-tagline {
  font-family: var(--mb-font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--mb-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── The road knob (collapse control, rides the outer edge) ────────── */
.sb-knob {
  position: absolute;
  top: 70px;
  inset-inline-end: -15px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--mb-ink-2);
  color: var(--mb-lime);
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: border-color var(--mb-dur-fast), transform var(--mb-dur-fast), box-shadow var(--mb-dur-fast);
}
.sb-knob:hover {
  border-color: var(--mb-lime-mid);
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(164, 240, 58, 0.35);
}
.sb-knob:focus-visible { outline: 2px solid var(--mb-lime); outline-offset: 2px; }
.sb-knob-svg { width: 16px; height: 16px; transition: transform 0.45s var(--mb-ease-out); }
.sb-knob-road {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 10 12;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.45s var(--mb-ease-out);
}
.sb-knob-pin {
  fill: var(--mb-lime);
  stroke: none;
  transition: transform 0.45s var(--mb-ease-out);
  transform-box: fill-box;
  transform-origin: center;
}
.sidebar.collapsed .sb-knob-svg { transform: rotate(180deg); }
.sidebar.collapsed .sb-knob-road { stroke-dashoffset: 22; }
.sidebar.collapsed .sb-knob-pin { transform: translateY(-5px) scale(0.9); }

/* ── The road + the pin ────────────────────────────────────────────── */
.sidebar-section {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
/* the dashed road runs under the icons' centre line */
.sidebar-section::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  inset-inline-start: 17px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.14) 0 6px, transparent 6px 14px);
  pointer-events: none;
}
/* ONE pin, riding the road to the active station (transform set by JS) */
.sb-pin {
  position: absolute;
  top: 0;
  inset-inline-start: 12px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 999px;
  background: var(--mb-lime);
  box-shadow: 0 0 0 4px rgba(164, 240, 58, 0.18), 0 0 18px rgba(164, 240, 58, 0.55);
  pointer-events: none;
  z-index: 2;
  transition: transform var(--mb-dur-slow) var(--mb-ease-out), opacity var(--mb-dur-fast);
}
.sb-pin::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--mb-ink);
}
.sb-pin.off { opacity: 0; }

.sb-sec-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 6px 4px 0;
  padding-inline-start: 24px;
  font-family: var(--mb-font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mb-muted);
  white-space: nowrap;
}
.sb-sec-no { color: var(--mb-faint); }
.sb-sec-no::after { content: " ·"; color: var(--mb-muted); }
.sb-sec-label[data-sec="ops"] .sb-sec-no { color: var(--mb-lime); }
.sb-sec-label[data-sec="team"] .sb-sec-no { color: var(--mb-meter-amber); }
.sb-sec-label[data-sec="admin"] .sb-sec-no { color: var(--mb-purple); }

/* ── Stations ──────────────────────────────────────────────────────── */
.sidebar-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  padding-inline-start: 24px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mb-faint);
  cursor: pointer;
  text-align: start;
  white-space: nowrap;
  transition: color var(--mb-dur-fast), background var(--mb-dur-fast);
}
.sidebar-btn > span[data-i18n] {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform var(--mb-dur-base) var(--mb-ease-out), color var(--mb-dur-fast);
}
.sidebar-btn .sb-ic { color: var(--mb-muted); transition: color var(--mb-dur-fast), transform var(--mb-dur-base) var(--mb-ease-out); }
/* the headlight: a soft lime radial behind the icon, lit on hover/active */
.sb-halo {
  position: absolute;
  inset-inline-start: 18px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(164, 240, 58, 0.28), transparent 72%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--mb-dur-base), transform var(--mb-dur-base) var(--mb-ease-out);
  pointer-events: none;
}
.sidebar-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.sidebar-btn:hover .sb-ic { color: var(--mb-ondark); }
.sidebar-btn:hover > span[data-i18n] { transform: translateX(4px); }
html[dir="rtl"] .sidebar-btn:hover > span[data-i18n] { transform: translateX(-4px); }
.sidebar-btn:hover .sb-halo { opacity: 1; transform: scale(1); }
.sidebar-btn:focus-visible { outline: 2px solid var(--mb-lime); outline-offset: -2px; }
.sidebar-btn.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(164, 240, 58, 0.12), rgba(164, 240, 58, 0.02) 70%, transparent);
}
html[dir="rtl"] .sidebar-btn.active {
  background: linear-gradient(270deg, rgba(164, 240, 58, 0.12), rgba(164, 240, 58, 0.02) 70%, transparent);
}
.sidebar-btn.active .sb-ic { color: var(--mb-lime); }
.sidebar-btn.active .sb-halo { opacity: 1; transform: scale(1); }

.sb-badge {
  margin-inline-start: auto;
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--mb-lime);
  color: var(--mb-ink);
  font-family: var(--mb-font-mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  flex: none;
  position: relative;
  z-index: 1;
}
.sb-badge.pop { animation: sb-pop 0.26s var(--mb-ease-out); }
@keyframes sb-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); background: var(--mb-lime-hover); }
  100% { transform: scale(1); }
}
.sb-badge.hidden { display: none !important; }

/* ── Footer: Pro banner + rows ─────────────────────────────────────── */
.sb-foot {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* ── locked stations (2026-09-05) ────────────────────────────────────
   A module outside the plan keeps its place in the rail. It is dimmed,
   not removed: a nav that grows and shrinks with the plan teaches
   nobody what the product is, and a customer who cannot see that
   Zeiterfassung exists will never ask for it. The lock sits where the
   badge would, so nothing shifts when a plan changes. */
.sidebar-btn.is-locked { color: var(--mb-faint); }
.sidebar-btn.is-locked .sb-ic { opacity: .55; }
.sidebar-btn.is-locked:hover { color: var(--mb-ondark); }
.sb-badge.is-muted { display: none !important; }
.sb-lock { margin-inline-start: auto; display: inline-flex; opacity: .6; }
.sb-lock-ic { width: 13px; height: 13px; }
.sidebar.collapsed .sb-lock {
  position: absolute; top: 5px; inset-inline-end: 7px; margin: 0;
}

/* ── the close button on the upgrade box ─────────────────────────── */
.sb-pro-close {
  position: absolute; top: 5px; inset-inline-end: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--mb-faint); cursor: pointer;
  transition: color var(--mb-dur-fast) var(--mb-ease-out), background-color var(--mb-dur-fast) var(--mb-ease-out);
}
.sb-pro-close:hover { background: rgba(255, 255, 255, .07); color: var(--mb-ondark); }
.sb-pro-close:focus-visible { outline: 2px solid var(--mb-lime); outline-offset: 1px; }
.sb-pro-x { width: 13px; height: 13px; }
/* The box is a flex column; the close button must not push the tag. */
.sb-pro-tag { padding-inline-end: 22px; }

/* Hidden means gone. The display rules below (and the collapsed variant)
   beat the UA's [hidden], which left a 24 px phantom box plus the footer
   gap on the top plan and after the X (2026-09-06). */
.sb-pro[hidden],
.sb-pro-mini[hidden],
.sidebar.collapsed .sb-pro-mini[hidden] { display: none !important; }

.sb-pro {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(164, 240, 58, 0.22);
  background:
    radial-gradient(90% 90% at 100% 100%, rgba(164, 240, 58, 0.16), transparent 65%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--mb-ink-2);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sb-pro-tag { font-family: var(--mb-font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; color: var(--mb-lime); }
.sb-pro-desc { font-size: 11.5px; font-weight: 500; line-height: 1.45; color: var(--mb-ondark); margin: 0; }
.sb-pro-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  border: none;
  border-radius: 9px;
  background: var(--mb-lime);
  color: var(--mb-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--mb-dur-fast), transform var(--mb-dur-fast);
}
.sb-pro-cta:hover { background: var(--mb-lime-hover); }
.sb-pro-cta:active { transform: scale(0.98); }
.sb-pro-cta .sb-ic { width: 13px; height: 13px; }
.sb-pro-mini {
  display: none;
  width: 40px;
  height: 40px;
  align-self: center;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(164, 240, 58, 0.3);
  background: rgba(164, 240, 58, 0.1);
  color: var(--mb-lime);
  cursor: pointer;
  transition: background var(--mb-dur-fast), transform var(--mb-dur-fast);
}
.sb-pro-mini:hover { background: rgba(164, 240, 58, 0.2); transform: translateY(-1px); }

.sb-foot-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 6px;
}
.sb-foot-rows .sidebar-btn { font-size: 12.5px; min-height: 36px; padding: 6px 10px; }
.sb-foot-rows .sb-ic { width: 15px; height: 15px; }
.sb-foot-rows .sb-halo { width: 26px; height: 26px; margin-top: -13px; }

/* official company mark — MitaBase is an ETMITA platform */
.sb-copy {
  padding-top: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  user-select: none;
}
.sb-copy-link { font-size: 10.5px; font-weight: 600; color: var(--mb-faint); text-decoration: none; transition: color var(--mb-dur-fast); }
.sb-copy-link:hover { color: var(--mb-lime); }
.sb-copy-meta { font-family: var(--mb-font-mono); font-size: 8.5px; font-weight: 500; letter-spacing: 0.14em; color: var(--mb-muted); }

/* ── Collapsed rail (desktop) ──────────────────────────────────────── */
@media (min-width: 1024px) {
  .sidebar.collapsed { width: 76px; }
  .sidebar.collapsed .sb-lockup,
  .sidebar.collapsed .sb-tagline,
  .sidebar.collapsed .sb-sec-label span[data-i18n],
  .sidebar.collapsed .sidebar-btn > span[data-i18n],
  .sidebar.collapsed .sb-pro,
  .sidebar.collapsed .sb-copy-link { display: none; }
  .sidebar.collapsed .sb-mark { display: block; }
  .sidebar.collapsed .sb-pro-mini { display: flex; }
  .sidebar.collapsed .sidebar-section::before { inset-inline-start: 11px; }
  .sidebar.collapsed .sb-pin { inset-inline-start: 6px; }
  .sidebar.collapsed .sb-sec-label { justify-content: center; margin-inline: 0; padding-inline-start: 0; }
  .sidebar.collapsed .sb-sec-no::after { content: ""; }
  .sidebar.collapsed .sidebar-btn { justify-content: center; padding: 10px 0 10px 8px; }
  .sidebar.collapsed .sb-halo { inset-inline-start: 50%; margin-inline-start: -11px; }
  .sidebar.collapsed .sb-badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 8px;
    min-width: 15px;
    padding: 0 4px;
    font-size: 8.5px;
    margin: 0;
  }
  .sidebar.collapsed .sb-copy-meta { font-size: 7.5px; letter-spacing: 0.04em; }
}

/* ── Mobile drawer ─────────────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: var(--mb-z-backdrop);
}
.sidebar-backdrop.open { display: block; }
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: 280px;
    max-width: 85vw;
    z-index: var(--mb-z-drawer);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s var(--mb-ease-out);
  }
  html[dir="ltr"] .sidebar:not(.open) { transform: translateX(-100%); }
  html[dir="rtl"] .sidebar:not(.open) { transform: translateX(100%); }
  .sb-knob { display: none; }
  .sidebar-btn { min-height: 44px; }
}
@media (min-width: 1024px) {
  .sidebar-backdrop { display: none !important; }
}

/* ── Floating tooltip for the collapsed rail ───────────────────────── */
.sb-tooltip {
  position: fixed;
  z-index: var(--mb-z-tooltip);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 11px;
  border-radius: 9px;
  background: var(--mb-ink-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--mb-font-sans);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--mb-dur-fast);
}
html[lang="fa"] .sb-tooltip { font-family: var(--mb-font-fa); }
.sb-tooltip.show { opacity: 1; }
.sb-tooltip-kbd {
  font-family: var(--mb-font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--mb-lime);
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(164, 240, 58, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar *, .sidebar::after, .sidebar::before, .sb-knob-svg, .sb-knob-road, .sb-knob-pin, .sb-pin {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
