/* ==========================================================
   WIRITALY — Design System v3 (Apple-style, coerente con wiritaly.it)
   Stessa identità visiva usata su areaclienti.wiritaly.it.
   ========================================================== */

/* --- Google Fonts: Inter (stesso font usato su wiritaly.it) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================
   DESIGN TOKENS — Light & Dark
   ========================================================== */
:root {
  /* Brand — stesso blu di wiritaly.it (#0071e3) */
  --sap-brand:             #0071e3;
  --sap-brand-hover:       #0058b0;
  --sap-brand-active:      #004a94;
  --sap-brand-subtle:      #e8f0fb;
  --sap-brand-2:           #0071e3;
  --sap-gradient:          linear-gradient(135deg, #2b8cff 0%, #0071e3 100%);
  --sap-gradient-soft:     linear-gradient(135deg, rgba(0,113,227,.09) 0%, rgba(0,113,227,.04) 100%);

  /* Semantic — colori di sistema in stile Apple */
  --sap-positive:          #1a9d1a;
  --sap-positive-bg:       #e9f9ec;
  --sap-negative:          #ff3b30;
  --sap-negative-bg:       #fff0ef;
  --sap-critical:          #d97a06;
  --sap-critical-bg:       #fff6e8;
  --sap-informative:       #0071e3;
  --sap-informative-bg:    #e8f0fb;
  --sap-neutral:           #6e6e73;

  /* Neutrals */
  --sap-base-bg:           #f5f5f7;
  --sap-base-bg-2:         #ececee;
  --sap-shell-bg:          #ffffff;
  --sap-shell-bg-2:        #ffffff;
  --sap-shell-fg:          #1d1d1f;
  --sap-tile-bg:           #ffffff;
  --sap-tile-border:       #e2e2e5;
  --sap-tile-shadow:       0 1px 2px rgba(0,0,0,.03), 0 1px 3px rgba(0,0,0,.04);
  --sap-tile-shadow-hover: 0 8px 20px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --sap-tile-shadow-lg:    0 16px 40px rgba(0,0,0,.12);
  --sap-separator:         #e5e5ea;

  /* Text */
  --sap-text-primary:      #1d1d1f;
  --sap-text-secondary:    #6e6e73;
  --sap-text-disabled:     #aeaeb2;
  --sap-text-inverse:      #ffffff;
  --sap-link:              #0071e3;

  /* Typography */
  --sap-font:              'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --sap-font-mono:         'SF Mono', 'IBM Plex Mono', 'Courier New', monospace;
  --sap-font-size-xs:      0.75rem;
  --sap-font-size-sm:      0.8125rem;
  --sap-font-size-base:    0.875rem;
  --sap-font-size-md:      1rem;
  --sap-font-size-lg:      1.25rem;
  --sap-font-size-xl:      1.5rem;
  --sap-font-size-2xl:     2rem;

  /* Spacing */
  --sap-space-xs:  4px;
  --sap-space-sm:  8px;
  --sap-space-md:  16px;
  --sap-space-lg:  24px;
  --sap-space-xl:  32px;

  /* Radius — arrotondamenti più morbidi, bottoni a pillola */
  --sap-radius-sm: 10px;
  --sap-radius-md: 14px;
  --sap-radius-lg: 20px;
  --sap-radius-pill: 980px;

  /* Shell/Header */
  --sap-header-height: 60px;

  /* Transition */
  --sap-transition:      220ms cubic-bezier(.4,0,.2,1);
  --sap-transition-slow: 320ms cubic-bezier(.4,0,.2,1);
}

/* ==========================================================
   DARK MODE — prefers-color-scheme
   ========================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --sap-base-bg:           #000000;
    --sap-base-bg-2:         #1c1c1e;
    --sap-shell-bg:          #000000;
    --sap-shell-bg-2:        #000000;
    --sap-shell-fg:          #f5f5f7;
    --sap-tile-bg:           #1c1c1e;
    --sap-tile-border:       #2c2c2e;
    --sap-tile-shadow:       0 1px 2px rgba(0,0,0,.4);
    --sap-tile-shadow-hover: 0 8px 24px rgba(0,0,0,.5);
    --sap-tile-shadow-lg:    0 16px 40px rgba(0,0,0,.6);
    --sap-separator:         #38383a;

    --sap-text-primary:      #f5f5f7;
    --sap-text-secondary:    #aeaeb2;
    --sap-text-disabled:     #6e6e73;
    --sap-text-inverse:      #1d1d1f;
    --sap-link:              #2b95ff;

    --sap-brand:             #2b95ff;
    --sap-brand-hover:       #5cadff;
    --sap-brand-active:      #8cc4ff;
    --sap-brand-subtle:      #0a2540;
    --sap-brand-2:           #2b95ff;
    --sap-gradient:          linear-gradient(135deg, #5cadff 0%, #2b95ff 100%);
    --sap-gradient-soft:     linear-gradient(135deg, rgba(43,149,255,.16) 0%, rgba(43,149,255,.08) 100%);

    --sap-positive:          #30d158;
    --sap-positive-bg:       #0d2415;
    --sap-negative:          #ff453a;
    --sap-negative-bg:       #2c1210;
    --sap-critical:          #ff9f0a;
    --sap-critical-bg:       #2b1e05;
    --sap-informative-bg:    #0a2540;
    --sap-neutral:           #8e8e93;
  }
}

/* ==========================================================
   MOTION PREFERENCE
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ==========================================================
   RESET & BASE
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--sap-font);
  font-size: var(--sap-font-size-base);
  line-height: 1.5;
  margin: 0;
  background: var(--sap-base-bg);
  color: var(--sap-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--sap-link);
  text-decoration: none;
  transition: color var(--sap-transition);
}
a:hover { text-decoration: underline; color: var(--sap-brand-hover); }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--sap-text-primary);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--sap-font-size-xl); font-weight: 700; }
h2 { font-size: var(--sap-font-size-lg); font-weight: 600; }
h3 { font-size: var(--sap-font-size-md); font-weight: 600; }

p { margin: 0 0 8px; }

hr { border: none; border-top: 1px solid var(--sap-separator); margin: var(--sap-space-lg) 0; }

::selection { background: var(--sap-brand-subtle); color: var(--sap-brand-active); }

:focus-visible {
  outline: 2px solid var(--sap-brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================
   CONTAINER
   ========================================================== */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--sap-space-lg) var(--sap-space-md);
}

