.home-portal-wrap {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  min-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.home-portal-page .container,
body.home-portal-page .container-fluid,
body.home-portal-page .row,
body.home-portal-page .home-portal-unbound {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Top Superset navbar (Home, Dashboards, Charts, etc.) */
.app #app-menu,
#app-menu {
  background: #1f2733 !important;
}

.app #app-menu > div,
#app-menu > div,
#app-menu [role="navigation"] {
  background: #1f2733 !important;
  border-color: #10151d !important;
}

#app-menu .container-fluid,
#app-menu .navbar-header,
#app-menu .navbar-collapse,
#app-menu .navbar-nav,
#app-menu ul,
#app-menu li,
#app-menu [role="menu"],
#app-menu [role="menubar"] {
  background: #1f2733 !important;
  border-color: #10151d !important;
}

.app #app-menu a,
.app #app-menu button,
#app-menu a,
#app-menu button {
  color: #c8ced6 !important;
}

#app-menu .navbar-nav > li > a,
#app-menu .dropdown-toggle,
#app-menu .navbar-brand,
#app-menu [role="menuitem"] {
  color: #c8ced6 !important;
}

/* React/Ant top nav */
#app-menu .ant-layout-header,
#app-menu .ant-menu,
#app-menu .ant-menu-overflow,
#app-menu .ant-menu-horizontal,
#app-menu .ant-menu-submenu-popup,
#app-menu .ant-menu-sub,
#app-menu .ant-menu-item,
#app-menu .ant-menu-submenu-title,
#app-menu .ant-menu-title-content {
  background: #1f2733 !important;
  color: #c8ced6 !important;
}

#app-menu .ant-menu-item-selected,
#app-menu .ant-menu-submenu-selected,
#app-menu .ant-menu-item-active,
#app-menu .ant-menu-submenu-active {
  background: transparent !important;
  color: #ffffff !important;
}

#app-menu .ant-menu-submenu-arrow,
#app-menu .anticon {
  color: #c8ced6 !important;
}

#app-menu .top-nav-icon {
  display: inline-block;
  margin-right: 7px;
  font-size: 13px;
  opacity: 0.95;
}

.app #app-menu a:hover,
.app #app-menu a:focus,
.app #app-menu button:hover,
.app #app-menu button:focus,
#app-menu a:hover,
#app-menu a:focus,
#app-menu button:hover,
#app-menu button:focus {
  color: #ffffff !important;
}

.navbar,
.navbar-default {
  background: #1f2733 !important;
  border-color: #10151d !important;
}

.navbar .navbar-brand,
.navbar .navbar-nav > li > a,
.navbar .dropdown-toggle,
.navbar-default .navbar-brand,
.navbar-default .navbar-nav > li > a {
  color: #c8ced6 !important;
}

.navbar .navbar-nav > li > a:hover,
.navbar .navbar-nav > li > a:focus,
.navbar .open > a,
.navbar .open > a:hover,
.navbar .open > a:focus,
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: #ffffff !important;
  background: transparent !important;
}

.home-secondary-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  background: #1f2733;
  border-bottom: 1px solid #10151d;
  position: relative;
  z-index: 80;
}

.home-nav-search-wrap {
  margin-left: auto;
  min-width: 260px;
  max-width: 340px;
  width: 28%;
}

.home-nav-search-input {
  width: 100%;
  height: 34px;
  border: 1px solid #46546a;
  border-radius: 7px;
  background: #111a27;
  color: #f1f5f9;
  padding: 0 10px;
}

.home-nav-search-input::placeholder {
  color: #a4b2c7;
}

.home-nav-search-input:focus {
  outline: 0;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.22);
}

.home-nav-search-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.home-dropdown {
  position: relative;
}

.home-secondary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c8ced6;
  padding: 8px 6px;
  border-radius: 4px;
  text-decoration: none;
  border: 0;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
}

.home-dropdown.active .home-secondary-item,
.home-secondary-item:hover {
  background: transparent;
  color: #ffffff;
}

.home-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  z-index: 2000;
  background: #f4f5f7;
  border: 1px solid #c3cad6;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
  padding: 10px 0;
}

.home-root-dropdown::after {
  /* Bridge hover gap between root trigger and dropdown panel */
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 10px;
}

.home-dropdown:hover .home-dropdown-menu,
.home-dropdown:focus-within .home-dropdown-menu {
  display: block;
}

.home-dropdown-item {
  display: block;
  color: #2a313d;
  text-decoration: none;
  border-radius: 0;
  padding: 8px 18px;
  font-size: 17px;
  white-space: nowrap;
}

.home-dropdown-item:hover,
.home-dropdown-item.active {
  background: #e2e8f2;
  color: #111827;
}

.home-dropdown-list,
.home-flyout-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-dropdown-li {
  position: relative;
}

.home-next {
  color: #687487;
  font-size: 18px;
}

