/* =================================================================
   Laercio Consultoria — Refino v2
   Sistema de motion profissional + monitor ao vivo (AnyDesk-like).
   Camada por cima de refino-ui.css. Ordem: executive → refino-ui → refino-v2.
   ================================================================= */

:root {
  /* ===== Tokens de motion profissionais ===== */
  --m-micro: 120ms;
  --m-fast:  180ms;
  --m-base:  260ms;
  --m-slow:  420ms;
  --m-page:  520ms;

  --e-standard: cubic-bezier(.2, 0, 0, 1);
  --e-decel:    cubic-bezier(0, 0, .2, 1);
  --e-accel:    cubic-bezier(.4, 0, 1, 1);
  --e-emph:     cubic-bezier(.2, 0, 0, 1.15);
  --e-spring:   cubic-bezier(.34, 1.56, .64, 1);

  --rt-bg: #0b1220;
  --rt-grid: rgba(255, 255, 255, .04);
  --rt-ink: #e8eef9;
  --rt-muted: #99a4b8;
  --rt-accent: #22c55e;
}

/* ===== Page transition mais sofisticada ===== */
.view {
  transition: opacity var(--m-page) var(--e-standard),
              transform var(--m-page) var(--e-emph),
              filter var(--m-slow) var(--e-decel);
}
.view.active {
  animation: viewSlideIn 560ms var(--e-emph) both;
}
@keyframes viewSlideIn {
  0%   { opacity: 0; transform: translateY(22px) scale(.985); filter: blur(6px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Stagger choreography: 6 niveis com curva exponencial decay */
.view.active > *:nth-child(1) { animation-delay: 0ms; }
.view.active > *:nth-child(2) { animation-delay: 60ms; }
.view.active > *:nth-child(3) { animation-delay: 110ms; }
.view.active > *:nth-child(4) { animation-delay: 150ms; }
.view.active > *:nth-child(5) { animation-delay: 180ms; }
.view.active > *:nth-child(6) { animation-delay: 200ms; }
.view.active > *:nth-child(n+7) { animation-delay: 220ms; }
.view.active > * {
  animation: childRise var(--m-page) var(--e-emph) both;
}
@keyframes childRise {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== Hover micro-interactions refinadas ===== */
.metric, .ribbon-card, .module, .record, .dd-card, .nav-item {
  transition: transform var(--m-fast) var(--e-emph),
              box-shadow var(--m-fast) var(--e-standard),
              border-color var(--m-fast) var(--e-standard),
              background var(--m-fast) var(--e-standard);
}
.metric:hover, .ribbon-card:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow: 0 22px 50px -28px rgba(20, 32, 51, .28);
}
.metric:active, .ribbon-card:active {
  transform: translateY(-1px) scale(.995);
  transition-duration: 90ms;
}

/* Ripple sutil ao clicar em cards-acao */
.metric, .ribbon-card { position: relative; overflow: hidden; }
.metric::before, .ribbon-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(21, 128, 61, .14), transparent 45%);
  opacity: 0;
  transition: opacity 280ms var(--e-decel);
  pointer-events: none;
}
.metric:hover::before, .ribbon-card:hover::before { opacity: 1; }

/* ===== KPI valor com contagem animada ===== */
.metric strong[data-animate-value] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  animation: valuePulse 480ms var(--e-emph);
}
@keyframes valuePulse {
  0%   { transform: translateY(6px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ===== Narrativa do robo (banda contextual no topo) ===== */
.narrative-band {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(21, 128, 61, .08), rgba(8, 114, 135, .05) 60%, transparent),
    linear-gradient(#fff, #fff);
  border: 1px solid #e5edf6;
  margin-bottom: 14px;
  overflow: hidden;
}
.narrative-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, .12), transparent);
  transform: translateX(-100%);
  animation: narrativeShine 6s var(--e-standard) infinite;
}
@keyframes narrativeShine {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
.narrative-band .narrative-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--laercio-soft);
  border-radius: 12px;
  color: var(--laercio);
}
.narrative-band .narrative-text { flex: 1; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.narrative-band .narrative-text b { color: var(--laercio); }

/* ===== Importacao inteligente: separacao por pasta/situacao ===== */
.import-intelligence {
  position: relative;
  display: grid;
  gap: 14px;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid rgba(21, 128, 61, .18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, rgba(34, 197, 94, .12), transparent 34%),
    linear-gradient(140deg, rgba(255, 255, 255, .98), rgba(248, 253, 250, .96));
  box-shadow: 0 24px 60px -42px rgba(10, 45, 28, .45);
  overflow: hidden;
}
.import-intelligence[hidden] { display: none !important; }
.import-intelligence::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(21, 128, 61, .08), transparent);
  transform: translateX(-100%);
  animation: narrativeShine 7s var(--e-standard) infinite;
}
.import-intel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.import-intel-head h3 {
  margin: 6px 0 4px;
  font-size: clamp(18px, 2vw, 24px);
  color: var(--ink);
}
.import-intel-head p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}
.import-intel-kpis {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.import-intel-kpi {
  min-width: 0;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid #e3edf5;
  background: rgba(255, 255, 255, .82);
}
.import-intel-kpi span,
.import-intel-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.import-intel-kpi strong {
  display: block;
  margin: 5px 0 2px;
  font-size: clamp(20px, 3vw, 30px);
  color: var(--ink);
  letter-spacing: -.04em;
}
.import-intel-kpi.green { border-color: rgba(21, 128, 61, .24); background: rgba(240, 253, 244, .78); }
.import-intel-kpi.blue { border-color: rgba(37, 99, 235, .22); background: rgba(239, 246, 255, .82); }
.import-intel-kpi.amber { border-color: rgba(217, 119, 6, .30); background: rgba(255, 251, 235, .9); }
.import-intel-groups {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.import-intel-group {
  border: 1px solid #e4edf5;
  border-radius: 15px;
  background: rgba(255, 255, 255, .9);
  overflow: hidden;
}
.import-intel-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 12px 13px;
  list-style: none;
}
.import-intel-group summary::-webkit-details-marker { display: none; }
.import-intel-group summary > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 800;
  color: var(--ink);
}
.import-intel-group.amber { border-color: rgba(217, 119, 6, .35); }
.import-intel-group.red { border-color: rgba(220, 38, 38, .28); }
.import-intel-group.green { border-color: rgba(21, 128, 61, .28); }
.import-intel-group.blue { border-color: rgba(37, 99, 235, .24); }
.import-sample-list {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}
.import-sample-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #fff;
}
.import-sample-row code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 11px;
}
.file-origin-cell {
  display: grid;
  gap: 5px;
  min-width: 190px;
}
.file-origin-cell > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.file-origin-cell small,
.file-origin-cell em {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

@media (max-width: 980px) {
  .import-intel-head,
  .import-intel-groups {
    grid-template-columns: 1fr;
  }
  .import-intel-head {
    display: grid;
  }
  .import-intel-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .import-intel-kpis,
  .import-intel-groups,
  .import-sample-row {
    grid-template-columns: 1fr;
  }
  .file-origin-cell {
    min-width: 0;
  }
}

/* ===== Breadcrumbs (trilha do contexto) ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.breadcrumbs .crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 32, 51, .04);
  transition: background var(--m-fast) var(--e-standard);
}
.breadcrumbs .crumb.active {
  background: var(--laercio-soft);
  color: var(--laercio);
  font-weight: 700;
}
.breadcrumbs .crumb-sep { color: #b6c3d4; }

/* ===== Command palette (Ctrl+K) ===== */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 12, 22, .55);
  backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--m-base) var(--e-standard);
}
.cmdk-backdrop.open { opacity: 1; pointer-events: auto; }
.cmdk-panel {
  position: fixed;
  top: 18vh;
  left: 50%;
  transform: translateX(-50%) translateY(-12px) scale(.97);
  width: min(640px, 92vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 50px 120px -30px rgba(8, 12, 22, .55);
  z-index: 201;
  opacity: 0;
  pointer-events: none;
  transition: transform var(--m-base) var(--e-emph),
              opacity var(--m-base) var(--e-standard);
  overflow: hidden;
}
.cmdk-backdrop.open ~ .cmdk-panel,
.cmdk-panel.open {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.cmdk-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  font-weight: 600;
  padding: 18px 22px;
  outline: 0;
  background: transparent;
}
.cmdk-list { max-height: 50vh; overflow: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  transition: background var(--m-fast) var(--e-standard);
}
.cmdk-item:hover, .cmdk-item.is-active {
  background: var(--laercio-soft);
  color: var(--laercio);
}
.cmdk-item .cmdk-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.cmdk-item small { margin-left: auto; color: var(--muted); font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); }
.cmdk-hint { padding: 8px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); display: flex; gap: 14px; }
.cmdk-hint kbd { background: var(--surface-3); padding: 2px 6px; border-radius: 5px; font-family: ui-monospace, monospace; font-size: 10.5px; }

