/* 08-sidebar-refresh.css — Sidebar refresh, the two sidebar layouts, layout picker, empty states, active menu item.
   Loaded after the files with a smaller number (later rules win). */

/* ===== Sidebar UI refresh: calm, flat, consistent ===== */
.rail { width: 60px; background: #fff; padding: .75rem 0; }
.rail-brand { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; font-size: 1rem; }
.rail-brand:hover { transform: none; }
.rail-list { margin-top: .7rem; padding-top: .7rem; gap: .3rem; }
.rail-item { width: 42px; height: 42px; border-radius: 10px; }
.rail-item .ri { width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--g, #1877f2) 12%, #fff) !important; color: var(--g, #1877f2); font-size: 1.05rem; }
.rail-item:hover { background: transparent; }
.rail-item:hover .ri { background: color-mix(in srgb, var(--g, #1877f2) 20%, #fff) !important; }
.rail-item.active { background: transparent; box-shadow: none; }
.rail-item.active .ri { background: var(--g, #1877f2) !important; color: #fff; }
.rail-item .ri.plain, .rail-item:hover .ri.plain { background: transparent !important; color: var(--muted); }
.rail-bar { left: -9px; width: 3px; }
.rail-item.active .rail-bar { height: 20px; }

.side-panel { width: 228px; padding: .9rem .7rem .6rem; background: #fff; background-image: none; }
.sp-head { gap: .6rem; margin: 0 .2rem .8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.sp-ic { width: 34px; height: 34px; border-radius: 10px; font-size: 1.05rem; background: color-mix(in srgb, var(--mod, #1877f2) 13%, #fff) !important; color: var(--mod, #1877f2); }
.sp-title small { max-width: 130px; font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); }
.sp-title h2 { font-size: 1.05rem; letter-spacing: -.01em; }
.sp-search { height: 36px; margin-bottom: .8rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.sp-search:hover { background: #fff; border-color: var(--border-strong); }
.sp-list { gap: 2px; }
.sp-item { padding: .4rem .55rem; gap: .65rem; font-size: .86rem; font-weight: 500; color: #3a3f47; border-radius: 8px; }
.sp-item .spi, .sp-item .spi.plain { width: 22px; height: 22px; background: transparent; box-shadow: none; font-size: 1rem; color: #7a828d; }
.sp-item:hover { background: #f3f5f8; }
.sp-item.active { background: color-mix(in srgb, var(--mod, #1877f2) 10%, #fff); font-weight: 600; color: var(--text); }
.sp-item.active .spi, .sp-item.active .spi.plain { color: var(--mod, #1877f2); }
.sp-label { margin: 1.1rem .55rem .35rem; font-size: .64rem; color: var(--subtle); }
.sp-card { margin: .9rem 0 0; padding: .5rem .6rem; border-radius: 8px; background: #f6faf6 !important; box-shadow: none !important; border-left: 3px solid #2ea043; }
.sp-card.bad { background: #fff5f6 !important; border-left-color: #e41e3f; }
.sp-card .sc-ic { background: transparent !important; box-shadow: none !important; color: #2ea043; width: 24px; height: 24px; font-size: 1.1rem; }
.sp-card.bad .sc-ic { color: #e41e3f; }
.sp-user { margin: auto 0 0; padding: .6rem .3rem 0; border-top: 1px solid var(--border); }
.sp-user .av { width: 30px; height: 30px; font-size: .8rem; }
.sp-item.active .spi, .sp-item.active .spi.plain, .sp-item:hover .spi { background: transparent !important; box-shadow: none !important; }

/* ===== Sidebar layouts: default = icon strip + menu panel; html[data-side="stacked"] = one column — module tabs on top, that module's pages underneath ===== */
@media (min-width: 992px) {
  html[data-side="stacked"] .side-inner { flex-direction: column; width: 244px; border-right: 1px solid var(--border); background: #fff; }
  html[data-side="stacked"] .rail, html[data-side="stacked"] .side-panel { border-right: 0; }
  html[data-side="stacked"] .rail { width: auto; flex-direction: row; align-items: center; padding: .55rem .6rem; gap: .15rem; border-bottom: 1px solid var(--border); background: #f7f9fc; }
  html[data-side="stacked"] .rail-brand { display: none; }
  html[data-side="stacked"] .rail-list, html[data-side="stacked"] .rail-bottom { flex-direction: row; width: auto; margin: 0; padding: 0; border: 0; gap: .15rem; }
  html[data-side="stacked"] .rail-bottom { margin-left: auto; }
  html[data-side="stacked"] .rail-item { width: 36px; height: 36px; }
  html[data-side="stacked"] .rail-item .ri { width: 30px; height: 30px; border-radius: 9px; font-size: .95rem; }
  html[data-side="stacked"] .rail-bar { left: 50%; top: auto; bottom: -7px; width: 0; height: 3px !important; border-radius: 3px 3px 0 0; transform: translateX(-50%); transition: width .2s; }
  html[data-side="stacked"] .rail-item.active .rail-bar { width: 18px; height: 3px; }
  html[data-side="stacked"] .rail-item::after { left: 50%; top: calc(100% + 10px); transform: translate(-50%, -4px) scale(.96); }
  html[data-side="stacked"] .rail-item:hover::after, html[data-side="stacked"] .rail-item:focus-visible::after { transform: translate(-50%, 0) scale(1); }
  html[data-side="stacked"] .side-panel { width: auto; flex: 1; min-height: 0; }

  /* hidden menu: back to a thin icon column */
  html[data-side="stacked"] .shell.side-collapsed .side-inner { width: 60px; }
  html[data-side="stacked"] .shell.side-collapsed .rail { flex-direction: column; width: 60px; height: 100%; padding: .75rem 0; border-bottom: 0; }
  html[data-side="stacked"] .shell.side-collapsed .rail-brand { display: grid; }
  html[data-side="stacked"] .shell.side-collapsed .rail-list { flex-direction: column; margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--border); width: 34px; }
  html[data-side="stacked"] .shell.side-collapsed .rail-bottom { flex-direction: column; margin: auto 0 0; }
  html[data-side="stacked"] .shell.side-collapsed .rail-item { width: 42px; height: 42px; }
  html[data-side="stacked"] .shell.side-collapsed .rail-item .ri { width: 34px; height: 34px; font-size: 1.05rem; }
  html[data-side="stacked"] .shell.side-collapsed .rail-bar { left: -9px; top: 50%; bottom: auto; width: 3px; height: 0 !important; border-radius: 0 3px 3px 0; transform: translateY(-50%); }
  html[data-side="stacked"] .shell.side-collapsed .rail-item.active .rail-bar { width: 3px; height: 20px !important; }
  html[data-side="stacked"] .shell.side-collapsed .rail-item::after { left: calc(100% + 14px); top: 50%; transform: translate(-6px, -50%) scale(.96); }
  html[data-side="stacked"] .shell.side-collapsed .rail-item:hover::after { transform: translate(0, -50%) scale(1); }
}

/* Settings: sidebar layout picker */
.side-opt { border: 0; background: none; padding: 0; text-align: left; }
.side-opt.on .tpl-body { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.side-opt.on .tpl-name .bi { opacity: 1; transform: none; }
.side-pv { position: relative; display: block; height: 78px; border: 1px solid var(--border); border-radius: 6px; background: #f4f6f9; overflow: hidden; }
.side-pv i { position: absolute; display: block; border-radius: 3px; background: #cfd6e2; }
.side-pv.stacked i.top { left: 6px; top: 6px; width: 62px; height: 8px; background: #1877f2; opacity: .75; }
.side-pv.stacked i.l1 { left: 6px; top: 22px; width: 62px; height: 7px; }
.side-pv.stacked i.l2 { left: 6px; top: 34px; width: 50px; height: 7px; }
.side-pv.stacked i.l3 { left: 6px; top: 46px; width: 56px; height: 7px; }
.side-pv.split i.rail { left: 0; top: 0; bottom: 0; width: 14px; border-radius: 0; background: #1877f2; opacity: .35; }
.side-pv.split i.l1 { left: 22px; top: 10px; width: 46px; height: 7px; }
.side-pv.split i.l2 { left: 22px; top: 22px; width: 38px; height: 7px; }
.side-pv.split i.l3 { left: 22px; top: 34px; width: 42px; height: 7px; }

/* Empty states: tidy icon + text + one inline button */
.empty-state { padding: 2.2rem 1rem 2.4rem; }
.empty-state > i { width: 56px; height: 56px; font-size: 1.5rem; margin-bottom: .7rem; }
.empty-state h6 { font-size: 1rem; margin-bottom: .2rem; }
.empty-state p { max-width: 340px; margin-left: auto; margin-right: auto; }
.empty-state .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem 1.1rem; font-size: .9rem; box-shadow: 0 8px 18px -10px rgba(24, 119, 242, .7); }
.empty-state .btn i { display: inline-block; font-size: 1rem; margin: 0 !important; width: auto; height: auto; background: none; }

/* Sidebar items: small icons, soft tinted background for the active one (no marker dot, see the last block) */
.sp-item { padding-left: .75rem; border-radius: 8px; }
.sp-item.active { background: color-mix(in srgb, var(--mod, #1877f2) 9%, #fff); }
.sp-item .spi, .sp-item .spi.plain { width: 20px; height: 20px; font-size: .98rem; }