.home-flyout-menu {
  display: none;
  position: absolute;
  top: -8px;
  left: calc(100% - 2px);
  min-width: 280px;
  background: #f4f5f7;
  border: 1px solid #c3cad6;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  padding: 8px 0;
  z-index: 2100;
}

.home-dropdown-li.has-children::after {
  /* Bridge hover gap between menu item and flyout submenu */
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  width: 12px;
  height: 100%;
}

.home-dropdown-li:hover > .home-flyout-menu,
.home-dropdown-li:focus-within > .home-flyout-menu {
  display: block;
}

.home-caret {
  font-size: 12px;
  line-height: 1;
  margin-top: 1px;
}

.home-dropdown-direct-link {
  display: none;
}

.home-main-section {
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  background: #fff;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
}

.home-dashboard-sidebar {
  border-right: 1px solid #dbe4f2;
  background: #f8fbff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-sidebar-title {
  margin: 0;
  padding: 14px 14px 10px;
  font-size: 16px;
  color: #1f3b5b;
  border-bottom: 1px solid #e4ebf5;
}

.home-dashboard-list {
  padding: 10px;
  overflow-y: auto;
  min-height: 0;
  max-height: calc(100vh - 220px);
}

.home-empty-inline {
  border: 1px dashed #c8d3e4;
  border-radius: 8px;
  color: #64748b;
  text-align: center;
  padding: 10px 8px;
}

.home-dashboard-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border: 1px solid #b8c6db;
  background: #fff;
  color: #1f3b5b;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

.home-dashboard-link-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.home-provider-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

.home-provider-icon::before {
  content: "?";
}

.home-provider-icon.provider-looker_studio {
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='13.4' cy='17' r='6.2' fill='none' stroke='%234a84e8' stroke-width='3.2'/%3E%3Ccircle cx='8.7' cy='8.1' r='2.6' fill='none' stroke='%23ea4335' stroke-width='2.2' stroke-dasharray='12 6'/%3E%3Cpath d='M10.9 6.4a2.7 2.7 0 0 1 0 3.4' fill='none' stroke='%23fbbc04' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='14.2' cy='3.3' r='1.8' fill='none' stroke='%2334a853' stroke-width='1.9'/%3E%3Cpath d='M12.8 11.4L9.8 4.9M11.2 6.1L13.1 4.2' stroke='%23000' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E");
  width: 24px;
  height: 24px;
  border-radius: 0;
}

.home-provider-icon.provider-looker_studio::before {
  content: "";
}

.home-provider-icon.provider-looker_studio::after {
  content: none;
}

.home-provider-icon.provider-power_bi {
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='1' y='11' width='9' height='12' rx='2' fill='%23ecd974'/%3E%3Crect x='7.8' y='7' width='9' height='16' rx='2' fill='%23edc324'/%3E%3Crect x='14.5' y='3' width='8.5' height='20' rx='2' fill='%23d89a0f'/%3E%3C/svg%3E");
}

.home-provider-icon.provider-power_bi::before {
  content: "";
}

.home-provider-icon.provider-canva {
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%2300c4cc'/%3E%3Cstop offset='100%25' stop-color='%237d2ae8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='12' cy='12' r='12' fill='url(%23g)'/%3E%3Ctext x='12' y='15' text-anchor='middle' font-family='Georgia, Times New Roman, serif' font-size='15' font-style='italic' fill='%23ffffff'%3EC%3C/text%3E%3C/svg%3E");
}

.home-provider-icon.provider-canva::before {
  content: "";
}

.home-provider-icon.provider-spreadsheet {
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%2327ae60'/%3E%3Cstop offset='100%25' stop-color='%23199f58'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='2' y='1.2' width='20' height='21.6' rx='2.2' fill='url(%23g)'/%3E%3Cpath d='M16 1.2h3.8L22 3.5V7h-4a2 2 0 0 1-2-2z' fill='%239fd7bb'/%3E%3Crect x='7.2' y='9.2' width='9.6' height='7.6' fill='%23ffffff' opacity='0.92'/%3E%3Cpath d='M10.4 9.2v7.6M13.6 9.2v7.6M7.2 12h9.6M7.2 14.8h9.6' stroke='%2327ae60' stroke-width='0.9'/%3E%3C/svg%3E");
}

.home-provider-icon.provider-spreadsheet::before {
  content: "";
}

.home-dashboard-link:hover {
  border-color: #7f9bc2;
}

.home-dashboard-link.active {
  background: #1f3b5b;
  color: #fff;
  border-color: #1f3b5b;
}

.home-main-viewer {
  position: relative;
  min-height: 0;
  width: 100%;
  background: #fff;
  overflow: hidden;
}

.home-main-frame-scroll {
  height: auto;
  width: 100%;
  overflow: hidden;
}

