/*
 * Copyright (c) 2026 Leonardo Marchi. Tutti i diritti riservati.
 * Codice proprietario. Uso non autorizzato vietato.
 * Vedi NOTICE.txt per titolarita e condizioni d'uso.
 */

:root {
  --bg: #0c1224;
  --bg-soft: #121b34;
  --panel: rgba(20, 29, 53, 0.8);
  --panel-strong: rgba(15, 23, 44, 0.92);
  --panel-light: rgba(255, 255, 255, 0.06);
  --line: rgba(162, 185, 228, 0.28);
  --line-strong: rgba(188, 212, 255, 0.46);
  --text: #ebf1ff;
  --muted: #9eafd4;
  --accent: #2ed4a6;
  --accent-2: #4f8cff;
  --accent-3: #6f58ff;
  --danger: #ff5e74;
  --warning: #ffb44f;
  --ok: #39d0a4;
  --shadow-lg: 0 24px 58px rgba(5, 10, 24, 0.46);
  --shadow-md: 0 14px 30px rgba(5, 10, 24, 0.34);
  --ui-font-family: "Rajdhani", "Segoe UI", sans-serif;
}

html {
  font-size: 16px;
}

body[data-ui-font="rajdhani"] {
  --ui-font-family: "Rajdhani", "Segoe UI", sans-serif;
}

body[data-ui-font="segoe"] {
  --ui-font-family: "Segoe UI", Tahoma, sans-serif;
}

body[data-ui-font="arial"] {
  --ui-font-family: Arial, "Helvetica Neue", sans-serif;
}

body[data-ui-font="verdana"] {
  --ui-font-family: Verdana, Geneva, sans-serif;
}

body[data-ui-font="trebuchet"] {
  --ui-font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body[data-ui-font="georgia"] {
  --ui-font-family: Georgia, "Times New Roman", serif;
}

body[data-ui-font] *:not(iframe) {
  font-family: var(--ui-font-family) !important;
}

body[data-ui-bold="off"] {
  --ui-font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

body[data-ui-bold="off"] *:not(iframe) {
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

body[data-ui-bold="off"] :is(h1, h2, h3, h4, h5, h6, strong, b, th) {
  font-weight: 500 !important;
}

body[data-ui-bold="off"] :is(.btn, .tab, .topbar, .badge, .panel-title, .section-title) {
  font-weight: 500 !important;
}

/* Compattezza grafica generale */
.tab {
  letter-spacing: 0.01em !important;
  font-size: clamp(0.78rem, 0.88vw, 0.9rem);
  padding: clamp(6px, 0.75vw, 8px) clamp(8px, 0.85vw, 11px);
}

.topbar .tab {
  font-size: clamp(0.68rem, 0.75vw, 0.78rem);
  padding: clamp(4px, 0.65vw, 6px) clamp(7px, 0.8vw, 9px);
}

.btn,
.btn-icon {
  font-size: clamp(0.72rem, 0.8vw, 0.86rem);
  height: clamp(26px, 2.1vw, 32px);
  padding: 0 clamp(7px, 0.8vw, 10px);
}

.btn-icon {
  width: clamp(26px, 2.1vw, 32px);
}

.search,
.date-input {
  height: clamp(26px, 2.1vw, 32px);
  font-size: 0.92rem;
}

.datebox {
  min-height: clamp(26px, 2.1vw, 32px);
}

.datebox span,
.datebox .date-label {
  height: clamp(26px, 2.1vw, 32px);
  padding: 0 clamp(6px, 0.7vw, 9px);
}

.cell-input,
.cell-select {
  font-size: clamp(0.76rem, 0.86vw, 0.92rem);
  padding: clamp(2px, 0.35vw, 4px) clamp(4px, 0.45vw, 6px);
  line-height: 1.05;
}

.cell-input-multiline {
  line-height: 1.05;
  min-height: 28px;
}

.data-table th,
.data-table td {
  padding-top: 2px;
  padding-bottom: 2px;
}

.anag-card {
  padding: 8px;
}

.anag-card h4 {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 166, 231, 0.58) rgba(255,255,255,0.03);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(108, 147, 224, 0.9), rgba(64, 103, 181, 0.9));
  border-radius: 999px;
  border: 1px solid rgba(13, 20, 38, 0.45);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(132, 172, 244, 0.95), rgba(75, 116, 197, 0.95));
}

@page {
  size: landscape;
  margin: 10mm;
}

@media print {
  :root { color-scheme: light; }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
  }

  body * {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  .topbar,
  .tabs,
  .toolbar,
  .selection-bar,
  .login-overlay,
  .modal,
  .chat-widget,
  .chat-panel,
  .fullscreen-widget,
  .btn,
  .cell-combo-select,
  .cer-multi-remove,
  .cer-multi-add {
    display: none !important;
  }

  main.shell {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  .panel {
    display: none !important;
  }

  .panel[data-panel="viaggio"].is-active {
    display: block !important;
    background: #fff !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.print-viaggi .panel[data-panel="viaggio"].is-active::before {
    content: attr(data-print-viaggi-title);
    display: block;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 700;
    color: #000;
    margin: 0 0 6mm 0;
    padding-bottom: 2mm;
    border-bottom: 1px solid #000;
  }

  .table-wrap {
    overflow: visible !important;
    border: 0 !important;
    background: #fff !important;
    padding: 0 !important;
    max-height: none !important;
  }

  .data-table {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse !important;
    background: #fff !important;
    font-family: Arial, sans-serif !important;
    font-size: 8.5pt !important;
    color: #000 !important;
  }

  .data-table thead {
    display: table-header-group;
  }

  .data-table th,
  .data-table td {
    position: static !important;
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    padding: 2mm 1.5mm !important;
    vertical-align: top;
  }

  .data-table th {
    font-size: 8pt !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    display: none !important;
  }

  .cell-input,
  .cell-select,
  .cell-input-multiline {
    background: transparent !important;
    color: #000 !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    font-family: Arial, sans-serif !important;
    font-size: 8.5pt !important;
    line-height: 1.2 !important;
    white-space: pre-wrap !important;
    -webkit-text-fill-color: #000 !important;
    appearance: none !important;
  }

  textarea.cell-input-multiline {
    resize: none !important;
    overflow: visible !important;
  }

  .cell-combo,
  .date-slot-cell,
  .cer-multi-wrap,
  .cer-multi-item {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 2px !important;
  }

  .cer-multi-item-top {
    grid-template-columns: 1fr 42px 24px !important;
  }

  .muted,
  .cer-multi-desc {
    color: #333 !important;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}


body {
  color: var(--text);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  background:
    radial-gradient(1000px 560px at -10% -14%, rgba(79, 140, 255, 0.38), transparent 60%),
    radial-gradient(780px 420px at 108% -8%, rgba(46, 212, 166, 0.26), transparent 58%),
    radial-gradient(920px 470px at 50% 118%, rgba(111, 88, 255, 0.24), transparent 66%),
    linear-gradient(180deg, #081125 0%, #090f1f 36%, #0b1223 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
}

body::before {
  width: 340px;
  height: 340px;
  top: 10vh;
  right: 6vw;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.28), transparent 70%);
  filter: blur(8px);
}

body::after {
  width: 280px;
  height: 280px;
  left: 6vw;
  bottom: 10vh;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(46, 212, 166, 0.22), transparent 74%);
  filter: blur(8px);
}

body.locked .topbar,
body.locked .shell {
  filter: blur(8px) saturate(0.8);
  pointer-events: none;
  user-select: none;
}

.login-view {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(3, 7, 17, 0.62);
  z-index: 50;
  backdrop-filter: blur(10px);
}

body.locked .login-view {
  display: grid;
}

.boot-splash {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(5, 10, 21, 0.6);
  backdrop-filter: blur(8px);
  z-index: 60;
}

body.booting .boot-splash {
  display: grid;
}

body.booting .login-view {
  display: none !important;
}

.boot-splash-card {
  width: min(340px, 88vw);
  border-radius: 16px;
  border: 1px solid rgba(188, 212, 255, 0.24);
  background: linear-gradient(160deg, rgba(18, 28, 50, 0.92), rgba(13, 21, 39, 0.95));
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.boot-splash-card strong {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.boot-splash-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.boot-splash-spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(188, 212, 255, 0.2);
  border-top-color: rgba(79, 140, 255, 0.95);
  animation: boot-spin 0.9s linear infinite;
}

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

.login-card {
  width: min(440px, 92vw);
  border-radius: 20px;
  border: 1px solid rgba(188, 212, 255, 0.32);
  background:
    linear-gradient(155deg, rgba(22, 33, 60, 0.94) 0%, rgba(16, 26, 49, 0.95) 52%, rgba(15, 22, 42, 0.96) 100%);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  display: grid;
  gap: 12px;
}

.login-card h1 {
  margin: 0;
  font-family: "Barlow Condensed", "Rajdhani", sans-serif;
  font-size: clamp(2rem, 4vw, 2.4rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-card label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  text-transform: uppercase;
  color: #cfe0ff;
}

.login-password-wrap {
  position: relative;
}

.login-password-wrap input {
  padding-right: 64px;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(188, 212, 255, 0.24);
  background: rgba(14, 26, 44, 0.72);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-password-toggle:hover {
  background: rgba(18, 33, 54, 0.92);
}

.login-password-toggle:focus-visible {
  outline: 2px solid rgba(154, 195, 255, 0.9);
  outline-offset: 2px;
}

.login-password-toggle-icon {
  position: relative;
  width: 18px;
  height: 12px;
  border: 2px solid rgba(243, 246, 251, 0.92);
  border-radius: 12px / 8px;
}

.login-password-toggle-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(243, 246, 251, 0.92);
  transform: translate(-50%, -50%);
}

.login-password-toggle.is-visible .login-password-toggle-icon::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 7px;
  width: 2px;
  height: 18px;
  border-radius: 999px;
  background: rgba(243, 246, 251, 0.96);
  transform: rotate(45deg);
}

.login-capslock {
  color: #ffd27d;
  min-height: 20px;
}

.login-card input,
.login-card textarea,
.login-card select,
.search,
.date-input,
.cell-input,
.cell-select,
.anag-form input,
.anag-form textarea,
.anag-form select {
  border: 1px solid rgba(179, 203, 248, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
}

.login-card input::placeholder,
.anag-form input::placeholder,
.anag-form textarea::placeholder,
.search::placeholder,
.cell-input::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, #ffffff 12%);
}

.login-card input:focus,
.login-card textarea:focus,
.login-card select:focus,
.search:focus,
.cell-input:focus,
.cell-select:focus,
.date-input:focus,
.anag-form input:focus,
.anag-form textarea:focus,
.anag-form select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-2) 74%, #ffffff 26%);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.2);
}

