/* ST1 brand tokens — extracted from "Guia da Marca.pdf" */
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Bebas+Neue&display=swap');

:root {
  /* Primary ST1 Colors */
  --st-blue: #333399;
  /* RGB 51 51 153   · CMYK 95 87 0 0  */
  --st-siena: #ff7400;
  /* RGB 255 116 0   · CMYK 0 64 94 40 */

  /* Secondary ST1 Colors */
  --st-mid: #3c22bc;
  /* RGB 60 34 188   · CMYK 91 83 0 0  */
  --st-purple: #7f5aff;
  /* RGB 127 90 255  · CMYK 74 69 0 0  */

  /* Neutral ST1 Colors */
  --st-white: #ffffff;
  /* RGB 255 255 255 · CMYK 0 0 0 0    */
  --st-black: #1a1a1a;
  /* RGB 26 26 26    · CMYK 76 67 61 83 */

  /* Typography */
  --st-font-display: "Bebas Neue", sans-serif;
  --st-font-body: "Barlow", sans-serif;

  /* Global Theme Color Mapping */
  --brand: var(--st-blue);
  --brand2: var(--st-mid);
  --brand-deep: #222270;
  --accent: var(--st-siena);
  --accent2: #e06600;
  --purple: var(--st-purple);
}

/* Light Mode Overrides */
:root[data-theme=light],
:root:not([data-theme=dark]) {
  --primary: var(--st-blue);
  --primary-light: var(--st-mid);
  --primary-dark: #222270;
  --primary-soft: rgba(51, 51, 153, 0.08);
  --primary-ring: rgba(51, 51, 153, 0.2);
  --orange: var(--st-siena);
  --orange-soft: rgba(255, 116, 0, 0.1);
  --purple: var(--st-purple);
  --purple-soft: rgba(127, 90, 255, 0.1);
  --bg-body: #f7f7f7;
  /* Pure neutral 0% saturation off-white, zero blue tint */
  --bg-sidebar: var(--st-blue, #333399);
  --bg-card: #ffffff;
}

/* Dark Mode Overrides */
:root[data-theme=dark] {
  --primary: #7575d6;
  --primary-light: #9494e0;
  --primary-dark: var(--st-blue);
  --primary-soft: rgba(51, 51, 153, 0.28);
  --primary-ring: rgba(117, 117, 214, 0.25);
  --orange: var(--st-siena);
  --orange-soft: rgba(255, 116, 0, 0.18);
  --purple: #9b7dff;
  --purple-soft: rgba(127, 90, 255, 0.2);
}

/* Clean Accent Utility Classes */
.text-brand {
  color: var(--st-blue) !important;
}

.text-accent {
  color: var(--st-siena) !important;
}

.text-purple {
  color: var(--st-purple) !important;
}

.bg-brand-soft {
  background-color: var(--primary-soft) !important;
}

.bg-accent-soft {
  background-color: var(--orange-soft) !important;
}

/* ============ FOUC PREVENTER & EARLY SVG STYLING ============ */
svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  box-sizing: border-box;
}

/* Sidebar & Topbar SVG sizing during initial paint */
.d-sidebar .nav-link svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
  display: inline-block;
}

.d-sidebar .chev,
.workspace-chev {
  width: 14px !important;
  height: 14px !important;
  display: inline-block;
}

.d-topbar svg {
  width: 18px !important;
  height: 18px !important;
  display: inline-block;
}

/* Fixed Hamburger Button */
.d-topbar .hamburger {
  flex-shrink: 0 !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Hamburger Visibility: Hidden on Desktop (>=992px), Visible on Mobile */
@media (min-width: 992px) {
  .d-topbar .hamburger {
    display: none !important;
  }
}

.d-topbar .hamburger svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
}

.d-topbar .icon-btn svg {
  width: 20px !important;
  height: 20px !important;
}

.d-topbar .cmd svg {
  width: 16px !important;
  height: 16px !important;
}

.d-topbar .sep {
  width: 10px !important;
  height: 10px !important;
}

/* Responsive 2-Row Topbar Layout on Mobile */
@media (max-width: 767.98px) {
  .d-topbar {
    flex-direction: column !important;
    height: auto !important;
    padding: 10px 14px !important;
    align-items: stretch !important;
  }
}

.topbar-row-main {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
}

/* KPI Top Padding & Spacing */
.kpi-top {
  padding-bottom: 12px !important;
  margin-bottom: 6px !important;
}