/* ===== Monitor ao vivo (AnyDesk-like) ===== */
.rt-mount {
  display: grid;
  gap: 12px;
  background: var(--rt-bg);
  color: var(--rt-ink);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 22px 60px -28px rgba(8, 12, 22, .55);
  overflow: hidden;
}
.rt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
}
.rt-bar-left { display: flex; align-items: center; gap: 14px; }
.rt-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; color: #fff;
}
.rt-live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rt-accent);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: rtPulse 1.6s var(--e-standard) infinite;
}
@keyframes rtPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
  50%      { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}
.rt-count { color: var(--rt-muted); font-size: 12px; }
.rt-bar-right { display: flex; gap: 8px; }
.rt-btn {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--m-fast) var(--e-standard);
}
.rt-btn:hover { background: rgba(255, 255, 255, .16); }

.rt-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
}
@media (max-width: 900px) {
  .rt-grid { grid-template-columns: 1fr; }
}

.rt-canvas-wrap {
  position: relative;
  background:
    radial-gradient(800px 500px at 30% 0%, rgba(21, 128, 61, .12), transparent 60%),
    radial-gradient(700px 600px at 100% 100%, rgba(8, 114, 135, .08), transparent 60%),
    var(--rt-bg);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  overflow: hidden;
  min-height: 360px;
  aspect-ratio: 16 / 9;
}
.rt-canvas {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--rt-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--rt-grid) 1px, transparent 1px);
  background-size: 40px 40px;
}
.rt-canvas::before {
  content: "";
  position: absolute;
  top: 12px; right: 14px;
  font-size: 10px;
  color: var(--rt-muted);
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 700;
  content: "TELA NORMALIZADA · CADA CURSOR = UMA SESSAO";
}
.rt-cursor {
  position: absolute;
  width: 22px; height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 220ms var(--e-emph), top 220ms var(--e-emph);
}
.rt-cursor .rt-label {
  position: absolute;
  top: 100%;
  left: 18px;
  margin-top: 2px;
  background: var(--cur);
  color: #fff;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}

.rt-sidepanel {
  display: grid;
  gap: 10px;
  align-content: start;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 12px;
  padding: 12px;
  max-height: 420px;
  overflow-y: auto;
}
.rt-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rt-muted);
  margin-top: 4px;
}
.rt-sessions, .rt-timeline { display: grid; gap: 8px; }
.rt-session, .rt-event {
  display: flex; gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  font-size: 12px;
  animation: rtFadeIn 280ms var(--e-decel);
}
@keyframes rtFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.rt-session-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.rt-session-body, .rt-event-body { flex: 1; min-width: 0; }
.rt-session-head, .rt-event-head { display: flex; gap: 8px; align-items: baseline; }
.rt-session-head strong, .rt-event-head strong { color: #fff; font-size: 12.5px; }
.rt-tag {
  font-size: 9.5px; padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-weight: 700;
  letter-spacing: .04em;
}
.rt-tag-click { background: rgba(34, 197, 94, .22); color: #c6f6d5; }
.rt-tag-error { background: rgba(190, 52, 55, .25); color: #ffd6d6; }
.rt-tag-view  { background: rgba(8, 114, 135, .25); color: #c2eef6; }
.rt-tag-command { background: rgba(167, 139, 250, .25); color: #e9defb; }
.rt-session-meta { color: var(--rt-muted); font-size: 11px; margin-top: 2px; }
.rt-event-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.rt-event-head time { margin-left: auto; color: var(--rt-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.rt-event-data { color: var(--rt-muted); font-size: 11px; margin-top: 3px; word-break: break-word; }
.rt-empty { color: var(--rt-muted); font-size: 11.5px; padding: 14px; text-align: center; }

/* ===== Painel Apoio Dev ===== */
.dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.dev-stat {
  background: linear-gradient(160deg, #f8fafc, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 4px;
}
.dev-stat label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dev-stat strong { font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.dev-stat span { font-size: 11.5px; color: var(--muted); }
.dev-stat.ok strong { color: var(--green); }
.dev-stat.warn strong { color: var(--amber); }
.dev-stat.err strong { color: var(--red); }
.dev-stat.ai strong { background: linear-gradient(135deg, var(--laercio), var(--cyan)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ===== Reduced motion respeitado ===== */
@media (prefers-reduced-motion: reduce) {
  .narrative-band::after,
  .rt-live-dot { animation: none !important; }
}

/* ===== Sidebar fluida: camada final sem vazamento ===== */
@media (min-width: 901px) {
  :root {
    --rail-w: clamp(56px, 4.25vw, 64px);
    --rail-expanded-w: clamp(268px, 22vw, 324px);
    --rail-pad-x: 7px;
    --rail-item: clamp(40px, 3.15vw, 44px);
  }

  .shell {
    grid-template-columns: var(--rail-w) minmax(0, 1fr) !important;
  }
  .shell.nav-expanded {
    grid-template-columns: var(--rail-expanded-w) minmax(0, 1fr) !important;
  }
  .main,
  .content,
  .topbar {
    min-width: 0;
  }

  .sidebar {
    width: 100% !important;
    max-width: var(--rail-expanded-w);
    min-width: 0;
    padding: clamp(10px, 1.35vh, 16px) var(--rail-pad-x) !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: clamp(8px, 1.2vh, 14px) !important;
    overflow: hidden auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 252, 231, .28) transparent;
    contain: paint;
    transition:
      width var(--m-base) var(--e-standard),
      box-shadow var(--m-base) var(--e-standard),
      padding var(--m-base) var(--e-standard);
  }
  .sidebar::-webkit-scrollbar { width: 7px; }
  .sidebar::-webkit-scrollbar-track { background: transparent; }
  .sidebar::-webkit-scrollbar-thumb {
    background: rgba(220, 252, 231, .22);
    border-radius: 999px;
  }

  .sidebar .brand {
    min-width: 0;
    justify-content: center;
    gap: 0 !important;
    padding: 0 0 clamp(8px, 1vh, 12px) !important;
  }
  .sidebar .brand-mark {
    width: var(--rail-item) !important;
    height: var(--rail-item) !important;
    border-radius: 13px !important;
    margin-inline: auto;
  }
  .shell.nav-expanded .sidebar .brand {
    justify-content: flex-start;
    gap: 0 !important;
    width: 100%;
    min-height: 76px;
    padding: 2px 12px clamp(10px, 1.2vh, 14px) !important;
    border-bottom-color: rgba(255, 255, 255, .10);
  }
  .shell.nav-expanded .sidebar .brand-mark {
    display: none !important;
  }

  .sidebar .brand div:not(.brand-mark),
  .sidebar .workspace-switch,
  .sidebar .nav-title,
  .sidebar .nav-item span,
  .sidebar .side-status span:not(.status-dot),
  .sidebar #networkHint {
    flex: 0 0 0;
    width: 0 !important;
    max-width: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding-inline: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transform: translateX(-8px);
    pointer-events: none;
  }
  .shell.nav-expanded .sidebar .brand div:not(.brand-mark),
  .shell.nav-expanded .sidebar .nav-item span,
  .shell.nav-expanded .sidebar .side-status span:not(.status-dot),
  .shell.nav-expanded .sidebar #networkHint {
    display: block !important;
    flex: 1 1 auto;
    width: auto !important;
    max-width: 190px !important;
    max-height: none !important;
    height: auto !important;
    opacity: 1 !important;
    transform: translateX(0);
    pointer-events: auto;
  }
  .shell.nav-expanded .sidebar .brand div:not(.brand-mark) {
    width: 100% !important;
    max-width: none !important;
    overflow: hidden !important;
  }
  .shell.nav-expanded .sidebar .brand-wordmark {
    width: 100% !important;
    inline-size: 100% !important;
    height: auto !important;
    max-width: none !important;
    object-fit: contain;
    object-position: left center;
    margin-left: 0;
  }
  .shell.nav-expanded .sidebar .brand-lockup span {
    display: block;
    width: 100%;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar .workspace-switch {
    height: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    margin: 0 !important;
  }
  .shell.nav-expanded .sidebar .workspace-switch {
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    opacity: 1 !important;
    transform: translateX(0);
    pointer-events: auto;
  }

  .sidebar .nav {
    min-height: 0;
    gap: clamp(8px, 1.05vh, 12px) !important;
    align-content: start;
  }
  .sidebar .nav-group {
    min-width: 0;
    gap: 5px !important;
  }
  .sidebar .nav-title {
    height: 0 !important;
    line-height: 0;
    margin: 0 !important;
  }
  .shell.nav-expanded .sidebar .nav-title {
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    line-height: 1.2;
    margin: 3px 8px 4px !important;
    opacity: 1 !important;
    transform: translateX(0);
    pointer-events: auto;
  }

  .sidebar .nav-item {
    width: var(--rail-item) !important;
    min-width: var(--rail-item) !important;
    height: var(--rail-item) !important;
    min-height: var(--rail-item) !important;
    margin: 2px auto !important;
    padding: 0 !important;
    justify-content: center !important;
    gap: 0 !important;
    border-radius: 13px !important;
    overflow: hidden;
    transform: translateZ(0) !important;
    will-change: background, color, box-shadow;
  }
  .sidebar .nav-item:hover {
    transform: translateZ(0) scale(1.025) !important;
  }
  .sidebar .nav-item i,
  .sidebar .nav-item svg.lucide {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
  }
  .sidebar .nav-item.active {
    background: linear-gradient(135deg, rgba(21, 128, 61, .44), rgba(21, 128, 61, .18)) !important;
    box-shadow: inset 0 0 0 1px rgba(220, 252, 231, .22), 0 10px 22px -14px rgba(34, 197, 94, .55) !important;
  }
  .sidebar .nav-item.active::before {
    left: 3px !important;
    top: 8px !important;
    bottom: 8px !important;
    width: 3px !important;
  }
  .sidebar .nav-item::after {
    display: none !important;
  }

  .shell.nav-expanded .sidebar .nav-item {
    width: calc(100% - 12px) !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 2px 6px !important;
    padding: 0 13px !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    overflow: hidden;
  }
  .shell.nav-expanded .sidebar .nav-item:hover {
    transform: translateX(2px) !important;
  }
  .shell.nav-expanded .sidebar .nav-item span {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .sidebar .side-status {
    min-width: 0;
    justify-items: center;
    padding: 10px 0 0 !important;
  }
  .sidebar .side-status > div {
    display: flex;
    min-width: 0;
    justify-content: center;
  }
  .shell.nav-expanded .sidebar .side-status {
    justify-items: stretch;
    padding: 12px 8px 0 !important;
  }
  .shell.nav-expanded .sidebar .side-status > div {
    justify-content: flex-start;
    gap: 6px;
  }

  .nav-collapser {
    top: 12px !important;
    right: 6px !important;
    width: 24px !important;
    height: 24px !important;
    opacity: 0;
    transform: scale(.86);
    z-index: 5 !important;
  }
  .shell.nav-expanded .nav-collapser,
  .sidebar:hover .nav-collapser,
  .nav-collapser:focus-visible {
    opacity: 1;
    transform: scale(1);
  }
}

@media (min-width: 901px) and (max-height: 740px) {
  :root {
    --rail-item: 38px;
    --rail-w: 56px;
  }
  .sidebar {
    padding-block: 8px !important;
    gap: 7px !important;
  }
  .sidebar .nav {
    gap: 6px !important;
  }
  .sidebar .nav-item {
    margin-block: 1px !important;
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden !important;
  }
  .shell {
    display: block !important;
    overflow: visible !important;
  }
  .shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 22, .42);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--m-base) var(--e-standard);
    z-index: 109;
  }
  .shell.nav-expanded::before {
    opacity: 1;
    pointer-events: auto;
  }
  .shell .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(86vw, 320px) !important;
    height: 100dvh !important;
    padding: 14px !important;
    transform: translateX(-104%);
    transition: transform var(--m-base) var(--e-standard);
    z-index: 110 !important;
    overflow: auto !important;
    box-shadow: 34px 0 80px -42px rgba(8, 12, 22, .8);
  }
  .main,
  .content,
  .topbar {
    max-width: 100vw;
    overflow-x: hidden !important;
  }
  .shell.nav-expanded .sidebar {
    transform: translateX(0);
  }
  .sidebar .brand div:not(.brand-mark),
  .sidebar .workspace-switch,
  .sidebar .nav-title,
  .sidebar .nav-item span,
  .sidebar .side-status span:not(.status-dot),
  .sidebar #networkHint {
    width: auto !important;
    max-width: none !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .shell.nav-expanded .sidebar .brand-mark {
    display: none !important;
  }
  .sidebar .brand-wordmark {
    width: min(250px, 82vw) !important;
    height: 72px !important;
    max-width: 100% !important;
    object-fit: cover;
    object-position: left center;
  }
  .sidebar .nav {
    grid-template-columns: 1fr !important;
  }
  .sidebar .nav-item {
    width: 100% !important;
    min-height: 42px !important;
    justify-content: flex-start !important;
    padding: 9px 10px !important;
    margin: 0 !important;
  }
}