.login-error {
  color: #ff8fa0;
  min-height: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
  padding: clamp(10px, 1.2vw, 14px) clamp(12px, 1.4vw, 18px);
  border-bottom: 1px solid rgba(167, 193, 240, 0.22);
  background:
    linear-gradient(90deg, rgba(13, 20, 40, 0.9) 0%, rgba(15, 24, 46, 0.78) 100%);
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
  min-width: 0;
  flex: 1 1 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Barlow Condensed", "Rajdhani", sans-serif;
  font-size: clamp(0.96rem, 1.35vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d8e7ff;
}

.brand-logo {
  width: clamp(42px, 3vw, 56px);
  height: clamp(42px, 3vw, 56px);
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px;
}

.brand-text {
  line-height: 1;
}

.brand-text-wrap {
  display: grid;
  gap: 2px;
  line-height: 1;
}

.brand-subtext {
  font-size: 1em;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.userbox {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 0.9vw, 12px);
  text-transform: uppercase;
  color: #dce9ff;
}

.user-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(6px, 0.8vw, 10px);
}

.user-text-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.user-meta strong {
  font-size: clamp(0.9rem, 1vw, 1.05rem);
  line-height: 1;
}

.user-text-meta #userRole {
  line-height: 1;
}

.user-meta span {
  color: var(--muted);
  font-size: clamp(0.74rem, 0.82vw, 0.88rem);
  line-height: 1;
}

.user-meta span.role-top-owner {
  color: #ff5f5f;
  font-weight: 700;
}

.user-meta span.role-top-admin {
  color: #ffaf45;
  font-weight: 700;
}

.user-meta span.role-top-user {
  color: #59d88d;
  font-weight: 700;
}

.user-actions {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.7vw, 8px);
}