/* ============ ST1 PRIMARY BLUE CHROME (SIDEBAR, TOPBAR, FOOTER) ============ */
html[data-theme=light] .d-sidebar,
html:not([data-theme=dark]) .d-sidebar,
html[data-theme=dark] .d-sidebar,
.d-sidebar,
.sidebar,
.d-drawer,
.d-drawer-content,
[data-shell-sidebar],
aside.d-sidebar {
  background-color: var(--st-blue, #333399) !important;
  background: var(--st-blue, #333399) !important;
  color: #ffffff !important;
}

.d-topbar,
.d-footer {
  background-color: var(--st-blue, #333399) !important;
  background: var(--st-blue, #333399) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Sidebar Text & Navigation Styling (Pure Bright High-Contrast White) */
.d-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.d-sidebar .brand-name {
  color: #ffffff !important;
  font-weight: 800 !important;
}

.d-sidebar .brand-tag {
  color: #ffffff !important;
  opacity: 0.95 !important;
  font-weight: 600 !important;
}

.d-sidebar .nav-label {
  color: #ffffff !important;
  opacity: 0.9 !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
}

.d-sidebar .nav-link {
  color: #ffffff !important;
  opacity: 1 !important;
  font-weight: 600 !important;
}

.d-sidebar .nav-link svg {
  stroke: #ffffff !important;
  opacity: 1 !important;
}

.d-sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.d-sidebar .nav-link:hover svg {
  stroke: #ffffff !important;
}

.d-sidebar .nav-link.is-active {
  background-color: var(--st-siena, #ff7400) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(255, 116, 0, 0.35) !important;
}

.d-sidebar .nav-link.is-active svg {
  stroke: #ffffff !important;
}

.d-sidebar .sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
  background-color: transparent !important;
}

.d-sidebar .workspace-name {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.d-sidebar .workspace-role {
  color: #ffffff !important;
  opacity: 0.9 !important;
}

.d-sidebar .workspace-chev {
  stroke: #ffffff !important;
}

/* Topbar Text & Controls Styling (Pure Bright High-Contrast White) */
.d-topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.d-topbar .crumbs span {
  color: #ffffff !important;
  opacity: 0.95 !important;
  font-weight: 600 !important;
}

.d-topbar .crumbs span.current {
  color: #ffffff !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}

.d-topbar .crumbs .sep {
  stroke: #ffffff !important;
  opacity: 0.9 !important;
}

.d-topbar .hamburger svg {
  stroke: #ffffff !important;
}

.d-topbar .icon-btn {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.d-topbar .icon-btn svg {
  stroke: #ffffff !important;
}

.d-topbar .icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.28) !important;
}

.d-topbar .cmd {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.d-topbar .cmd svg {
  stroke: #ffffff !important;
}

.d-topbar .cmd span {
  color: #ffffff !important;
  font-weight: 600 !important;
}

.d-topbar .cmd .kbd {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: none !important;
}

.avatar,
.d-topbar .avatar,
.user-avatar-circle {
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  background-color: var(--st-siena, #ff7400) !important;
  background: var(--st-siena, #ff7400) !important;
  box-shadow: 0 2px 8px rgba(255, 116, 0, 0.35) !important;
}

.avatar svg,
.d-topbar .avatar svg,
.user-avatar-circle svg {
  stroke: #ffffff !important;
}

/* Neutral 0% Saturation Pure Canvas Background (Zero Blue Tint, #f7f7f7) */
:root {
  --bg-body: #f7f7f7 !important;
}

html,
body,
.shell,
.main,
.content,
html[data-theme=light] html,
html:not([data-theme=dark]) html,
html[data-theme=light] body,
html:not([data-theme=dark]) body,
html[data-theme=dark] body,
html[data-theme=light] .main,
html:not([data-theme=dark]) .main,
html[data-theme=dark] .main,
html[data-theme=light] .content,
html:not([data-theme=dark]) .content,
html[data-theme=dark] .content {
  background-color: #f7f7f7 !important;
  background: #f7f7f7 !important;
  background-image: none !important;
}

/* Smooth Page Paint */
body {
  opacity: 1;
  transition: opacity 0.15s ease-in;
}

/* ============ COMBINED KPI CARD (DESKTOP SINGLE CARD WITH VERTICAL DIVIDER, MOBILE SEPARATE CARDS) ============ */
@media (min-width: 992px) {
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .kpi-card-combined {
    grid-column: span 2;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    padding: 20px !important;
    gap: 0;
  }

  .kpi-card-combined-3 {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .kpi-combined-half {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .kpi-divider-vertical {
    width: 1px;
    height: 100%;
    min-height: 100px;
    background-color: var(--border, #e4e8ef);
    margin: 0 24px;
    flex-shrink: 0;
  }
}

@media (max-width: 991.98px) {
  .kpi-card-combined {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .kpi-combined-half {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e4e8ef);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: none;
  }

  .kpi-divider-vertical {
    display: none !important;
  }
}

/* ============ CARD TITLES & LABELS WORD WRAPPING (BREAK BY WORD, NO ELLIPSIS) ============ */
.kpi-label,
.kpi-title,
.card-title,
.kpi-identity,
.kpi-identity .kpi-label,
.kpi-top .kpi-label,
.card-header .card-title {
  white-space: normal !important;
  text-overflow: unset !important;
  overflow: visible !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  line-height: 1.35 !important;
}

/* ============ KPI VALUE: ALWAYS SINGLE LINE, AUTO-SHRINK TO FIT ============ */
.kpi-combined-half .kpi-value {
  white-space: nowrap !important;
  overflow: hidden !important;
  max-width: 100% !important;
  font-size: clamp(14px, 2vw, 24px) !important;
}

.kpi-combined-half .kpi-compare {
  white-space: nowrap !important;
  overflow: hidden !important;
  max-width: 100% !important;
  font-size: clamp(9px, 1.1vw, 11px) !important;
}

/* ============ KPI VALUE UNIT SPACING ============ */
.kpi-value sup,
.kpi-value sub,
.kpi-value span {
  margin-left: 6px !important;
  padding-left: 2px !important;
  display: inline-block;
}

/* ============ RESPONSIVE TABLE PREVENT OVERLAPPING ============ */
.table-responsive {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 720px;
}

.table-responsive table th,
.table-responsive table td {
  white-space: nowrap;
}

/* ============ HIDE ALL SCROLLBARS ON MOBILE WHILE PRESERVING SCROLLING ============ */
@media (max-width: 991.98px) {

  html,
  body,
  * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
  }
}

/* ============ CUSTOM SLEEK SCROLLBARS (DESKTOP) ============ */
@media (min-width: 992px) {

  /* Main Page Scrollbar */
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
  }

  html::-webkit-scrollbar-track,
  body::-webkit-scrollbar-track {
    background: var(--bg-body, #f4f4f5) !important;
  }

  html::-webkit-scrollbar-thumb,
  body::-webkit-scrollbar-thumb {
    background: rgba(51, 51, 153, 0.35) !important;
    border-radius: 10px !important;
  }

  html::-webkit-scrollbar-thumb:hover,
  body::-webkit-scrollbar-thumb:hover {
    background: var(--st-blue, #333399) !important;
  }

  html,
  body {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(51, 51, 153, 0.35) var(--bg-body, #f4f4f5) !important;
  }

  /* Sidebar Scrollbar */
  .d-sidebar::-webkit-scrollbar {
    width: 5px !important;
  }

  .d-sidebar::-webkit-scrollbar-track {
    background: var(--st-blue, #333399) !important;
  }

  .d-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 10px !important;
  }

  .d-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45) !important;
  }

  .d-sidebar {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255, 255, 255, 0.25) var(--st-blue, #333399) !important;
  }
}

/* ============ CLEAN REMOVAL OF ALL BLUISH CARD HOVER & INNER SHADOWS ============ */
.card-premium,
.card-premium-interactive,
.card-premium-accent,
.card-premium-red,
.card-premium-purple,
.card-premium-green,
.card-premium-blue,
.toggle-btn-group,
.card,
.kpi-card,
.kpi-card-combined,
.kpi-combined-half {
  box-shadow: none !important;
  background-image: none !important;
}

.card-premium-interactive:hover,
.card-premium-accent:hover,
.card-premium-red:hover,
.card-premium-purple:hover,
.card-premium-green:hover,
.card-premium-blue:hover,
.card:hover,
.kpi-card:hover,
.kpi-card-combined:hover,
.kpi-combined-half:hover {
  box-shadow: none !important;
  transform: none !important;
}

/* ============ SOFT TINT BACKGROUND FOR PRIORITY SELECTION BUTTONS ============ */
.prio-selector .btn-check + .btn {
  border: 1px solid var(--border, #e4e8ef) !important;
  background-color: var(--surface, #ffffff) !important;
  color: var(--text) !important;
  transition: all 0.15s ease-in-out !important;
}

.prio-selector .btn-check:checked + .prio-baixa,
.prio-selector .btn-check:checked + label[for="prio-baixa"] {
  border-color: var(--st-blue, #333399) !important;
  background-color: rgba(51, 51, 153, 0.06) !important;
}

.prio-selector .btn-check:checked + .prio-media,
.prio-selector .btn-check:checked + label[for="prio-media"] {
  border-color: #c98a18 !important;
  background-color: rgba(201, 138, 24, 0.06) !important;
}

.prio-selector .btn-check:checked + .prio-alta,
.prio-selector .btn-check:checked + label[for="prio-alta"] {
  border-color: var(--st-siena, #ff7400) !important;
  background-color: rgba(255, 116, 0, 0.06) !important;
}

.prio-selector .btn-check:checked + .prio-critica,
.prio-selector .btn-check:checked + label[for="prio-critica"] {
  border-color: #e5484d !important;
  background-color: rgba(229, 72, 77, 0.06) !important;
}

/* ============ FORCE WORD BREAKING & TEXT WRAPPING IN FISCAL & DATA TABLES ============ */
.table-premium td,
.table-premium td:last-child,
.table-premium th,
.table-premium th:last-child,
.card table td,
.card table td:last-child {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  text-overflow: unset !important;
  overflow: visible !important;
}