/* =========================================================
   GeQo Liquid
   Arrotondamento finestre + tema scuro attivabile dall'utente
   ========================================================= */

/* Arrotondamento disponibile sia nel tema chiaro sia in quello scuro */
.liquid-theme .x-window {
  border-radius: 14px !important;
  overflow: hidden !important;
}

.liquid-theme .x-window.x-window-maximized {
  border-radius: 0 !important;
}

/* =========================================================
   Token del tema scuro
   ========================================================= */

body.geqo-dark-theme {
  --geqo-dark-canvas: #0f151b;
  --geqo-dark-surface: #18212a;
  --geqo-dark-surface-alt: #1d2731;
  --geqo-dark-raised: #24303b;
  --geqo-dark-header: #2b3946;
  --geqo-dark-border: #364553;
  --geqo-dark-border-strong: #4a5b6a;
  --geqo-dark-text: #e7edf3;
  --geqo-dark-text-muted: #a5b2be;
  --geqo-dark-input: #11181f;
  --geqo-dark-hover: #2a3844;
  --geqo-dark-selected: #183b5a;
  --geqo-dark-selected-border: #397fba;
  --geqo-dark-accent: #67b1f5;
  --geqo-dark-warning: #f2c46d;

  --menu-background: #131b22;
  --menu-surface: #19232c;
  --menu-text: #dce5ed;
  --menu-border: #30404d;
  --menu-expanded: #202d38;
  --menu-selected: #183b5a;
  --menu-selected-border: #397fba;
  --menu-primary: #67b1f5;

  color: var(--geqo-dark-text);
  background-color: var(--geqo-dark-canvas);
  color-scheme: dark;
}

/* =========================================================
   Viewport e superfici principali
   ========================================================= */

.geqo-dark-theme.x-body,
.geqo-dark-theme .x-viewport,
.geqo-dark-theme .x-border-layout-ct,
.geqo-dark-theme #MainViewport,
.geqo-dark-theme #centerViewPortId,
.geqo-dark-theme #centerViewPortId-body {
  background-color: var(--geqo-dark-canvas) !important;
  color: var(--geqo-dark-text);
}

.geqo-dark-theme #northViewPortId,
.geqo-dark-theme #northViewPortId-body,
.geqo-dark-theme .topbar-toolbar,
.geqo-dark-theme .topbar-toolbar .x-box-inner {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-header) !important;
  background-image: none !important;
}

.geqo-dark-theme #southViewPortId,
.geqo-dark-theme #southViewPortId-body {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface-alt) !important;
}

.geqo-dark-theme #westViewPortId {
  box-shadow: 4px 0 18px rgb(0 0 0 / 28%);
}

.geqo-dark-theme #westViewPortId_header .x-tool-img {
  filter: brightness(0) invert(1);
  opacity: 0.78;
}

.geqo-dark-theme #westViewPortId_header .x-tool-over .x-tool-img {
  opacity: 1;
}

/* =========================================================
   Pulsanti della toolbar superiore
   ========================================================= */

.geqo-dark-theme .topbar-circle-btn.x-btn {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-raised) !important;
  background-image: none !important;
  box-shadow: 0 2px 7px rgb(0 0 0 / 22%);
}

.geqo-dark-theme .topbar-circle-btn .x-btn-icon-el,
.geqo-dark-theme .topbar-circle-btn .x-btn-icon-el::before {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .topbar-circle-btn.x-btn-over {
  border-color: var(--geqo-dark-accent) !important;
  background-color: var(--geqo-dark-hover) !important;
}

.geqo-dark-theme .geqo-theme-toggle-active.x-btn {
  border-color: #8a6b30 !important;
  background-color: var(--geqo-dark-warning) !important;
  box-shadow: 0 0 0 2px rgb(242 196 109 / 18%);
}

.geqo-dark-theme .geqo-theme-toggle-active .x-btn-icon-el,
.geqo-dark-theme .geqo-theme-toggle-active .x-btn-icon-el::before {
  color: #202830 !important;
}

/* =========================================================
   Pannelli
   ========================================================= */

.geqo-dark-theme .x-panel-default,
.geqo-dark-theme .x-panel-default-framed {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface) !important;
}