/* ==========================================================
   SHELL HEADER — top bar
   ========================================================== */
.header {
  background: rgba(255,255,255,.78) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--sap-text-primary) !important;
  border: none !important;
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: none !important;
  padding: 0 !important;
  height: var(--sap-header-height);
  position: sticky;
  top: 0;
  z-index: 200;
}
@media (prefers-color-scheme: dark) {
  .header {
    background: rgba(0,0,0,.72) !important;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
}

.header .container {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  height: 100%;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.header-logo img {
  height: 26px !important;
  max-height: 26px !important;
  width: auto;
}

.header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-icon { display: inline-flex; width: 15px; height: 15px; flex: 0 0 auto; }
.nav-icon svg { width: 100%; height: 100%; }

/* Bottoni nella nav — pillola trasparente, stile wiritaly.it */
.header .btn {
  background: transparent !important;
  border: none !important;
  color: var(--sap-text-primary) !important;
  font-size: var(--sap-font-size-sm) !important;
  font-weight: 500;
  padding: 6px 14px !important;
  border-radius: var(--sap-radius-pill) !important;
  height: 32px;
  line-height: 1;
  transition: background var(--sap-transition), color var(--sap-transition);
}
.header .btn:hover {
  background: var(--sap-brand-subtle) !important;
  color: var(--sap-brand) !important;
  text-decoration: none;
  transform: none;
}

/* Ticket button — accento pieno in nav */
.header .btn-ticket {
  background: var(--sap-brand) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: none;
}
.header .btn-ticket:hover {
  background: var(--sap-brand-hover) !important;
  color: #fff !important;
}

/* Danger in header */
.header .btn-danger {
  background: transparent !important;
  border: none !important;
  color: var(--sap-negative) !important;
}
.header .btn-danger:hover {
  background: var(--sap-negative-bg) !important;
  color: var(--sap-negative) !important;
}

/* ==========================================================
   CARD — tile
   ========================================================== */
.card {
  background: var(--sap-tile-bg);
  border: 1px solid var(--sap-tile-border);
  border-radius: var(--sap-radius-lg);
  box-shadow: var(--sap-tile-shadow);
  padding: var(--sap-space-lg);
  margin-bottom: var(--sap-space-md);
  transition: box-shadow var(--sap-transition-slow), transform var(--sap-transition-slow);
}
.card:hover { box-shadow: var(--sap-tile-shadow-hover); transform: translateY(-1px); }
.card.card-compact { padding: var(--sap-space-md) var(--sap-space-lg); }
.card.card-static:hover { transform: none; }

/* ==========================================================
   LAYOUT ROW / COL
   ========================================================== */
.row { display: flex; gap: var(--sap-space-md); flex-wrap: wrap; }
.col { flex: 1 1 300px; }

/* ==========================================================
   HERO CARD — banner di benvenuto/riepilogo pagina
   ========================================================== */
.hero-card {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--sap-space-md) + 4px);
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--sap-gradient);
}
.hero-card .hero-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--sap-space-sm);
}
.hero-card .hero-eyebrow {
  font-size: var(--sap-font-size-xs);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sap-text-secondary);
  margin-bottom: 2px;
}
.hero-card h1 { margin: 0; }