.home-main-frame {
  width: 100%;
  height: auto;
  border: 0;
  min-height: calc(100vh - 140px);
  display: block;
}

.home-content-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding: 10px 10px 12px;
  margin: 0;
  overflow-x: hidden;
  overflow-y: visible;
}

.home-empty {
  padding: 24px;
  text-align: center;
  border: 1px dashed #c8d3e4;
  border-radius: 8px;
  color: #64748b;
}

.home-manage-wrap {
  margin-top: 20px;
}

.home-manage-page {
  --manage-purple: #6f4de6;
  --manage-purple-deep: #5535c8;
  --manage-purple-soft: #f1ecff;
  --manage-border: #ddd6fe;
  overflow-x: hidden;
}

.home-manage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-btn-primary,
.home-manage-page .btn.btn-primary {
  background: var(--manage-purple);
  border-color: var(--manage-purple);
}

.home-btn-primary:hover,
.home-manage-page .btn.btn-primary:hover {
  background: var(--manage-purple-deep);
  border-color: var(--manage-purple-deep);
}

.home-create-panel {
  border: 1px solid var(--manage-border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
}

.home-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-create-actions,
.home-main-actions,
.home-assign-actions {
  margin-top: 10px;
}

.home-manage-grid-v2 {
  display: grid;
  grid-template-columns: 32% 1fr;
  gap: 14px;
  align-items: stretch;
}

.home-panel {
  border: 1px solid var(--manage-border);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.home-panel-main {
  display: flex;
  flex-direction: column;
}

.home-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-pill {
  background: var(--manage-purple-soft);
  color: var(--manage-purple);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.home-panel-structure {
  min-height: 0;
}

.home-structure-layout {
  margin-top: 10px;
  border: 1px solid var(--manage-border);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 42% 1fr;
  height: min(72vh, 860px);
  max-height: calc(100vh - 220px);
  min-height: 560px;
  overflow: hidden;
}

.home-structure-tree {
  border-right: 1px solid var(--manage-border);
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.menu-node-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  min-width: 0;
}

.menu-node-row.active {
  background: var(--manage-purple-soft);
  border-color: #c4b5fd;
}

.menu-node-select {
  border: 0;
  background: transparent;
  padding: 6px 4px;
  width: 100%;
  text-align: left;
  color: #1f2937;
  font-weight: 600;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.menu-node-meta {
  color: #a78bfa;
  padding-right: 8px;
}

.menu-node-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.menu-node-actions .btn {
  min-width: 28px;
  height: 26px;
  padding: 2px 7px;
  font-size: 14px;
  line-height: 1;
  border: 1px solid var(--manage-border, #ddd6fe);
  background: var(--manage-purple-soft, #f1ecff);
  color: var(--manage-purple, #6f4de6);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.menu-node-actions .btn:hover:not(:disabled) {
  background: var(--manage-purple, #6f4de6);
  color: #fff;
  border-color: var(--manage-purple, #6f4de6);
}

.menu-node-actions .btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.home-structure-editor {
  padding: 12px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.home-editor-kicker {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.home-editor-header h3 {
  margin: 6px 0 2px;
}

.home-menu-edit {
  margin-top: 10px;
}

.home-menu-edit-flags {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.home-edit-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.home-assignment-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-assignment-title {
  margin: 2px 0 6px;
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.home-pick-row {
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.home-pick-row span {
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.home-pick-row .btn {
  flex: 0 0 auto;
}

.home-main-item {
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

.home-main-item input {
  accent-color: var(--manage-purple);
}

.home-main-third-party-block {
  margin-top: 10px;
}

.inline-row {
  display: flex;
  gap: 8px;
}

.home-checklist {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.home-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-weight: 500;
}

.home-checklist-item:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .home-portal-wrap {
    height: auto;
    min-height: calc(100vh - 58px);
    overflow: visible;
  }

  .home-content-wrap {
    overflow: visible;
  }

  .home-main-section {
    grid-template-columns: 1fr;
    height: auto;
  }

  .home-dashboard-sidebar {
    border-right: 0;
    border-bottom: 1px solid #dbe4f2;
  }

  .home-dashboard-list {
    max-height: 220px;
  }

  .home-secondary-item {
    font-size: 16px;
  }

  .home-nav-search-wrap {
    margin-left: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
    order: 999;
  }

  .home-dropdown-menu {
    position: static;
    display: block;
    min-width: 0;
    box-shadow: none;
    margin-top: 4px;
  }

  .home-flyout-menu {
    position: static;
    display: block;
    box-shadow: none;
    border: 0;
    padding-left: 14px;
  }

  .home-create-grid,
  .home-manage-grid-v2,
  .home-structure-layout,
  .home-assignment-cols {
    grid-template-columns: 1fr;
  }

  .home-structure-layout {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .home-main-viewer {
    height: 68vh;
    min-height: 360px;
  }
}
