/* =============================================
   SmartTalk Design System — CSS Variables
   ============================================= */
:root {
  /* Brand palette */
  --st-primary:        #E01F1C;
  --st-primary-light:  #fef2f2;
  --st-primary-dark:   #c11a18;
  --st-success:        #62C42F;
  --st-success-light:  #f0fdf0;
  --st-warning:        #F9A925;
  --st-warning-light:  #fffbeb;
  --st-danger:         #E01F1C;
  --st-danger-light:   #fef2f2;
  --st-info:           #1C7FFF;
  --st-info-light:     #eef5ff;
  --st-info-active:    #bfdbfe;
  --st-teal:           #027B7C;
  --st-indigo:         #585EDD;
  --st-cyan:           #41D7FF;

  /* Grays */
--st-gray-50:  #f9fafb;
--st-gray-100: #f3f4f6;
--st-gray-200: #e5e7eb;
--st-gray-300: #d1d5db;
--st-gray-400: #9ca3af;
--st-gray-500: #6b7280;
--st-gray-600: #4b5563;
--st-gray-700: #374151;
--st-gray-800: #1f2937;
--st-gray-900: #111827;

  --st-radius-sm: 5px;
  --st-radius:    8px;
  --st-radius-lg: 12px;
  --st-radius-xl: 16px;

  --st-shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --st-shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --st-shadow:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --st-shadow-lg: 0 10px 30px rgba(0,0,0,.1), 0 4px 8px rgba(0,0,0,.06);

  --st-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --st-transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   Base & Typography
   ============================================= */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html { font-size: 15px; }
}

body {
  margin-bottom: 60px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--st-gray-700);
}

/* =============================================
   Layout — titlediv, back arrow, buttons
   ============================================= */
.titlediv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--st-gray-200);
}

.titlediv > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.titlediv > h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--st-gray-800);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.01em;
}

.aBackTitle {
  font-size: 1.4rem;
  color: var(--st-gray-400);
  margin-right: 0.15em;
  transition: color var(--st-transition);
  text-decoration: none;
}
.aBackTitle:hover { color: var(--st-primary); text-decoration: none; }

.titlebutton { margin-left: 0; margin-right: 4px; padding: .22rem .55rem !important; font-size: .78rem !important; }
.modal-footer { gap: .4rem; }

@media screen and (max-width: 620px) {
  .titlediv { justify-content: flex-end; }
  .titlediv > h2 { display: none; }
}

.confirmation-card { max-width: 800px;  margin-top: 2rem; }
.edit-card          { max-width: 1000px; margin-top: 1rem; }

/* =============================================
   Cards
   ============================================= */
.card {
  border-radius: var(--st-radius) !important;
  box-shadow: var(--st-shadow-sm) !important;
  border: 1px solid var(--st-gray-200) !important;
  margin-bottom: 1.25rem;
}

.card-header {
  border-radius: var(--st-radius) var(--st-radius) 0 0 !important;
  padding: 0.875rem 1.25rem !important;
  background-color: var(--st-gray-50) !important;
  border-bottom: 1px solid var(--st-gray-200) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header h2,
.card-header h3,
.card-header h4,
.card-header strong {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--st-gray-700) !important;
  margin: 0 !important;
  letter-spacing: -0.01em;
}

.card-body {
  padding: 1.25rem !important;
}

/* Opt-in overflow scroll only where content is genuinely wider (tables, code blocks) */
.card-body-scroll { overflow: auto !important; }

/* Colored top-border variants */
.card-outline.card-primary { border-top: 3px solid var(--st-primary) !important; }
.card-outline.card-success { border-top: 3px solid var(--st-success) !important; }
.card-outline.card-warning { border-top: 3px solid var(--st-warning) !important; }
.card-outline.card-danger  { border-top: 3px solid var(--st-danger)  !important; }
.card-outline.card-info    { border-top: 3px solid var(--st-info)    !important; }

/* UI flat: le card decorative (tutte le varianti tranne danger) perdono ombra,
   barra superiore e separatore dell'header. Solo card-danger (conferme di
   eliminazione, anomalie) mantiene la barra colorata perche' comunica uno stato.
   Per tornare al look precedente basta rimuovere questo blocco. */
.card.card-outline:not(.card-danger) {
  box-shadow: none !important;
  border: 1px solid var(--st-gray-200) !important;
}
.card.card-outline:not(.card-danger) > .card-header {
  background-color: transparent !important;
  border-bottom: 0 !important;
  padding-bottom: 0.25rem !important;
}

/* =============================================
   Tables
   ============================================= */
table {
  width: 100% !important;
  text-align: left;
}

.table thead th {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-gray-500) !important;
  padding: 0.6rem 0.875rem !important;
  background: var(--st-gray-50) !important;
  border-bottom: 2px solid var(--st-gray-200) !important;
  white-space: nowrap;
}

.table td {
  padding: 0.55rem 0.875rem !important;
  font-size: 0.83rem !important;
  color: var(--st-gray-700);
  vertical-align: middle !important;
  border-bottom: 1px solid var(--st-gray-100) !important;
}

td { vertical-align: middle !important; }

.table tbody tr { transition: background-color var(--st-transition); }
.table tbody tr:hover { background-color: var(--st-gray-50) !important; }

.table.fancytree-ext-table { font-size: 0.83rem; }

/* =============================================
   Buttons
   ============================================= */
.btn {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  border-radius: var(--st-radius-sm) !important;
  transition: all var(--st-transition) !important;
  letter-spacing: 0.01em;
}

.btn:active { transform: translateY(1px); }

/* Compact icon buttons used in table action columns */
.btn-table {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: var(--st-radius-sm) !important;
}

/* Tighter gap between action buttons in a group */
.btn-group .btn + .btn { margin-left: 3px; }
.btn-group .btn-table + .btn-table { margin-left: 3px; }

/* =============================================
   Status Badges  (.st-badge)
   ============================================= */
.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  user-select: none;
}

/* Dot indicator */
.st-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.st-badge-success { background: var(--st-success-light); color: var(--st-success); }
.st-badge-danger  { background: var(--st-danger-light);  color: var(--st-danger);  }
.st-badge-warning { background: var(--st-warning-light); color: var(--st-warning); }
.st-badge-gray    { background: var(--st-gray-100);      color: var(--st-gray-500);}
.st-badge-primary { background: var(--st-primary-light); color: var(--st-primary); }
.st-badge-info    { background: var(--st-info-light);    color: var(--st-info);    }

/* Animated dot for "working/running" states */
.st-badge-pulse::before {
  animation: st-pulse 1.4s ease-in-out infinite;
}

@keyframes st-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.4; transform: scale(0.7);  }
}

/* =============================================
   API Key masking utility
   ============================================= */
.st-apikey-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.78rem;
}

.st-apikey-mask  { color: var(--st-gray-400); letter-spacing: 0.12em; }
.st-apikey-value { display: none; word-break: break-all; color: var(--st-gray-700); }

.st-apikey-cell.revealed .st-apikey-mask  { display: none; }
.st-apikey-cell.revealed .st-apikey-value { display: inline; }