.user-avatar {
  width: clamp(28px, 2vw, 34px);
  height: clamp(28px, 2vw, 34px);
  border-radius: clamp(8px, 0.7vw, 10px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(163, 189, 240, 0.64);
  color: #d4e4ff;
  background: rgba(255, 255, 255, 0.06);
  font-size: clamp(0.82rem, 0.9vw, 1rem);
}

.shell {
  padding: clamp(10px, 1vw, 16px);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.8vw, 10px);
  padding: clamp(3px, 0.4vw, 4px);
  margin-bottom: clamp(8px, 0.9vw, 12px);
  border: 1px solid rgba(169, 195, 240, 0.22);
  border-radius: clamp(12px, 1vw, 16px);
  background: rgba(18, 28, 51, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar .tabs {
  margin-bottom: 0;
  padding: 3px;
  gap: clamp(4px, 0.5vw, 6px);
  border-radius: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.tab {
  border: 1px solid rgba(171, 198, 245, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #c7d8f9;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(0.84rem, 0.95vw, 0.96rem);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: clamp(8px, 0.95vw, 10px) clamp(10px, 1vw, 14px);
  border-radius: 12px;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.topbar .tab {
  padding: clamp(6px, 0.8vw, 8px) clamp(8px, 0.9vw, 10px);
  font-size: clamp(0.72rem, 0.8vw, 0.82rem);
  border-radius: 10px;
}

.tab:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 196, 248, 0.44);
  background: rgba(255, 255, 255, 0.08);
}

.tab.is-active {
  color: #f7fbff;
  border-color: transparent;
  background: linear-gradient(125deg, var(--accent-2) 0%, var(--accent-3) 100%);
  box-shadow: 0 10px 18px rgba(79, 140, 255, 0.32);
}

.topbar .tab.omologhe-alert-pulse {
  border-color: rgba(255, 111, 129, 0.42);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

html.omologhe-pulse-on .topbar .tab.omologhe-alert-pulse {
  box-shadow: 0 10px 18px rgba(79, 140, 255, 0.22), 0 0 0 6px rgba(255, 120, 132, 0.2);
  background: linear-gradient(180deg, rgba(186, 72, 98, 0.94), rgba(154, 48, 74, 0.95));
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .topbar .tab.omologhe-alert-pulse {
    transition: none;
  }
  section[data-panel="omologhe"] .omologhe-pdf-actions .btn.omologhe-pdf-missing-btn {
    transition: none;
  }
}

.panel {
  display: none;
  border: 1px solid var(--line);
  border-radius: clamp(14px, 1.2vw, 18px);
  padding: clamp(10px, 1vw, 14px);
  background:
    linear-gradient(160deg, rgba(20, 29, 53, 0.88) 0%, rgba(16, 24, 44, 0.86) 62%, rgba(14, 21, 39, 0.9) 100%);
  box-shadow: var(--shadow-md);
}

.panel.is-active {
  display: block;
  animation: panelIn 220ms ease;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toolbar {
  display: grid;
  grid-template-columns: auto auto auto minmax(180px, 1fr) auto;
  gap: clamp(6px, 0.7vw, 8px);
  align-items: center;
}

.toolbar-viaggio {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.toolbar-movimenti {
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
}

.viaggio-toolbar-filters {
  display: grid;
  grid-template-columns: minmax(180px, 300px) max-content max-content;
  gap: 8px;
  align-items: center;
  justify-content: start;
  min-width: 0;
}

.toolbar-viaggio .viaggio-toolbar-filters .search {
  min-width: 0;
}

.viaggio-status-filter-combo {
  width: 100%;
  min-width: 0;
  grid-template-columns: 1fr;
}

.viaggio-status-filter {
  width: 100%;
  cursor: pointer;
  border: 0;
  padding-right: 10px;
  text-overflow: ellipsis;
}

.viaggio-status-filter.status-filter-all {
  background-color: #5b6b86;
}

.viaggio-status-filter:focus {
  outline: 2px solid rgba(109, 171, 255, 0.45);
  outline-offset: 1px;
}

.viaggio-status-filter-combo .cell-combo-menu {
  z-index: 35;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
}

.viaggio-toggle-pill,
.viaggio-toggle-da-stabilire {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  border: 1px solid rgba(163, 189, 235, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #cfe0ff;
  cursor: pointer;
  padding: 0 10px;
  justify-content: center;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  height: 22px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.viaggio-toggle-pill.is-active,
.viaggio-toggle-da-stabilire.is-active {
  background: linear-gradient(120deg, #2f8cff 0%, #5e77ff 100%);
  color: #fff;
  border-color: transparent;
}

.toolbar-left,
.toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.7vw, 8px);
  flex-wrap: wrap;
}

/* Override dopo la regola generica .toolbar-right (che altrimenti sovrascrive il layout viaggi) */
.toolbar-viaggio .toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  flex-wrap: nowrap;
}

.toolbar-viaggio .toolbar-right > * {
  min-width: 0;
  flex: 0 0 auto;
}

.toolbar-viaggio #viaggioStatusFilterCombo {
  width: clamp(150px, 12vw, 200px);
}

.toolbar-viaggio #viaggioDaStabilireToggleBtn,
.toolbar-viaggio #viaggioOnlyMineToggleBtn {
  width: clamp(140px, 12vw, 190px);
}

.chip-live {
  display: inline-flex;
  align-items: center;
  height: clamp(30px, 2.4vw, 36px);
  border-radius: clamp(10px, 0.8vw, 12px);
  border: 1px solid rgba(255, 163, 178, 0.44);
  color: #ffc0cb;
  background: rgba(255, 109, 137, 0.14);
  font-weight: 700;
  text-transform: uppercase;
  padding: 0 clamp(9px, 0.9vw, 12px);
  font-size: clamp(0.75rem, 0.82vw, 0.86rem);
}

.chip-live-btn {
  cursor: pointer;
}

.chip-live-btn:hover {
  background: rgba(255, 109, 137, 0.22);
}

.selection-bar {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.7vw, 8px);
  margin-top: clamp(8px, 0.8vw, 10px);
}

.selection-bar[hidden] {
  display: none !important;
}

.panel-iframe {
  padding: 0;
  overflow: hidden;
}

.panel-iframe iframe {
  width: 100%;
  min-height: calc(100vh - 190px);
  border: 0;
  background: #fff;
}

.viaggio-move-dialog::backdrop {
  background: rgba(6, 11, 22, 0.55);
  backdrop-filter: blur(2px);
}

.viaggio-move-card {
  width: min(320px, 90vw);
  border-radius: 10px;
  border: 1px solid rgba(170, 197, 243, 0.24);
  background: linear-gradient(160deg, rgba(20, 29, 53, 0.95) 0%, rgba(16, 24, 44, 0.94) 100%);
  box-shadow: 0 18px 38px rgba(2, 7, 17, 0.42);
  color: #dce9ff;
  padding: 8px;
}

.viaggio-move-head {
  border-bottom: 1px solid rgba(166, 193, 237, 0.16);
}

.viaggio-move-head h3 {
  margin: 0;
  color: #dce9ff;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.viaggio-move-message {
  margin: 4px 0 0;
  color: #9cb5de;
  line-height: 1.3;
}

.viaggio-move-grid {
  grid-template-columns: 1fr;
  gap: 6px;
}

.viaggio-move-grid > label {
  display: grid;
  gap: 0;
}

.viaggio-move-datebox {
  width: 100%;
  min-height: 32px;
}

.viaggio-move-datebox .date-input {
  width: 100%;
  min-width: 0;
}

.viaggio-move-datebox .date-input::-webkit-calendar-picker-indicator {
  display: none;
}

.viaggio-move-datebox .date-input::-webkit-clear-button {
  display: none;
}

.viaggio-move-today-btn {
  min-width: 44px;
  height: 24px;
  padding: 0 8px;
  border-radius: 8px;
}

.viaggio-move-actions {
  border-top: 1px solid rgba(166, 193, 237, 0.14);
  padding-top: 6px;
}

.selected-count {
  min-width: clamp(34px, 2.5vw, 40px);
  height: clamp(28px, 2.3vw, 34px);
  border-radius: clamp(8px, 0.8vw, 10px);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-3) 100%);
  color: #fff;
  font-weight: 700;
}

.btn,
.btn-icon {
  border: 1px solid rgba(170, 197, 243, 0.26);
  color: #e7f0ff;
  background: rgba(255, 255, 255, 0.06);
  border-radius: clamp(10px, 0.8vw, 12px);
  text-transform: uppercase;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(0.78rem, 0.86vw, 0.93rem);
  font-weight: 700;
  cursor: pointer;
  height: clamp(30px, 2.4vw, 36px);
  padding: 0 clamp(9px, 0.9vw, 12px);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.btn-icon:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 197, 247, 0.44);
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon.is-active {
  border-color: rgba(255, 148, 162, 0.5);
  background: rgba(255, 94, 116, 0.2);
  color: #ffd7dd;
}

.btn:disabled,
.btn-icon:disabled,
.tab:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.is-active {
  background: linear-gradient(125deg, var(--accent-2) 0%, var(--accent-3) 100%);
  border-color: transparent;
  color: #fff;
}

.btn-alt {
  color: #c7d7f5;
}

.btn-danger {
  background: rgba(255, 94, 116, 0.2);
  border-color: rgba(255, 148, 162, 0.5);
  color: #ffd7dd;
}

.btn-danger:hover {
  background: rgba(255, 94, 116, 0.3);
}

.btn-logout {
  height: clamp(26px, 2vw, 30px);
  padding: 0 clamp(8px, 0.8vw, 10px);
  font-size: clamp(0.68rem, 0.72vw, 0.78rem);
}

.btn-icon {
  width: clamp(30px, 2.4vw, 36px);
  padding: 0;
  font-size: clamp(0.86rem, 0.94vw, 1.02rem);
}

.search {
  width: 100%;
  height: clamp(30px, 2.4vw, 36px);
  padding-inline: clamp(8px, 0.9vw, 12px);
}

.datebox {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(164, 192, 240, 0.3);
  border-radius: clamp(10px, 0.8vw, 12px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  min-height: clamp(30px, 2.4vw, 36px);
}

.datebox span,
.datebox .date-label {
  background: linear-gradient(120deg, #273a67 0%, #1f2f54 100%);
  color: #ddebff;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0 clamp(8px, 0.8vw, 11px);
  height: clamp(30px, 2.4vw, 36px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.datebox .btn-icon {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.date-input {
  border: 0;
  height: clamp(30px, 2.4vw, 36px);
  padding: 0 clamp(6px, 0.7vw, 8px);
  border-radius: 0;
  background: transparent;
}

.week-display {
  border: 0;
  border-radius: 0;
  height: clamp(30px, 2.4vw, 36px);
  padding: 0 clamp(8px, 0.8vw, 10px);
  background: transparent;
  color: #dce9ff;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.toolbar-ingressi .datebox .date-input {
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.toolbar-viaggio .datebox .date-label {
  padding-inline: 7px;
  min-width: 40px;
}

.toolbar-viaggio .datebox .date-input {
  width: 142px;
  min-width: 142px;
  padding-inline: 4px;
}

.table-wrap {
  margin-top: clamp(8px, 0.8vw, 10px);
  border: 1px solid rgba(166, 193, 237, 0.26);
  border-radius: clamp(10px, 0.9vw, 14px);
  overflow: auto;
  max-height: 52vh;
  background: rgba(7, 12, 24, 0.52);
}

section[data-panel="viaggio"] .table-wrap {
  overflow: visible;
  max-height: none;
}

section[data-panel="viaggio"].panel {
  margin-bottom: 56px;
}

.table-wrap.tall {
  max-height: min(70vh, 920px);
}

.ingressi-week-wrap {
  margin-top: clamp(8px, 0.8vw, 10px);
  border: 1px solid rgba(166, 193, 237, 0.22);
  border-radius: clamp(10px, 0.9vw, 14px);
  background: rgba(8, 14, 27, 0.55);
  overflow: hidden;
}

.ingressi-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 0.8vw, 10px);
  padding: clamp(8px, 0.8vw, 10px) clamp(10px, 1vw, 12px);
  border-bottom: 1px solid rgba(166, 193, 237, 0.18);
  background: rgba(255, 255, 255, 0.02);
}


.ingressi-week-label {
  font-family: "Barlow Condensed", "Rajdhani", sans-serif;
  font-size: clamp(0.92rem, 1vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #dce9ff;
  text-transform: uppercase;
}

.ingressi-color-legend {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.7vw, 8px);
}

.ingressi-legend-edit-btn {
  padding: 2px 8px;
  font-size: 0.78rem;
}

.ingressi-color-manager {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(166, 193, 237, 0.14);
  background: rgba(255,255,255,0.015);
}

.ingressi-color-manager[hidden] {
  display: none !important;
}

.ingressi-color-manager-form {
  display: grid;
  grid-template-columns: 220px auto auto 1fr;
  gap: 6px;
  align-items: center;
}

.ingressi-color-manager-form .cell-input {
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  padding: 4px 8px;
}

.ingressi-color-manager-form small {
  color: #9cb5de;
  font-size: 0.72rem;
}

.ingressi-color-manager-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ingressi-color-manager-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(166, 193, 237, 0.18);
  border-radius: 999px;
  padding: 3px 4px 3px 8px;
  background: rgba(255,255,255,0.02);
  color: #dce9ff;
}

.ingressi-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(166, 193, 237, 0.22);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  color: #dce9ff;
}

.ingressi-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.22);
}

.ingressi-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  gap: 1px;
  background: rgba(166, 193, 237, 0.18);
  overflow-x: auto;
}

.ingressi-day-col {
  min-height: 520px;
  background: rgba(7, 12, 24, 0.95);
  display: grid;
  grid-template-rows: auto 1fr;
}

.ingressi-day-col.is-today {
  background: rgba(10, 16, 30, 0.92);
}

.ingressi-day-col.is-today .ingressi-day-head {
  background: linear-gradient(180deg, rgba(62, 115, 214, 0.22), rgba(62, 115, 214, 0.1));
}

.ingressi-day-col.is-drop-target {
  outline: 2px dashed rgba(113, 171, 255, 0.75);
  outline-offset: -2px;
}

.ingressi-day-head {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 7px;
  border-bottom: 1px solid rgba(166, 193, 237, 0.14);
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(18, 27, 48, 0.95);
}

.ingressi-day-name {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: #acc4ee;
}

.ingressi-day-date {
  font-family: "Barlow Condensed", "Rajdhani", sans-serif;
  font-size: 1rem;
  color: #f2f6ff;
}

.ingresso-add-day {
  justify-self: end;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
}

.ingressi-day-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  align-items: stretch;
}