.geqo-dark-theme .x-panel-body,
.geqo-dark-theme .x-panel-body-default,
.geqo-dark-theme .x-panel-body-default-framed {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface) !important;
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-panel-header-default,
.geqo-dark-theme .x-panel-header-default-framed {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-header) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-panel-header-title-default,
.geqo-dark-theme .x-panel-header-title-default-framed,
.geqo-dark-theme .x-panel-header-title-default .x-title-text,
.geqo-dark-theme .x-panel-header-title-default-framed .x-title-text {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-panel-header-default .x-tool-img:not(.x-tool-close),
.geqo-dark-theme .x-panel-header-default-framed .x-tool-img:not(.x-tool-close) {
  filter: brightness(0) invert(1);
  opacity: 0.78;
}

/* =========================================================
   Finestre e dialog
   ========================================================= */

.geqo-dark-theme .x-window {
  border-color: #26333e !important;
  background-color: #26333e !important;
  box-shadow: 0 18px 44px rgb(0 0 0 / 48%) !important;
}

.geqo-dark-theme .x-window.x-window-maximized {
  box-shadow: none !important;
}

.geqo-dark-theme .x-window-body,
.geqo-dark-theme .x-window-body-default {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface) !important;
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-window-header-default {
  border-color: #26333e !important;
  background-color: var(--geqo-dark-header) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-window-header-title-default,
.geqo-dark-theme .x-window-header-title-default .x-title-text,
.geqo-dark-theme .x-window-header-title-default .x-title-icon {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-window-header-default .x-tool-img:not(.x-tool-close) {
  filter: brightness(0) invert(1);
  opacity: 0.82;
}

.geqo-dark-theme
  .x-window-header-default
  .x-tool-over
  .x-tool-img:not(.x-tool-close) {
  opacity: 1;
}

.geqo-dark-theme .x-mask {
  background-color: #05080c;
  opacity: 0.68;
}

.geqo-dark-theme .x-mask-msg {
  border-color: var(--geqo-dark-border-strong);
  background-color: var(--geqo-dark-raised);
  background-image: none;
  color: var(--geqo-dark-text);
}

.geqo-dark-theme .x-mask-msg-inner {
  border-color: var(--geqo-dark-border);
  background-color: var(--geqo-dark-surface);
  color: var(--geqo-dark-text);
}

/* =========================================================
   Toolbar
   ========================================================= */

.geqo-dark-theme .x-toolbar-default,
.geqo-dark-theme .x-toolbar-footer {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-raised) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-toolbar-default .x-tool-img,
.geqo-dark-theme .x-toolbar-footer .x-tool-img {
  background-color: transparent !important;
}

.geqo-dark-theme .x-toolbar-text,
.geqo-dark-theme .x-toolbar-text-default,
.geqo-dark-theme .x-toolbar-text-footer {
  color: var(--geqo-dark-text-muted) !important;
}

.geqo-dark-theme .x-toolbar-separator-horizontal {
  border-left-color: var(--geqo-dark-border-strong) !important;
  border-right-color: transparent !important;
}

/* =========================================================
   Pulsanti standard
   ========================================================= */

.geqo-dark-theme .x-btn-default-small,
.geqo-dark-theme .x-btn-default-medium,
.geqo-dark-theme .x-btn-default-large {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-raised) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-btn-inner-default-small,
.geqo-dark-theme .x-btn-inner-default-medium,
.geqo-dark-theme .x-btn-inner-default-large,
.geqo-dark-theme .x-btn-icon-el-default-small,
.geqo-dark-theme .x-btn-icon-el-default-medium,
.geqo-dark-theme .x-btn-icon-el-default-large {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-btn-over.x-btn-default-small,
.geqo-dark-theme .x-btn-over.x-btn-default-medium,
.geqo-dark-theme .x-btn-over.x-btn-default-large {
  border-color: var(--geqo-dark-accent) !important;
  background-color: var(--geqo-dark-hover) !important;
}

.geqo-dark-theme .x-btn-pressed.x-btn-default-small,
.geqo-dark-theme .x-btn-pressed.x-btn-default-medium,
.geqo-dark-theme .x-btn-pressed.x-btn-default-large {
  border-color: var(--geqo-dark-selected-border) !important;
  background-color: var(--geqo-dark-selected) !important;
}

.geqo-dark-theme .x-btn-disabled {
  opacity: 0.44;
}

/* =========================================================
   Form, campi e fieldset
   ========================================================= */

.geqo-dark-theme .x-form-item-label,
.geqo-dark-theme .x-form-item-label-default,
.geqo-dark-theme .x-form-item-label-text,
.geqo-dark-theme .x-form-display-field,
.geqo-dark-theme .x-form-display-field-default {
  color: var(--geqo-dark-text-muted) !important;
}

.geqo-dark-theme .x-form-trigger-wrap,
.geqo-dark-theme .x-form-trigger-wrap-default {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-input) !important;
}

.geqo-dark-theme .x-form-trigger-wrap-focus,
.geqo-dark-theme .x-form-trigger-wrap-default.x-form-trigger-wrap-focus {
  border-color: var(--geqo-dark-accent) !important;
  box-shadow: 0 0 0 2px rgb(103 177 245 / 16%);
}

.geqo-dark-theme .x-form-text,
.geqo-dark-theme .x-form-text-default,
.geqo-dark-theme .x-form-textarea,
.geqo-dark-theme input.x-form-field,
.geqo-dark-theme textarea.x-form-field {
  background-color: var(--geqo-dark-input) !important;
  color: var(--geqo-dark-text) !important;
  caret-color: var(--geqo-dark-accent);
}

.geqo-dark-theme .x-form-text::placeholder,
.geqo-dark-theme .x-form-textarea::placeholder,
.geqo-dark-theme input.x-form-field::placeholder,
.geqo-dark-theme textarea.x-form-field::placeholder {
  color: #758492 !important;
  opacity: 1;
}

.geqo-dark-theme .x-form-trigger {
  border-left-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-raised) !important;
  opacity: 0.9;
}

.geqo-dark-theme .x-form-trigger-over {
  background-color: var(--geqo-dark-hover) !important;
  opacity: 1;
}

.geqo-dark-theme .x-form-readonly .x-form-text,
.geqo-dark-theme .x-item-disabled .x-form-text,
.geqo-dark-theme .x-item-disabled .x-form-trigger-wrap {
  background-color: #192129 !important;
  color: #82909d !important;
}

.geqo-dark-theme .x-fieldset {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: rgb(255 255 255 / 1.5%);
}

.geqo-dark-theme .x-fieldset-header-text,
.geqo-dark-theme .x-fieldset-header-text-default,
.geqo-dark-theme .x-fieldset-header-default {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme input:-webkit-autofill,
.geqo-dark-theme input:-webkit-autofill:hover,
.geqo-dark-theme input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--geqo-dark-text);
  box-shadow: 0 0 0 1000px var(--geqo-dark-input) inset;
}

/* =========================================================
   Griglie e tree grid
   ========================================================= */

.geqo-dark-theme .x-grid,
.geqo-dark-theme .x-grid-body,
.geqo-dark-theme .x-grid-view,
.geqo-dark-theme .x-grid-empty {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface) !important;
  color: var(--geqo-dark-text-muted) !important;
}