.st-icon-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--st-radius-sm);
  color: var(--st-gray-400);
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
  transition: color var(--st-transition), background var(--st-transition);
  font-size: 0.75rem;
}
.st-icon-btn:hover         { color: var(--st-primary); background: var(--st-primary-light); }
.st-icon-btn.copy-success  { color: var(--st-success); background: var(--st-success-light); }

/* =============================================
   Forms
   ============================================= */
.form-control {
  border-radius: var(--st-radius-sm) !important;
  border-color: var(--st-gray-300) !important;
  font-size: 0.85rem !important;
  transition: border-color var(--st-transition), box-shadow var(--st-transition) !important;
  color: var(--st-gray-700) !important;
}

.form-control:focus {
  border-color: var(--st-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}

.form-group > label,
.form-group > strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--st-gray-600);
  margin-bottom: 0.3rem;
  display: block;
}

select.form-control,
select.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 14px;
}

textarea {
  line-height: 2ch;
  background-image: linear-gradient(transparent, transparent calc(2ch), #E7EFF8 0px);
  background-size: 100% 2ch;
  border-radius: var(--st-radius-sm) !important;
}

/* =============================================
   Modals
   ============================================= */
.modal-content {
  border-radius: var(--st-radius-lg) !important;
  border: none !important;
  box-shadow: var(--st-shadow-lg) !important;
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--st-gray-200) !important;
  padding: 1rem 1.25rem !important;
  background: var(--st-gray-50);
}

.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header strong {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--st-gray-800) !important;
  margin: 0 !important;
  letter-spacing: -0.01em;
}

.modal-footer {
  border-top: 1px solid var(--st-gray-200) !important;
  padding: 0.75rem 1.25rem !important;
  background: var(--st-gray-50);
}

.modal-body { padding: 1.25rem !important; }

.modal-backdrop { backdrop-filter: blur(2px); }

/* =============================================
   Alerts
   ============================================= */
.alert {
  border-radius: var(--st-radius) !important;
  font-size: 0.85rem;
  border-left-width: 4px !important;
}

/* AdminLTE rende alert-danger/alert-warning con sfondo saturo (rosso pieno / arancione pieno) e
   testo bianco/scuro alla radice — ma .text-muted di Bootstrap (!important) lo sovrascriveva con un
   grigio a basso contrasto su ENTRAMBI gli sfondi, illeggibile (es. card anomalie di Operations).
   Qui si forza il contrasto giusto per contesto invece di rimuovere .text-muted dai template. */
.alert-danger, .alert-danger .small, .alert-danger a { color: #fff !important; }
.alert-danger .text-muted { color: rgba(255, 255, 255, .85) !important; }
.alert-warning, .alert-warning .small, .alert-warning a { color: #1f2d3d !important; }
.alert-warning .text-muted { color: rgba(31, 45, 61, .7) !important; }

/* License warning as a pill badge */
#expiredWrite {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(220, 38, 38, .18);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, .3);
  animation: st-pulse-border 2.5s ease-in-out infinite;
}

@keyframes st-pulse-border {
  0%, 100% { border-color: rgba(220,38,38,.3); }
  50%       { border-color: rgba(220,38,38,.7); }
}

/* =============================================
   Toggle Switch (.form-switch)
   ============================================= */
.form-switch {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.form-switch span { margin-right: 0.8em; font-weight: 450; }

.form-switch i {
  position: relative;
  display: inline-block;
  margin-right: .5rem;
  width: 46px;
  height: 26px;
  background-color: var(--st-gray-300);
  border-radius: 23px;
  vertical-align: text-bottom;
  transition: background-color 0.3s linear;
}

.form-switch i::before {
  content: "";
  position: absolute;
  left: 0;
  width: 42px;
  height: 22px;
  background-color: #fff;
  border-radius: 11px;
  transform: translate3d(2px, 2px, 0) scale3d(1, 1, 1);
  transition: all 0.25s linear;
}

.form-switch i::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 22px;
  background-color: #fff;
  border-radius: 11px;
  box-shadow: 0 2px 2px rgba(0,0,0,.24);
  transform: translate3d(2px, 2px, 0);
  transition: all 0.2s ease-in-out;
}

label.form-switch:active i::after { width: 28px; transform: translate3d(2px, 2px, 0); }
label.form-switch:active input:is(:checked) + i::after { transform: translate3d(16px, 2px, 0); }

label.form-switch input { display: none; }

label.form-switch input:checked + i { background-color: var(--st-success); }
label.form-switch input:checked + i::before { transform: translate3d(18px, 2px, 0) scale3d(0, 0, 0); }
label.form-switch input:checked + i::after  { transform: translate3d(22px, 2px, 0); }

label.form-switch > input:disabled:checked + i     { background-color: color-mix(in srgb, var(--st-success) 50%, transparent); }
label.form-switch > input:disabled:not(:checked) + i::before { background-color: var(--st-gray-100); }

/* =============================================
   Cron / Schedule widgets
   ============================================= */
.custom-container-cron {
  display: block;
  margin: 20px;
  padding: 20px;
}

.cronjobselector {
  padding: 20px;
  background: var(--st-gray-100);
  border-radius: var(--st-radius);
}

.cronjobselector .timesAndDates ul li,
.cronjobselector .timesAndDates ul {
  list-style: none;
  margin: 0;
  padding: 0 10px;
}

.cronjobselector select:disabled { background: #ccc; }

/* =============================================
   Drag-and-drop / dropzone
   ============================================= */
.item { height: 100%; }

.dropzone {
  display: flex;
  height: 100px;
  width: 100px;
  margin: 10px;
  background-color: transparent;
  background-image: url(../images/placeholder.png);
  background-repeat: no-repeat;
  background-size: 100px 100px;
}

.draggable-dropzone--occupied {
  display: flex;
  justify-content: center;
}

/* =============================================
   Misc utilities
   ============================================= */
.rectangle {
  position: relative;
  padding: 20px;
  box-shadow: var(--st-shadow);
  border-radius: var(--st-radius);
}

.subtitleLabel { font-size: 1.35rem; font-weight: 700; color: var(--st-gray-700); }
.terminalImage { max-height: 35px; }
.iconImageHome { max-width: 30px; }

.divTitlePage {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2em;
}
.h1TitlePage { margin: 0; }

.rolebtn { display: flex; align-items: center; margin-top: 0.2em; }

/* =============================================
   JSTree / FancyTree
   ============================================= */
.jstree-table-header-regular     { background-color: white !important; }
.jstree-default .jstree-themeicon-custom { background-size: contain !important; }
.iconTableTree                    { max-height: 25px; }

.select2-container--default .select2-selection--single { height: 100% !important; }

.jstree-default .jstree-anchor {
  line-height: 24px !important;
  height: 35px !important;
  font-size: 20px !important;
}

div.jstree-table-cell-root-groupTree {
  line-height: 24px !important;
  min-height: 35px !important;
  font-size: 20px !important;
}

.jstree-table-separator { height: auto !important; }

.transparent-tooltip             { background: transparent; border: 1px solid red; box-shadow: none; }
.transparent-tooltip::before     { border: none; }

/* =============================================
   Pipeline — step type badges (for builder)
   ============================================= */
.st-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.st-step-filter    { background: #fef3c7; color: #92400e; }
.st-step-formatter { background: #dbeafe; color: #1e40af; }
.st-step-saver     { background: #dcfce7; color: #14532d; }
.st-step-reader    { background: #f3e8ff; color: #6b21a8; }

/* =============================================
   Form & Detail page design system
   ============================================= */

/* Card header h2/h3 — compact, uppercase section title */
.card .card-header h2,
.card .card-header h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: inherit;
  margin: 0;
  line-height: 1.4;
}

/* Form field labels */
label.control-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-gray-500);
  margin-bottom: 0.3rem;
  display: block;
}

/* Inline validation error messages */
span.text-danger,
.field-validation-error {
  font-size: 0.78rem;
  display: block;
  margin-top: 0.2rem;
}

/* Read-only / disabled fields (Details pages) */
.form-control:disabled,
.form-control[readonly] {
  background-color: var(--st-gray-50) !important;
  border-color: var(--st-gray-200) !important;
  color: var(--st-gray-600) !important;
  cursor: default !important;
}

/* Save / action buttons in titlediv */
.titlediv .btn {
  min-width: 110px;
  font-weight: 600;
}

/* Slightly tighter form-group spacing */
.form-group {
  margin-bottom: 1rem;
}

/* Form section divider */
.st-form-divider {
  border: none;
  border-top: 1px solid var(--st-gray-200);
  margin: 1.5rem 0;
}

/* Required field marker */
.st-req {
  color: var(--st-danger);
  margin-left: 2px;
}

/* Details page: value displayed as a clean text block */
.st-detail-value {
  display: block;
  padding: 0.45rem 0.75rem;
  background: var(--st-gray-50);
  border: 1px solid var(--st-gray-200);
  border-radius: var(--st-radius-sm);
  font-size: 0.875rem;
  color: var(--st-gray-700);
  min-height: 38px;
  line-height: 1.5;
}

/* =============================================
   Instance selector (sidebar selectpicker)
   ============================================= */
.main-sidebar nav .bootstrap-select {
  width: 100% !important;
}

.main-sidebar nav .bootstrap-select > .dropdown-toggle,
.main-sidebar nav .bootstrap-select > .dropdown-toggle.btn-light,
.main-sidebar nav .bootstrap-select > .dropdown-toggle.btn-default {
  width: 100%;
  white-space: normal;
  word-break: break-word;
  height: auto;
  min-height: 34px;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  background: #fff !important;
  color: var(--st-gray-700) !important;
  border: 1px solid #dde0e7 !important;
  border-radius: var(--st-radius-sm) !important;
  box-shadow: none !important;
}

.main-sidebar nav .bootstrap-select > .dropdown-toggle:hover,
.main-sidebar nav .bootstrap-select > .dropdown-toggle:focus,
.main-sidebar nav .bootstrap-select > .dropdown-toggle:active,
.main-sidebar nav .bootstrap-select > .dropdown-toggle.btn-light:hover {
  background: var(--st-primary-light) !important;
  color: var(--st-primary) !important;
  border-color: var(--st-primary) !important;
  box-shadow: none !important;
  outline: none !important;
}

.main-sidebar nav .bootstrap-select > .dropdown-toggle::after {
  border-top-color: var(--st-gray-500);
}

.main-sidebar nav .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.3;
  color: var(--st-gray-700);
}

.main-sidebar nav .bootstrap-select .dropdown-menu li a span.text {
  white-space: normal;
  word-break: break-word;
}

/* Collapsed (icon-only) sidebar: the instance picker and facility code have
   no place in a 4.6rem-wide rail, so hide them like AdminLTE hides nav text,
   and bring them back on the same hover/focus expand AdminLTE already uses. */
@media (min-width: 992px) {
  .sidebar-mini.sidebar-collapse .main-sidebar .bootstrap-select,
  .sidebar-mini.sidebar-collapse .main-sidebar .st-current-instance-code {
    display: none;
  }

  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover .bootstrap-select,
  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand).sidebar-focused .bootstrap-select,
  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover .st-current-instance-code,
  .sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand).sidebar-focused .st-current-instance-code {
    display: block;
  }
}

