/* =====================================================
   Base Global — ERP Fundación Red
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
    font-family: var(--font-primary);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
}

a { text-decoration: none; color: var(--color-primary); transition: color var(--transition-fast); }
a:hover { color: var(--color-primary-dark); }
button { font-family: var(--font-primary); cursor: pointer; border: none; outline: none; transition: all var(--transition-fast); }
img { max-width: 100%; display: block; }
input, textarea, select { font-family: var(--font-primary); }

/* ─── Scrollbar personalizado ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =====================================================
   Layout Principal
   ===================================================== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── Sidebar ─── */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width var(--transition-normal);
    overflow: hidden;
    position: relative;
    z-index: 30;
}
.app-sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-logo img {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    object-fit: contain;
    filter: brightness(1.2);
}
.sidebar-logo-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--transition-normal);
}
.app-sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; overflow-x: hidden; }
.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 0.75rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--transition-normal);
}
.app-sidebar.collapsed .sidebar-section-label { opacity: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-sidebar);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 2px;
}
.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: #ffffff;
}
.nav-item.active {
    background: var(--bg-sidebar-active);
    color: #ffffff;
    font-weight: 600;
}
.nav-item.active .nav-icon { color: var(--color-primary); }
.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.nav-label {
    flex: 1;
    opacity: 1;
    transition: opacity var(--transition-normal);
}
.app-sidebar.collapsed .nav-label { opacity: 0; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.875rem 0.75rem;
}

/* ─── Header ─── */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-menu-btn {
    background: none;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}
.header-menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.header-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.625rem 0.3rem 0.3rem;
    border-radius: var(--border-radius-full);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-surface);
}
.user-chip:hover { border-color: var(--color-primary); background: var(--bg-hover); }

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-chip-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}
@media (max-width: 640px) { .user-chip-name { display: none; } }

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.page-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem;
    background-color: var(--bg-body);
}
@media (max-width: 768px) { .page-wrapper { padding: 1rem; } }

/* ─── Cards Base ─── */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.card:hover { box-shadow: var(--shadow-md); }

/* ─── Transición de rutas Vue ─── */
.fade-enter-active, .fade-leave-active { transition: opacity var(--transition-fast), transform var(--transition-fast); }
.fade-enter-from, .fade-leave-to { opacity: 0; transform: translateY(6px); }

/* ─── Formularios ─── */
.form-control {
    width: 100%;
    padding: 0.5625rem 0.875rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

/* ─── Botones base ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}
.btn-primary   { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(229,57,53,0.35); }
.btn-secondary { background: var(--bg-hover); border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border-color); }
.btn-danger    { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ─── Auth Layout ─── */
.auth-layout { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-body); }
.auth-card   { width: 100%; max-width: 400px; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .app-sidebar { position: fixed; height: 100vh; z-index: 100; transform: translateX(0); }
    .app-sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); width: var(--sidebar-width); }
}

/* ─── Submenús del Sidebar ─── */
.nav-group {
    margin-bottom: 1px;
}

.nav-group-trigger {
    justify-content: flex-start;
    cursor: pointer;
    user-select: none;
}

.nav-group-trigger.group-open {
    color: #ffffff;
    background: rgba(255,255,255,0.07);
}

.nav-chevron {
    margin-left: auto;
    font-size: 0.65rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0.5rem;
    border-left: 2px solid rgba(255,255,255,0.08);
    margin-bottom: 0;
}

.nav-submenu.open {
    max-height: 400px;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.875rem 0.5rem 1rem;
    font-size: 0.815rem;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    text-decoration: none;
    border-radius: 0 6px 6px 0;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.nav-subitem:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.06);
}

.nav-subitem.active {
    color: #ffffff;
    background: var(--bg-sidebar-active);
    font-weight: 600;
}

