:root {
  --ds-midnight: #303650;
  --ds-offwhite: #F6F7FB;
  --ds-steel: #4A5277;
  --ds-bronze: #F9B17A;
  --ds-silver: #E8F0FD;
  --ds-white: #FFFFFF;
  --ds-danger: #EB6170;
  --ds-success: #28A678;

  --ds-shadow-soft: 0 12px 30px rgba(48, 54, 80, 0.09);
  --ds-shadow-strong: 0 18px 46px rgba(48, 54, 80, 0.16);
  --ds-radius-sm: 8px;
  --ds-radius-md: 12px;
  --ds-radius-lg: 16px;
  --ds-btn-h: 44px;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--ds-steel);
  background: var(--ds-offwhite);
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.app-card-title,
.navbar-brand {
  font-family: "Inter", "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
  color: var(--ds-midnight);
}

.app-container {
  width: min(100%, 1560px);
  margin-inline: auto;
  padding-inline: clamp(0.7rem, 2vw, 1.5rem);
}

.ds-section-dark {
  background: var(--ds-midnight);
  color: var(--ds-offwhite);
}

.ds-section-light {
  background: var(--ds-offwhite);
  color: var(--ds-steel);
}

.app-navbar {
  background: var(--ds-midnight);
  border-bottom: 1px solid rgba(232, 240, 253, 0.18);
  box-shadow: none;
}

.app-navbar .navbar-brand,
.app-navbar .nav-link,
.app-navbar .nav-link-label {
  color: var(--ds-offwhite);
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus-visible {
  color: var(--ds-bronze);
  background: rgba(255, 240, 228, 0.12);
}

/* ======================================
   NEW LAYOUT — SIDEBAR & MAIN CONTENT
   ====================================== */

.app-shell {
  display: flex !important;
  flex-direction: row !important; /* ABSOLUTELY FORCE SIDE-BY-SIDE */
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #F6F7FB !important;
  position: relative;
}

.app-shell.has-custom-background {
  background-color: #F6F7FB !important;
  background-image: var(--app-bg-image) !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
}

body.fullscreen-page.has-custom-background {
  background-color: #F6F7FB !important;
  background-image: var(--app-bg-image) !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
}

.app-shell::before,
.app-shell::after {
  content: none;
}

/* ---- SIDEBAR ---- */
.app-sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  flex: 0 0 88px !important;
  width: 88px !important;
  background: var(--ds-midnight) !important;
  color: var(--ds-silver);
  display: flex !important;
  flex-direction: column !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  border-right: 1px solid rgba(232, 240, 253, 0.14);
  box-shadow: 10px 0 34px rgba(48, 54, 80, 0.16);
  /* Custom scrollbar for sidebar */
}

@media (max-width: 991.98px) {
  #sidebarToggle {
    position: fixed;
    top: 12px;
    left: 12px;
    right: auto;
    z-index: 1300;
    transition: left .25s ease;
  }

  .app-shell.sidebar-open #sidebarToggle {
    left: 96px;
    right: auto;
  }

  .app-shell.flyout-open #sidebarToggle {
    left: auto;
    right: 12px;
  }

  .app-sidebar {
    width: 84px !important;
    min-width: 84px !important;
    max-width: 84px !important;
    flex: 0 0 84px !important;
    flex-basis: 84px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(-100%);
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-closed .app-sidebar,
  .sidebar-closed .app-sidebar {
    transform: translateX(-100%);
  }

  .sidebar-closed main {
    margin-left: 0 !important;
  }

  .sidebar-primary-control,
  #sidebarMainToggle {
    display: none !important;
  }

  #sidebarGroups {
    max-height: none !important;
    opacity: 1 !important;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
  }

  #sidebarGroups .sidebar-group-button {
    opacity: 1 !important;
    transform: none !important;
  }

  .sidebar-label {
    display: none;
  }

  .sidebar-item {
    justify-content: center !important;
  }

  .sidebar-user-menu {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
  }

  .sidebar-user-menu.is-open {
    max-height: 130px !important;
    opacity: 1 !important;
    overflow: visible !important;
    pointer-events: auto;
  }
}

