/* ACCIONA dashboard theme — brand red/fonts from Acciona manual (assets/brand) */

@font-face {
  font-family: "Acciona";
  src: url("/assets/fonts/Acciona-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Acciona";
  src: url("/assets/fonts/Acciona-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Acciona";
  src: url("/assets/fonts/Acciona-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Acciona";
  src: url("/assets/fonts/Acciona-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --acc-red: #ED1C24;
  --acc-red-dark: #c0171e;
  --acc-soft-red: #F06A70;
  --acc-pink: #F6B8BE;
  --acc-dark-grey: #404040;
  --acc-mid-grey: #8A8A8F;
  --acc-light-grey: #BFBFBF;
  --acc-sidebar-width: 240px;
  --acc-sidebar-collapsed-width: 72px;
  --acc-sidebar-bg: #ED1C24;
  --acc-sidebar-text: #ffffff;
  --acc-sidebar-muted: rgba(255, 255, 255, 0.72);
  --acc-sidebar-active-bg: #ffffff;
  --acc-sidebar-active-text: #1f1f1f;
  --acc-page-bg: #f5f5f7;
  --acc-font: "Acciona", Calibri, "Segoe UI", Arial, sans-serif;
}

html,
body {
  height: 100%;
  scroll-behavior: auto;
}

body {
  background-color: var(--acc-page-bg) !important;
  font-family: var(--acc-font);
  color: #222222;
  margin: 0;
}

/* ----- Fixed left sidebar ----- */

.acc-app-shell {
  position: relative;
  min-height: 100vh;
  width: 100%;
}


.acc-sidebar {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: var(--acc-sidebar-width) !important;
  max-width: var(--acc-sidebar-width) !important;
  height: 100vh !important;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--acc-sidebar-bg) !important;
  color: var(--acc-sidebar-text) !important;
  padding: 0.7rem 0.85rem 1rem;
  z-index: 1040;
  box-sizing: border-box;
  transition: width 0.2s ease;
  display: flex;
  flex-direction: column;
}

.acc-sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
}

.acc-sidebar-session {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.acc-sidebar-user {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.78rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.35rem;
}

.acc-sidebar-logout {
  width: 100%;
}

.acc-sidebar-brand {
  /* Bottom padding kept tighter so the separator stays put when the title drops. */
  padding: 0 0.35rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 0.75rem;
}

.acc-sidebar-brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  /* Slightly larger gap drops TECHNICAL LEADERS/Dashboard a few pixels. */
  margin-bottom: 1.55rem;
}

.acc-sidebar-logo {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
  margin: 0;
  max-width: 140px;
}

.acc-sidebar-toggle {
  border: 0;
  background: transparent;
  color: #ffffff;
  border-radius: 0.35rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

.acc-sidebar-toggle:hover {
  background: transparent;
  color: #ffffff;
  opacity: 0.85;
}

.acc-sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff !important;
  line-height: 1.2;
  padding: 0 0.25rem;
}

.acc-sidebar-subtitle {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7) !important;
  line-height: 1.2;
  padding: 0 0.25rem;
}

.acc-sidebar-group-label {
  margin: 0.85rem 0.35rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--acc-sidebar-muted) !important;
}

.acc-sidebar-group-label-short {
  display: none;
}

.acc-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

button.acc-sidebar-link {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #ffffff !important;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 0.35rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  line-height: 1.25;
}

button.acc-sidebar-link .acc-sidebar-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex: 0 0 auto;
}

button.acc-sidebar-link img.acc-sidebar-icon-leaf {
  /* Keep the same layout slot as other icons; scale the glyph only. */
  width: 1.05rem;
  height: 1.05rem;
  object-fit: contain;
  display: block;
  transform: scale(1.22);
  transform-origin: center;
}

/* Active row is white: tint the leaf to Acciona red so it stays visible. */
button.acc-sidebar-link.is-active img.acc-sidebar-icon-leaf {
  filter: brightness(0) saturate(100%) invert(17%) sepia(92%) saturate(7471%)
    hue-rotate(346deg) brightness(98%) contrast(95%);
}

button.acc-sidebar-link .acc-sidebar-link-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.acc-sidebar-link:hover {
  background-color: rgba(0, 0, 0, 0.18) !important;
  color: #ffffff !important;
}

button.acc-sidebar-link.is-active {
  background-color: var(--acc-sidebar-active-bg) !important;
  color: var(--acc-sidebar-active-text) !important;
  font-weight: 600;
}

button.acc-sidebar-link.acc-nav-my-activity:not(.is-active) {
  background-color: rgba(0, 0, 0, 0.22) !important;
  color: #ffffff !important;
  font-weight: 700;
}

