/**
 * Backoffice shell layout (header, top nav, side nav, content offsets).
 * Source of truth for layout CSS — edit this file, not src/assets/less.
 * Loaded from public/index.html so production always has layout styles
 * even if theme CSS (/css/light-theme.css) fails to load.
 * 28-05-2026: Created from compiled theme layout rules.
 */

/* Logo */
.logo {
  width: 130px;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background-color: transparent;
  transition: all 0.2s ease;
}

.logo img {
  height: 30px;
  width: auto;
  object-fit: contain;
  max-width: 100%;
}

/* App header */
.app-header {
  position: fixed;
  width: 100%;
  left: 0;
  z-index: 1000;
  display: flex;
  box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.15);
}

.app-header .app-header-wrapper {
  display: flex;
  width: 100%;
}

.app-header .app-header-wrapper.layout-top-nav {
  width: 100%;
}

.app-header .nav-icon {
  font-size: 1.25rem;
}

.app-header.ant-layout-header {
  height: 48px;
  line-height: 48px;
  padding: 0;
  background-color: #fff;
}

.app-header .nav {
  display: flex;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
}

.app-header .nav-right {
  margin-left: auto;
  padding: 0 1rem;
  display: flex;
  flex-grow: 3;
  justify-content: flex-end;
}

.app-header .nav-left {
  display: flex;
  flex-grow: 5;
  align-items: center;
}

.app-header .nav-left .ant-menu .ant-menu-item,
.app-header .nav-right .ant-menu .ant-menu-item {
  padding: 0 1rem;
  margin: 0;
  line-height: 48px;
}

/* Top navigation bar */
.top-nav {
  height: 45px;
  background-color: #001529;
  position: fixed;
  top: 48px;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 0.75rem 1.5rem rgba(18, 38, 63, 0.03);
  transition: background-color 0.25s ease;
}

.top-nav .top-nav-wrapper .ant-menu-horizontal {
  line-height: 45px;
  border-bottom: 0;
}

.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal {
  background: transparent;
  display: flex;
  align-items: center;
  height: 45px;
  line-height: 1;
}

.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item {
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  padding: 0 14px;
  height: 45px;
  line-height: 1 !important;
  font-size: 13px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item.ant-menu-item-selected {
  background-color: rgba(0, 0, 0, 0.12) !important;
}

.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item .anticon,
.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item .ant-menu-item-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  min-width: 14px;
  font-size: 14px;
  margin: 0 !important;
  vertical-align: middle;
}

.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item .anticon + span,
.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item .ant-menu-title-content {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  margin-left: 8px !important;
  opacity: 1 !important;
}

/* Side navigation */
.side-nav {
  height: calc(100vh - 48px);
  position: fixed;
  top: 48px;
  box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.15);
  z-index: 999;
  direction: ltr;
  background-color: #fff;
}

@media print {
  .side-nav {
    display: none;
  }
}

.side-nav.side-nav-dark {
  background-color: #283142;
}

.side-nav.side-nav-under-top-nav {
  top: 93px;
  height: calc(100vh - 48px - 45px);
}

.side-nav .ant-layout-sider-children {
  height: 100%;
}

.side-nav .side-nav-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.side-nav .side-nav-collapse-trigger {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.side-nav .side-nav-collapse-btn {
  color: rgba(0, 0, 0, 0.65);
}

.side-nav .side-nav-collapse-btn:hover,
.side-nav .side-nav-collapse-btn:focus {
  color: #3e79f7;
  background-color: rgba(0, 0, 0, 0.04);
}

.side-nav.side-nav-collapsed .side-nav-collapse-trigger {
  justify-content: center;
  padding: 4px 0;
}

.side-nav.side-nav-collapsed .ant-menu-inline-collapsed {
  width: 100%;
}

.side-nav.side-nav-collapsed .ant-menu-inline-collapsed > .ant-menu-item,
.side-nav.side-nav-collapsed .ant-menu-inline-collapsed > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-item,
.side-nav.side-nav-collapsed .ant-menu-inline-collapsed > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-submenu > .ant-menu-submenu-title,
.side-nav.side-nav-collapsed .ant-menu-inline-collapsed > .ant-menu-submenu > .ant-menu-submenu-title {
  height: 40px !important;
  line-height: 40px !important;
  margin: 4px 0 !important;
  padding: 0 calc(50% - 8px) !important;
  text-align: center;
}

.side-nav.side-nav-collapsed .ant-menu-inline-collapsed .ant-menu-item .anticon,
.side-nav.side-nav-collapsed .ant-menu-inline-collapsed .ant-menu-submenu-title .anticon {
  margin: 0 !important;
  line-height: 40px !important;
  font-size: 16px;
}

.side-nav.side-nav-dark .side-nav-collapse-trigger {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.side-nav.side-nav-dark .side-nav-collapse-btn {
  color: rgba(255, 255, 255, 0.75);
}

.side-nav.side-nav-dark .side-nav-collapse-btn:hover,
.side-nav.side-nav-dark .side-nav-collapse-btn:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.side-nav .side-nav-menu-scroll {
  flex: 1;
  min-height: 0;
}

.side-nav .hide-group-title .ant-menu-item-group-title {
  display: none;
}

/* Main content area */
.app-layout {
  transition: all 0.3s ease;
}

.app-content {
  padding: 15px;
  margin-top: 48px;
  min-height: calc(100vh - 108px);
  position: relative;
}

.app-content .app-breadcrumb {
  margin-bottom: 15px;
}

.app-content.layout-top-nav {
  width: 100%;
}

@media only screen and (min-width: 992px) {
  .app-content.layout-top-nav {
    margin-top: 93px;
    min-height: calc(100vh - 108px - 45px);
  }
}

@media only screen and (max-width: 768px) {
  .app-content {
    padding: 15px;
  }
}

@media print {
  .app-content {
    padding: 0;
    margin-top: 0;
  }

  .app-layout {
    padding-left: 0 !important;
  }
}

/* Keep full-width shell in top-nav mode (avoid boxed 1400px wrappers) */
.app-header .app-header-wrapper.layout-top-nav .nav {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.app-content.layout-top-nav,
.app-content.layout-top-nav > * {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Hard overrides for stale production theme cache (70px/55px old shell) */
header.ant-layout-header.app-header {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  line-height: 48px !important;
}

div.top-nav,
div.top-nav.light,
div.top-nav.dark {
  top: 48px !important;
  height: 45px !important;
  min-height: 45px !important;
  max-height: 45px !important;
}

div.top-nav .top-nav-wrapper .ant-menu-horizontal {
  line-height: 45px !important;
}

div.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal,
div.top-nav .top-nav-wrapper .top-nav-root-menu.ant-menu-horizontal > .top-nav-root-item.ant-menu-item {
  height: 45px !important;
  line-height: 45px !important;
}

section.ant-layout .app-content.layout-top-nav {
  margin-top: 93px !important;
  width: 100% !important;
  max-width: none !important;
}