.nav-sub-icon {
    font-size: 0.85rem;
    width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Ocultar submenús cuando el sidebar está colapsado */
.app-sidebar.collapsed .nav-submenu { display: none; }
.app-sidebar.collapsed .nav-chevron { display: none; }
.app-sidebar.collapsed .nav-group-trigger { justify-content: center; }

/* =====================================================
   Sidebar 1 — Port de frontend-joe/es6-components
   Glassmorphism · colapsable (mobile) · acordeón interno
   ===================================================== */
.sidebar {
  --s-width:      260px;
  --s-collapsed:  72px; 
  --s-bg:         #0a0a0a;
  --s-blur:       none;
  --s-radius:     16px;
  --s-accent:     var(--color-primary, #e53935);
  --s-text:       rgba(255, 255, 255, 0.95);
  --s-border:     rgba(255, 255, 255, 0.08);
  --s-hover:      rgba(0, 0, 0, 0.1);
  --s-active:     rgba(0, 0, 0, 0.3);
  --s-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  position: fixed;
  top: 24px;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: var(--s-width);
  border-radius: var(--s-radius);
  padding: 0 16px;
  border: 1px solid var(--s-border);
  background: var(--s-bg);
  backdrop-filter: var(--s-blur);
  -webkit-backdrop-filter: var(--s-blur);
  transition: width var(--s-transition), transform var(--s-transition);
  z-index: 1000;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--s-collapsed); }

.s-header {
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0 4px 0 0;
  border-bottom: 1px solid var(--s-border);
  flex-shrink: 0;
}
.s-burger {
  width: 52px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.s-logo { height: 24px; filter: brightness(0) invert(1); }
.s-brand {
  font-size: 15px; font-weight: 600; color: #fff; margin-left: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 1; transition: opacity var(--s-transition);
}
.sidebar.collapsed .s-brand { opacity: 0; pointer-events: none; }

.s-nav-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.s-nav-container::-webkit-scrollbar { display: none; }

.s-nav {
  display: grid;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.s-nav > li { margin: 2px 0; }

.s-btn {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: center;
  height: 50px;
  width: 100%;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  padding: 0 16px;
  color: var(--s-text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.s-btn p { flex: 1 1 auto; margin: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--s-transition); }
.sidebar.collapsed .s-btn p { opacity: 0; pointer-events: none; }

.s-btn:is(.active, :hover) { background: var(--s-active); }
.s-btn:not(.active):hover { background: var(--s-hover); }

.s-btn i { font-size: 18px; width: 20px; max-width: 20px; min-width: 20px; text-align: center; transition: 0.3s; }
.s-chevron { font-size: 14px !important; margin-left: auto; transition: transform 0.3s; }
.sidebar.collapsed .s-chevron { display: none; }
.s-btn.expanded .s-chevron { transform: rotate(-180deg); }

/* Submenu Accordion */
.sub-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-in-out;
}
.sub-menu.open { grid-template-rows: 1fr; }
.sub-menu-inner { overflow: hidden; }

.sub-menu ul { list-style: none; padding: 0; margin: 0; display: grid; }
.sub-menu .s-btn { padding-left: 52px; font-size: 13px; font-weight: 400; height: 42px; }
.sub-menu .s-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.35);
  transition: background-color 0.2s;
}
.sub-menu .s-btn.active::before { background-color: var(--s-accent); }
.sub-menu .s-btn.active { font-weight: 600; color: #fff; }

/* ─── Footer ─── */
.s-footer {
  flex-shrink: 0;
  padding: 8px 0 10px;
  border-top: 1px solid var(--s-border);
}

/* Main Content adjustment */
.main-content {
  margin-left: calc(var(--s-width) + 24px + 20px);
  transition: margin-left var(--s-transition);
}
.main-content.sidebar-collapsed {
  margin-left: calc(var(--s-collapsed) + 24px + 20px);
}

/* Mobile */
.sb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 999;
  opacity: 0; visibility: hidden; pointer-events: none; transition: 0.3s;
}
.sb-overlay.show { opacity: 1; visibility: visible; pointer-events: all; }

@media (max-width: 768px) {
  .sidebar {
    top: 0; left: 0; bottom: 0; border-radius: 0 16px 16px 0;
    width: var(--s-width) !important; transform: translateX(-115%);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .s-burger { display: none; }
  .main-content, .main-content.sidebar-collapsed { margin-left: 0 !important; }
}


  --s-collapsed:   72px;
  --s-bg:         rgba(0, 0, 0, 0.35);
  --s-blur:       blur(28px);
  --s-radius:     16px;
  --s-accent:     var(--color-primary, #e53935);
  --s-muted:      rgba(255,255,255,0.45);
  --s-text:       rgba(255,255,255,0.88);
  --s-hover:      rgba(255,255,255,0.08);
  --s-active-bg:  rgba(255,255,255,0.13);
  --s-border:     rgba(255,255,255,0.08);
  --s-transition: 0.4s cubic-bezier(0.4,0,0.2,1);

  position: fixed;
  top: 24px;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: var(--s-width);
  border-radius: var(--s-radius);
  padding: 0 12px;
  background: var(--s-bg);
  backdrop-filter: var(--s-blur);
  -webkit-backdrop-filter: var(--s-blur);
  border: 1px solid var(--s-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  transition: width var(--s-transition);
  z-index: 1000;
  overflow: hidden;
}

/* Collapsed state */
.sidebar.collapsed {
  width: var(--s-collapsed);
}

/* ─── Header ─── */
.s-header {
  display: flex;
  align-items: center;
  height: 68px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--s-border);
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.s-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.s-brand {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  opacity: 1;
  transition: opacity var(--s-transition);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar.collapsed .s-brand { opacity: 0; pointer-events: none; }

/* ─── Search ─── */
.s-search {
  position: relative;
  flex-shrink: 0;
  margin: 6px 0;
}
.s-search input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 12px 8px 36px;
  color: var(--s-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.s-search input::placeholder { color: var(--s-muted); }
.s-search input:focus {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.2);
}
.s-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--s-muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: left var(--s-transition);
}
/* When collapsed: hide input text, center icon */
.sidebar.collapsed .s-search input {
  padding-left: 0;
  padding-right: 0;
  text-indent: -9999px;
  border-color: transparent;
  background: transparent;
  cursor: pointer;
}
.sidebar.collapsed .s-search-icon {
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ─── Nav section label ─── */
.s-section {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--s-muted);
  padding: 14px 4px 4px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--s-transition);
}
.sidebar.collapsed .s-section { opacity: 0; pointer-events: none; }

/* ─── Nav scroll area ─── */
.s-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.s-nav::-webkit-scrollbar { display: none; }

/* ─── Nav item ─── */
.s-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--s-muted);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
  margin: 1px 0;
  text-decoration: none;
}
.s-item:hover {
  background: var(--s-hover);
  color: var(--s-text);
}
.s-item.active {
  background: var(--s-active-bg);
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255,255,255,0.6);
  box-shadow: inset 3px 0 0 var(--s-accent), 0 0 10px rgba(229,57,53,0.3);
}
.s-item.active .s-icon { 
  color: var(--s-accent); 
  filter: drop-shadow(0 0 6px var(--s-accent));
}