.acc-shell-main {
  min-height: 100vh;
  box-sizing: border-box;
  margin-left: var(--acc-sidebar-width);
  width: calc(100% - var(--acc-sidebar-width));
  transition: margin-left 0.2s ease, width 0.2s ease;
}

.acc-sidebar.is-collapsed {
  width: var(--acc-sidebar-collapsed-width) !important;
  max-width: var(--acc-sidebar-collapsed-width) !important;
  padding: 0.75rem 0.45rem 1rem;
}

.acc-sidebar.is-collapsed .acc-sidebar-logo,
.acc-sidebar.is-collapsed .acc-sidebar-title,
.acc-sidebar.is-collapsed .acc-sidebar-subtitle,
.acc-sidebar.is-collapsed .acc-sidebar-link-label,
.acc-sidebar.is-collapsed .acc-sidebar-group-label-full,
.acc-sidebar.is-collapsed .acc-sidebar-user {
  display: none !important;
}

.acc-sidebar.is-collapsed .acc-sidebar-session {
  padding-left: 0;
  padding-right: 0;
  align-items: center;
}

.acc-sidebar.is-collapsed .acc-sidebar-logout {
  width: auto;
  min-width: 0;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-size: 0.7rem;
}

.acc-sidebar.is-collapsed .acc-sidebar-group-label-short {
  display: block;
  text-align: center;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.acc-sidebar.is-collapsed .acc-sidebar-brand-top {
  justify-content: center;
  margin-bottom: 0.35rem;
}

.acc-sidebar.is-collapsed .acc-sidebar-brand {
  padding: 0.15rem 0 0.65rem;
}

.acc-sidebar.is-collapsed .acc-sidebar-group-label {
  margin: 0.7rem 0 0.25rem;
  text-align: center;
}

.acc-sidebar.is-collapsed button.acc-sidebar-link {
  justify-content: center;
  padding: 0.6rem 0.35rem;
  gap: 0;
}

.acc-sidebar.is-collapsed button.acc-sidebar-link .acc-sidebar-icon {
  font-size: 1.15rem;
}

.acc-sidebar.is-collapsed button.acc-sidebar-link img.acc-sidebar-icon-leaf {
  width: 1.15rem;
  height: 1.15rem;
  transform: scale(1.22);
}

.acc-app-shell.is-sidebar-collapsed .acc-shell-main,
.acc-shell-main.is-sidebar-collapsed {
  margin-left: var(--acc-sidebar-collapsed-width);
  width: calc(100% - var(--acc-sidebar-collapsed-width));
}

/* ----- Top filter bar (logo + filters; height grows when wrapping) ----- */

.acc-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 56px;
  height: auto;
  display: flex;
  align-items: center;
  background-color: var(--acc-red) !important;
  border-bottom: 3px solid var(--acc-red-dark);
  overflow: visible;
  margin-bottom: 0 !important;
  padding: 0.55rem 1rem;
  box-sizing: border-box;
}

.acc-navbar .Select-menu-outer,
.acc-navbar .VirtualizedSelectOption {
  z-index: 1040;
}

.acc-navbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  width: 100%;
}

.acc-topbar-filter {
  flex: 0 1 auto;
  min-width: 0;
}

.acc-topbar-exports {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 3rem;
}

.acc-export-dropdown .dropdown-menu {
  min-width: 9rem;
  z-index: 1050;
}

.acc-export-button,
.acc-export-toggle,
.acc-export-dropdown > .btn,
.acc-navbar .acc-export-dropdown .dropdown-toggle {
  border: 0 !important;
  background-color: var(--acc-red) !important;
  background-image: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
  min-width: 2.25rem;
  padding-left: 0.45rem !important;
  padding-right: 0.45rem !important;
}

.acc-export-button:hover,
.acc-export-button:focus,
.acc-export-button:active,
.acc-export-toggle:hover,
.acc-export-toggle:focus,
.acc-export-toggle:active,
.acc-export-toggle.show,
.acc-export-dropdown > .btn:hover,
.acc-export-dropdown > .btn:focus,
.acc-export-dropdown > .btn:active,
.acc-export-dropdown > .btn.show,
.acc-navbar .acc-export-dropdown .dropdown-toggle:hover,
.acc-navbar .acc-export-dropdown .dropdown-toggle:focus,
.acc-navbar .acc-export-dropdown .dropdown-toggle.show {
  border: 0 !important;
  background-color: var(--acc-red) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  outline: none !important;
}

.acc-export-toggle::after {
  margin-left: 0.35rem;
  border-top-color: #ffffff !important;
}

