/* Extraído de theme.css — Layout e Sidebar */

/* ── Layout ──────────────────────────────────────────── */
#sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  transition: transform 0.25s ease;
}

#main-wrapper {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 240px);
}

.topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-content {
  padding: 24px;
  flex: 1;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar-brand {
  padding: 20px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-brand i { color: var(--accent); font-size: 20px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  list-style: none;
  margin: 0;
  overflow-y: auto;
}

.sidebar-nav li { margin-bottom: 2px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  margin-left: 5px;
  padding: 8px 12px;
}

.sidebar-link.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-left-color: var(--accent);
  color: var(--accent-light);
  margin-left: 5px;
}

.sidebar-link i { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}

.theme-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }
.theme-toggle i { font-size: 17px; width: 20px; text-align: center; }

/* ── Mobile Sidebar ──────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}

@media (max-width: 767px) {
  #sidebar { transform: translateX(-240px); }
  #sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar-overlay.active { display: block; }
  #main-wrapper { margin-left: 0; width: 100%; }
  .page-content { padding: 16px; }
}

/* ── Sidebar group labels ────────────────────────────── */
.sidebar-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 12px 10px 4px;
  list-style: none;
  pointer-events: none;
  user-select: none;
  border-top: 0.5px solid rgba(255,255,255,0.08);
}

.sidebar-group-label:first-child {
  border-top: none;
  padding-top: 4px;
}

.sidebar-group-sep {
  border-top: 0.5px solid rgba(255,255,255,0.08);
  margin: 8px 0 4px;
  list-style: none;
}

/* ── Sidebar: brand mark ────────────────────────────────── */
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.35);
  flex-shrink: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 9.5px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Sidebar: active glow bar ───────────────────────────── */
.sidebar-link {
  /* override: remove border-left, use ::before glow bar */
  border-left: none !important;
  overflow: visible;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-light);
  box-shadow: 0 0 12px rgba(167,139,250,0.6);
}

/* Make parent li position:relative for the ::before to anchor correctly */
.sidebar-nav li { position: relative; }

/* ── Sidebar: link-label + link-meta ────────────────────── */
.link-label { flex: 1; }

.link-meta {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}

/* ── Sidebar: sync status pill ──────────────────────────── */
.sync-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--green-soft);
  border: 1px solid rgba(74,222,128,0.18);
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 6px;
  transition: opacity 0.15s;
  text-align: left;
}

.sync-pill.stale {
  background: rgba(251,191,36,0.06);
  border-color: rgba(251,191,36,0.25);
}

.sync-pill.error {
  background: var(--red-soft);
  border-color: rgba(248,113,113,0.25);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74,222,128,0.8);
  flex-shrink: 0;
}

.sync-pill.stale .sync-dot {
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(251,191,36,0.8);
}

.sync-pill.error .sync-dot {
  background: var(--red);
  box-shadow: 0 0 8px rgba(248,113,113,0.8);
}

.sync-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.sync-text strong { font-size: 11px; font-weight: 500; }

.sync-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
