/* DoorBase-format side menu (SidebarModern.js), SM8 colours. Tiles style only: the sidebar gets
   class "menu-db". Drop-down style keeps the old row menu from the page's own CSS (rollback).
   Navy is the portal UI navy used by the top bar (#002070). */
:root { --tile-bg: #fff; --tile-bg-hover: linear-gradient(180deg,#dbeafe 0%,#bfdbfe 100%); --tile-edge: #000; --tile-shadow: 0 1px 2px rgba(0,0,0,.08); --tile-box: #d1d5db; --tile-selected: #002070; }
.sidebar.menu-db { width: 224px; padding: 0; display: flex; flex-direction: column; background: #fff; border-right: 1px solid #e0e0e0; flex-shrink: 0; position: sticky; top: 0; align-self: flex-start; height: calc(100vh - 95px); min-height: 480px; }
.menu-db .nav-body { flex: 1; padding: 12px; overflow-y: auto; }
.menu-db .nav-item { border: 2px solid #000; border-left: 2px solid #000; border-radius: 8px; color: #002070; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; font-weight: 500; }
.menu-db .nav-item:not(.active) { background: var(--tile-bg); box-shadow: var(--tile-shadow); }
.menu-db .nav-item:not(.active):hover, .menu-db .nav-item:not(.active):active, .menu-db .nav-item:not(.active):focus-visible { background: var(--tile-bg-hover); box-shadow: 0 0 0 1px var(--tile-edge); color: #002070; }
.menu-db .nav-item.active, .menu-db .nav-item.active:hover { background: #002070; box-shadow: 0 0 0 1px #002070; color: #fff; font-weight: 600; }
.menu-db .nav-item:focus-visible { outline: 2px solid #002070; outline-offset: 2px; }
.menu-db .nav-label { color: #374151; }
.menu-db .nav-item.active .nav-label { color: #fff; }
.tile-ico { display:block; width:48px; height:48px; object-fit:contain; }
/* Dashboard, Jobs: big pinned buttons */
.menu-db .nav-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 16px 0; margin-bottom: 8px; width: 100%; }
.menu-db .nav-big .icon { font-size: 30px; width: auto; line-height: 1; margin-bottom: 4px; }
.menu-db .nav-big .tile-ico,.menu-db .nav-open-title .tile-ico { width:48px; height:48px; }
.menu-db .nav-big .nav-label { font-size: 14px; }
/* 2-column grid, every cell the same height */
.menu-db .nav-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 82px; gap: 8px; margin-top: 4px; }
.menu-db .nav-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 8px 6px; text-align: center; }
.menu-db .nav-cell .icon { font-size: 24px; width: auto; line-height: 1; margin-bottom: 6px; }
.menu-db .nav-cell .tile-ico { width:36px; height:36px; }
.menu-db .nav-cell .nav-label { font-size: 11px; line-height: 1.25; }
.menu-db .nav-grid > .nav-cell:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc((100% - 8px) / 2); box-sizing: border-box; }
.menu-db .nav-open-title { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 0; margin-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.menu-db .nav-open-title .icon { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.menu-db .nav-open-title .nav-label { font-size: 14px; font-weight: 600; color: #002070; }
.menu-db .nav-back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 12px 0; margin-top: 16px; width: 100%; }
.menu-db .nav-back .icon { font-size: 24px; width: auto; line-height: 1; margin-bottom: 4px; }
.menu-db .nav-back .nav-label { font-size: 12px; }
/* Admin, alone at the bottom */
.menu-db .nav-admin { flex-shrink: 0; border-top: 1px solid #e5e7eb; padding: 8px 12px; }
.menu-db .nav-admin-btn { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; }
.menu-db .nav-admin-btn .icon { font-size: 20px; width: auto; }
.menu-db .nav-admin-btn .tile-ico { width:28px; height:28px; }
.menu-db .nav-admin-btn .nav-label { font-size: 14px; font-weight: 600; }
/* User footer */
.menu-db .nav-user { flex-shrink: 0; border-top: 1px solid #e5e7eb; background: #f9fafb; padding: 12px; display: flex; align-items: center; gap: 12px; }
.menu-db .nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: #002070; color: #fff; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.menu-db .nav-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-db .nav-user-text b { font-size: 14px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-db .nav-user-text small { font-size: 10px; color: #6b7280; }
.menu-db .nav-version { font-size: 9px; color: #9ca3af; white-space: nowrap; }

/* Mobile: one scrolling strip of icon-over-label buttons, Admin pinned at the right edge. */
@media (max-width: 768px) {
  .layout:has(> .sidebar.menu-db) { flex-direction: column; }
  .sidebar.menu-db { width: 100%; height: auto; min-height: 0; position: static; flex-direction: row; align-items: stretch; border-right: 0; border-bottom: 1px solid #e0e0e0; padding: 6px 8px; overflow: visible; max-height: none; }
  .menu-db .nav-body { display: flex; gap: 4px; padding: 0; overflow-x: auto; overflow-y: hidden; flex: 1; min-width: 0; }
  .menu-db .nav-grid { display: contents; }
  .menu-db .nav-open-title, .menu-db .nav-user { display: none; }
  .menu-db .nav-big, .menu-db .nav-cell, .menu-db .nav-back, .menu-db .nav-admin-btn { flex: 0 0 84px; width: 84px; height: 66px; margin: 0; padding: 6px 4px; flex-direction: column; align-items: center; justify-content: center; gap: 0; white-space: normal; border-bottom: 0; }
  .menu-db .nav-grid > .nav-cell:last-child:nth-child(odd) { width: 84px; }
  .menu-db .nav-big .icon, .menu-db .nav-cell .icon, .menu-db .nav-back .icon, .menu-db .nav-admin-btn .icon { font-size: 22px; margin-bottom: 4px; }
  .menu-db .nav-big .tile-ico, .menu-db .nav-cell .tile-ico, .menu-db .nav-back .tile-ico, .menu-db .nav-admin-btn .tile-ico { width:28px; height:28px; }
  .menu-db .nav-big .nav-label, .menu-db .nav-cell .nav-label, .menu-db .nav-back .nav-label, .menu-db .nav-admin-btn .nav-label { font-size: 11px; font-weight: 500; line-height: 1.2; text-align: center; }
  .menu-db .nav-back { order: -1; }
  .menu-db .nav-admin { border-top: 0; border-left: 1px solid #e5e7eb; padding: 0 0 0 6px; margin-left: 4px; display: flex; }
  .menu-db .nav-item.active { border-bottom: 0; }
}