.acc-export-toast-stack {
  position: fixed;
  /* Sit below the sticky top bar so download / manager controls stay usable. */
  top: 5.25rem;
  right: 1.1rem;
  z-index: 1020; /* below .acc-navbar (1030) */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  pointer-events: none;
}

.acc-export-toast {
  display: none;
  position: relative;
  width: 100%;
  pointer-events: none;
}

.acc-export-toast.is-visible {
  display: block;
  pointer-events: auto;
}

.acc-export-toast-body {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 2.2rem 1.55rem 0.95rem;
  background: #ffffff;
  color: #222222;
  border-radius: 0.45rem;
  border-left: 4px solid var(--acc-red);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.acc-export-toast.is-error .acc-export-toast-body {
  border-left-color: #b00020;
  padding-bottom: 0.85rem;
}

.acc-export-toast.is-error .acc-export-toast-spinner {
  display: none;
}

.acc-export-toast-spinner {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.12rem;
  border: 2px solid rgba(229, 27, 36, 0.22);
  border-top-color: var(--acc-red);
  border-radius: 50%;
  animation: acc-export-spin 0.75s linear infinite;
}

.acc-export-toast-message {
  flex: 1 1 auto;
  font-size: 0.88rem;
  line-height: 1.35;
}

.acc-export-toast-close {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  border: 0;
  background: transparent;
  color: #666666;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
}

.acc-export-toast-close:hover {
  color: #111111;
}

.acc-export-toast-cancel {
  position: absolute;
  right: 0.55rem;
  bottom: 0.35rem;
  border: 0;
  background: transparent;
  color: #888888;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  cursor: pointer;
  text-decoration: underline;
}

.acc-export-toast-cancel:hover:not(:disabled) {
  color: #b00020;
}

.acc-export-toast-cancel:disabled {
  color: #c4c4c4;
  cursor: default;
  text-decoration: none;
}

.acc-export-manager-button {
  border: 0 !important;
  background: transparent !important;
  color: #ffffff !important;
  box-shadow: none !important;
  position: relative;
  min-width: 2.25rem;
  padding-left: 0.45rem !important;
  padding-right: 0.45rem !important;
}

.acc-export-manager-button:hover,
.acc-export-manager-button:focus {
  color: #ffffff !important;
  opacity: 0.9;
}

.acc-export-manager-badge:empty {
  display: none;
}

.acc-export-manager-badge:not(:empty) {
  position: absolute;
  top: -0.15rem;
  right: -0.1rem;
  min-width: 1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--acc-red);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}

.acc-export-manager-table-wrap {
  overflow-x: auto;
}

.acc-export-manager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.acc-export-manager-table th,
.acc-export-manager-table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid #e8e8e8;
  text-align: left;
  vertical-align: middle;
}

.acc-export-manager-table th {
  color: #666666;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.acc-export-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.acc-export-manager-action {
  border: 1px solid #d5d5d5;
  background: #ffffff;
  color: #444444;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.acc-export-manager-action:hover:not(:disabled) {
  border-color: #999999;
  color: #111111;
}

.acc-export-manager-action:disabled {
  color: #bdbdbd;
  cursor: default;
}

.acc-export-manager-action--danger {
  border-color: #e2b6b9;
  color: #b00020;
}

.acc-export-manager-action--danger:hover:not(:disabled) {
  border-color: #b00020;
  color: #8a0018;
}

.acc-export-manager-empty {
  font-size: 0.9rem;
}

.acc-export-status--queued {
  color: #666666;
}

.acc-export-status--running {
  color: var(--acc-red);
  font-weight: 600;
}

.acc-export-status--paused {
  color: #8a6d3b;
}

.acc-export-status--ready {
  color: #2f6b3a;
}

.acc-export-status--error {
  color: #b00020;
}

.kn-navbar-period-dropdown {
  min-width: 200px;
}

.acc-kn-period-summary {
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.acc-kn-period-summary:empty {
  display: none;
}

.kn-custom-period-picker {
  display: block;
}

.kn-custom-period-picker .DateInput_input {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
}

@keyframes acc-export-spin {
  to {
    transform: rotate(360deg);
  }
}

.acc-export-dropdown .dropdown-item:disabled,
.acc-export-dropdown .dropdown-item.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.element-export-card {
  position: relative;
  width: 100%;
}

.element-export-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.element-export-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333333;
}

.element-export-card-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.15rem;
}

.element-export-dropdown {
  display: inline-flex;
  align-items: center;
}

