
/* ================================================================== */
/* Menu system */
/* ================================================================== */
/* -------------------------------------- */

.menu-top {
  height:46px;
  width:100%;
  z-index:1001;
  position:fixed;
  top:0px;
  background-color:var(--bg-menu-top);
  box-shadow: 0 2px 4px -1px rgb(0 0 0 / 25%);
  transition: all 0.3s ease-out;
}

.menu-top-hide {
  top:-46px;
  transition: all 0.3s ease-out;
}

.menu-l1 ul {
  list-style:none;
  margin:0px;
  padding:0px;
}

.menu-l1 li {
  display: inline-block;
}

.menu-l1 li a {
  text-decoration: none;
}

.menu-l1 li div {
  text-decoration: none;
  color: #fff;

  height: 24px;
  padding: 11px 13px 11px 13px;
  cursor:pointer;
  font-size:1.5rem;
  transition: all 0.1s ease-out;
}

.menu-l1 li div:hover {
  background-color:var(--bg-menu-top-hover);
}

.menu-l1 .active {
  background-color:var(--bg-menu-top-active);
}

.menu-l1 { float:left; }
.menu-text-l1 {
  display:inline-block;
  font-size:1rem;
  margin-left:3px;
  vertical-align: middle;
}

.menu-tr { float:right; }

.menu-tr ul {
  list-style:none;
  margin:0;
}

.menu-tr li div {
  text-decoration: none;
  color: #fff;
  height: 24px;
  padding: 11px 13px 11px 13px;
  cursor:pointer;
  font-size:1.5rem;
  background-color:var(--bg-menu-tr);
}

.menu-tr li div:hover {
  background-color:var(--bg-menu-tr-hover);
}

.dropdown-menu svg.icon {
  fill:#000;
}
/* Dark mode: invert dropdown icon fill to light */
[data-theme="dark"] .dropdown-menu svg.icon {
  fill: currentColor;
  color: var(--si-text, #f1f5f9);
}

.htop {
  height:0px;
}


.menu-l2 {
  width:0px;
  height: 100%;
  background-color:var(--bg-l2);
  display:inline-block;
  position:fixed;
  top:46px;
  z-index:1000;
  transition: all 0.3s ease-out;
  box-shadow: 0 2px 4px 1px rgb(0 0 0 / 25%);
}

.menu-l2-inner {
  height: calc(100% - 96px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* can also be: thin */
  -ms-overflow-style: none;
}

.menu-l2-inner::-webkit-scrollbar {
  display: none;
}

.menu-title-l2 {
  text-indent: 1rem;
  padding: 1em 0 0.75em 0;
  margin: 0;
  text-transform: capitalize;
  color: var(--l2-title);
  border-bottom: 1px solid var(--l2-border);
  height:18px;
}

.menu-l2 ul {
  list-style:none;
  margin:0px;
  padding:0px;
}

.menu-l2 li {
  /*border-bottom: 1px solid var(--l2-border);*/
  overflow:hidden;  
}

.menu-l2 li a {
  text-decoration:none;
}

.menu-l2 li div {
  text-decoration: none;
  color: #ccc;
  display: block;
  padding: 0.94rem;
  cursor:pointer;
  overflow:hidden;
  white-space: nowrap;
  transition: all 0.1s ease-out;
}

.menu-l2 li div:hover {
  background-color:var(--bg-l2-hover);
}

.menu-l2 .active {
  background-color:var(--bg-l2-active);
  /* add highlight bar on the left */
    border-left: 3px solid var(--accent);
    color:#fff;
}

.menu-text-l2 {
  /*display:none;*/
}

#menu-l2-controls {
  background-color:var(--bg-l2);
  position: inherit;
  bottom: 0;
  text-decoration: none;
  color: var(--l2-text);
  display: block;
  cursor:pointer;
  overflow:hidden;
  transition: all 0.3s ease-out;
}


/* -------------------------------------- */


.ctrl-exp {
  padding: 15px 112px 15px 112px;
}

.ctrl-min {
  padding: 15px 17px 15px 17px;
}

.ctrl-hide {
  padding: 15px 0 15px 0;
  width: 0;
}

#menu-l2-controls:hover {
  background-color:var(--bg-l2-hover);
}

/* -------------------------------------- */

.menu-l3 {
  position:fixed;
  top:46px;
  left:0px;
  width:0px;
  height: calc(100% - 46px);
  background-color:var(--bg-l3);
  /*display:none;*/
  z-index:999;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: nowrap;
  scrollbar-width: none; /* can also be: thin */
  -ms-overflow-style: none;
  box-shadow: 0 2px 4px 1px rgb(0 0 0 / 25%);
  transition: all 0.3s ease-out;
}

.menu-l3::-webkit-scrollbar {
  display: none;
}

.menu-l3 ul {
  list-style:none;
  margin:0px;
  padding:0px;
}

.menu-l3 li {
  border-bottom: 1px solid var(--l3-border);
  line-height: 20px;
}

.menu-l3 li a {
  text-decoration: none;
  color: var(--l3-text);
  display: block;
  padding: 0.94em;
  transition: all 0.1s ease-out;
}

.menu-l3 li a:hover {
  background-color:var(--bg-l2-hover);
  color: var(--l3-text-hover);
}