.ingressi-day-empty {
  border: 1px dashed rgba(166, 193, 237, 0.2);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  color: #8ea6cf;
  font-size: 0.86rem;
  background: rgba(255, 255, 255, 0.01);
}

.ingressi-card {
  --ingresso-color: #5b6d88;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ingresso-color) 45%, rgba(255,255,255,0.18));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ingresso-color) 18%, rgba(255,255,255,0.04)) 0%, rgba(255,255,255,0.02) 100%);
  box-shadow: inset 3px 0 0 0 var(--ingresso-color);
  overflow: hidden;
}

.ingressi-card.is-dragging {
  opacity: 0.55;
}

.ingressi-card.is-selected {
  box-shadow: inset 3px 0 0 0 var(--ingresso-color), 0 0 0 1px rgba(255,255,255,0.18);
}

.ingressi-card.is-completed {
  opacity: 0.55;
  filter: saturate(0.35) brightness(0.92);
}

.ingressi-card-header {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  align-items: stretch;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ingressi-card-meta-left {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.ingressi-card-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 2px;
  align-items: start;
}

.ingressi-card-actions-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.ingressi-card-actions-col .ingresso-add-cer-btn {
  margin-top: auto;
}

.ingressi-card-actions-bottom {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.ingressi-card-title {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  color: #eef4ff;
  line-height: 1.05;
  font-size: 0.86rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ingressi-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ingresso-delete-btn,
.ingresso-reset-color {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  font-size: 0.66rem;
}

.ingresso-add-cer-btn {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  font-size: 0.66rem;
  line-height: 1;
  border-radius: 999px;
}

.ingresso-done-btn {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  font-size: 0.62rem;
  line-height: 1;
  border-radius: 4px;
}

.ingresso-done-btn.is-active {
  background: rgba(46, 197, 156, 0.34);
  border-color: rgba(46, 197, 156, 0.52);
  color: #eafff7;
}

.ingressi-color-picker {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(166, 193, 237, 0.28);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.ingressi-color-select {
  height: 22px;
  min-width: 82px;
  border-radius: 6px;
  border: 1px solid rgba(166, 193, 237, 0.28);
  background: rgba(255,255,255,0.03);
  color: #dce9ff;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 4px;
}

.ingressi-color-select option {
  background: #1a2745;
  color: #eaf2ff;
}

.ingressi-card-body {
  display: grid;
  gap: 3px;
  padding: 4px 5px 5px;
}

.ingressi-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 88px;
  gap: 3px;
}

.ingressi-card-row.ingressi-card-row-single {
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1.35fr);
  align-items: center;
}

.ingressi-card-row.ingressi-card-row-name {
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
}

.ingressi-card-row.ingressi-card-row-cassoni {
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
}

.ingressi-card-row-spacer {
  min-width: 0;
}

.ingressi-card-field {
  display: grid;
  gap: 0;
}

.ingressi-card-field-inline-cer {
  min-width: 0;
}

.ingressi-card-field-inline-cer .ingressi-cer-multi-wrap {
  margin-top: 0;
}

.ingressi-card-row.ingressi-card-row-single .ingressi-card-field-label,
.ingressi-card-row.ingressi-card-row-name .ingressi-card-field-label,
.ingressi-card-row.ingressi-card-row-cassoni .ingressi-card-field-label,
.ingressi-card-field-name-header .ingressi-card-field-label,
.ingressi-card-field-cassoni-header .ingressi-card-field-label,
.ingressi-card-field-cer-header .ingressi-card-field-label {
  display: none;
}

.ingressi-card-row.ingressi-card-row-single .ingressi-card-field .cell-input,
.ingressi-card-row.ingressi-card-row-name .ingressi-card-field .cell-input,
.ingressi-card-row.ingressi-card-row-cassoni .ingressi-card-field .cell-input,
.ingressi-card-field-name-header .cell-input,
.ingressi-card-field-cassoni-header .cell-input,
.ingressi-card-field-cer-header .cell-input {
  height: 20px;
  min-height: 20px;
  padding: 0 3px;
  font-size: 0.72rem;
}

.ingressi-card-field-cassoni-header .cell-input {
  text-align: center;
}

.ingressi-card-field-name-header .cell-input {
  font-weight: 700;
}

.ingressi-card-field-cer-header .cell-input {
  font-weight: 400;
}

.ingressi-card-row.ingressi-card-row-single .ingressi-card-field-inline-cer .cer-multi-wrap,
.ingressi-card-field-cer-header .cer-multi-wrap {
  gap: 1px;
}

.ingressi-card-field-cer-header .cer-multi-item {
  padding: 1px 2px;
  border-radius: 6px;
}

.ingressi-card-field-cer-header .cer-multi-remove {
  min-width: 18px;
  width: 18px;
  height: 18px;
  font-size: 0.66rem;
  line-height: 1;
  padding: 0;
}

.ingressi-card-field-cer-header .cer-multi-add {
  min-width: 18px;
  width: 18px;
  height: 18px;
  font-size: 0.66rem;
  line-height: 1;
  border-radius: 999px;
  padding: 0;
}

.ingressi-card-field-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9eb6de;
}

.ingressi-cer-desc {
  margin-top: 2px;
  font-size: 0.68rem;
  line-height: 1.1;
  color: #b8caea;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ingressi-card-field .cell-input {
  height: 23px;
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

th,
td {
  border: 1px solid rgba(160, 188, 233, 0.14);
  padding: 2px;
  white-space: nowrap;
  text-align: left;
  font-size: clamp(0.84rem, 0.9vw, 0.98rem);
  height: clamp(30px, 2.6vw, 36px);
  color: var(--text);
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(27, 40, 70, 0.95) 0%, rgba(22, 33, 58, 0.96) 100%);
  text-transform: uppercase;
  color: #caddff;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(0.72rem, 0.8vw, 0.84rem);
  letter-spacing: 0.05em;
  padding: clamp(5px, 0.6vw, 7px) clamp(6px, 0.7vw, 8px);
}

tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.04);
}

tbody tr:hover td {
  background: rgba(79, 140, 255, 0.12);
}

.cell-input,
.cell-select {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(0.82rem, 0.92vw, 0.98rem);
  color: var(--text);
  padding: clamp(4px, 0.55vw, 6px) clamp(5px, 0.6vw, 7px);
  outline: none;
  border-radius: 0;
  box-shadow: none;
}

td.note-cell {
  white-space: normal;
  vertical-align: top;
  min-width: 180px;
}

.cell-input-multiline {
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.15;
  min-height: 32px;
}

section[data-panel="movimenti"] .data-table td {
  vertical-align: top;
}

section[data-panel="movimenti"] .data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

section[data-panel="movimenti"] .data-table td .cell-input {
  font-size: 0.9rem;
  padding: 5px 6px;
}

section[data-panel="omologhe"] .data-table {
  min-width: 100%;
  table-layout: fixed;
}

section[data-panel="omologhe"] .data-table th:nth-child(1),
section[data-panel="omologhe"] .data-table td:nth-child(1) {
  width: 8%;
  min-width: 8%;
  max-width: 8%;
}

section[data-panel="omologhe"] .data-table th:nth-child(2),
section[data-panel="omologhe"] .data-table td:nth-child(2) {
  width: 17%;
  min-width: 17%;
  max-width: 17%;
}

section[data-panel="omologhe"] .data-table th:nth-child(3),
section[data-panel="omologhe"] .data-table td:nth-child(3) {
  width: 5%;
  min-width: 5%;
  max-width: 5%;
}

section[data-panel="omologhe"] .data-table th:nth-child(4),
section[data-panel="omologhe"] .data-table td:nth-child(4) {
  width: 3%;
  min-width: 3%;
  max-width: 3%;
}

section[data-panel="omologhe"] .data-table th:nth-child(5),
section[data-panel="omologhe"] .data-table td:nth-child(5) {
  width: 16%;
  min-width: 16%;
  max-width: 16%;
}

section[data-panel="omologhe"] .data-table th:nth-child(6),
section[data-panel="omologhe"] .data-table td:nth-child(6) {
  width: 6%;
  min-width: 6%;
  max-width: 6%;
}

section[data-panel="omologhe"] .data-table th:nth-child(7),
section[data-panel="omologhe"] .data-table td:nth-child(7) {
  width: 35%;
  min-width: 35%;
  max-width: 35%;
}

section[data-panel="omologhe"] .data-table th:nth-child(8),
section[data-panel="omologhe"] .data-table td:nth-child(8) {
  width: 10%;
  min-width: 10%;
  max-width: 10%;
}

section[data-panel="omologhe"] .omologhe-pdf-cell {
  white-space: normal;
}

section[data-panel="omologhe"] .omologhe-pdf-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 22px;
  align-items: center;
  gap: 4px;
  width: 100%;
}

section[data-panel="omologhe"] .omologhe-pdf-actions .btn {
  min-height: 26px;
  height: 26px;
  min-width: 0;
  padding: 2px 8px;
  font-size: 0.74rem;
  line-height: 1;
  width: 100%;
}