.element-export-dropdown .dropdown-menu {
  min-width: 4.25rem;
  z-index: 1050;
  font-size: 0.72rem;
  border-color: #e2e2e2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.element-export-toggle,
.element-export-dropdown > .btn,
.element-export-dropdown .dropdown-toggle {
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: #9a9a9a !important;
  box-shadow: none !important;
  font-size: 0.95rem;
  line-height: 1;
  min-width: 0;
  padding: 0.15rem 0.3rem !important;
  opacity: 0.7;
}

.element-export-toggle:hover,
.element-export-toggle:focus,
.element-export-toggle:active,
.element-export-toggle.show,
.element-export-dropdown > .btn:hover,
.element-export-dropdown > .btn:focus,
.element-export-dropdown > .btn:active,
.element-export-dropdown > .btn.show,
.element-export-dropdown .dropdown-toggle:hover,
.element-export-dropdown .dropdown-toggle:focus,
.element-export-dropdown .dropdown-toggle.show {
  border: 0 !important;
  background: transparent !important;
  color: #666666 !important;
  box-shadow: none !important;
  outline: none !important;
  opacity: 1;
}

.element-export-toggle::after,
.element-export-dropdown .dropdown-toggle::after {
  display: none;
}

.element-export-dropdown .dropdown-item {
  color: #555555;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
}

.element-export-dropdown .dropdown-item:hover,
.element-export-dropdown .dropdown-item:focus {
  background: #f7f7f7;
  color: #333333;
}

.element-export-dropdown .dropdown-item:disabled,
.element-export-dropdown .dropdown-item.disabled {
  color: #c4c4c4;
  opacity: 1;
  pointer-events: none;
}

.acc-logout-button {
  border-color: rgba(255, 255, 255, 0.75) !important;
  color: #ffffff !important;
}

.acc-logout-button:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.acc-page-container {
  padding: 1rem 1.25rem 2rem;
}

.acc-tab-content {
  min-height: 0;
}

.acc-tab-content.is-scroll-pending {
  visibility: hidden;
}

.acc-kpi-card {
  border-left: 4px solid var(--acc-red);
  border-radius: 0.4rem;
}

.acc-kpi-card .card-body {
  background-color: #ffffff;
}

.acc-section-header h4 {
  color: var(--acc-red);
  font-weight: 600;
}

.acc-section-header p {
  color: #555555;
}

.acc-table-container {
  background-color: #ffffff;
  border-radius: 0.4rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.acc-graph-card {
  background-color: #ffffff;
  border-radius: 0.4rem;
  padding: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

input.dash-filter--case {
  display: none !important;
}

.acc-navbar .navbar-filter-dropdown-host {
  position: relative;
  min-width: 200px;
}

.acc-navbar .navbar-filter-dropdown {
  min-width: 200px;
  width: 100%;
}

.acc-navbar .navbar-filter-dropdown .Select-control,
.acc-navbar .navbar-filter-dropdown.dash-dropdown {
  background-color: #ffffff;
  border-color: #ffffff;
}

.acc-navbar .navbar-filter-all-placeholder {
  display: none;
  position: absolute;
  left: 12px;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 2;
}

.acc-navbar
  .navbar-filter-dropdown-host.is-inactive-all:not(
    :has(.dash-dropdown[aria-expanded="true"])
  )
  .navbar-filter-all-placeholder {
  display: block;
}

.acc-navbar
  .navbar-filter-dropdown-host.is-inactive-all:not(
    :has(.dash-dropdown[aria-expanded="true"])
  )
  .dash-dropdown-value,
.acc-navbar
  .navbar-filter-dropdown-host.is-inactive-all:not(
    :has(.dash-dropdown[aria-expanded="true"])
  )
  .dash-dropdown-value-count {
  visibility: hidden;
}

@media (max-width: 1100px) {
  .acc-topbar-exports {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .acc-sidebar,
  .acc-sidebar.is-collapsed {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
  }

  .acc-shell-main,
  .acc-shell-main.is-sidebar-collapsed,
  .acc-app-shell.is-sidebar-collapsed .acc-shell-main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .acc-sidebar.is-collapsed .acc-sidebar-logo,
  .acc-sidebar.is-collapsed .acc-sidebar-title,
  .acc-sidebar.is-collapsed .acc-sidebar-subtitle,
  .acc-sidebar.is-collapsed .acc-sidebar-link-label,
  .acc-sidebar.is-collapsed .acc-sidebar-group-label-full {
    display: initial !important;
  }

  .acc-sidebar.is-collapsed .acc-sidebar-group-label-short {
    display: none !important;
  }

  .acc-sidebar.is-collapsed button.acc-sidebar-link {
    justify-content: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
  }

  .acc-navbar-inner {
    align-items: stretch;
  }

  .acc-topbar-filter {
    flex: 1 1 100%;
  }

  .acc-topbar-exports {
    flex-basis: 100%;
  }
}