/* =============================================
   Content wrapper — unified background
   ============================================= */
.content-wrapper {
  background: var(--st-gray-100) !important;
}

/* =============================================
   Modalità "embed": pagina intera montata in un iframe da un widget della
   dashboard Home (?embed=1), invece di duplicarne la logica in un componente
   a parte — vedi .claude/plans/dashboard-widget-terminali-gridstack.md
   (widget Terminali) e .claude/plans/dashboard-home-widget-log-servizi-e-terminale.md
   (widget Log). Nasconde solo il telaio dell'app (navbar/sidebar/breadcrumb/
   banner tenant di _Layout.cshtml), non il contenuto della pagina.
   Promossa qui da `.tl-embed` (wwwroot/css/pages/terminalList.css): la regola
   non aveva nulla di specifico ai terminali.
   ============================================= */
body.page-embed .main-header,
body.page-embed .main-sidebar,
body.page-embed .tenant-alert-banner,
body.page-embed nav.st-breadcrumb { display: none !important; }
body.page-embed .content-wrapper {
  margin-left: 0 !important;
  margin-top: 0 !important;
  padding-bottom: 0 !important;
}
body.page-embed .content-wrapper .container-fluid { padding: 0 !important; }

/* =============================================
   Breadcrumb
   ============================================= */
.st-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--st-gray-400);
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.st-breadcrumb a {
  color: var(--st-gray-400);
  text-decoration: none;
  transition: color var(--st-transition);
}
.st-breadcrumb a:hover { color: var(--st-primary); }

.st-breadcrumb .sep { color: var(--st-gray-300); }

.st-breadcrumb .current {
  color: var(--st-gray-600);
  font-weight: 600;
}

/* =============================================
   Delete page — dl/dt/dd layout
   ============================================= */
.confirmation-card dl.row { margin: 0; }

.confirmation-card dl.row dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-gray-400);
  padding-top: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--st-gray-100);
}

.confirmation-card dl.row dd {
  font-size: 0.86rem;
  color: var(--st-gray-700);
  font-weight: 500;
  padding-top: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--st-gray-100);
  margin-bottom: 0;
}

.confirmation-card dl.row dt:last-of-type,
.confirmation-card dl.row dd:last-of-type {
  border-bottom: none;
}

/* =============================================
   DataTables — empty state
   ============================================= */
.dataTables_empty {
  padding: 2.5rem 1rem !important;
  color: var(--st-gray-400) !important;
  font-size: 0.85rem !important;
}

/* =============================================
   Editable table — edit in-line (creazione + modifica riga)
   ============================================= */
tr.st-editing-row {
  background-color: var(--st-primary-light) !important;
}