.menu-text-l3 {}

.menu-l3 .active {
  color: var(--l3-text-active);
}

.l3-title { 
  color: var(--l3-title);
  line-height:30px;
}

/* -------------------------------------- */

@media (max-width: 576px) {
    .menu-l2 li div {
      padding: 14px 17px 14px 17px;
    }
}

/* -------------------------------------------------------------------
Gravatar icon in toolbar
--------------------------------------------------------------------*/

a.grav-container img.grav {
  max-height: 1.2em;
}
a.grav-container img.grav {
  border: 2px solid #ccc;
}
a.grav-container:hover img.grav {
  border-color: #dedede;
}
.no-gravitar a.grav-container {
  border-radius: 50%;
  background: #c5c5c5;
  width: 1.36em;
  height: 1.36em;
  line-height: 1.37em;
  border: 2px solid #ccc;
  overflow: hidden;
  margin: 0.2em;
  font-size:1.5rem;
}

.no-gravitar a.grav-container:hover {
  background: none;
}

.no-gravitar a.grav-container .icon.user {
  font-size: 1.66em;
  margin: 0 -.1em;
}

.gravitar a.grav-container {
  border-radius: 50%;
  overflow: hidden;
  padding: 6px;
  font-size:1.5rem;
  transition: all 0.1s ease-out;
}

.gravitar a.grav-container:hover {
  background: var(--bg-menu-top-hover);
}


/* Smart IoT: top-bar icon layout using SVG icons */
.menu-l1 li div {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 14px;
  font-size: 1.1rem;
  white-space: nowrap;
}
.menu-l1 li div .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.menu-text-l1 {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Smart IoT: sidebar title with logo */
.menu-title-l2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  margin: 0;
  color: var(--l2-title);
  border-bottom: 1px solid var(--l2-border);
  min-height: 56px;
  height: auto;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}

/* Smart IoT: sidebar item borders */
.menu-l2 li {
  border-bottom: 1px solid var(--l2-border);
}

/* Smart IoT: l2 sidebar item layout — flex with gap between icon and label */
.menu-l2 li div {
  color: var(--l2-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-l2 li div .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

/* Smart IoT: mobile touch targets */
@media (max-width: 576px) {
  .menu-l2 li div {
    padding: 12px 17px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  /* Mobile: content never shifts — sidebar overlays */
  .content-container {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ── Dark mode: dropdown menu ──────────────────────────────────────── */
[data-theme="dark"] .dropdown-menu {
  background-color: var(--si-surface, #1e293b);
  border-color: var(--si-border, #334155);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
[data-theme="dark"] .dropdown-menu li > a {
  color: var(--si-text, #f1f5f9) !important;
}
[data-theme="dark"] .dropdown-menu li > a:hover,
[data-theme="dark"] .dropdown-menu li > a:focus {
  background-color: var(--si-surface-2, #263147) !important;
  color: var(--si-text, #f1f5f9) !important;
}
[data-theme="dark"] .dropdown-menu .divider {
  background-color: var(--si-border, #334155) !important;
  border-bottom-color: var(--si-border, #334155) !important;
}

/* ── Dark mode: top navigation bar ────────────────────────────────── */
[data-theme="dark"] .menu-top {
  background-color: #0f172a !important;
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
[data-theme="dark"] .menu-l1 li div:hover {
  background-color: #1e293b !important;
}
[data-theme="dark"] .menu-l1 .active {
  background-color: #1e293b !important;
}
[data-theme="dark"] .menu-tr li div {
  background-color: #0f172a !important;
}
[data-theme="dark"] .menu-tr li div:hover {
  background-color: #1e293b !important;
}

/* ── Dark mode: L2 sidebar ─────────────────────────────────────────── */
[data-theme="dark"] .menu-l2 {
  background-color: #0f172a !important;
  border-right: 1px solid #1e293b;
  box-shadow: 2px 0 8px rgba(0,0,0,.4);
}
[data-theme="dark"] .menu-l2 li div {
  color: #94a3b8 !important;
}
[data-theme="dark"] .menu-l2 li div:hover {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .menu-l2 .active {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-left-color: #3b82f6 !important;
}
[data-theme="dark"] .menu-title-l2 {
  color: #475569 !important;
  border-bottom-color: #1e293b !important;
}
[data-theme="dark"] #menu-l2-controls {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
}
[data-theme="dark"] #menu-l2-controls:hover {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

/* ── Dark mode: L3 sub-panel ───────────────────────────────────────── */
[data-theme="dark"] .menu-l3 {
  background-color: #1e293b !important;
  box-shadow: 2px 0 8px rgba(0,0,0,.4);
}
[data-theme="dark"] .menu-l3 li {
  border-bottom-color: #263147 !important;
}
[data-theme="dark"] .menu-l3 li a {
  color: #94a3b8 !important;
}
[data-theme="dark"] .menu-l3 li a:hover {
  background-color: #263147 !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .menu-l3 .active > a,
[data-theme="dark"] .menu-l3 .active {
  color: #f1f5f9 !important;
  background-color: #263147 !important;
}
[data-theme="dark"] .l3-title {
  color: #475569 !important;
  border-bottom-color: #263147 !important;
}