.s-icon {
  font-size: 1.2rem;
  width: 22px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: color 0.2s;
}

.s-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity var(--s-transition);
}
.sidebar.collapsed .s-label { opacity: 0; pointer-events: none; }

/* ─── Sub items ─── */
.s-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px 8px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--s-muted);
  font-size: 12.5px;
  font-weight: 400;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
  margin: 1px 0;
}
.s-subitem:hover { background: var(--s-hover); color: var(--s-text); }
.s-subitem.active { color: #ffffff; font-weight: 600; }
.s-sub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.s-subitem.active .s-sub-dot { background: var(--s-accent); }
.sidebar.collapsed .s-subitem { opacity: 0; pointer-events: none; height: 0; margin: 0; padding: 0; }

/* ─── Footer ─── */
.s-footer {
  flex-shrink: 0;
  padding: 8px 0 10px;
  border-top: 1px solid var(--s-border);
}

/* ─── Toggle button ─── */
.s-toggle {
  position: absolute;
  top: 22px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.7rem;
  z-index: 10;
  transition: transform var(--s-transition), background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.s-toggle:hover { background: rgba(255,255,255,0.25); color: #fff; }
.sidebar.collapsed .s-toggle { transform: rotate(180deg); }

/* ─── Main content spacing ─── */
.main-content {
  margin-left: calc(var(--s-width) + 24px + 20px);
  transition: margin-left var(--s-transition);
}
.main-content.sidebar-collapsed {
  margin-left: calc(var(--s-collapsed) + 24px + 20px);
}

/* ─── Mobile overlay ─── */
.sb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}
.sb-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* ─── Responsive mobile ─── */
@media (max-width: 768px) {
  .sidebar {
    top: 0;
    left: 0;
    bottom: 0;
    border-radius: 0 var(--s-radius) var(--s-radius) 0;
    width: var(--s-width) !important;
    transform: translateX(-115%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .s-toggle { display: none; }
  .main-content,
  .main-content.sidebar-collapsed {
    margin-left: 0 !important;
  }
}