section[data-panel="omologhe"] .omologhe-pdf-actions .btn.omologhe-pdf-missing-btn {
  border-color: rgba(255, 111, 129, 0.52);
  color: #ff5f71;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

html.omologhe-pulse-on section[data-panel="omologhe"] .omologhe-pdf-actions .btn.omologhe-pdf-missing-btn {
  box-shadow: 0 6px 14px rgba(79, 140, 255, 0.2), 0 0 0 4px rgba(255, 120, 132, 0.2);
  background: linear-gradient(180deg, rgba(186, 72, 98, 0.94), rgba(154, 48, 74, 0.95));
  border-color: rgba(255, 148, 160, 0.82);
  color: #ffffff;
}

section[data-panel="omologhe"] .omologhe-pdf-actions .omologhe-delete-btn {
  width: 22px;
  min-width: 22px;
  padding: 0;
}

section[data-panel="omologhe"] .omologhe-pdf-meta {
  display: block;
  margin-top: 2px;
  color: #9ab0d8;
  font-size: 0.7rem;
  line-height: 1.1;
}

.omologhe-pdf-dialog {
  width: min(94vw, 1240px);
}

.omologhe-pdf-card {
  width: 100%;
  max-width: 100%;
  min-height: min(88vh, 920px);
  display: grid;
  grid-template-rows: auto 1fr;
}

.omologhe-pdf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.omologhe-pdf-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.omologhe-pdf-body {
  border: 1px solid rgba(164, 192, 240, 0.28);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(7, 12, 24, 0.52);
  min-height: min(74vh, 760px);
}

#omologhePdfFrame {
  width: 100%;
  height: min(74vh, 760px);
  border: 0;
  background: #111;
}

section[data-panel="omologhe"] .data-table td.omologhe-expired-cell {
  background: #ffd9d9 !important;
  border-color: #d34a4a;
}

section[data-panel="omologhe"] .data-table tr.omologhe-expired-row td {
  background: #ffd9d9 !important;
  border-color: #d34a4a;
}

section[data-panel="omologhe"] .data-table td.omologhe-expired-cell .cell-input {
  color: #5a1010;
  font-weight: 800;
  text-shadow: none;
  background: rgba(255, 255, 255, 0.72);
}

section[data-panel="omologhe"] .data-table td.omologhe-expired-cell .cell-input::placeholder {
  color: #8a2c2c;
  opacity: 1;
}

section[data-panel="omologhe"] .data-table td.omologhe-expired-cell .cell-input:focus {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(170, 44, 44, 0.32);
}

