:root {
  --tip-topbar-height: 64px;
  --tip-sidebar-width: 286px;
  --tip-sidebar-collapsed-width: 78px;
  --tip-sidebar-bg: #071522;
  --tip-sidebar-surface: #0c2030;
  --tip-sidebar-border: rgba(91, 183, 215, 0.18);
  --tip-sidebar-text: #dce8f3;
  --tip-sidebar-muted: #8298aa;
  --tip-sidebar-primary: #19d6c0;
  --tip-sidebar-cyan: #17bfe2;
}

body.tip-sidebar-layout {
  min-height: 100vh;
  overflow-x: hidden;
}

.tip-topbar,
.tip-sidebar,
.tip-sidebar-layout .content-wrapper,
.tip-sidebar-layout .main-footer {
  transition: margin-left 220ms ease, left 220ms ease, width 220ms ease, transform 220ms ease;
}

.tip-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1040;
  min-height: var(--tip-topbar-height);
  height: var(--tip-topbar-height);
  margin-left: 0 !important;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(4, 16, 29, 0.96) !important;
  border-bottom: 1px solid rgba(43, 154, 194, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.tip-topbar__left,
.tip-topbar__actions,
.tip-topbar__mobile-brand {
  display: flex;
  align-items: center;
}

.tip-topbar__left {
  min-width: 0;
  gap: 14px;
}

.tip-topbar__actions {
  gap: 8px;
}

.tip-topbar__mobile-brand {
  display: none;
  gap: 9px;
  color: #f1f7fb !important;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}

.tip-topbar__mobile-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.tip-topbar__mobile-brand span span,
.tip-sidebar__brand-text span {
  color: var(--tip-sidebar-primary);
}

.tip-topbar__page {
  overflow: hidden;
  color: #aabccc;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tip-icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: #b7c8d6 !important;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none !important;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

button.tip-icon-button {
  cursor: pointer;
  font: inherit;
}

.tip-icon-button:hover,
.tip-icon-button:focus-visible {
  color: #46ebd4 !important;
  background: rgba(24, 190, 208, 0.09);
  border-color: rgba(34, 211, 210, 0.25);
  outline: none;
}

.tip-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1050;
  width: var(--tip-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--tip-sidebar-text);
  background:
    radial-gradient(circle at 20% 0%, rgba(16, 164, 196, 0.12), transparent 32%),
    linear-gradient(180deg, #061521 0%, #07131f 100%);
  border-right: 1px solid var(--tip-sidebar-border);
  box-shadow: 14px 0 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.tip-sidebar__header {
  min-height: var(--tip-topbar-height);
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tip-sidebar-border);
}

.tip-sidebar__brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #f2f8fb !important;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none !important;
  white-space: nowrap;
}

.tip-sidebar__brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
}

.tip-sidebar__brand-text {
  overflow: hidden;
  opacity: 1;
  transition: opacity 140ms ease, width 220ms ease;
}

.tip-sidebar__toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #91a8ba;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.tip-sidebar__toggle:hover,
.tip-sidebar__toggle:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.tip-sidebar__body {
  flex: 1;
  padding: 18px 14px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tip-sidebar__section-label {
  margin: 20px 12px 8px;
  color: var(--tip-sidebar-muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tip-sidebar__section-label:first-child {
  margin-top: 4px;
}

.tip-sidebar__nav {
  display: grid;
  gap: 4px;
}

.tip-sidebar__link {
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #b8cad8 !important;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.tip-sidebar__link i {
  width: 22px;
  flex: 0 0 22px;
  color: #86a7bd;
  font-size: 1rem;
  text-align: center;
  transition: color 150ms ease;
}

.tip-sidebar__link span {
  overflow: hidden;
  opacity: 1;
  transition: opacity 140ms ease;
}

.tip-sidebar__link:hover,
.tip-sidebar__link:focus-visible {
  color: #eefaff !important;
  background: rgba(18, 128, 164, 0.12);
  border-color: rgba(61, 184, 214, 0.12);
  outline: none;
}

.tip-sidebar__link:hover i,
.tip-sidebar__link:focus-visible i {
  color: var(--tip-sidebar-cyan);
}

.tip-sidebar__link.active {
  color: #f4ffff !important;
  background: linear-gradient(90deg, rgba(16, 196, 203, 0.18), rgba(13, 117, 165, 0.10));
  border-color: rgba(42, 215, 213, 0.24);
  box-shadow: inset 3px 0 0 var(--tip-sidebar-primary);
}

.tip-sidebar__link.active i {
  color: #40e5d1;
}

.tip-sidebar__footer {
  padding: 17px 20px 20px;
  color: #7790a4;
  background: rgba(3, 13, 22, 0.56);
  border-top: 1px solid var(--tip-sidebar-border);
  overflow: hidden;
  white-space: nowrap;
}

.tip-sidebar__status {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b7cad6;
  font-size: 0.84rem;
}

.tip-sidebar__status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: #32d583;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(50, 213, 131, 0.55);
}

.tip-sidebar-overlay {
  display: none;
}

/* Neutralize the space reserved by the native AdminLTE sidebar. */
body.tip-sidebar-layout .main-header,
body.tip-sidebar-layout .content-wrapper,
body.tip-sidebar-layout .main-footer,
body.tip-sidebar-layout.sidebar-collapse .main-header,
body.tip-sidebar-layout.sidebar-collapse .content-wrapper,
body.tip-sidebar-layout.sidebar-collapse .main-footer,
body.tip-sidebar-layout.sidebar-mini .main-header,
body.tip-sidebar-layout.sidebar-mini .content-wrapper,
body.tip-sidebar-layout.sidebar-mini .main-footer {
  margin-left: 0 !important;
}

.tip-sidebar-layout .content-wrapper {
  width: auto !important;
  min-height: calc(100vh - var(--tip-topbar-height));
  padding-top: var(--tip-topbar-height);
}

.tip-global-footer {
  background: #061421 !important;
  border-top-color: rgba(63, 145, 181, 0.18) !important;
}

/* Desktop expanded state. */
@media (min-width: 992px) {
  body.tip-sidebar-expanded .tip-sidebar {
    width: var(--tip-sidebar-width);
  }

  body.tip-sidebar-expanded .tip-topbar,
  body.tip-sidebar-expanded .content-wrapper,
  body.tip-sidebar-expanded .main-footer {
    margin-left: var(--tip-sidebar-width) !important;
  }

  /* Desktop collapsed state: icons remain visible. */
  body.tip-sidebar-collapsed .tip-sidebar {
    width: var(--tip-sidebar-collapsed-width);
  }

  body.tip-sidebar-collapsed .tip-topbar,
  body.tip-sidebar-collapsed .content-wrapper,
  body.tip-sidebar-collapsed .main-footer {
    margin-left: var(--tip-sidebar-collapsed-width) !important;
  }

  body.tip-sidebar-collapsed .tip-sidebar__header {
    padding: 0;
    justify-content: center;
  }

  body.tip-sidebar-collapsed .tip-sidebar__brand {
    justify-content: center;
  }

  body.tip-sidebar-collapsed .tip-sidebar__brand img {
    width: 38px;
    height: 38px;
  }

  body.tip-sidebar-collapsed .tip-sidebar__brand-text,
  body.tip-sidebar-collapsed .tip-sidebar__section-label,
  body.tip-sidebar-collapsed .tip-sidebar__link span,
  body.tip-sidebar-collapsed .tip-sidebar__footer-text,
  body.tip-sidebar-collapsed .tip-sidebar__toggle {
    display: none;
  }

  body.tip-sidebar-collapsed .tip-sidebar__body {
    padding: 14px 9px 20px;
  }

  body.tip-sidebar-collapsed .tip-sidebar__nav {
    gap: 8px;
  }

  body.tip-sidebar-collapsed .tip-sidebar__link {
    width: 56px;
    min-height: 52px;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  body.tip-sidebar-collapsed .tip-sidebar__link i {
    width: auto;
    flex: 0 0 auto;
    font-size: 1.08rem;
  }

  body.tip-sidebar-collapsed .tip-sidebar__link.active {
    box-shadow: inset 3px 0 0 var(--tip-sidebar-primary);
  }

  body.tip-sidebar-collapsed .tip-sidebar__footer {
    padding: 18px 0;
    display: flex;
    justify-content: center;
  }

  body.tip-sidebar-collapsed .tip-sidebar__status {
    margin: 0;
  }

  body.tip-sidebar-collapsed .tip-topbar__page {
    margin-left: 2px;
  }
}

/* Tablet and mobile: off-canvas sidebar. */
@media (max-width: 991.98px) {
  body.tip-sidebar-mobile-open {
    overflow: hidden;
  }

  .tip-sidebar {
    z-index: 1060;
    width: min(var(--tip-sidebar-width), calc(100vw - 32px));
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.38);
    transform: translateX(-104%);
    visibility: hidden;
  }

  body.tip-sidebar-mobile-open .tip-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .tip-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
    background: rgba(1, 8, 15, 0.68);
    border: 0;
    opacity: 0;
    visibility: hidden;
    cursor: default;
    backdrop-filter: blur(3px);
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.tip-sidebar-mobile-open .tip-sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }

  .tip-topbar,
  .tip-sidebar-layout .content-wrapper,
  .tip-sidebar-layout .main-footer {
    margin-left: 0 !important;
  }

  .tip-topbar__mobile-brand {
    display: flex;
  }

  .tip-topbar__page {
    display: none;
  }

  .tip-sidebar__toggle i {
    font-size: 1.05rem;
  }
}

@media (max-width: 575.98px) {
  .tip-topbar {
    padding: 0 12px;
  }

  .tip-topbar__left {
    gap: 8px;
  }

  .tip-topbar__actions {
    gap: 2px;
  }

  .tip-topbar__mobile-brand > span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tip-topbar,
  .tip-sidebar,
  .tip-sidebar-layout .content-wrapper,
  .tip-sidebar-layout .main-footer,
  .tip-sidebar-overlay,
  .tip-icon-button,
  .tip-sidebar__link,
  .tip-sidebar__brand-text,
  .tip-sidebar__link span {
    transition: none !important;
  }
}

@media (max-width: 767.98px) {
    .brand-link,
    .navbar-brand {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}