/* Hamburger Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 15px; /* Moved up slightly */
    left: 10px; /* Moved left to avoid branding overlap */
    z-index: 2000; /* Higher than sidebar */
    width: 40px;
    height: 40px;
    background: var(--ds-midnight);
    border: none;
    border-radius: 10px;
    color: var(--ds-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(48, 54, 80, 0.18);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.sidebar-toggle:hover {
    transform: scale(1.05);
    background: var(--ds-bronze);
    color: var(--ds-midnight);
}

@media (min-width: 992px) {
  .sidebar-toggle {
    display: none !important;
  }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(48, 54, 80, 0.42);
    z-index: 1039;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

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

@media (min-width: 992px) {
    .sidebar-overlay {
        display: none !important;
    }
}


.app-sidebar::-webkit-scrollbar,
.sidebar-top-menu::-webkit-scrollbar {
  width: 6px;
}
.app-sidebar::-webkit-scrollbar-thumb,
.sidebar-top-menu::-webkit-scrollbar-thumb {
  background: rgba(103, 111, 157, 0.24);
  border-radius: 4px;
}

.sidebar-primary-control,
.sidebar-user-control {
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-control-button,
.sidebar-item {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ds-silver);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.3s ease, opacity 0.25s ease, box-shadow 0.15s ease;
}

.sidebar-control-button {
  background: rgba(232, 240, 253, 0.12);
  color: var(--ds-white);
  font-size: 1.2rem;
}

.sidebar-user-button {
  background: rgba(232, 240, 253, 0.12);
  color: var(--ds-white);
  border: 1px solid rgba(232, 240, 253, 0.18);
  font-size: 1.35rem;
}

.sidebar-control-button:hover,
.sidebar-control-button:focus-visible,
.sidebar-control-button.is-open {
  background: var(--ds-bronze);
  color: var(--ds-midnight);
}

.sidebar-user-button:hover,
.sidebar-user-button:focus-visible,
.sidebar-user-button.is-open {
  background: var(--ds-bronze);
  color: var(--ds-midnight);
}

.sidebar-control-button:active,
.sidebar-item:active {
  transform: scale(0.9);
}

.sidebar-separator {
  flex: 0 0 auto;
  height: 1px;
  margin: 0 16px;
  background: rgba(232, 240, 253, 0.18);
}

.sidebar-top-menu,
.sidebar-user-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-inline: 17px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.sidebar-top-menu {
  flex-direction: column;
  margin-top: 6px;
}

.sidebar-top-menu.open {
  max-height: calc(100vh - 190px);
  opacity: 1;
  overflow-y: auto;
}

.sidebar-user-menu {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-inline: 17px;
  pointer-events: none;
  transition: max-height 0.4s ease, opacity 0.25s ease, padding 0.25s ease;
}

.sidebar-user-menu.is-open {
  max-height: 140px;
  opacity: 1;
  padding-block: 4px;
  pointer-events: auto;
}

.sidebar-top-menu .sidebar-item,
.sidebar-user-menu .sidebar-item {
  opacity: 0;
  transform: translateY(-10px);
}

.sidebar-user-menu .sidebar-item,
.sidebar-user-menu > * {
  transform: translateY(10px);
}

.sidebar-top-menu.open .sidebar-item,
.sidebar-user-menu.open .sidebar-item,
.sidebar-user-menu.is-open > * {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-top-menu.open .sidebar-item:nth-child(1) { transition-delay: 0.03s; }
.sidebar-top-menu.open .sidebar-item:nth-child(2) { transition-delay: 0.06s; }
.sidebar-top-menu.open .sidebar-item:nth-child(3) { transition-delay: 0.09s; }
.sidebar-top-menu.open .sidebar-item:nth-child(4) { transition-delay: 0.12s; }
.sidebar-top-menu.open .sidebar-item:nth-child(5) { transition-delay: 0.15s; }
.sidebar-top-menu.open .sidebar-item:nth-child(6) { transition-delay: 0.18s; }
.sidebar-top-menu.open .sidebar-item:nth-child(n + 7) { transition-delay: 0.21s; }
.sidebar-user-menu.open .sidebar-item:nth-child(1) { transition-delay: 0.05s; }
.sidebar-user-menu.open .sidebar-item:nth-child(2) { transition-delay: 0.1s; }
.sidebar-user-menu.is-open > *:nth-child(1) { transition-delay: 0.05s; }
.sidebar-user-menu.is-open > *:nth-child(2) { transition-delay: 0.1s; }
.sidebar-top-menu:not(.open) .sidebar-item:nth-last-child(2) { transition-delay: 0.03s; }
.sidebar-top-menu:not(.open) .sidebar-item:nth-last-child(3) { transition-delay: 0.06s; }
.sidebar-top-menu:not(.open) .sidebar-item:nth-last-child(4) { transition-delay: 0.09s; }
.sidebar-top-menu:not(.open) .sidebar-item:nth-last-child(5) { transition-delay: 0.12s; }
.sidebar-top-menu:not(.open) .sidebar-item:nth-last-child(n + 6) { transition-delay: 0.15s; }

.sidebar-item:hover,
.sidebar-item:focus-visible {
  background: rgba(255, 240, 228, 0.12);
  color: var(--ds-white);
}

.sidebar-item.active {
  background: rgba(249, 177, 122, 0.16);
  color: var(--ds-white);
  box-shadow: inset 3px 0 0 var(--ds-bronze);
}

.sidebar-logout-item:hover,
.sidebar-logout-item:focus-visible {
  background: rgba(235, 97, 112, 0.14);
  color: var(--ds-danger);
}

.sidebar-user-action {
  opacity: 0;
  transform: translateY(10px);
  transition: background 0.18s ease, color 0.18s ease, transform 0.3s ease, opacity 0.25s ease, box-shadow 0.18s ease;
}

.sidebar-logout-action:hover,
.sidebar-logout-action:focus-visible {
  background: rgba(235, 97, 112, 0.14);
  color: var(--ds-danger);
}

.sidebar-label {
  display: none;
}

.sidebar-flex-spacer {
  flex: 1 1 auto;
  min-height: 4px;
}

@media (max-width: 991.98px) {
  .sidebar-label {
    display: inline;
    font-size: 0.82rem;
    font-weight: 650;
    white-space: nowrap;
  }

  .sidebar-top-menu,
  .sidebar-user-menu {
    align-items: stretch;
    padding-inline: 12px;
  }

  .sidebar-top-menu .sidebar-item,
  .sidebar-user-menu .sidebar-item {
    display: flex;
  }

  .sidebar-primary-control,
  .sidebar-user-control {
    justify-content: flex-start;
    padding-inline: 12px;
  }
}

.sidebar-groups {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 17px;
  pointer-events: none;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.25s ease;
}

.sidebar-groups.is-open {
  max-height: 520px;
  opacity: 1;
  padding-block: 6px 16px;
  pointer-events: auto;
}

#sidebarGroups.is-open {
  max-height: 520px;
  opacity: 1;
  padding-top: 6px;
  padding-bottom: 16px;
  pointer-events: auto;
}

.sidebar-group-button {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ds-silver);
  font-size: 1.08rem;
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
  transition: background 0.18s ease, color 0.18s ease, transform 0.3s ease, opacity 0.25s ease, box-shadow 0.18s ease;
}

.sidebar-groups .sidebar-group-button {
  opacity: 0;
  transform: translateY(-10px);
}

.sidebar-groups.is-open .sidebar-group-button {
  opacity: 1;
  transform: translateY(0);
}

#sidebarGroups.is-open .sidebar-group-button {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-group-button:hover,
.sidebar-group-button:focus-visible {
  background: rgba(255, 240, 228, 0.12);
  color: var(--ds-white);
}

.sidebar-group-button:focus-visible {
  outline: 2px solid var(--ds-bronze);
  outline-offset: 2px;
}

.sidebar-group-button:active {
  transform: scale(0.9);
}

.sidebar-group-button.is-current {
  background: rgba(249, 177, 122, 0.16);
  color: var(--ds-white);
  box-shadow: inset 3px 0 0 var(--ds-bronze);
}

.sidebar-group-button.is-open {
  background: var(--ds-bronze);
  color: var(--ds-midnight);
  box-shadow: none;
}

.sidebar-groups.is-open .sidebar-group-button:nth-child(1) { transition-delay: 0.03s; }
.sidebar-groups.is-open .sidebar-group-button:nth-child(2) { transition-delay: 0.06s; }
.sidebar-groups.is-open .sidebar-group-button:nth-child(3) { transition-delay: 0.09s; }
.sidebar-groups.is-open .sidebar-group-button:nth-child(4) { transition-delay: 0.12s; }
.sidebar-groups.is-open .sidebar-group-button:nth-child(5) { transition-delay: 0.15s; }
.sidebar-groups.is-open .sidebar-group-button:nth-child(6) { transition-delay: 0.18s; }
.sidebar-groups:not(.is-open) .sidebar-group-button:nth-last-child(1) { transition-delay: 0.03s; }
.sidebar-groups:not(.is-open) .sidebar-group-button:nth-last-child(2) { transition-delay: 0.06s; }
.sidebar-groups:not(.is-open) .sidebar-group-button:nth-last-child(3) { transition-delay: 0.09s; }
.sidebar-groups:not(.is-open) .sidebar-group-button:nth-last-child(4) { transition-delay: 0.12s; }
.sidebar-groups:not(.is-open) .sidebar-group-button:nth-last-child(5) { transition-delay: 0.15s; }
.sidebar-groups:not(.is-open) .sidebar-group-button:nth-last-child(6) { transition-delay: 0.18s; }

.sidebar-flyout {
  position: fixed;
  top: 12px;
  left: 88px;
  z-index: 1060;
  width: 300px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(232, 240, 253, 0.95);
  border-radius: 12px;
  background: var(--ds-white);
  box-shadow: 0 18px 45px rgba(48, 54, 80, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.sidebar-flyout.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.sidebar-flyout-panel {
  display: none;
}

.sidebar-flyout-panel.active {
  display: block;
}

.sidebar-flyout-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 12px 14px;
  border-bottom: 1px solid rgba(232, 240, 253, 0.95);
  font-size: 0.96rem;
  font-weight: 750;
}

.sidebar-flyout-title i {
  width: 22px;
  color: var(--ds-bronze);
  text-align: center;
}

.sidebar-flyout-section {
  margin: 14px 10px 5px;
  color: var(--ds-steel);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sidebar-flyout-links {
  display: grid;
  gap: 4px;
  padding: 8px 0;
}

.sidebar-flyout-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ds-steel);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-flyout-link i {
  width: 22px;
  color: var(--ds-steel);
  text-align: center;
}

.sidebar-flyout-link:hover,
.sidebar-flyout-link:focus-visible {
  background: #FFF0E4;
  color: var(--ds-midnight);
}

.sidebar-flyout-link:focus-visible {
  outline: 2px solid var(--ds-bronze);
  outline-offset: 1px;
}

.sidebar-flyout-link.active {
  background: #FFF0E4;
  color: var(--ds-midnight);
  box-shadow: inset 3px 0 0 var(--ds-bronze);
}

.sidebar-flyout-link.active i {
  color: var(--ds-midnight);
}

.sidebar-flyout-link.sidebar-logout-item:hover,
.sidebar-flyout-link.sidebar-logout-item:focus-visible {
  background: rgba(235, 97, 112, 0.12);
  color: var(--ds-danger);
}

@media (max-width: 991.98px) {
  .sidebar-groups {
    width: 100% !important;
    align-items: center;
    padding-inline: 12px;
  }

  .sidebar-user-area {
    width: 100% !important;
  }

  .sidebar-user-control {
    width: 100% !important;
    padding: 12px;
  }

  .sidebar-flyout {
    top: 0;
    bottom: 0;
    left: 84px !important;
    width: min(260px, calc(100vw - 96px)) !important;
    max-width: min(260px, calc(100vw - 96px)) !important;
    max-height: none;
    border-block: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateX(-8px);
  }

  .sidebar-flyout.is-open {
    transform: translateX(0);
  }

  .sidebar-closed .sidebar-flyout {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar-flyout-title {
    padding-inline: 8px;
    font-size: 0.88rem;
  }

  .sidebar-flyout-link {
    padding-inline: 8px;
    font-size: 0.78rem;
  }
}

/* ---- MAIN CONTAINER ---- */
main {
  flex: 1 !important;
  min-width: 0 !important;
  background: transparent;
  border-top-left-radius: 0 !important;
  margin-left: 88px;
  overflow-y: auto !important;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  position: relative;
  transition: all 0.3s ease;
  /* Premium Layered Shadow for depth */
  box-shadow: none;
}

/* Custom scrollbar for Main Container */
main::-webkit-scrollbar {
  width: 8px;
}
main::-webkit-scrollbar-track {
  background: transparent;
}
main::-webkit-scrollbar-thumb {
  background: rgba(74, 82, 119, 0.18);
  border-radius: 10px;
}
main::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 82, 119, 0.28);
}

.app-card,
.card,
.stat-card,
.module-card,
.table-responsive {
  border: 1px solid rgba(232, 240, 253, 0.95) !important;
  border-radius: var(--ds-radius-md) !important;
  box-shadow: var(--ds-shadow-soft);
  background: var(--ds-white);
}

.app-card::after {
  background: radial-gradient(circle at top right, rgba(232, 240, 253, 0.72), transparent 45%);
}

.home-hero {
  border: 1px solid rgba(232, 240, 253, 0.95) !important;
  background: var(--ds-white);
}

.module-grid-home .module-card {
  min-height: 230px;
}

.search-toolbar,
.section-panel,
.app-table-shell,
.app-results-list {
  border-color: rgba(232, 240, 253, 0.95) !important;
}

.section-panel .card-header {
  border-bottom: 1px solid rgba(232, 240, 253, 0.95);
  background: #E8F0FD;
  font-weight: 700;
  color: var(--ds-midnight);
}

.app-results-list {
  border-radius: 14px;
  overflow: hidden;
}

.app-results-list .list-group-item {
  border-bottom: 1px solid rgba(232, 240, 253, 0.95);
  background: #FFFFFF;
}

.app-results-list .list-group-item:last-child {
  border-bottom: 0;
}

.btn,
.btn-ds-primary,
.btn-ds-secondary,
.btn-ds-ghost,
.btn-ds-danger {
  min-height: var(--ds-btn-h);
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.6rem 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-sm,
.btn-lg {
  min-height: var(--ds-btn-h);
  border-radius: 999px;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
}

.btn-primary,
.btn-ds-primary {
  background: var(--ds-bronze);
  border-color: var(--ds-bronze);
  color: var(--ds-midnight);
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-ds-primary:hover,
.btn-ds-primary:focus-visible {
  background: #FFF0E4;
  border-color: var(--ds-bronze);
  color: var(--ds-midnight);
}

.btn-outline-primary,
.btn-ds-secondary {
  border-color: var(--ds-steel);
  color: var(--ds-midnight);
  background: var(--ds-white);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible,
.btn-ds-secondary:hover,
.btn-ds-secondary:focus-visible {
  background: #FFF0E4;
  border-color: var(--ds-bronze);
  color: var(--ds-midnight);
}

.btn-success {
  background: var(--ds-success);
  border-color: var(--ds-success);
  color: #fff;
}

.btn-danger {
  background: var(--ds-danger);
  border-color: var(--ds-danger);
  color: #fff;
}

.btn-warning,
.btn-info,
.btn-secondary {
  background: var(--ds-white);
  border-color: var(--ds-steel);
  color: var(--ds-midnight);
}

.btn-warning:hover,
.btn-warning:focus-visible,
.btn-info:hover,
.btn-info:focus-visible,
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #FFF0E4;
  border-color: var(--ds-bronze);
  color: var(--ds-midnight);
}

.btn-outline-success,
.btn-outline-danger,
.btn-outline-secondary,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-light {
  border-color: var(--ds-steel);
  color: var(--ds-midnight);
  background: var(--ds-white);
}

.btn-outline-success:hover,
.btn-outline-success:focus-visible,
.btn-outline-danger:hover,
.btn-outline-danger:focus-visible,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible,
.btn-outline-info:hover,
.btn-outline-info:focus-visible,
.btn-outline-warning:hover,
.btn-outline-warning:focus-visible,
.btn-outline-light:hover,
.btn-outline-light:focus-visible {
  background: #FFF0E4;
  border-color: var(--ds-bronze);
  color: var(--ds-midnight);
}

.btn-link,
.btn-ds-ghost {
  color: var(--ds-midnight);
  text-decoration: none;
}

.btn-link:hover,
.btn-ds-ghost:hover {
  color: var(--ds-steel);
  text-decoration: underline;
}

.form-control,
.form-select,
textarea,
input,
select {
  min-height: 44px;
  border-radius: 12px !important;
  border: 1px solid rgba(232, 240, 253, 0.95) !important;
  background-color: var(--ds-white) !important;
  color: var(--ds-midnight);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus,
select:focus {
  border-color: var(--ds-silver) !important;
  box-shadow: 0 0 0 0.2rem rgba(249, 177, 122, 0.22) !important;
}

.sync-confirm-field {
  flex: 1 1 420px;
  max-width: 560px;
  min-width: min(100%, 320px);
}

.sync-confirm-field .form-label {
  color: var(--ds-midnight);
  line-height: 1.25;
}

.sync-confirm-field input {
  width: 100%;
}

.table thead th {
  background: #E8F0FD;
  color: var(--ds-midnight);
  border-bottom: 0;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table > :not(caption) > * > * {
  border-color: rgba(66, 71, 105, 0.1);
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

img,
video,
svg {
  max-width: 100%;
}

.app-footer {
  background: var(--ds-midnight);
  border-top: 1px solid rgba(224, 224, 224, 0.2);
}

.app-footer .footer-content {
  color: var(--ds-offwhite);
}

.app-code-sample {
  background: var(--ds-midnight);
  color: var(--ds-white);
  border: 1px solid rgba(249, 177, 122, 0.45);
}

.sg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

@media (max-width: 991.98px) {
  .page-header,
  .app-card-header,
  .home-header,
  .productos-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .page-actions {
    width: 100%;
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
  }

  .page-actions .btn {
    flex: 1 1 220px;
  }

  .ds-menu-shell {
    top: 0;
    position: sticky;
  }

  .ds-session-pill {
    position: fixed;
    top: 0.55rem;
    right: 0.55rem;
    left: 0.55rem;
    margin-top: 0;
    justify-content: space-between;
    z-index: 85;
  }

  .ds-menu-board {
    height: 72px;
  }

  .ds-menu-board::before,
  .ds-menu-board::after {
    width: 80px;
    height: 80px;
  }

  .ds-menu-group.left,
  .ds-menu-group.right {
    gap: 6px;
    padding-right: 50px;
    padding-left: 50px;
  }

  .ds-menu-item {
    width: 60px;
    height: 52px;
  }

  .ds-home-wrap {
    width: 106px;
    height: 108px;
    border-radius: 0 0 53px 53px;
  }

  .ds-home-spacer {
    flex: 0 0 106px;
  }

  .ds-menu-home {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .product-list-container .product-grid,
  .productos-form .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .product-list-container .product-main,
  .productos-form .product-main {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.7rem;
  }

  main {
    padding-bottom: 2rem;
    padding-top: 5rem;
    margin-left: 0;
    border-top-left-radius: 0 !important;
  }
}

@media (max-width: 575.98px) {
  .ds-menu-board {
    height: 62px;
  }

  .ds-menu-board::before,
  .ds-menu-board::after {
    width: 60px;
    height: 60px;
  }

  .ds-menu-group.left {
    padding-right: 44px;
  }
  .ds-menu-group.right {
    padding-left: 44px;
  }

  .ds-home-wrap {
    width: 88px;
    height: 96px;
    border-radius: 0 0 44px 44px;
  }

  .ds-home-spacer {
    flex: 0 0 88px;
  }

  .ds-menu-home {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
  }

  .ds-menu-item {
    width: 52px;
    height: 46px;
  }

  .ds-menu-text {
    display: none;
  }
}

/* ======================================
   CART PANEL (Bootstrap column, always visible on desktop)
   ====================================== */
.cart-panel-sticky {
  position: sticky;
  top: 24px;
}

.cart-panel-sticky .cart-drawer-panel {
  width: 100%;
}

/* ======================================
   NEW COMPACT PREMIUM PRODUCT CARDS 
   ====================================== */

.product-list-container .product-grid {
  grid-template-columns: 1fr; /* Force 1 column per row to make it horizontal */
  gap: 12px;
}

.product-card.product-row {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--ds-white);
  border-radius: 14px;
  border: 1px solid rgba(66, 71, 105, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  gap: 20px;
  height: auto;
}

/* Strict Flexbox for 2 columns to prevent overlaps */
.productos-workspace {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
}

.product-list-container {
  width: calc(100% - 380px) !important;
  max-width: calc(100% - 380px) !important;
  flex: 0 0 calc(100% - 380px) !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.cart-drawer {
  flex: 0 0 350px !important;
  width: 350px !important;
  max-width: 350px !important;
  position: sticky !important;
  top: 24px !important;
  margin-top: 0 !important;
}

@media (max-width: 991px) {
  .productos-workspace {
    flex-direction: column !important;
  }
  .product-list-container {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }
  .cart-drawer {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    z-index: 1050 !important;
  }
}

/* Remove hover effect completely as requested */
.product-card.product-row:hover {
  transform: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(66, 71, 105, 0.08) !important;
}

.product-card--active {
  border-color: var(--ds-bronze) !important;
  background: linear-gradient(135deg, #FFF0E4, #FFFFFF) !important;
  box-shadow: 0 8px 24px rgba(48, 54, 80, 0.1) !important;
}

/* LEFT SIDE - Info */
.product-main-compact {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.product-thumb-compact {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #E8F0FD;
  border: 1px solid rgba(232, 240, 253, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #4A5277;
  font-size: 1.4rem;
}

.product-thumb-compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info-compact {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-title-compact {
  font-family: "Montserrat", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ds-midnight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.product-meta-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
}

.badge-stock {
  background: rgba(40, 166, 120, 0.12);
  color: var(--ds-success);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid rgba(40, 166, 120, 0.22);
}

/* RIGHT SIDE - Actions */
.product-actions-compact {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.action-price, .action-subtotal {
  min-width: 80px;
  text-align: right;
}

.action-qty {
  width: 80px;
}

.action-qty .form-control-sm {
  text-align: center;
  font-weight: 700;
  border-radius: 8px;
  height: 38px;
  padding: 4px;
  border-color: rgba(232, 240, 253, 0.95);
}

.action-qty .form-control-sm:focus {
  border-color: var(--ds-bronze);
  box-shadow: 0 0 0 0.2rem rgba(249, 177, 122, 0.22);
}

.subtotal.text-bronze {
  color: var(--ds-steel);
  font-size: 1.05rem;
  font-weight: 800;
}

.action-btns {
  width: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compact-btn {
  height: 38px;
  min-height: 38px;
  border-radius: 8px;
  font-size: 0.9rem;
  padding: 0 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.add-to-cart {
  background: var(--ds-bronze) !important;
  border-color: var(--ds-bronze) !important;
  color: var(--ds-midnight) !important;
}
.add-to-cart:hover {
  background: #FFF0E4 !important;
  color: var(--ds-midnight) !important;
  transform: translateY(-1px);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
  .product-card.product-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .product-actions-compact {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px dashed rgba(44,62,80,0.15);
  }
  .action-price, .action-subtotal {
    text-align: left;
  }
  .action-btns {
    width: auto;
  }
}

@media (max-width: 768px) {
  .product-title-compact {
    white-space: normal;
  }
  .product-list-container .product-grid {
    grid-template-columns: 1fr;
  }
}