/* ==========================================================
   TOOLBAR — barra filtri/ricerca
   ========================================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sap-space-sm);
  margin-bottom: var(--sap-space-md);
  padding-bottom: var(--sap-space-sm);
}
.toolbar-hint {
  color: var(--sap-text-secondary);
  font-size: var(--sap-font-size-xs);
  margin-right: auto;
}
.toolbar .input,
.toolbar select.input {
  width: auto;
  min-width: 150px;
}
.toolbar .search-input { min-width: 220px; flex: 1 1 220px; max-width: 320px; }
.toolbar .btn-clear { color: var(--sap-text-secondary); }

/* Filtri di stato — pillole cliccabili (usate nel backend ticket) */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--sap-space-md);
}
.filter-pills a.badge {
  padding: 5px 14px;
  cursor: pointer;
  transition: background var(--sap-transition), color var(--sap-transition), border-color var(--sap-transition);
}
.filter-pills a.badge:hover { text-decoration: none; }
.filter-pills a.badge.active {
  background: var(--sap-brand);
  border-color: var(--sap-brand);
  color: #fff;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  height: 36px;
  font-family: var(--sap-font);
  font-size: var(--sap-font-size-sm);
  font-weight: 500;
  border-radius: var(--sap-radius-pill);
  border: 1px solid var(--sap-tile-border);
  background: var(--sap-tile-bg);
  color: var(--sap-text-primary);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--sap-transition), border-color var(--sap-transition), transform var(--sap-transition);
}
.btn:hover {
  background: var(--sap-base-bg-2);
  text-decoration: none;
  transform: scale(1.02);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--sap-brand);
  border-color: var(--sap-brand);
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--sap-brand-hover);
  border-color: var(--sap-brand-hover);
}
.btn-primary:active { background: var(--sap-brand-active); }

.btn-danger {
  background: transparent;
  border-color: var(--sap-tile-border);
  color: var(--sap-negative) !important;
}
.btn-danger:hover {
  background: var(--sap-negative-bg);
  border-color: var(--sap-negative);
}

.btn-ticket {
  background: var(--sap-brand);
  border-color: var(--sap-brand);
  color: #fff !important;
}
.btn-ticket:hover {
  background: var(--sap-brand-hover);
  border-color: var(--sap-brand-hover);
  color: #fff !important;
}

.btn-sm { height: 30px; padding: 5px 14px; font-size: var(--sap-font-size-xs); }
.btn-block { width: 100%; }

/* ==========================================================
   FORM / INPUT
   ========================================================== */
