/* ═══════════════════════════════════════════════════════════════
   Zim Rail Menu — reużywalny sidebar nawigacyjny (Deep Navy / Steel Blue)
   Źródło stylu: Cowork/cowork.html ("Zim Platform" theme).
   Zawiera: zmienne motywu, lewy pasek (rail), zachowanie mobilne
   (hamburger + przeciągnięcie od krawędzi), minimalny wrapper treści
   (.content, .view/.view.active, view-title/view-sub).

   Reszta stylów widoków (karty, tabele, pigułki itd.) NIE jest częścią
   tego pakietu — dokładane osobno przez każdy projekt, który z niego
   korzysta.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-base:      #0d1b2a;
  --bg-deep:      #08121d;
  --bg-surface:   #112236;
  --bg-raised:    #16304a;
  --bg-hover:     #1e3a5f;
  --bg-active:    #234971;

  --accent:       #4a9eda;
  --accent-soft:  #63b3ed;
  --accent-dim:   rgba(74, 158, 218, 0.18);
  --accent-glow:  0 0 20px rgba(74, 158, 218, 0.28);
  --green:        #23d18b;
  --green-dim:    rgba(35, 209, 139, 0.16);
  --red:          #ff5f5f;
  --red-dim:      rgba(255, 95, 95, 0.14);
  --orange:       #d89a4b;
  --orange-dim:   rgba(216, 154, 75, 0.16);

  --text-primary:   #f4f7fa;
  --text-secondary: #c8d6e5;
  --text-muted:     #8b9ab0;

  --border:       rgba(200, 214, 229, 0.10);
  --border-light: rgba(200, 214, 229, 0.18);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-ui:   'Space Grotesk', system-ui, sans-serif;
  --font-code: 'JetBrains Mono', 'Fira Code', monospace;

  --transition: 0.18s ease;
  --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
  --panel-shadow-soft: 0 14px 32px rgba(2, 8, 15, 0.26);
  --surface-sheen: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0));
}

* { box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; margin: 0; }
body.zim-app {
  background:
    radial-gradient(circle at 14% 12%, rgba(99, 179, 237, 0.12), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(74, 158, 218, 0.14), transparent 24%),
    radial-gradient(circle at 52% 100%, rgba(45, 107, 196, 0.18), transparent 34%),
    linear-gradient(180deg, #102133 0%, var(--bg-base) 44%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--font-code); font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- left rail ---- */
.rail {
  width: 250px;
  flex-shrink: 0;
  background: var(--surface-sheen), linear-gradient(180deg, rgba(19, 38, 60, 0.98), rgba(12, 24, 38, 0.98));
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(200, 214, 229, 0.06);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}
.rail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 18px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.logo-mark {
  flex-shrink: 0;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(74, 158, 218, 0.5));
  animation: pulse-logo 3s ease-in-out infinite;
}
@keyframes pulse-logo {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(74, 158, 218, 0.4)); }
  50%       { filter: drop-shadow(0 0 12px rgba(74, 158, 218, 0.75)); }
}
.rail-title .wordmark {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.15;
}
.rail-title .wordmark b { color: var(--text-primary); font-weight: 700; }
.rail-title .wordmark i {
  display: block;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1px;
}

.rail-section-label {
  font-family: var(--font-code);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: 14px 18px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 9px 18px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
  box-shadow: inset 0 0 16px rgba(74, 158, 218, 0.08);
}
.nav-icon { width: 14px; text-align: center; opacity: .85; }
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-raised);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  padding: 0 6px;
}

.rail-footer {
  margin-top: auto;
  padding: 14px 18px 4px;
  border-top: 1px solid var(--border);
}
.rail-btn {
  width: 100%;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  background: var(--accent);
  color: var(--bg-base);
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 10px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: var(--transition);
}
.rail-btn:hover:not(:disabled) { background: var(--accent-soft); box-shadow: var(--accent-glow); }
.rail-btn.ghost {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.rail-btn.ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); box-shadow: none; }
.rail-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---- right content wrapper (minimalny) ---- */
.content {
  flex: 1;
  min-width: 0;
  padding: 40px 44px 80px;
  max-width: 1000px;
  position: relative;
  z-index: 1;
}
h1.view-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.view-sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 28px; max-width: 60ch; }

.view { display: none; }
.view.active { display: block; }

.menu-hint { display: none; }

@media (max-width: 720px) {
  body.zim-app { flex-direction: column; }
  .content { padding: 20px 18px 60px; }

  /* pełnoekranowe menu — tylko translateX (tanie dla GPU), bez scale/rotate/
     animowanego box-shadow które na słabszych telefonach potrafiły "zawieszać" animacje */
  .rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: calc(100vw - 26px);
    height: 100vh;
    background: var(--bg-deep);
    transform: translateX(-100%);
    transition: transform .22s ease-out;
    z-index: 100;
    will-change: transform;
  }
  .rail.open { transform: translateX(0); }

  /* uchwyt-strzałka, efekt "zakładki" — zostawiamy pasek ekranu na szerokość
     strzałki (26px) niezakryty przez rail. Przesuwa się tym samym transform/
     transition co rail (translateX), żeby jechały razem, bez skoku w połowie */
  .menu-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%; left: 0;
    transform: translateY(-50%) translateX(0);
    transition: transform .22s ease-out;
    z-index: 120;
    width: 26px; height: 64px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-muted);
    font-size: 18px;
    box-shadow: none;
    will-change: transform;
  }
  body.menu-open .menu-hint { transform: translateY(-50%) translateX(calc(100vw - 26px)); }
}
