/* Tema unificado dos paineis autenticados. A Home continua com sua identidade roxo/rosa. */
body[data-route="client"],
body[data-route="admin"] {
  --rr-bg: #0a0c12;
  --rr-bg-soft: #0e1018;
  --rr-panel: #11141d;
  --rr-panel-raised: #151824;
  --rr-panel-hover: #191c28;
  --rr-border: rgba(225, 229, 242, .085);
  --rr-border-strong: rgba(225, 229, 242, .14);
  --rr-text: #f1f2f7;
  --rr-muted: #989cab;
  --rr-faint: #676b7a;
  --rr-accent: #b866e3;
  --rr-accent-strong: #ca73ef;
  --rr-accent-soft: rgba(184, 102, 227, .12);
  --rr-green: #5ce6a0;
  --rr-amber: #e4b86a;
  --rr-red: #ee7791;
  background: var(--rr-bg);
}

body:is([data-route="client"], [data-route="admin"]) > .noise { opacity: .035; }
body:is([data-route="client"], [data-route="admin"]) > .ambient { opacity: .08; filter: blur(110px); }

:is(.dashboardShell-client, .dashboardShell-admin) {
  color: var(--rr-text);
  background:
    radial-gradient(circle at 78% 7%, rgba(104, 74, 145, .07), transparent 31%),
    linear-gradient(135deg, #0a0c12 0%, #0d0f17 58%, #0a0c12 100%);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardSidebar {
  width: 264px;
  border-right: 1px solid var(--rr-border);
  background:
    linear-gradient(180deg, rgba(19, 21, 31, .98), rgba(11, 13, 20, .99)),
    radial-gradient(circle at 45% 15%, rgba(184, 102, 227, .08), transparent 35%);
  box-shadow: 18px 0 60px rgba(0, 0, 0, .18);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardSidebar::after {
  background: linear-gradient(180deg, rgba(184, 102, 227, .24), rgba(184, 102, 227, .04) 34%, transparent 78%);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardBrand {
  min-height: 94px;
  margin: 0 16px 10px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--rr-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardBrand:hover { transform: none; background: transparent; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardBrand img { width: 132px; filter: saturate(.9) brightness(1.08); }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardRole { display: none; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNav { gap: 8px; padding: 0 14px; }

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroup {
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroup.active,
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroup.expanded {
  border-color: var(--rr-border);
  background: rgba(255, 255, 255, .018);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroupLabel {
  min-height: 44px;
  padding: 0 12px;
  color: #858997;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroup.active > .dashboardNavGroupLabel { color: #c7c9d3; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroupLabel > svg { width: 14px; height: 14px; color: #7f8390; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroupChevron svg { width: 12px; height: 12px; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavGroupItems { gap: 3px; padding: 0 7px 8px; }

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavItem {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #898d9a;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavItem:hover {
  color: #dfe1e8;
  background: rgba(255, 255, 255, .035);
  transform: translateX(2px);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavItem > svg {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  color: #767a89;
  background: transparent;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavItem.active {
  border-color: rgba(184, 102, 227, .27);
  color: #f7f3fa;
  background: linear-gradient(100deg, rgba(184, 102, 227, .18), rgba(184, 102, 227, .06));
  box-shadow: inset 3px 0 0 var(--rr-accent);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavItem.active::before { display: none; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavItem.active > svg { color: var(--rr-accent-strong); }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardNavItem b {
  min-width: 21px;
  height: 21px;
  color: #d9b6ec;
  background: rgba(184, 102, 227, .13);
  font-size: 9px;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardSidebarFooter {
  margin: auto 14px 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rr-border);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardSidebarFooter .dashboardNavItem { min-height: 38px; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardLogout { color: #ba778a; }

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardWorkspace {
  position: relative;
  overflow: visible;
  background: transparent;
  scroll-padding-top: 84px;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardWorkspace::before { display: none; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardTopbar {
  min-height: 76px;
  padding: 0 30px;
  border-bottom: 1px solid var(--rr-border);
  background: rgba(10, 12, 18, .87);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .12);
  backdrop-filter: blur(18px);
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardTopbar::after { opacity: .35; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardGreeting {
  gap: 5px;
  padding: 0 17px 0 0;
  border: 0;
  border-right: 1px solid var(--rr-border);
  border-radius: 0;
  background: transparent;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardGreeting::before { display: none; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardGreeting small { color: #858997; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardGreeting strong { color: #d7a5ee; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardTopContext { color: #b5b8c3; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardTopContext svg { color: #777b89; }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardRoleChip {
  min-height: 38px;
  border-color: var(--rr-border-strong);
  color: #b9bbc5;
  background: rgba(255, 255, 255, .025);
  box-shadow: none;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardAvatar { width: 39px; height: 39px; border-color: rgba(184, 102, 227, .42); }
:is(.dashboardShell-client, .dashboardShell-admin) .dashboardMain {
  z-index: 1;
  width: min(1540px, 100%);
  padding: 24px 34px 76px;
}

:is(.dashboardShell-client, .dashboardShell-admin) .dashboardPageHeading { display: none; }

/* Cartoes e conteudo do Cliente. */
.dashboardShell-client .dashboardContentBlock {
  margin-bottom: 16px;
  padding: 22px;
  border-color: var(--rr-border);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(19, 22, 32, .96), rgba(13, 15, 23, .96));
  box-shadow: 0 22px 55px rgba(0, 0, 0, .14);
}

.dashboardShell-client .dashboardContentBlock.dashboardPrimary {
  border-color: var(--rr-border);
  background: linear-gradient(145deg, rgba(20, 23, 34, .98), rgba(13, 15, 23, .98));
}

.dashboardShell-client .clientBlockHead { border-bottom-color: var(--rr-border); }
.dashboardShell-client .clientBlockHead > i,
.dashboardShell-client .clientProductMark,
.dashboardShell-client .clientLicenseDot,
.dashboardShell-client .loaderStatusIcon,
.dashboardShell-client .clientHelpIcon {
  border-color: rgba(184, 102, 227, .17);
  color: var(--rr-accent);
  background: var(--rr-accent-soft);
}

.dashboardShell-client :is(.clientActionHero, .clientLicenseRow, .loaderProductCard, .clientHelpMini, .clientHelpPanel, .purchaseTimeline) {
  border-color: var(--rr-border);
  background: rgba(14, 16, 24, .92);
  box-shadow: none;
}

.dashboardShell-client .clientActionHero::before,
.dashboardShell-client .clientActionHero::after { opacity: .2; }
.dashboardShell-client :is(.clientBlockHead h2, .clientActionHero h3, .clientLicenseIdentity strong, .loaderProductCard strong) { color: var(--rr-text); }
.dashboardShell-client :is(.clientBlockHead p, .clientActionHero p, .clientLicenseIdentity p, .loaderProductCard p) { color: var(--rr-muted); }

/* Administração usa os mesmos paineis limpos, sem o grande card roxo externo. */
.dashboardShell-admin .adminMainPanel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dashboardShell-admin :is(.adminOpsHero, .adminOpsGrid > *, .adminSalesCard, .adminAlert, .adminProblemBox, .adminHealthSummary, .adminHealthMiniCard, .notice, .panel, .tableWrap, .adminBotConfigPanel, .adminOwnLoaderPanel > *, .botPanelGrid > *) {
  border-color: var(--rr-border);
  background-color: rgba(16, 18, 27, .95);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
}

.dashboardShell-admin :is(.notice, .panel, .tableWrap) {
  border-radius: 14px;
  background-image: linear-gradient(145deg, rgba(20, 23, 34, .96), rgba(13, 15, 23, .98));
}

.dashboardShell-admin :is(.panelHeader, .adminHealthSummaryHead, .modalHeader) { border-color: var(--rr-border); }
.dashboardShell-admin :is(h2, h3, h4, strong) { color: var(--rr-text); }
.dashboardShell-admin :is(p, .muted, small) { color: var(--rr-muted); }
.dashboardShell-admin :is(table th, table td) { border-color: var(--rr-border); }
.dashboardShell-admin table th { color: #8d91a0; background: rgba(255, 255, 255, .018); }
.dashboardShell-admin table tbody tr:hover { background: rgba(255, 255, 255, .018); }

/* Campos e dropdowns consistentes nos tres paineis. */
:is(.dashboardShell-client, .dashboardShell-admin) :is(input:not([type="checkbox"]):not([type="radio"]), textarea),
body:is([data-route="client"], [data-route="admin"]) .modalHost :is(input:not([type="checkbox"]):not([type="radio"]), textarea) {
  border-color: var(--rr-border);
  color: var(--rr-text);
  background: #0d0f17;
}

:is(.dashboardShell-client, .dashboardShell-admin) :is(input, textarea):focus,
body:is([data-route="client"], [data-route="admin"]) .modalHost :is(input, textarea):focus {
  border-color: rgba(184, 102, 227, .48);
  box-shadow: 0 0 0 3px rgba(184, 102, 227, .08);
}

:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdownTrigger,
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdownTrigger {
  border: 1px solid var(--rr-border);
  color: var(--rr-text);
  background: #0d0f17;
}

:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdownTrigger:hover,
:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdown.open .smartDropdownTrigger,
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdownTrigger:hover,
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdown.open .smartDropdownTrigger {
  border-color: rgba(184, 102, 227, .48);
  background: #121520;
}

:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdownChevron,
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdownChevron {
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 102, 227, .2);
  border-radius: 9px;
  background: rgba(184, 102, 227, .08);
}

:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdownMenu,
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdownMenu {
  max-height: min(270px, 42vh);
  padding: 6px;
  overflow: auto;
  border: 1px solid rgba(183, 96, 224, .3);
  border-radius: 12px;
  background: rgba(13, 15, 23, .99);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .48);
}

:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdownOption,
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdownOption { color: rgba(236, 231, 243, .76); }

:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdownOption:is(:hover, :focus-visible, .selected),
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdownOption:is(:hover, :focus-visible, .selected) {
  color: #fff;
  background: rgba(171, 72, 217, .16);
  outline: none;
}

:is(.dashboardShell-client, .dashboardShell-admin) .smartDropdown.open,
body:is([data-route="client"], [data-route="admin"]) .modalHost .smartDropdown.open { z-index: 1200; }

body:is([data-route="client"], [data-route="admin"]) .modalHost > .modal:has(.smartDropdown.open),
body:is([data-route="client"], [data-route="admin"]) .modalHost .modalCard:has(.smartDropdown.open) { overflow: visible !important; }

@media (max-width: 820px) {
  :is(.dashboardShell-client, .dashboardShell-admin) .dashboardSidebar { width: 100%; }
  :is(.dashboardShell-client, .dashboardShell-admin) .dashboardBrand { width: 100px; min-height: 44px; height: 44px; margin: 0; border: 0; }
  :is(.dashboardShell-client, .dashboardShell-admin) .dashboardBrand img { width: 96px; }
  :is(.dashboardShell-client, .dashboardShell-admin) .dashboardNav { padding: 0 0 2px 8px; }
  :is(.dashboardShell-client, .dashboardShell-admin) .dashboardMain { padding: 15px 13px 58px; }
  :is(.dashboardShell-client, .dashboardShell-admin) .dashboardTopbar { padding: 9px 13px; }
  .dashboardShell-client .dashboardContentBlock { padding: 16px; }
}

/* Keep the authenticated sidebar usable on shorter desktop screens. */
@media (min-width: 821px) {
  .dashboardShell .dashboardSidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
  }

  .dashboardShell .dashboardNav {
    display: block;
    grid-row: 2;
    align-self: stretch;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 8px 18px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none;
    position: relative;
    z-index: 1;
    contain: layout paint;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .dashboardShell .dashboardNav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .dashboardShell .dashboardNavGroup {
    width: 100%;
    max-width: 228px;
    margin: 0 auto 8px;
    min-height: 0;
  }

  .dashboardShell .dashboardNavGroup.expanded {
    display: block;
    overflow: visible;
  }

  .dashboardShell .dashboardNavGroup.expanded .dashboardNavGroupItems {
    max-height: none;
    min-height: 0;
    overflow: visible;
    overflow-anchor: none;
  }

  .dashboardShell .dashboardBrand,
  .dashboardShell .dashboardRole,
  .dashboardShell .dashboardSidebarFooter {
    flex: 0 0 auto;
  }

  .dashboardShell .dashboardBrand {
    grid-row: 1;
    width: calc(100% - 36px);
    margin-right: auto;
    margin-left: auto;
    justify-self: center;
    justify-content: center;
  }

  .dashboardShell .dashboardBrand img {
    margin: 0 auto;
    object-position: center;
  }

  .dashboardShell .dashboardSidebarFooter {
    grid-row: 3;
    align-self: end;
    width: calc(100% - 36px);
    max-width: 228px;
    margin: 0 auto 14px;
    padding: 12px 0 0;
    position: relative;
    z-index: 5;
    border-top: 1px solid rgba(225, 229, 242, .09);
    background: linear-gradient(180deg, rgba(11, 13, 20, .98), #0b0d14 30%);
    box-shadow: 0 -18px 26px rgba(11, 13, 20, .92);
  }
}