tr.st-editing-row > td {
  vertical-align: middle;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.st-edit-input {
  min-width: 90px;
}

.st-edit-error {
  margin-top: 0.15rem;
}

.st-edit-multiselect {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 110px;
  overflow-y: auto;
}

.st-edit-multiselect-opt {
  font-weight: normal;
  font-size: 0.8rem;
  margin-bottom: 0;
  white-space: nowrap;
}

/* Tabelle a densità ridotta (es. Documenti/Output di Schedule): .table-sm di Bootstrap è
   neutralizzato da ".table td" sopra (stessa specificità !important), serve una classe scoped. */
.st-table-compact th,
.st-table-compact td {
  padding: 0.3rem 0.6rem !important;
  font-size: 0.78rem !important;
}

/* =============================================
   DataTables — comandi di paging/ricerca/info, stessa scala del corpo tabella
   ============================================= */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_info {
  font-size: 0.78rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

/* =============================================
   Bootstrap client-side validation
   ============================================= */
.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: var(--st-danger) !important;
  background-image: none !important;
}

.was-validated .form-control:valid,
.form-control.is-valid {
  border-color: var(--st-success) !important;
  background-image: none !important;
}

.invalid-feedback {
  font-size: 0.76rem;
  color: var(--st-danger);
}

/* =============================================
   Password toggle button (show/hide)
   ============================================= */
.st-pw-toggle {
  padding: 0 0.6rem !important;
  min-width: unset !important;
  height: 38px;
  border-color: var(--st-gray-300) !important;
  background: var(--st-gray-50) !important;
  color: var(--st-gray-500) !important;
}
.st-pw-toggle:hover {
  background: var(--st-gray-100) !important;
  color: var(--st-gray-700) !important;
}

/* =============================================
   Card header with icon — icon colour hint
   ============================================= */
.card-header .card-header-icon {
  color: var(--st-primary);
  opacity: 0.7;
  margin-right: 0.35rem;
  font-size: 0.85rem;
}

/* =============================================
   Permission enabled / disabled icons (Role/Details)
   ============================================= */
.st-perm-icon { font-size: 1.05rem; margin-left: 0.4rem; flex-shrink: 0; }
.st-perm-on  { color: var(--st-success); }
.st-perm-off { color: var(--st-danger); }

/* =============================================
   Service status mini-badges (IndexServices)
   ============================================= */
.st-svc-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.72rem; font-weight: 600;
  padding: 0.18rem 0.5rem; border-radius: 0.75rem;
}
.st-svc-running  { background: #d1fae5; color: #065f46; }
.st-svc-updating { background: #fef3c7; color: #92400e; }
.st-svc-updated  { background: #dbeafe; color: #1e40af; }
.st-svc-stopped  { background: #f3f4f6; color: #6b7280; }
.st-svc-error    { background: #fee2e2; color: #991b1b; }

/* =============================================
   Log page — filter label width
   ============================================= */
.st-log-filter-label { width: 150px; flex-shrink: 0; margin: 0 1rem 0 0; }

/* =============================================
   Navbar — light gray, red accents (matches login)
   ============================================= */
.main-header.navbar {
  background: #f0f2f5 !important;
  border-bottom: 1px solid #dde0e7;
  padding: 0 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.main-header .nav-link {
  padding: 0.6rem 0.75rem;
  color: var(--st-gray-600);
  transition: color var(--st-transition);
}
.main-header .nav-link:hover { color: var(--st-primary); }

.navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-brand-logo {
  opacity: .9;
  max-height: 24px;
}

.navbar-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--st-primary-light);
  color: var(--st-primary);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.navbar-username {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--st-gray-700);
}

.navbar-lang-select {
  width: 68px;
  border-radius: 6px;
  padding: 3px 4px;
  font-size: 0.85rem;
  border: 1px solid var(--st-gray-300);
  background: #fff;
  color: var(--st-gray-700);
  cursor: pointer;
  transition: background var(--st-transition);
}
.navbar-lang-select:hover { background: var(--st-gray-100); }
.navbar-lang-select option { background: #fff; color: var(--st-gray-700); }

/* Hamburger icon nel navbar light */
.main-header .fas.fa-bars { color: var(--st-gray-600) !important; }

/* =============================================
   Sidebar — light gray, red accents (matches login)
   ============================================= */
.main-sidebar {
  background: #f0f2f5 !important;
  box-shadow: 2px 0 8px rgba(0,0,0,.07);
  border-right: 1px solid #dde0e7;
  /* AdminLTE riserva questo margine per compensare un .brand-link separato prima di .sidebar:
     qui il logo è dentro .sidebar stesso, quindi senza azzerarlo resta uno spazio vuoto in alto. */
  margin-top: 0 !important;
}

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

.main-sidebar .brand-link {
  border-bottom: 1px solid #dde0e7;
  padding: 0.85rem 1rem;
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
}

/* Override AdminLTE sidebar-dark-primary per tema chiaro */
.sidebar-dark-primary .nav-sidebar .nav-item .nav-link {
  padding: 0.42rem 0.8rem;
  border-radius: 6px;
  margin: 1px 8px;
  color: var(--st-gray-600);
  font-size: 0.81rem;
}
.sidebar-dark-primary .nav-sidebar .nav-item .nav-link p {
  color: var(--st-gray-600);
}
.sidebar-dark-primary .nav-sidebar .nav-item .nav-link:hover {
  background: var(--st-gray-100);
  color: #000;
  font-weight: 700;
}
.sidebar-dark-primary .nav-sidebar .nav-item .nav-link:hover p {
  color: #000;
  font-weight: 700;
}
/* Combinatore diretto (>) perché ".nav-item" è anche la classe delle voci annidate dentro
   ".nav-treeview": senza ">" questa regola vince (stessa specificità, 5 classi) sulla regola
   .nav-treeview .nav-link.active più sotto anche per padding-left/border-left, che quella non
   ridichiara — risultato: la voce annidata selezionata perdeva il rientro e appariva al livello
   orizzontale delle voci di primo livello invece che allineata alle sue sorelle. */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background: var(--st-info);
  color: #fff;
  font-weight: 700;
  border-left: 3px solid var(--st-info);
  padding-left: calc(0.8rem - 3px);
}
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active p {
  color: #fff;
  font-weight: 700;
}
.sidebar-dark-primary .nav-sidebar .nav-item .nav-link .nav-icon {
  color: var(--st-gray-400);
  font-size: 0.8rem;
  width: 1.3rem;
  transition: color var(--st-transition);
}
.sidebar-dark-primary .nav-sidebar .nav-item .nav-link.active .nav-icon {
  color: #fff;
}
.sidebar-dark-primary .nav-sidebar .nav-item .nav-link:hover .nav-icon {
  color: #000;
}
.sidebar-dark-primary .nav-header {
  color: var(--st-gray-400);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 0.8rem 1rem 0.2rem;
  margin-top: 0.2rem;
}

/* Sottomenu innestati (Configurazione, Pipeline, Utenti, Logs, AI, ...) — N livelli */
.sidebar-dark-primary .nav-sidebar .nav-treeview {
  background: rgba(0,0,0,.02);
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link {
  padding: 0.38rem 0.8rem 0.38rem 2.1rem;
  margin: 1px 8px;
  border-radius: 6px;
  color: var(--st-gray-600);
  font-size: 0.78rem;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-treeview .nav-link {
  padding-left: 3.3rem;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link p {
  color: var(--st-gray-600);
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link:hover,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link:focus {
  background: var(--st-gray-100);
  color: #000;
  font-weight: 700;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link:hover p,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link:focus p {
  color: #000;
  font-weight: 700;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link.active,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link.active:hover,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link.active:focus {
  background: var(--st-info);
  color: #fff;
  font-weight: 700;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link.active p {
  color: #fff;
  font-weight: 700;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link .nav-icon {
  color: var(--st-gray-400);
  font-size: 0.75rem;
  width: 1.2rem;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link.active .nav-icon {
  color: #fff;
}
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link:hover .nav-icon {
  color: #000;
}
/* Freccia di espansione: icona a riposo fa-angle-up (chiuso = su). adminlte.css ruota
   .right di -90deg su menu-open/menu-is-opening, il che porterebbe un'icona "su" a
   sinistra invece che giù: qui si sovrascrive a 180deg per avere sempre su/giù, mai
   sinistra, a qualunque profondità di nesting. */
.sidebar-dark-primary .nav-sidebar .nav-link .right {
  color: var(--st-gray-400);
}
.sidebar-dark-primary .nav-sidebar .nav-item.menu-open > .nav-link .right,
.sidebar-dark-primary .nav-sidebar .nav-item.menu-is-opening > .nav-link .right {
  color: var(--st-gray-600);
  transform: rotate(180deg);
}

/* Scrollbar sidebar in tema chiaro */
.sidebar { background: #f0f2f5 !important; }

.sidebar-copyright {
  padding: 0.75rem 1rem 1rem;
  font-size: 0.68rem;
  color: var(--st-gray-400);
  line-height: 1.6;
  text-align: center;
  border-top: 1px solid #dde0e7;
}
.sidebar-copyright a {
  color: rgba(255,255,255,.35);
  text-decoration: none;
  transition: color var(--st-transition);
}
.sidebar-copyright a:hover { color: var(--st-danger); }

/* =============================================
   btn-info → primary palette (reduce color count)
   ============================================= */
.btn-info {
  background-color: var(--st-primary);
  border-color: var(--st-primary);
  color: #fff;
}
.btn-info:hover, .btn-info:focus, .btn-info:active {
  background-color: var(--st-primary-dark);
  border-color: var(--st-primary-dark);
  color: #fff;
}
.btn-outline-info {
  color: var(--st-primary);
  border-color: var(--st-primary);
  background: transparent;
}
.btn-outline-info:hover {
  background-color: var(--st-primary);
  border-color: var(--st-primary);
  color: #fff;
}

/* =============================================
   Step type badges — palette-aligned
   ============================================= */
.st-step-filter    { background: var(--st-warning-light); color: #7c4800; }
.st-step-formatter { background: var(--st-primary-light); color: var(--st-primary-dark); }
.st-step-saver     { background: var(--st-success-light); color: #185c0c; }
.st-step-reader    { background: var(--st-gray-100);      color: var(--st-gray-600); }

/* =============================================
   Service status badges — palette-aligned
   ============================================= */
.st-svc-running  { background: var(--st-success-light); color: #185c0c; }
.st-svc-updating { background: var(--st-warning-light); color: #7c4800; }
.st-svc-updated  { background: var(--st-primary-light); color: var(--st-primary-dark); }
.st-svc-stopped  { background: var(--st-gray-100);      color: var(--st-gray-500); }
.st-svc-error    { background: var(--st-danger-light);   color: var(--st-danger); }

/* =============================================
   Modals — modern style
   ============================================= */
.modal-dialog {
  margin-top: 4vh;
}

.modal-content {
  border: none;
  border-radius: var(--st-radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.1);
  overflow: hidden;
}

.modal-header {
  background: var(--st-gray-50);
  border-bottom: 1px solid var(--st-gray-200);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header .close {
  margin: -0.5rem -0.5rem -0.5rem auto;
  padding: 0.5rem;
  opacity: .5;
  font-size: 1.2rem;
  line-height: 1;
  transition: opacity var(--st-transition);
}
.modal-header .close:hover { opacity: 1; }

.modal-body {
  padding: 1.25rem;
  background: #fff;
}

.modal-footer {
  background: var(--st-gray-50);
  border-top: 1px solid var(--st-gray-200);
  padding: 0.75rem 1.25rem;
  gap: 0.5rem;
}

.modal-backdrop.show { opacity: .4; }

/* =============================================
   SweetAlert2 — palette overrides
   ============================================= */
.swal2-popup {
  border-radius: var(--st-radius-lg);
  padding: 1.75rem 1.5rem;
  font-family: inherit;
}
.swal2-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--st-gray-800);
}
.swal2-html-container {
  font-size: 0.875rem;
  color: var(--st-gray-600);
}
.swal2-confirm {
  background-color: var(--st-primary);
  border-radius: var(--st-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1.25rem;
}
.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(77,78,107,.3); }
.swal2-cancel {
  background-color: var(--st-gray-200);
  color: var(--st-gray-700);
  border-radius: var(--st-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1.25rem;
}
.swal2-cancel:hover { background-color: var(--st-gray-300); }
.swal2-icon { margin: 0.75rem auto 1rem; }
.swal2-icon.swal2-success .swal2-success-ring { border-color: var(--st-success); }
.swal2-icon.swal2-success [class^=swal2-success-line] { background: var(--st-success); }
.swal2-icon.swal2-error [class^=swal2-x-mark-line] { background: var(--st-danger); }
.swal2-icon.swal2-warning { border-color: var(--st-warning); color: var(--st-warning); }

/* =============================================
   Dropdown user menu — modern
   ============================================= */
.st-user-dropdown {
  border-radius: var(--st-radius-lg);
  border: 1px solid var(--st-gray-200);
  box-shadow: var(--st-shadow-lg);
  min-width: 200px;
  overflow: hidden;
  padding: 0;
}

.st-user-header {
  background: var(--st-primary-light);
  border-bottom: 1px solid var(--st-gray-200);
  padding: 1rem;
  border-radius: 0;
}

/* Toastr — palette override */
.toast-success { background-color: var(--st-success); }
.toast-error   { background-color: var(--st-danger); }
.toast-warning { background-color: var(--st-warning); }
.toast-info    { background-color: var(--st-primary); }

#toast-container > div {
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  font-size: 0.83rem;
  opacity: .96;
}

/* =============================================
   btn-secondary — palette-aligned
   ============================================= */
.btn-secondary {
  background-color: var(--st-gray-200);
  border-color: var(--st-gray-300);
  color: var(--st-gray-700);
}
.btn-secondary:hover, .btn-secondary:focus {
  background-color: var(--st-gray-300);
  border-color: var(--st-gray-400);
  color: var(--st-gray-800);
}

.btn-outline-secondary {
  color: var(--st-gray-600);
  border-color: var(--st-gray-300);
}
.btn-outline-secondary:hover {
  background-color: var(--st-gray-100);
  border-color: var(--st-gray-400);
  color: var(--st-gray-800);
}

/* =============================================
   Utility helpers — replace common inline styles
   ============================================= */
.st-fw-medium { font-weight: 500; }

.st-code {
  font-size: 0.78rem;
  background: var(--st-gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--st-gray-700);
  font-family: var(--st-font-mono, "SFMono-Regular", Consolas, monospace);
}

.st-modal-section-title {
  font-weight: 700;
  color: var(--st-gray-700);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.st-modal-section-title:first-child { margin-top: 0; }

.st-modal-hint {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.st-modal-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--st-gray-600);
  margin-bottom: 0.25rem;
}

.st-col-grid { display: grid; }

.st-pre-json {
  height: 52vh;
  max-height: 52vh;
  border-radius: var(--st-radius);
  font-size: 0.82rem;
  overflow: auto;
}

/* Dropdown menu — override AdminLTE inline styles not needed */
.dropdown-menu {
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow-lg);
  border: 1px solid var(--st-gray-200);
  min-width: 160px;
}

/* =============================================
   Form / card layout helpers
   ============================================= */
.st-card-narrow { max-width: 500px; }
.st-card-md     { max-width: 600px; }
.st-card-lg     { max-width: 700px; }
.st-card-xl     { max-width: 1120px; }

/* Map / canvas containers */
.st-map-box     { width: 100%; height: 450px; }
.st-map-box-lg  { width: 100%; height: 540px; }
.st-fill        { width: 100%; height: 100%; }

/* Solari navbar logo */
.navbar-brand-logo {     max-height: 50px;
    width: auto;
    padding: 10px; }

/* Allow DataTable row dropdowns to escape overflow containers */
table.dataTable tbody .dropdown .dropdown-menu { position: fixed; }

/* =============================================
   Dimension utilities (width / height / max-*)
   ============================================= */
/* Percentage widths */
.st-select-half { width: 50%; }
.st-w-25pct     { width: 25%; }
.st-w-35pct     { width: 35%; }
.st-w-50pct     { width: 50%; }
.st-w-70pct     { width: 70%; }

/* Fixed pixel widths */
.st-w-50px      { width: 50px; }
.st-w-100px     { width: 100px; }
.st-w-150px     { width: 150px; }
.st-w-250px     { width: 250px; }
.st-w-300px     { width: 300px; }
.st-w-350px     { width: 350px; }

/* Fixed pixel heights */
.st-h-38        { height: 38px; }
.st-h-45        { height: 45px; }

/* Max-width constraints */
.st-mw-100px    { max-width: 100px; }
.st-mw-195px    { max-width: 195px; }
.st-mw-250px    { max-width: 250px; }
.st-mw-290px    { max-width: 290px; }
.st-mw-400px    { max-width: 400px; }

/* Max-height constraints */
.st-mh-150px    { max-height: 150px; }

/* Log viewer panel */
.st-log-view    { height: 60vh; max-height: 60vh; }

/* Scrollable bounded panel */
.st-scroll-panel { overflow-y: auto; max-height: 400px; }

/* =============================================
   Misc display / layout utilities
   ============================================= */
.st-inline-grid  { display: inline-grid; }
.st-invisible    { visibility: hidden; }
.st-no-pointer   { pointer-events: none; }
.st-flex-between { display: flex; justify-content: space-between; align-items: center; }
.st-aside-line   { border-left: 3px solid var(--st-gray-300); padding-left: 0.75rem; }
.st-mt-modal     { margin-top: 20px; }

/* Square compact action button */
.st-btn-sq { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }

/* Service status grid (Home/Index) */
.grid-container { display: grid; grid-template-columns: repeat(3, 1fr); }

/* =============================================
   Modal header — normalize heading size
   ============================================= */
.modal-header h1, .modal-header h2, .modal-header h3,
.modal-header h4, .modal-header h5, .modal-header h6,
.modal-header strong {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: var(--st-gray-800);
}

/* =============================================
   Component-specific overrides
   ============================================= */
/* User-action log row colours */
.redClass    { background-color: var(--st-danger-light) !important; }
.yellowClass { background-color: rgba(249,169,37,.18)   !important; }
.greenClass  { background-color: rgba(98,196,47,.15)    !important; }

/* Log viewer select width (bootstrap-select plugin) */
.bootstrap-select { width: 220px !important; }

/* Log viewer two-column layout */
.mainflex {
    display: flex;
    justify-content: space-between;
    margin-top: 1em;
    flex-direction: row;
}
@media screen and (max-width: 1450px) {
    .mainflex { flex-direction: column; }
    .mainflex > div { margin-top: 1em; }
}

/* =============================================
   Tenant alert banner
   ============================================= */
.tenant-alert-banner {
  background: #fff3cd;
  border-bottom: 2px solid #f0ad4e;
  padding: 0.55rem 1.5rem;
}
.tenant-alert-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
}
.tenant-alert-icon {
  color: #856404;
  font-size: 1rem;
  flex-shrink: 0;
}
.tenant-alert-body {
  flex: 1;
  font-size: 0.875rem;
  color: #664d03;
}
.tenant-alert-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}
.tenant-alert-date {
  font-size: 0.75rem;
  color: #997404;
  white-space: nowrap;
  flex-shrink: 0;
}
.tenant-alert-dismiss {
  background: none;
  border: none;
  color: #856404;
  cursor: pointer;
  padding: 0 0 0 0.5rem;
  font-size: 0.9rem;
  opacity: 0.7;
  flex-shrink: 0;
}
.tenant-alert-dismiss:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   Home/Index — Command grid, status badges, cards, KPI, layout
   ═══════════════════════════════════════════════════════════════ */
.cmd-grid-wrapper { margin-bottom: 4px; }
.cmd-cat-label { font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #868e96; margin: 10px 0 4px; border-bottom: 1px solid #e9ecef; padding-bottom: 2px; }
.cmd-btn-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.cmd-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 8px 3px; font-size: .63rem; line-height: 1.2; min-height: 54px;
    border: 1px solid #dee2e6; border-radius: 6px; background: #fff;
    color: #495057; cursor: pointer; transition: background .12s, border-color .12s, color .12s;
    text-align: center; word-break: break-word;
}
.cmd-btn i { font-size: 1.1rem; margin-bottom: 3px; display: block; }
.cmd-btn:hover { background: #e9ecef; border-color: #adb5bd; }
.cmd-btn.active { background: #007bff; border-color: #0069d9; color: #fff; box-shadow: 0 2px 5px rgba(0,123,255,.3); }
.cmd-btn.active:hover { background: #0069d9; }
.cmd-btn:disabled, .cmd-btn.cmd-btn-fw-locked {
    opacity: .6; cursor: not-allowed; background: #fff5f5; border-color: #f5c2c7; color: #dc3545;
}
.cmd-btn:disabled:hover, .cmd-btn.cmd-btn-fw-locked:hover { background: #fff5f5; border-color: #f5c2c7; }
.cmd-btn:disabled i, .cmd-btn.cmd-btn-fw-locked i { color: #dc3545; }

.st-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: .67rem; font-weight: 600; white-space: nowrap; }
.st-badge i { font-size: .72rem; }
.st-ok      { background: #d4edda; color: #155724; }
.st-offline { background: #f8d7da; color: #721c24; }
.st-warning { background: #fff3cd; color: #856404; }
.st-update  { background: #cce5ff; color: #004085; }
.st-config    { background: #e2e3e5; color: #383d41; }
.st-provision { background: #dbeafe; color: #1e3a5f; }
.st-error     { background: #f8d7da; color: #721c24; }
.st-neutral   { background: #f8f9fa; color: #868e96; }

#cardGrid { padding: 4px 0; }
.st-card { border-radius: 8px; border: 1px solid #dee2e6; border-left: 4px solid #6c757d; overflow: hidden; height: 100%; display: flex; flex-direction: column; background: #fff; transition: box-shadow .15s; }
.st-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.st-card.bl-ok      { border-left-color: #28a745; }
.st-card.bl-offline { border-left-color: #dc3545; }
.st-card.bl-warning { border-left-color: #ffc107; }
.st-card.bl-error   { border-left-color: #dc3545; }
.st-card.bl-update  { border-left-color: #17a2b8; }
.st-card.bl-config    { border-left-color: #6f42c1; }
.st-card.bl-provision { border-left-color: #1e3a5f; }
.st-card.bl-neutral   { border-left-color: #6c757d; }
.st-card-header { padding: 8px 12px; font-weight: 600; font-size: .83rem; display: flex; align-items: center; gap: 8px; background: #f8f9fa; border-bottom: 1px solid #dee2e6; cursor: pointer; }
.st-card-header:hover { background: #e9ecef; }
.st-card-header .st-card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-card-body { padding: 8px 12px; font-size: .80rem; flex: 1; cursor: pointer; }
.st-card-body:hover { background: rgba(0,0,0,.02); }
.st-card-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }
.st-card-label { color: #6c757d; font-size: .75rem; }
.st-card-footer { padding: 8px 12px; border-top: 1px solid #dee2e6; background: #f8f9fa; display: flex; gap: 4px; flex-wrap: wrap; }
.st-card-group-header { background: #e9ecef; }

.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; }
@media (max-width: 992px) { .kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 576px)  { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
.kpi-card {
    border-radius: 8px; padding: 9px 12px 13px;
    display: flex; align-items: center; gap: 10px;
    position: relative; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    animation: kpiFadeUp .45s ease both;
    cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.kpi-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.kpi-card:focus-visible { outline: 2px solid rgba(255,255,255,.9); outline-offset: 1px; }
.kpi-card.kpi-active { box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 4px 12px rgba(0,0,0,.18); }
.kpi-card::after {
    content:''; position:absolute; top:-20px; right:-20px;
    width:70px; height:70px; border-radius:50%; background:rgba(255,255,255,.08);
    pointer-events:none;
}
.kpi-total   { background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%); color:#fff; animation-delay:.05s; }
.kpi-online  { background: linear-gradient(135deg, #134e2a 0%, #1e7e4a 100%); color:#fff; animation-delay:.10s; }
.kpi-offline { background: linear-gradient(135deg, #6b1414 0%, #b02a2a 100%); color:#fff; animation-delay:.15s; }
.kpi-update      { background: linear-gradient(135deg, #5c3200 0%, #b36200 100%); color:#fff; animation-delay:.20s; }
.kpi-provision   { background: linear-gradient(135deg, #2c3e50 0%, #4a6278 100%); color:#fff; animation-delay:.25s; }
.kpi-icon { font-size: 1.4rem; opacity: .80; flex-shrink: 0; }
.kpi-info { flex: 1; min-width: 0; }
.kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; font-family:'Roboto Mono',monospace,sans-serif; }
.kpi-label { font-size: .62rem; opacity: .75; text-transform: uppercase; letter-spacing: .09em; margin-top: 2px; }
.kpi-pct { font-size: .7rem; font-weight: 700; opacity: .75; font-family:'Roboto Mono',monospace,sans-serif; white-space:nowrap; align-self:flex-end; padding-bottom:2px; }
.kpi-dot {
    position: absolute; top: 8px; right: 9px;
    width: 7px; height: 7px; border-radius: 50%;
}
.kpi-dot-on  { background: #6ee7a0; animation: dotPulse 2s infinite; }
.kpi-dot-err { background: #f87171; animation: dotPulse 2s infinite 1s; }
.kpi-dot-neu  { background: rgba(255,255,255,.35); }
.kpi-dot-prov { background: rgba(255,255,255,.5); animation: dotPulse 3s infinite .5s; }
.kpi-bar-wrap { position:absolute; bottom:0; left:0; right:0; height:4px; background:rgba(255,255,255,.15); }
.kpi-bar { height:100%; background:rgba(255,255,255,.8); transition:width .6s cubic-bezier(.4,0,.2,1); border-radius:0 2px 2px 0; }

.home-split { display: flex; gap: 0; align-items: flex-start; min-height: 520px; }
.hs-left { flex: 1 1 65%; min-width: 200px; overflow: hidden; display: flex; flex-direction: column; }
.hs-left > .card { flex: 1; margin-bottom: 0; }
.hs-divider {
    flex: 0 0 7px; cursor: col-resize; background: #e2e8f0;
    border-radius: 4px; margin: 4px 3px;
    position: relative; transition: background .15s;
    display: flex; align-items: center; justify-content: center; z-index: 10;
}
.hs-divider:hover, .hs-divider.dragging { background: #3b82f6; }
.hs-divider::before {
    content: ''; display: block;
    width: 3px; height: 32px; background: currentColor;
    border-radius: 2px; opacity: .45; box-shadow: 4px 0 0 currentColor;
}

.hs-right {
    flex: 0 0 340px; min-width: 240px; max-width: 600px;
    display: flex; flex-direction: column;
    background: #f8fafc; border-radius: 8px; overflow: hidden;
    border: 1px solid #dee2e6; box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.rp-header {
    padding: 11px 14px; background: #1e293b; color: #fff;
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.rp-header-name { font-weight: 600; font-size: .88rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-placeholder {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #94a3b8; gap: 10px; padding: 32px 20px; text-align: center; font-size: .82rem;
}
.rp-placeholder i { font-size: 2.2rem; opacity: .5; }
.rp-cmd-scroll { flex: 1; overflow-y: auto; padding: 10px 12px; display: none; }
.rp-send-bar { padding: 10px 12px; background: #fff; border-top: 1px solid #e2e8f0; flex-shrink: 0; display: none; }
.rp-activity {
    border-top: 1px solid #e2e8f0; flex-shrink: 0;
    max-height: 260px; overflow-y: auto; background: #fff;
}
.rp-act-header {
    padding: 6px 12px; font-size: .67rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; color: #64748b;
    background: #f8fafc; border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0;
}
.rp-act-item {
    padding: 5px 10px 5px 13px; border-bottom: 1px solid #f8fafc; font-size: .72rem;
    animation: slideRight .18s ease-out; border-left: 3px solid transparent;
    transition: border-left-color .3s, background .3s;
}
.rp-act-item:last-child { border-bottom: none; }
.rp-act-row1 { display: flex; align-items: center; gap: 7px; }
.rp-act-ok   { color: #16a34a; }
.rp-act-err  { color: #dc2626; }
.rp-act-target { font-weight: 600; color: #334155; max-width: 85px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.rp-act-cmd  { flex: 1; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-act-time { color: #94a3b8; font-size: .66rem; white-space: nowrap; flex-shrink: 0; }
.rp-act-empty { padding: 14px 12px; text-align: center; color: #94a3b8; font-size: .75rem; }
.rp-act-reply { font-size: .68rem; padding: 2px 0 0 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-act-reply-ok   { color: #16a34a; }
.rp-act-reply-err  { color: #dc2626; }
.rp-act-reply-wait { color: #94a3b8; font-style: italic; }
.rp-act-pending     { border-left-color: #94a3b8; }
.rp-act-replied-ok  { border-left-color: #16a34a; background: #f0fdf4; }
.rp-act-replied-err { border-left-color: #dc2626; background: #fef2f2; }

@keyframes kpiFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes dotPulse {
    0%   { box-shadow: 0 0 0 0 rgba(110,231,160,.7); }
    70%  { box-shadow: 0 0 0 8px rgba(110,231,160,0); }
    100% { box-shadow: 0 0 0 0 rgba(110,231,160,0); }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.st-legend-fab {
    position: fixed; bottom: 24px; right: 24px; z-index: 1040;
    width: 42px; height: 42px; border-radius: 50%;
    background: #495057; color: #fff; border: none; box-shadow: 0 3px 10px rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: background .15s, transform .15s;
}
.st-legend-fab:hover { background: #343a40; transform: scale(1.08); }

/* ═══════════════════════════════════════════════════════════════
   Pipeline/Index — KPI row, table styling, channel cards
   ═══════════════════════════════════════════════════════════════ */
#pl-kpi-row .small-box { border-radius: 10px; overflow: hidden; margin-bottom: 0; }
#pl-kpi-row .small-box h3 { font-size: 2rem; font-weight: 700; margin-bottom: 0; }
#pl-kpi-row .small-box p  { margin-bottom: 0; font-size: .85rem; opacity: .9; }
#pl-kpi-row .small-box .icon { font-size: 3rem; top: 8px; right: 12px; }

#pipelinesTable thead th {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #ecf0f1;
    border-color: rgba(255,255,255,.1) !important;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .65rem .75rem;
}
#pipelinesTable tr.pl-row-active td:first-child { border-left: 3px solid #28a745 !important; }
#pipelinesTable tr.pl-row-stop  td:first-child  { border-left: 3px solid #ffc107 !important; }
#pipelinesTable tr.pl-row-error td:first-child  { border-left: 3px solid #dc3545 !important; }
#pipelinesTable tbody tr { transition: background .12s; }
#pipelinesTable tbody tr:hover > td { background: rgba(0,123,255,.03) !important; }

@keyframes pl-glow {
    0%,100% { box-shadow: 0 0 0 0 rgba(40,167,69,.5); }
    60%      { box-shadow: 0 0 0 6px rgba(40,167,69,0); }
}
.st-badge-pulse { animation: pl-glow 1.5s infinite; }

#pl-sync-chip { display: flex; align-items: center; gap: .4rem; }
#pl-sync-chip .pl-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #28a745; flex-shrink: 0;
    animation: pl-dot-blink 2s infinite;
}
@keyframes pl-dot-blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.channel-card {
    border-left: 4px solid #007bff;
    margin: .6rem;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,.07);
    overflow: hidden;
}
.channel-card:nth-child(2n) { border-left-color: #17a2b8; }
.channel-card:nth-child(3n) { border-left-color: #6f42c1; }
.channel-card .ch-header {
    background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #dee2e6;
    padding: .55rem .85rem;
    display: flex; align-items: center;
}
.ch-num-badge {
    width: 26px; height: 26px; border-radius: 50%;
    background: #007bff; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .78rem; flex-shrink: 0;
}
.channel-card:nth-child(2n) .ch-num-badge { background: #17a2b8; }
.channel-card:nth-child(3n) .ch-num-badge { background: #6f42c1; }
.ch-field-label {
    font-size: .7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: #6c757d; margin-bottom: .2rem;
}
.scarico-section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    cursor: pointer;
}
.scarico-section-header:hover { background: #f0f4f8; }

/* =============================================
   Sticky titlediv (punto 11)
   ============================================= */
.titlediv {
  position: sticky;
  top: 0;
  z-index: 98;
  background: var(--st-gray-100);
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Badge "modifiche non salvate": centrato in alto nell'header di pagina invece che
   accanto ai pulsanti azione, per non generare confusione con essi. .titlediv è già
   positioned (sticky) sopra; .card-header (es. CheckAndIn/Index) va reso positioned qui. */
.card-header:has(#unsavedChangesBadge) {
  position: relative;
}

#unsavedChangesBadge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  white-space: nowrap;
}

/* =============================================
   Page progress bar (punto 7)
   ============================================= */
#st-load-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  height: 3px;
  background: var(--st-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease, opacity .3s ease .1s;
  pointer-events: none;
  opacity: 0;
}
#st-load-bar.st-loading {
  transform: scaleX(0.65);
  opacity: 1;
  transition: transform 2s cubic-bezier(.1,0,.4,1), opacity .1s;
}
#st-load-bar.st-done {
  transform: scaleX(1);
  opacity: 0;
  transition: transform .15s ease, opacity .25s ease .1s;
}

/* =============================================
   Empty state component (punto 8)
   ============================================= */
.st-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--st-gray-400);
}
.st-empty-state i {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  opacity: .5;
}
.st-empty-state-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--st-gray-500);
  margin-bottom: .35rem;
}
.st-empty-state-sub {
  font-size: .8rem;
  color: var(--st-gray-400);
  margin-bottom: 1.25rem;
}

/* DataTables empty row — richer style */
.dataTables_empty {
  padding: 0 !important;
  background: transparent !important;
}
.dt-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem;
  color: var(--st-gray-400);
}
.dt-empty-inner i { font-size: 2rem; margin-bottom: .6rem; opacity: .45; }
.dt-empty-inner span { font-size: .83rem; font-weight: 500; color: var(--st-gray-500); }

/* =============================================
   Card scelta tipo terminale (modal Crea Programmazione)
   ============================================= */
.st-type-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.st-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 16px;
  background: #fff;
  border: 1px solid var(--st-gray-200);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow-xs);
  text-align: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color var(--st-transition), box-shadow var(--st-transition), transform var(--st-transition);
}
.st-type-card:hover,
.st-type-card:focus {
  border-color: var(--st-primary);
  box-shadow: var(--st-shadow);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.st-type-card.selected {
  border-color: var(--st-primary);
  border-width: 2px;
  background: var(--st-gray-50, #f8f9fa);
  box-shadow: var(--st-shadow);
}
.st-type-card img {
  height: 96px;
  max-width: 100%;
  object-fit: contain;
}
.st-type-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--st-gray-800);
}
.st-type-card-subtitle {
  font-size: .82rem;
  color: var(--st-gray-500);
}

/* Righe di tabella trascinabili (drag&drop nativo, es. riordino operazioni DESFire) */
.dt-draggable-row {
  cursor: move;
}
.dt-draggable-row.dt-dragging {
  opacity: .4;
}
.dt-draggable-row.dt-drag-over {
  box-shadow: inset 0 2px 0 var(--st-primary), inset 0 -2px 0 var(--st-primary);
}

/* Dashboard Home: evidenzia i widget mentre la griglia è in modalità "Personalizza" */
#dashWidgets.dash-editing .grid-stack-item-content { outline: 2px dashed var(--solari-red, #E01F1C); outline-offset: -2px; cursor: move; }