.movimenti-hover-tooltip {
  position: fixed;
  z-index: 2500;
  max-width: min(560px, calc(100vw - 28px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(145, 184, 255, 0.32);
  background: linear-gradient(180deg, rgba(18, 31, 59, 0.97) 0%, rgba(12, 22, 44, 0.98) 100%);
  color: #e8f1ff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(98, 137, 212, 0.12) inset;
  backdrop-filter: blur(8px);
  font-size: 0.84rem;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
}

.movimenti-pager-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.movimenti-page-info {
  min-width: 150px;
  text-align: center;
  font-size: 0.72rem;
  color: #b9cdef;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.movimenti-columns-filter-combo {
  width: clamp(170px, 15vw, 220px);
}

.movimenti-columns-filter {
  width: 100%;
  cursor: pointer;
  border: 1px solid rgba(158, 193, 255, 0.42);
  background: linear-gradient(180deg, rgba(34, 53, 92, 0.92) 0%, rgba(21, 35, 66, 0.94) 100%);
  color: #eef5ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  padding-right: 10px;
  text-overflow: ellipsis;
}

.movimenti-columns-filter:focus {
  outline: 2px solid rgba(124, 182, 255, 0.52);
  outline-offset: 1px;
}

.movimenti-columns-filter-combo .cell-combo-menu {
  z-index: 35;
  min-width: 100%;
  max-height: 280px;
}

section[data-panel="movimenti"] .datebox .date-input[data-date-mode="year"] {
  width: 92px;
  min-width: 92px;
  text-align: center;
}

.movimenti-total-bar {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(138, 174, 240, 0.25);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(21, 36, 67, 0.6) 0%, rgba(13, 23, 44, 0.7) 100%);
  color: #d4e5ff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: right;
}

.cell-input.cer-input-hazardous {
  background: rgba(173, 27, 27, 0.18);
  color: #ffd7d7;
  box-shadow: inset 0 0 0 1px rgba(255, 96, 96, 0.28);
}

td.cer-multi-cell {
  white-space: normal;
  height: auto;
  min-width: 260px;
  vertical-align: top;
}

.cer-multi-wrap {
  display: grid;
  gap: 3px;
  padding: 1px 26px 1px 1px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

td.cer-multi-cell-auto .cer-multi-wrap {
  padding-right: 1px;
}

section[data-panel="viaggio"] td.cer-multi-cell {
  min-width: 232px;
}

section[data-panel="viaggio"] .cer-multi-wrap {
  gap: 2px;
  padding: 0;
}

section[data-panel="viaggio"] .cer-multi-item {
  border-radius: 6px;
  padding: 0;
}

section[data-panel="viaggio"] .cer-multi-item-top {
  grid-template-columns: minmax(84px, 1fr) 52px;
  gap: 2px;
}

section[data-panel="viaggio"] .cer-multi-item-top.has-sf:not(.has-remove) {
  grid-template-columns: minmax(84px, 1fr) 52px;
}

section[data-panel="viaggio"] .cer-multi-item-top > .cell-input {
  min-height: 22px;
  height: 22px;
  padding: 1px 5px;
  font-size: 0.78rem;
}

section[data-panel="viaggio"] .cer-sf-select {
  min-width: 52px;
  width: 52px;
  height: 22px;
  padding: 0 3px;
  border-radius: 5px;
  font-size: 0.66rem;
}

section[data-panel="viaggio"] .cer-sf-select.cell-combo-select {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  height: 22px;
  min-height: 22px;
  max-height: 22px;
}

.cer-multi-item {
  border: 1px solid rgba(158, 187, 234, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 1px;
}

.cer-multi-item.is-hazardous {
  border-color: rgba(255, 104, 104, 0.35);
  background: rgba(173, 27, 27, 0.08);
}

.cer-multi-item-top {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 56px 28px;
  gap: 4px;
  align-items: center;
}

.cer-multi-item-top.has-remove:not(.has-sf) {
  grid-template-columns: minmax(96px, 1fr) 28px;
}

.cer-multi-item-top.has-sf:not(.has-remove) {
  grid-template-columns: minmax(96px, 1fr) 56px;
}

.cer-multi-item-top:not(.has-sf):not(.has-remove) {
  grid-template-columns: minmax(96px, 1fr);
}

.cer-multi-item-top > .cell-input {
  min-height: 28px;
  padding: 3px 7px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

section[data-panel="ingressi"] .cer-multi-item-top > .cell-input {
  font-weight: 400;
}

.cer-multi-item-top.has-remove:not(.has-sf) > .cell-input {
  grid-column: 1;
}

.cer-multi-item-top.has-remove:not(.has-sf) > .cer-multi-remove {
  grid-column: 2;
}

.cer-multi-item-top.has-remove:not(.has-sf) > .cer-sf-select[hidden] {
  display: none !important;
}

.cell-helper-text.cer-multi-desc {
  display: none;
}

.cer-multi-item:hover .cell-helper-text.cer-multi-desc,
.cer-multi-item:focus-within .cell-helper-text.cer-multi-desc {
  display: block;
}

section[data-panel="viaggio"] .cer-multi-item .cell-helper-text.cer-multi-desc,
section[data-panel="viaggio"] .cer-multi-item:hover .cell-helper-text.cer-multi-desc,
section[data-panel="viaggio"] .cer-multi-item:focus-within .cell-helper-text.cer-multi-desc {
  display: none !important;
}

section[data-panel="ingressi"] .cer-multi-item .cell-helper-text.cer-multi-desc,
section[data-panel="ingressi"] .cer-multi-item:hover .cell-helper-text.cer-multi-desc,
section[data-panel="ingressi"] .cer-multi-item:focus-within .cell-helper-text.cer-multi-desc {
  display: none !important;
}

.cer-sf-select {
  min-width: 56px;
  width: 56px;
  height: 28px;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 0.72rem;
  text-align: center;
}

.cer-sf-select.cell-combo-select {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0 4px;
}

.cer-sf-select[hidden] {
  display: none !important;
}

.cer-multi-remove {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
}

.cer-multi-actions {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.cer-multi-add {
  min-width: 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1;
  border-radius: 999px;
  border-width: 1px;
}

.cell-select {
  appearance: auto;
}

.cell-select option,
.cell-combo-select option,
.anag-form select option,
.modal-grid select option {
  color: #dce9ff;
  background: #1a2745;
}

.date-slot {
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  min-width: 108px;
  padding: 2px;
}

.date-slot-top {
  display: grid;
  grid-template-columns: 1fr 22px;
  gap: 4px;
  align-items: center;
}

.date-plus {
  border: 1px solid rgba(169, 195, 238, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #d5e5ff;
  font-weight: 700;
  cursor: pointer;
  height: 24px;
  line-height: 1;
}

.date-plus:hover:not(:disabled) {
  background: rgba(124, 169, 255, 0.18);
}

.date-slot-cell .date-slot-top .cell-input {
  border: 1px solid rgba(169, 195, 238, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  height: 24px;
  padding: 1px 5px;
}

.date-slot-cell .cell-combo .cell-input {
  min-height: 24px;
  padding: 2px 5px;
}

section[data-panel="viaggio"] .date-slot {
  min-width: 0;
  width: 100%;
}

section[data-panel="viaggio"] .date-slot-top {
  grid-template-columns: 1fr 16px;
  gap: 2px;
}

section[data-panel="viaggio"] .date-plus {
  width: 16px;
  min-width: 16px;
  height: auto;
  min-height: 20px;
  border-radius: 5px;
  font-size: 0.68rem;
  padding: 0;
}

section[data-panel="viaggio"] .date-slot-cell .date-slot-top .cell-input {
  height: auto;
  min-height: 20px;
  padding: 1px 2px;
  font-size: 0.7rem;
}

section[data-panel="viaggio"] .date-slot-cell .cell-combo .cell-input {
  min-height: 20px;
  height: auto;
  padding: 1px 3px;
  font-size: 0.7rem;
}

section[data-panel="viaggio"] .date-slot-cell .cell-combo {
  grid-template-columns: minmax(0, 1fr) 16px;
}

section[data-panel="viaggio"] .date-slot-cell .cell-combo .cell-combo-select {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: auto;
  min-height: 20px;
  font-size: 0.62rem;
}

.status-cell {
  min-width: 132px;
  width: 132px;
}

.status-wrap {
  display: grid;
  grid-template-rows: auto auto auto;
}

section[data-panel="viaggio"] .data-table th:nth-child(3),
section[data-panel="viaggio"] .data-table td:nth-child(3) {
  min-width: 220px;
}

section[data-panel="viaggio"] .data-table th:nth-child(4),
section[data-panel="viaggio"] .data-table td:nth-child(4) {
  min-width: 190px;
}

section[data-panel="viaggio"] .data-table th:nth-child(8),
section[data-panel="viaggio"] .data-table td:nth-child(8) {
  min-width: 88px;
  width: 88px;
}

.status-owner {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.05;
  padding: 1px 4px;
  white-space: normal;
  overflow-wrap: anywhere;
}

section[data-panel="viaggio"] .status-wrap {
  gap: 1px;
}

section[data-panel="viaggio"] .status-owner {
  font-size: 0.58rem;
  line-height: 1;
  padding: 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

section[data-panel="viaggio"] .status-owner-date {
  text-align: left;
}

section[data-panel="viaggio"] .status-owner-name {
  text-align: left;
}

.status-select {
  width: 100%;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-family: "Rajdhani", sans-serif;
  padding: 1px 10px;
  height: 22px;
}

section[data-panel="viaggio"] .status-select {
  height: auto;
  min-height: 19px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.68rem;
}

.status-draft .status-select,
.status-select.status-draft {
  background: #7a879d;
}

.status-going .status-select,
.status-select.status-going {
  background: #2ec59c;
}

.status-pending .status-select,
.status-select.status-pending {
  background: #f3a347;
}

.status-completed .status-select,
.status-select.status-completed {
  background: #6f7e8f;
}

.status-suspended .status-select,
.status-select.status-suspended {
  background: #ff6079;
}

.status-leave .status-select,
.status-select.status-leave,
.status-vacation .status-select,
.status-select.status-vacation {
  background: #7a4bd9;
}

section[data-panel="viaggio"] th.viaggio-camion-col {
  min-width: 130px;
}

section[data-panel="viaggio"] th.viaggio-section-divider,
section[data-panel="viaggio"] td.viaggio-section-divider {
  border-left: 2px solid rgba(120, 160, 230, 0.22);
}

section[data-panel="viaggio"] td.viaggio-section-divider {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.02);
}

.viaggio-camion-cell {
  min-width: 180px;
}

.viaggio-camion-stack {
  display: grid;
  gap: 1px;
}

.viaggio-camion-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 1px;
  align-items: stretch;
}

.viaggio-camion-label {
  display: grid;
  place-items: center;
  min-height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(166, 193, 237, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #b8caeb;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.viaggio-camion-row .viaggio-camion-combo {
  min-width: 0;
}

section[data-panel="viaggio"] .viaggio-camion-row .viaggio-camion-combo .cell-input {
  min-height: 22px;
  padding-top: 1px;
  padding-bottom: 1px;
  font-size: 0.66rem;
}

section[data-panel="viaggio"] .viaggio-camion-row .viaggio-camion-combo .cell-combo-multiline {
  min-height: 22px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  font-size: 0.66rem;
  overflow-y: hidden !important;
}

section[data-panel="viaggio"] .viaggio-camion-row .viaggio-camion-combo .cell-combo-select {
  min-height: 22px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.56rem;
}

.status-select.status-filter-all {
  background: #5b6b86;
}

.data-table tbody tr.status-draft td:first-child {
  box-shadow: inset 4px 0 0 #7a879d;
}

.data-table tbody tr.status-going td:first-child {
  box-shadow: inset 4px 0 0 #2ec59c;
}

.data-table tbody tr.status-pending td:first-child {
  box-shadow: inset 4px 0 0 #f3a347;
}

.data-table tbody tr.status-completed td:first-child {
  box-shadow: inset 4px 0 0 #7f8894;
}

.data-table tbody tr.status-suspended td:first-child {
  box-shadow: inset 4px 0 0 #ff6079;
}

.data-table tbody tr.status-leave td:first-child,
.data-table tbody tr.status-vacation td:first-child {
  box-shadow: inset 4px 0 0 #7a4bd9;
}

.data-table tbody tr.status-going td {
  background: rgba(46, 197, 156, 0.11);
}

.data-table tbody tr.status-draft td {
  background: rgba(122, 135, 157, 0.11);
}

.data-table tbody tr.status-pending td {
  background: rgba(243, 163, 71, 0.11);
}

.data-table tbody tr.status-completed td {
  background: rgba(44, 52, 64, 0.5);
}

section[data-panel="viaggio"] .data-table tbody tr.status-completed td:not(.note-cell) .cell-input,
section[data-panel="viaggio"] .data-table tbody tr.status-completed td:not(.note-cell) .cell-select,
section[data-panel="viaggio"] .data-table tbody tr.status-completed td:not(.note-cell) .cell-combo-select {
  background: rgba(60, 69, 80, 0.28) !important;
}

.data-table tbody tr.status-suspended td {
  background: rgba(255, 96, 121, 0.12);
}

.data-table tbody tr.status-leave td,
.data-table tbody tr.status-vacation td {
  background: rgba(122, 75, 217, 0.16);
}

section[data-panel="viaggio"] .data-table tbody tr.status-completed td:not(.status-cell):not(.note-cell) .cell-input,
section[data-panel="viaggio"] .data-table tbody tr.status-completed td:not(.status-cell):not(.note-cell) .cell-select,
section[data-panel="viaggio"] .data-table tbody tr.status-completed td:not(.status-cell):not(.note-cell) .cell-combo-select {
  background: rgba(98, 113, 136, 0.78) !important;
}

.cell-combo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  position: relative;
}

.cell-combo .cell-input {
  min-width: 0;
}

section[data-panel="viaggio"] .cell-combo {
  align-items: stretch;
}

section[data-panel="viaggio"] .cell-combo .cell-input {
  min-height: 22px;
  height: auto;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.1;
  padding-top: 2px;
  padding-bottom: 2px;
}

section[data-panel="viaggio"] .cell-combo .cell-input.cell-combo-multiline {
  resize: none !important;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  min-height: 28px;
}

section[data-panel="viaggio"] .data-table th {
  padding-top: 1px;
  padding-bottom: 1px;
  height: 24px;
}

section[data-panel="viaggio"] .data-table td {
  padding: 1px;
}

section[data-panel="viaggio"] .data-table td:not(.date-slot-cell):not(.status-cell) {
  vertical-align: middle;
}

section[data-panel="viaggio"] .data-table td .cell-input,
section[data-panel="viaggio"] .data-table td .cell-select {
  min-height: 20px;
  padding-top: 1px;
  padding-bottom: 1px;
}

section[data-panel="viaggio"] .data-table td:not(.status-cell) .cell-input,
section[data-panel="viaggio"] .data-table td:not(.status-cell) .cell-select {
  font-size: 0.7rem;
}

section[data-panel="viaggio"] .data-table td:not(.date-slot-cell):not(.status-cell) .cell-combo {
  align-items: center;
}

section[data-panel="viaggio"] .data-table td:not(.date-slot-cell):not(.status-cell) .cell-combo .cell-combo-select {
  align-self: center;
}

/* Viaggio: tutto maiuscolo tranne NOTE e STATO */
section[data-panel="viaggio"] .data-table td:not(.note-cell):not(.status-cell) input.cell-input:not([type="date"]),
section[data-panel="viaggio"] .data-table td:not(.note-cell):not(.status-cell) textarea.cell-input {
  text-transform: uppercase;
}

section[data-panel="viaggio"] .data-table td.note-cell .cell-input {
  color: #5a1010;
}

section[data-panel="viaggio"] .data-table td:nth-child(3),
section[data-panel="viaggio"] .data-table td:nth-child(4) {
  padding-top: 1px;
  padding-bottom: 1px;
}

section[data-panel="viaggio"] .data-table td:nth-child(2) .cell-combo .cell-input.cell-combo-multiline,
section[data-panel="viaggio"] .data-table td:nth-child(3) .cell-combo .cell-input.cell-combo-multiline,
section[data-panel="viaggio"] .data-table td:nth-child(4) .cell-combo .cell-input.cell-combo-multiline {
  min-height: 32px;
  font-size: 0.7rem;
  line-height: 1.15;
  padding-top: 2px;
  padding-bottom: 2px;
  overflow-y: hidden !important;
}

section[data-panel="viaggio"] textarea.cell-combo-multiline::-webkit-resizer,
section[data-panel="viaggio"] textarea.cell-combo-multiline::-webkit-scrollbar-corner {
  display: none;
}

section[data-panel="viaggio"] textarea.cell-combo-multiline {
  appearance: none;
  -webkit-appearance: none;
}

section[data-panel="viaggio"] .cell-combo .cell-combo-select {
  align-self: start;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  font-size: 0.62rem;
}

section[data-panel="viaggio"] .data-table td:nth-child(3) .cell-combo .cell-combo-select,
section[data-panel="viaggio"] .data-table td:nth-child(4) .cell-combo .cell-combo-select {
  min-height: 20px;
}

section[data-panel="viaggio"] td {
  height: auto;
  vertical-align: top;
}

.anag-combo {
  grid-template-columns: 1fr 34px;
}

.anag-combo .cell-input {
  border: 1px solid rgba(179, 203, 248, 0.3);
  border-radius: 10px 0 0 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  min-height: 38px;
}

.anag-combo .cell-combo-select {
  width: 34px;
  min-height: 38px;
  border-radius: 0 10px 10px 0;
}

.cell-combo-select {
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  border: 0;
  border-left: 1px solid rgba(163, 189, 235, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.settings-font-combo {
  width: 100%;
}

.settings-font-combo .cell-input {
  min-height: 38px;
  height: 38px;
  border: 1px solid rgba(163, 189, 235, 0.22);
  border-radius: 10px 0 0 10px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.settings-font-combo .cell-combo-select {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border: 1px solid rgba(163, 189, 235, 0.22);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.08);
}

.settings-font-combo .cell-combo-menu {
  z-index: 40;
}

.settings-font-combo .cell-combo-item {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.9rem;
}

.cell-combo-toggle {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.cell-combo-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  display: none;
  flex-direction: column;
  min-width: 220px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid rgba(103, 137, 197, 0.42);
  border-radius: 8px;
  background: #1a2745;
  z-index: 30;
  box-shadow: 0 10px 20px rgba(2, 10, 25, 0.46);
}

.cell-combo.is-open .cell-combo-menu {
  display: flex;
}

.cell-combo.open-up .cell-combo-menu {
  top: auto;
  bottom: calc(100% + 2px);
}

/* Near the right edge (e.g. Viaggi > Stato), open menus leftward to avoid page horizontal scroll. */
section[data-panel="viaggio"] .data-table td:last-child .cell-combo-menu,
section[data-panel="viaggio"] .data-table td:nth-last-child(2) .cell-combo-menu {
  left: auto;
  right: 0;
}

section[data-panel="viaggio"] td.status-cell .cell-combo-menu {
  max-height: 270px;
}

.cell-combo-item {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-bottom: 1px solid rgba(130, 159, 211, 0.2);
  background: transparent;
  color: #dce9ff;
  text-align: left;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.cell-combo-item:last-child {
  border-bottom: 0;
}

.cell-combo-item:hover,
.cell-combo-item:focus {
  outline: none;
  background: rgba(79, 140, 255, 0.28);
}

.cell-combo-item.is-active {
  background: rgba(79, 140, 255, 0.38);
}

.viaggio-context-menu {
  position: fixed;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  max-width: 260px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(103, 137, 197, 0.42);
  border-radius: 8px;
  background: #1a2745;
  z-index: 90;
  box-shadow: 0 10px 20px rgba(2, 10, 25, 0.46);
}

.viaggio-context-menu-item {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-bottom: 1px solid rgba(130, 159, 211, 0.2);
  background: transparent;
  color: #dce9ff;
  text-align: left;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.viaggio-context-menu-item:last-child {
  border-bottom: 0;
}

.viaggio-context-menu-item:hover,
.viaggio-context-menu-item:focus {
  outline: none;
  background: rgba(79, 140, 255, 0.28);
}

.anagrafiche {
  margin-top: clamp(8px, 0.9vw, 12px);
  border: 1px solid rgba(166, 192, 236, 0.24);
  border-radius: clamp(10px, 0.9vw, 14px);
  background: rgba(255, 255, 255, 0.03);
  padding: clamp(10px, 1vw, 12px);
}

.anagrafiche-panel {
  margin-top: 0;
}

.settings-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: clamp(8px, 0.8vw, 10px);
}

.anag-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.7vw, 8px);
  margin: 0 0 clamp(8px, 0.9vw, 12px);
  padding: clamp(6px, 0.7vw, 8px);
  border: 1px solid rgba(165, 193, 240, 0.16);
  border-radius: clamp(10px, 0.8vw, 12px);
  background: rgba(255,255,255,0.02);
}

.anag-subtab {
  min-width: 150px;
  justify-content: center;
}

.anag-subtab.is-active {
  border-color: rgba(121, 161, 231, 0.34);
  background: linear-gradient(180deg, rgba(80, 113, 181, 0.32), rgba(55, 78, 127, 0.28));
  color: #e8f1ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px rgba(92, 131, 203, 0.14);
}

.anag-detail-stack {
  display: grid;
}

.anag-detail-panel {
  min-width: 0;
}

.anag-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(8px, 1vw, 12px);
}

.anag-card-head small {
  display: block;
  margin-top: 3px;
}

.anag-card-detail {
  min-height: 420px;
}

.anag-form-detail {
  margin-top: 2px;
}

.anag-form-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 420px) 1fr;
  align-items: start;
}

.anag-table-wrap-detail {
  max-height: 320px;
}

.anag-search-input {
  width: 100%;
  min-width: 0;
  margin-top: 2px;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.users-form-card,
.users-table-card {
  min-width: 0;
}

.users-form-card {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: stretch;
  gap: 10px;
  padding: 12px;
  background:
    radial-gradient(500px 220px at 10% -20%, rgba(93, 133, 209, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
}

.users-form-card h4,
.users-table-card h4 {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(165, 193, 240, 0.14);
}

.users-form {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.users-form-grid {
  display: grid;
  align-content: start;
  gap: 8px;
}

.users-form-grid > input,
.users-form-grid > select,
.users-form-grid > .toolbar-left {
  min-width: 0;
}

.users-session-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.users-session-row select {
  min-width: 100px;
}

.users-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.users-form-actions .btn {
  min-width: 128px;
}

.users-form-message {
  min-height: 18px;
  display: block;
  margin-top: 0;
}

.users-table-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 12px;
  min-height: 0;
}

.users-table-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.users-table-wrap {
  margin-top: 0;
  height: 100%;
  min-height: 0;
  max-height: none;
  background: rgba(17, 26, 49, 0.26);
}

.users-mini-table {
  min-width: 760px;
}

section[data-panel="utenti"] .mini-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(41, 58, 97, 0.96), rgba(33, 48, 84, 0.94));
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

section[data-panel="utenti"] .mini-table td:last-child {
  width: 88px;
  min-width: 88px;
  white-space: nowrap;
  text-align: center;
}

section[data-panel="utenti"] .mini-table td:last-child .btn-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  margin: 0 2px;
  border-radius: 9px;
}

section[data-panel="utenti"] .mini-table td {
  vertical-align: middle;
}

.anagrafiche h3 {
  margin: 0 0 12px;
  font-family: "Barlow Condensed", "Rajdhani", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  font-size: 1.4rem;
}

.anag-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.settings-group-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.settings-subsection {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(165, 193, 240, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.settings-subsection h5 {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cfe0ff;
}

.settings-subsection .modal-note {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.theme-choice {
  display: grid;
  gap: 10px;
}

.theme-choice label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: inherit;
}

.theme-choice input[type="radio"] {
  accent-color: var(--accent-2);
}

.font-size-control {
  display: grid;
  gap: 8px;
}

.font-size-track-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.font-size-a {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.font-size-a-sm {
  font-size: 0.9rem;
}

.font-size-a-lg {
  font-size: 1.35rem;
}

.font-size-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent-2);
}

.font-size-value-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(166, 193, 237, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-actions {
  display: grid;
  gap: 8px;
}

@media (min-width: 1600px) {
  .shell {
    padding: 12px;
  }

  .panel {
    padding: 12px;
  }

  .topbar .tabs {
    padding: 2px;
  }

  .topbar .tab {
    letter-spacing: 0.03em;
  }
}

.anag-card {
  border: 1px solid rgba(165, 193, 240, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.anag-card h4 {
  margin: 0 0 8px;
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
  color: var(--text);
  letter-spacing: 0.03em;
}

.anag-form {
  display: grid;
  gap: 8px;
}

section[data-panel="anagrafiche"] .anag-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
}

section[data-panel="anagrafiche"] .anag-card h4 {
  margin-bottom: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(165, 193, 240, 0.14);
}

section[data-panel="anagrafiche"] .anag-form {
  align-content: start;
  gap: 7px;
}

section[data-panel="anagrafiche"] .anag-form .toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

section[data-panel="anagrafiche"] .anag-form .toolbar-left .btn {
  min-width: 112px;
}

section[data-panel="anagrafiche"] .mini-table-wrap {
  margin-top: 4px;
  max-height: 250px;
  background: rgba(17, 26, 49, 0.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

section[data-panel="anagrafiche"] .mini-table {
  min-width: 0;
}

section[data-panel="anagrafiche"] .mini-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(41, 58, 97, 0.96), rgba(33, 48, 84, 0.94));
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

section[data-panel="anagrafiche"] .mini-table td {
  vertical-align: middle;
  line-height: 1.25;
}

section[data-panel="anagrafiche"] #tbody-autisti td:last-child,
section[data-panel="anagrafiche"] #tbody-produttori td:last-child,
section[data-panel="anagrafiche"] #tbody-attrezzature td:last-child {
  width: 74px;
  min-width: 74px;
  text-align: center;
  white-space: nowrap;
}

section[data-panel="anagrafiche"] #tbody-autisti td:last-child .btn-icon,
section[data-panel="anagrafiche"] #tbody-produttori td:last-child .btn-icon,
section[data-panel="anagrafiche"] #tbody-attrezzature td:last-child .btn-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  margin: 0 2px;
  border-radius: 9px;
}

section[data-panel="anagrafiche"] #tbody-produttori td:nth-child(2) {
  font-size: 0.88rem;
  color: var(--muted);
}

section[data-panel="anagrafiche"] small {
  color: var(--muted);
  line-height: 1.2;
}

.mini-table-wrap {
  margin-top: clamp(6px, 0.7vw, 8px);
  border: 1px solid rgba(166, 193, 239, 0.22);
  border-radius: clamp(8px, 0.7vw, 10px);
  overflow: auto;
  max-height: 230px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.mini-table th,
.mini-table td {
  border: 1px solid rgba(158, 187, 234, 0.16);
  padding: clamp(4px, 0.5vw, 6px) clamp(5px, 0.55vw, 7px);
  font-size: clamp(0.8rem, 0.85vw, 0.93rem);
  color: var(--text);
}

.cell-helper-text {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
  white-space: normal;
  max-width: 240px;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(142, 177, 236, 0.34);
  background: rgba(44, 63, 104, 0.55);
  color: #d7e8ff;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.role-badge-owner {
  border-color: rgba(255, 200, 92, 0.65);
  background: linear-gradient(180deg, rgba(122, 76, 8, 0.72) 0%, rgba(93, 54, 4, 0.8) 100%);
  color: #ffe7a8;
  box-shadow: inset 0 0 0 1px rgba(255, 226, 150, 0.16);
}

.account-row-owner td {
  background: rgba(128, 84, 17, 0.13);
}

/* Classic theme: light enterprise "gestionale" style (flat, clear, non-modern) */
body.theme-classic {
  --bg: #dfe5ef;
  --bg-soft: #e8edf5;
  --panel: rgba(244, 247, 252, 0.98);
  --panel-strong: rgba(236, 242, 249, 0.99);
  --panel-light: rgba(255, 255, 255, 0.82);
  --line: rgba(112, 128, 152, 0.34);
  --line-strong: rgba(98, 118, 147, 0.5);
  --text: #1d2737;
  --muted: #5e6d83;
  --shadow-lg: 0 2px 6px rgba(32, 47, 70, 0.08);
  --shadow-md: 0 1px 3px rgba(32, 47, 70, 0.06);
  --ui-font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

body.theme-classic {
  background:
    linear-gradient(180deg, #e7ecf4 0%, #dfe6f0 42%, #edf2f8 100%);
}

body.theme-classic::before {
  background: radial-gradient(circle, rgba(110, 126, 154, 0.12), transparent 72%);
  filter: blur(10px);
}

body.theme-classic::after {
  background: radial-gradient(circle, rgba(145, 156, 174, 0.1), transparent 74%);
  filter: blur(10px);
}

body.theme-classic .topbar {
  background: #d7deea;
  border-bottom-color: rgba(98, 118, 147, 0.26);
  backdrop-filter: none;
}

body.theme-classic .tabs {
  background: #e7ecf4;
  border-color: rgba(112, 129, 154, 0.2);
  box-shadow: none;
}

body.theme-classic .tab {
  color: #243247;
  background: #f3f6fb;
  border-color: rgba(119, 136, 160, 0.24);
  border-radius: 6px;
  text-transform: none;
  letter-spacing: 0 !important;
  font-weight: 600;
}

body.theme-classic .tab:hover {
  background: #edf2f9;
  border-color: rgba(102, 122, 151, 0.34);
}

body.theme-classic .tab.is-active {
  color: #10233f;
  background: #cfd9ea;
  border-color: rgba(92, 113, 144, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.theme-classic .panel,
body.theme-classic .anagrafiche,
body.theme-classic .anag-card {
  background: #f4f7fc;
  backdrop-filter: none;
  border-color: rgba(112, 129, 154, 0.2);
  border-radius: 8px;
}

body.theme-classic .btn,
body.theme-classic .btn-icon {
  background: #eef3fa;
  border-color: rgba(112, 129, 154, 0.26);
  color: #203049;
  box-shadow: none;
  border-radius: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

body.theme-classic .btn:hover,
body.theme-classic .btn-icon:hover {
  background: #e5edf8;
  border-color: rgba(96, 116, 146, 0.34);
}

body.theme-classic .search,
body.theme-classic .date-input,
body.theme-classic .cell-input,
body.theme-classic .cell-select,
body.theme-classic .anag-form input,
body.theme-classic .anag-form textarea,
body.theme-classic .anag-form select {
  background: #ffffff;
  border-color: rgba(117, 134, 158, 0.26);
  color: #1d2737;
  border-radius: 5px;
}

body.theme-classic .table-wrap {
  background: #eef3fa;
  border-color: rgba(112, 129, 154, 0.2);
  border-radius: 8px;
}

body.theme-classic th {
  color: #21314a;
  background: #dde6f3;
  border-color: rgba(120, 137, 161, 0.22);
  text-transform: none;
  letter-spacing: 0.01em;
}

body.theme-classic tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.96);
}

body.theme-classic tbody tr:nth-child(even) td {
  background: rgba(247, 250, 254, 0.96);
}

body.theme-classic tbody tr:hover td {
  background: rgba(217, 229, 246, 0.9);
}

body.theme-classic td,
body.theme-classic th {
  color: #1f2b3d;
  border-color: rgba(129, 145, 168, 0.16);
}

body.theme-classic .chat-panel {
  backdrop-filter: none;
  border-color: rgba(112, 129, 154, 0.2);
  box-shadow: 0 2px 6px rgba(32, 47, 70, 0.08);
}

body.theme-classic .chat-launcher,
body.theme-classic .fullscreen-toggle {
  background: #e9eff8;
  border-color: rgba(112, 129, 154, 0.24);
  color: #22324a;
  box-shadow: 0 1px 3px rgba(32, 47, 70, 0.06);
}

body.theme-classic .brand,
body.theme-classic .userbox {
  color: #22324a;
}

body.theme-classic .user-meta span {
  color: #54657d;
}

body.theme-classic .user-avatar {
  color: #2a4163;
  border-color: rgba(111, 128, 152, 0.32);
  background: #f7f9fc;
}

body.theme-classic .datebox {
  background: #eef3fa;
  border-color: rgba(112, 129, 154, 0.24);
  border-radius: 6px;
}

body.theme-classic .datebox span,
body.theme-classic .datebox .date-label {
  background: #c9d5e8;
  color: #1f314b;
}

body.theme-classic .chip-live {
  background: #e9edf4;
  color: #4c5c72;
  border-color: rgba(123, 140, 163, 0.28);
}

body.theme-classic .chip-live-btn:hover {
  background: #dfe6f0;
}

body.theme-classic .login-view {
  background: rgba(217, 225, 236, 0.72);
  backdrop-filter: blur(4px);
}

.mini-table th {
  background: rgba(33, 49, 83, 0.9);
  text-transform: uppercase;
  color: #c7dafd;
  font-size: clamp(0.7rem, 0.75vw, 0.8rem);
  letter-spacing: 0.04em;
}

/* Warning dialogs/messages must be uppercase across the app */
.agenda-warning-head h3,
.agenda-warning-head h4,
.agenda-warning-message,
.chat-notice-head h3,
.chat-notice-message,
.agenda-warning-actions .btn,
.chat-notice-actions .btn {
  text-transform: uppercase;
}