label {
  display: block;
  font-size: var(--sap-font-size-xs);
  font-weight: 600;
  color: var(--sap-text-secondary);
  margin: 16px 0 4px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
label:first-child { margin-top: 0; }

.input, select.input, textarea.input,
form input[type="text"], form input[type="email"], form input[type="password"],
form input[type="number"], form input[type="file"], form select, form textarea {
  width: 100%;
  padding: 6px 10px;
  min-height: 34px;
  font-family: var(--sap-font);
  font-size: var(--sap-font-size-base);
  background: var(--sap-tile-bg);
  border: 1px solid var(--sap-tile-border);
  border-radius: var(--sap-radius-sm);
  color: var(--sap-text-primary);
  outline: none;
  transition: border-color var(--sap-transition), box-shadow var(--sap-transition);
}
form textarea { min-height: 100px; resize: vertical; }
.input:focus, form input:focus, form select:focus, form textarea:focus {
  border-color: var(--sap-brand);
  box-shadow: 0 0 0 3px rgba(0,113,227,.14);
}
.input::placeholder, form textarea::placeholder { color: var(--sap-text-disabled); }

form button, button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--sap-space-md);
  padding: 8px 18px;
  height: 36px;
  font-family: var(--sap-font);
  font-size: var(--sap-font-size-sm);
  font-weight: 500;
  border-radius: var(--sap-radius-pill);
  border: 1px solid var(--sap-brand);
  background: var(--sap-brand);
  color: #fff;
  cursor: pointer;
  transition: background var(--sap-transition), transform var(--sap-transition);
}
form button:hover, button[type="submit"]:hover { background: var(--sap-brand-hover); transform: scale(1.02); }
form button:active, button[type="submit"]:active { background: var(--sap-brand-active); transform: scale(.97); }
form button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ==========================================================
   TABLE — analytical table
   ========================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sap-font-size-base);
}

th {
  padding: 9px 10px;
  border-bottom: 2px solid var(--sap-separator);
  text-align: left;
  font-size: var(--sap-font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sap-text-secondary);
  background: var(--sap-base-bg);
  white-space: nowrap;
}

td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--sap-separator);
  text-align: left;
  color: var(--sap-text-primary);
  vertical-align: middle;
}

tbody tr { transition: background var(--sap-transition); }
tbody tr:hover { background: var(--sap-brand-subtle); }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================================
   BADGE / STATUS PILL
   ========================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--sap-radius-pill);
  background: var(--sap-base-bg-2);
  border: 1px solid var(--sap-separator);
  font-size: var(--sap-font-size-xs);
  font-weight: 500;
  color: var(--sap-text-secondary);
  white-space: nowrap;
}

.badge-success { background: var(--sap-positive-bg); border-color: var(--sap-positive); color: var(--sap-positive); }
.badge-error   { background: var(--sap-negative-bg); border-color: var(--sap-negative); color: var(--sap-negative); }
.badge-warning { background: var(--sap-critical-bg); border-color: var(--sap-critical); color: var(--sap-critical); }
.badge-info    { background: var(--sap-informative-bg); border-color: var(--sap-informative); color: var(--sap-informative); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--sap-radius-pill);
  font-size: var(--sap-font-size-xs);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.status-pill-success { background: var(--sap-positive-bg); color: var(--sap-positive); }
.status-pill-danger  { background: var(--sap-negative-bg); color: var(--sap-negative); }
.status-pill-warning { background: var(--sap-critical-bg); color: var(--sap-critical); }
.status-pill-info    { background: var(--sap-informative-bg); color: var(--sap-informative); }
.status-pill-neutral { background: var(--sap-base-bg-2); color: var(--sap-text-secondary); }

/* Mappatura stati ticket (NUOVO / IN LAVORAZIONE / IN COLLAUDO / CHIUSO) */
.status-pill-nuovo         { background: var(--sap-informative-bg); color: var(--sap-informative); }
.status-pill-in-lavorazione{ background: var(--sap-critical-bg); color: var(--sap-critical); }
.status-pill-in-collaudo   { background: var(--sap-brand-subtle); color: var(--sap-brand); }
.status-pill-chiuso        { background: var(--sap-positive-bg); color: var(--sap-positive); }

/* ==========================================================
   ALERT — messaggi di stato in pagina (login, form, ecc.)
   ========================================================== */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--sap-radius-md);
  font-size: var(--sap-font-size-sm);
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-danger  { background: var(--sap-negative-bg); color: var(--sap-negative); border-color: rgba(187,0,0,.2); }
.alert-success { background: var(--sap-positive-bg); color: var(--sap-positive); border-color: rgba(24,137,24,.2); }
.alert-info    { background: var(--sap-informative-bg); color: var(--sap-informative); border-color: rgba(0,113,227,.2); }

/* ==========================================================
   INFO LIST — coppie badge/valore compatte
   ========================================================== */