.geqo-dark-theme .x-grid-header-ct,
.geqo-dark-theme .x-column-header {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-header) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-column-header-over,
.geqo-dark-theme .x-column-header-open {
  background-color: var(--geqo-dark-hover) !important;
}

.geqo-dark-theme .x-column-header-text,
.geqo-dark-theme .x-column-header-text-inner {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-grid-item {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface) !important;
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-grid-item-alt {
  background-color: var(--geqo-dark-surface-alt) !important;
}

.geqo-dark-theme .x-grid-item-over {
  background-color: var(--geqo-dark-hover) !important;
}

.geqo-dark-theme .x-grid-item-selected {
  background-color: var(--geqo-dark-selected) !important;
  color: #fff !important;
}

.geqo-dark-theme .x-grid-item-selected .x-grid-cell,
.geqo-dark-theme .x-grid-item-selected .x-grid-cell-inner {
  color: #fff !important;
}

.geqo-dark-theme .x-grid-cell,
.geqo-dark-theme .x-grid-cell-inner,
.geqo-dark-theme .x-tree-node-text {
  border-color: var(--geqo-dark-border) !important;
  color: inherit;
}

.geqo-dark-theme .x-grid-group-hd {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-raised) !important;
}

.geqo-dark-theme .x-grid-group-title {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-grid-row-summary .x-grid-cell,
.geqo-dark-theme .x-grid-row-summary .x-grid-cell-inner {
  background-color: var(--geqo-dark-raised) !important;
  color: var(--geqo-dark-text) !important;
}

/* =========================================================
   Tab
   ========================================================= */

.geqo-dark-theme .x-tab-bar-default {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-header) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-tab-default {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface-alt) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-tab-inner-default,
.geqo-dark-theme .x-tab-icon-el-default {
  color: var(--geqo-dark-text-muted) !important;
}

.geqo-dark-theme .x-tab-over.x-tab-default {
  background-color: var(--geqo-dark-hover) !important;
}

.geqo-dark-theme .x-tab-active.x-tab-default {
  border-color: var(--geqo-dark-selected-border) !important;
  background-color: var(--geqo-dark-selected) !important;
}

.geqo-dark-theme .x-tab-active .x-tab-inner-default,
.geqo-dark-theme .x-tab-active .x-tab-icon-el-default {
  color: #fff !important;
}

/* =========================================================
   Menu, combo e picker
   ========================================================= */

.geqo-dark-theme .x-menu-default,
.geqo-dark-theme .x-menu-body-default,
.geqo-dark-theme .x-boundlist,
.geqo-dark-theme .x-boundlist-list-ct {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-surface-alt) !important;
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-menu-item-text-default,
.geqo-dark-theme .x-menu-item-link,
.geqo-dark-theme .x-boundlist-item {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-menu-item-active,
.geqo-dark-theme .x-boundlist-item-over {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-hover) !important;
  background-image: none !important;
}

.geqo-dark-theme .x-boundlist-selected {
  border-color: var(--geqo-dark-selected-border) !important;
  background-color: var(--geqo-dark-selected) !important;
  color: #fff !important;
}

.geqo-dark-theme .x-menu-item-separator {
  border-top-color: var(--geqo-dark-border) !important;
  background-color: transparent !important;
}

.geqo-dark-theme .x-datepicker {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-surface-alt) !important;
}