.info-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 28px;
}
.info-list .info-item {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--sap-separator);
}
.info-list .info-item .badge { flex: 0 0 auto; }
.info-list .info-item .info-value {
  color: var(--sap-text-primary);
  font-weight: 500;
  word-break: break-word;
}

/* ==========================================================
   CARD TITLE — intestazione card con icona + badge
   ========================================================== */
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--sap-space-md);
}
.card-title .card-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--sap-radius-sm);
  background: var(--sap-gradient-soft);
  color: var(--sap-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.card-title .card-title-icon svg { width: 16px; height: 16px; }
.card-title h2, .card-title h3 { margin: 0; }
.card-title .badge, .card-title .status-pill { margin-left: auto; }

/* ==========================================================
   EMPTY STATE
   ========================================================== */
.empty-state {
  text-align: center;
  padding: var(--sap-space-xl) var(--sap-space-md);
  color: var(--sap-text-secondary);
}
.empty-state .empty-icon {
  width: 40px; height: 40px;
  margin: 0 auto 10px;
  opacity: .5;
}
.empty-state p { margin: 0; font-size: var(--sap-font-size-base); }

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  color: var(--sap-text-secondary);
  font-size: var(--sap-font-size-xs);
  text-align: center;
  padding: var(--sap-space-lg) var(--sap-space-md);
  border-top: 1px solid var(--sap-separator);
  margin-top: var(--sap-space-xl);
}

/* ==========================================================
   LOGIN — card centrata con barra sfumata in alto
   ========================================================== */
.login-wrap {
  max-width: 420px;
  margin: 40px auto;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--sap-gradient);
}
.logo-center { text-align: center; margin: 10px 0 6px; }
.logo-center img { max-width: 190px; height: auto; display: inline-block; }
.login-subtitle { text-align: center; color: var(--sap-text-secondary); font-size: var(--sap-font-size-sm); margin-bottom: 20px; }
.muted { color: var(--sap-text-secondary); font-size: .95rem; }

/* ==========================================================
   RISPOSTE — messaggi cliente/backend sul ticket
   ========================================================== */
.risposta {
  padding: 10px 14px;
  border-radius: var(--sap-radius-md);
  background: var(--sap-base-bg);
  border: 1px solid var(--sap-tile-border);
  margin-bottom: 10px;
}
.risposta .risposta-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--sap-font-size-xs);
  color: var(--sap-text-secondary);
  margin-bottom: 4px;
}
.risposta.risposta-backend { background: var(--sap-brand-subtle); }

/* ==========================================================
   ENTRANCE ANIMATION (leggera, rispetta reduced-motion)
   ========================================================== */
@keyframes sap-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.container > .card {
  animation: sap-fade-up 360ms cubic-bezier(.4,0,.2,1) both;
}

/* ==========================================================
   MOBILE FIX
   ========================================================== */
@media (max-width: 720px) {
  .container { padding: var(--sap-space-sm) var(--sap-space-sm); }
  .card { padding: 14px; border-radius: var(--sap-radius-md); }
  .row { flex-direction: column; gap: 12px; }
  .col { flex: 0 1 auto; min-width: 0; }

  .header {
    height: auto !important;
    min-height: var(--sap-header-height);
  }
  .header .container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--sap-space-sm);
    padding-top: var(--sap-space-sm) !important;
    padding-bottom: var(--sap-space-sm) !important;
  }
  .header-logo { display: flex; justify-content: center; }
  .header-actions {
    flex-direction: column;
    gap: 6px;
  }
  .header .btn {
    width: 100%;
    height: 40px;
    font-size: var(--sap-font-size-base) !important;
    background: var(--sap-base-bg-2) !important;
  }

  .input, form input, form select, form textarea { font-size: 16px; }
  .toolbar .input, .toolbar select.input, .toolbar .search-input { width: 100%; max-width: none; }

  table { font-size: var(--sap-font-size-xs); }

  .login-wrap { max-width: 100%; margin: 24px 0; }
  .logo-center img { max-width: 160px; }
}

/* ==========================================================
   NAV — stato attivo (header condiviso includes/header.php)
   ========================================================== */
.header .btn.btn-active {
  background: var(--sap-brand-subtle) !important;
  color: var(--sap-brand) !important;
  font-weight: 600;
}