.geqo-dark-theme .x-datepicker-header {
  background-color: var(--geqo-dark-header) !important;
}

.geqo-dark-theme .x-datepicker-column-header,
.geqo-dark-theme .x-datepicker-cell,
.geqo-dark-theme .x-datepicker-date {
  border-color: var(--geqo-dark-border) !important;
  background-color: var(--geqo-dark-surface-alt) !important;
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-datepicker-cell:hover .x-datepicker-date {
  background-color: var(--geqo-dark-hover) !important;
}

.geqo-dark-theme .x-datepicker-selected .x-datepicker-date {
  background-color: var(--geqo-dark-selected) !important;
  color: #fff !important;
}

/* =========================================================
   Tooltip, notifiche e progress
   ========================================================= */

.geqo-dark-theme .x-tip-default,
.geqo-dark-theme .x-tip-body-default,
.geqo-dark-theme .x-tip-header-default {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-raised) !important;
  background-image: none !important;
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-tip-header-title-default,
.geqo-dark-theme .x-tip-body-default {
  color: var(--geqo-dark-text) !important;
}

.geqo-dark-theme .x-progress-default {
  border-color: var(--geqo-dark-border-strong) !important;
  background-color: var(--geqo-dark-input) !important;
}

.geqo-dark-theme .x-progress-text {
  color: var(--geqo-dark-text) !important;
}

/* =========================================================
   Scrollbar
   ========================================================= */

.geqo-dark-theme * {
  scrollbar-color: #526474 transparent;
}

.geqo-dark-theme *::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.geqo-dark-theme *::-webkit-scrollbar-track {
  background: transparent;
}

.geqo-dark-theme *::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #526474;
  background-clip: padding-box;
}

.geqo-dark-theme *::-webkit-scrollbar-thumb:hover {
  background: #6c8192;
  background-clip: padding-box;
}

@media (prefers-reduced-motion: reduce) {
  .geqo-theme-toggle,
  .geqo-dark-theme .topbar-circle-btn {
    transition: none !important;
  }
}


.geqo-dark-theme .app-readonly-field {
  background-color: var(--geqo-dark-input) !important;
  color: var(--geqo-dark-text-muted) !important;
}