/* === SirPix³ Desktop Skin — cleaned duplicate CSS rules === */

/* === SirPix³ Desktop Skin === */
/* ric to { transform:translateY(-10px) scale(1.02); } */
:root { --bg:#0b0b12; --card:#22263a; --card_lighter:#34394e; --muted:#8f97a6; --text:#e9ecf1; --brand:#7c5cff; --brand-2:#00d1ff; --accent:#70a1ff; --accent-amber:#ffd666; --cyan:#22d3ee; --info:#60a5fa; --ok:#2ecc71; --warn:#f1c40f; --danger:#ff5e57; --line:rgba(255,255,255,.06); --border:var(--line); --border-strong:rgba(255,255,255,.18); --hover:rgba(255,255,255,.04); --text-muted:var(--muted); --text-strong:var(--text); --ink_on_accent:#fff; --radius:16px; --shadow:0 10px 30px rgba(0,0,0,.35); --container:min(1680px,96vw); --app-header-h:64px; --chip-brand-bg:rgba(124,92,255,.15); --chip-brand-border:rgba(124,92,255,.3); --chip-brand-color:#b8a4ff; --chip-brand-hover:rgba(124,92,255,.25); --chip-info-bg:rgba(0,209,255,.12); --chip-info-border:rgba(0,209,255,.28); --chip-info-color:#7ee2ff; --chip-info-hover:rgba(0,209,255,.22); --chip-danger-bg:rgba(255,94,87,.12); --chip-danger-border:rgba(255,94,87,.28); --chip-danger-color:#fecaca; --chip-danger-hover:rgba(255,94,87,.22); --chip-warning-bg:rgba(255,165,0,.12); --chip-warning-border:rgba(255,165,0,.28); --chip-warning-color:#fdba74; --chip-warning-hover:rgba(255,165,0,.22); --chip-success-bg:rgba(34,197,94,.12); --chip-success-border:rgba(34,197,94,.28); --chip-success-color:#86efac; --chip-success-hover:rgba(34,197,94,.22); --z-modal:10000; }

/* Reset e box-sizing  */
* { box-sizing:border-box; }

html,body { height:auto; }

/* Background generali e gradienti */
body.page::before { content:""; position:fixed; inset:0; z-index:-1; pointer-events:none; background-image:radial-gradient(closest-side at 85% -20%,rgba(124,92,255,.32),transparent 62%),radial-gradient(closest-side at -6% 0%,rgba(0,209,255,.24),transparent 60%); background-repeat:no-repeat,no-repeat; background-size:165vw 72vh,125vw 56vh; background-position:85% -20%,-6% 0%; }

body.page::after { content:""; position:fixed; inset:0; z-index:-1; pointer-events:none; background:radial-gradient(120% 100% at 50% -10%,rgba(0,0,0,0) 60%,rgba(0,0,0,.10) 100%),radial-gradient(120% 100% at 50% 110%,rgba(0,0,0,0) 65%,rgba(0,0,0,.12) 100%); }

/* Container e layout generale */
.container { max-width:var(--container); margin:0 auto; padding:0 24px; }

.header__inner { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:16px; padding:14px 0; }

/* Brand / Logo */
.brand { display:flex; align-items:center; gap:10px; }

.brand__logo { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:12px; background:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; font-weight:800; text-decoration:none; box-shadow:var(--shadow); }

.brand__tag { font-size:12px; color:var(--muted); letter-spacing:.4px; }

/* Navigazione / Nav */
.nav { display:flex; align-items:center; gap:10px; }

.nav__link { appearance:none; border:0; text-decoration:none; color:var(--muted); padding:8px 12px; border-radius:10px; transition:180ms; background:transparent; font:inherit; line-height:1.2; cursor:pointer; }

.nav__link:hover,
.nav__group:hover > .nav__trigger,
.nav__group:focus-within > .nav__trigger { color:#fff; background:rgba(255,255,255,.06); }

.nav__link.is-active,
.nav__group.is-active > .nav__trigger { color:#fff; background:rgba(124,92,255,.18); }

.nav__group { position:relative; }

.nav__trigger::after { content:""; display:inline-block; width:6px; height:6px; margin-left:8px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:translateY(-2px) rotate(45deg); opacity:.8; }

.nav__menu { position:absolute; top:calc(100% + 8px); left:0; z-index:2100; min-width:220px; padding:8px; border:1px solid var(--border-strong); border-radius:12px; background:rgba(18,19,29,.98); box-shadow:var(--shadow); opacity:0; transform:translateY(-4px); pointer-events:none; transition:opacity .16s ease, transform .16s ease; }

.nav__group:hover > .nav__menu,
.nav__group:focus-within > .nav__menu { opacity:1; transform:translateY(0); pointer-events:auto; }

.nav__group:last-child .nav__menu { left:auto; right:0; }

.nav__menu--wide { left:50%; display:grid; grid-template-columns:repeat(4,minmax(160px,1fr)); gap:8px; width:min(820px,calc(100vw - 64px)); transform:translate(-50%,-4px); }

.nav__group:hover > .nav__menu--wide,
.nav__group:focus-within > .nav__menu--wide { transform:translate(-50%,0); }

.nav__section { display:flex; flex-direction:column; gap:2px; }

.nav__label { padding:8px 10px 6px; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; }

.nav__item { display:block; padding:9px 10px; border-radius:8px; color:var(--text); text-decoration:none; white-space:nowrap; }

.nav__item:hover,
.nav__item:focus { color:#fff; background:rgba(255,255,255,.07); outline:none; }

/* User / avatar / notifiche */
.user { display:flex; align-items:center; gap:8px; }

.user__notif { border:none !important; background:none !important; padding:8px 10px; color:var(--text); cursor:pointer; }

a.user__avatar { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; font-weight:700; background:#1a1b25; border:1px solid rgba(255,255,255,.08); text-decoration:none; color:inherit; }

a.user__avatar:hover,
a.user__avatar:focus { border-color:rgba(255,255,255,.25); background:#222330; outline:none; }

/* Hero / Titoli */
.hero__inner { display:grid; grid-template-columns:1.1fr .9fr; gap:28px; align-items:center; }

.hero__title { font-size:clamp(28px,4vw,40px); margin:0 0 8px; letter-spacing:.2px; }

.hero__subtitle { margin:0 0 22px; color:var(--muted); }

/* Search / Quick access / Chip */
.search { display:flex; gap:10px; margin-bottom:14px; }

.search__input { flex:1; background:#0e0f18; border:1px solid rgba(255,255,255,.1); color:var(--text); padding:14px 14px; border-radius:12px; outline:none; }

.search__input::placeholder { color:#6f7687; }

.search__btn { min-width:110px; }

.quick { display:flex; gap:10px; flex-wrap:wrap; }

.chip { gap:6px; padding:9px 12px; font-size:14px; border-radius:999px; border:1px solid rgba(255,255,255,.12); color:#fff; text-decoration:none; background:linear-gradient(180deg,rgba(124,92,255,.18),rgba(0,0,0,0)); }

/* Glow card */
.glow-card__ring { position:absolute; width:160%; height:160%; background:radial-gradient(closest-side,rgba(124,92,255,.35),transparent 55%),radial-gradient(closest-side,rgba(0,209,255,.35),transparent 55%); filter:blur(30px); opacity:.7; animation:float 9s ease-in-out infinite alternate; }

.glow-card__content { position:relative; z-index:1; display:grid; gap:6px; place-items:center; font-weight:700; letter-spacing:.3px; }

/* KPI / Griglie */
.kpi { background:var(--card); border:1px solid rgba(255,255,255,.3); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow); }

.kpis__grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }

.kpi__label { color:var(--muted); font-size:12px; letter-spacing:.4px; margin-bottom:8px; text-transform:uppercase; }

.kpi__value { font-size:28px; font-weight:800; }

/* Panel */
.panel { background:var(--card); border:1px solid rgba(255,255,255,.3); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }

.panels__grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }

.dashboard-shell { padding:14px 0 42px; }
.dashboard-shell__grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,380px); gap:16px; align-items:stretch; }
.dashboard-shell__main { min-width:0; }
.kpis.dashboard-shell__kpis { padding:0 0 6px; }
.dashboard-shell__kpis .kpis__grid { grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); }
.dashboard-shell__panels { padding:10px 0 0; }
.dashboard-shell__panels .panels__grid { grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); }
.dashboard-shell__aside { position:sticky; top:calc(var(--app-header-h) + 16px); align-self:start; height:calc(100% - 42px); }

.panel__head { padding:14px 16px; border-bottom:1px solid var(--line); }

.panel__title { font-size:16px; }

/* liste */
.list--lines .list__row { display:grid; grid-template-columns:1fr auto; align-items:center; gap:14px; padding:12px 16px; border-bottom:1px solid var(--line); }

.list__row:last-child { border-bottom:0; }

.list__title { color:#fff; font-weight:600; text-decoration:none; }

.list__title:hover { text-decoration:underline; }

.list__meta { color:var(--muted); font-size:13px; }

/* Pulsanti e link */
.btn--primary { background:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#0b0b12; }

.btn--secondary { background:transparent; color:var(--text); border:1px solid rgba(255,255,255,.15); }

.btn--secondary:hover { background:rgba(255,255,255,.06); }

.btn--ghost { background:transparent; color:var(--text); border:1px solid rgba(255,255,255,.12); }

.link { color:#cbd5ff; text-decoration:none; }

.link:hover { text-decoration:underline; }

/* Footer */
.footer__inner { display:flex; align-items:center; justify-content:space-between; }

/* Page header */
.page-head__inner { display:flex; align-items:end; justify-content:space-between; gap:16px; }

.page-title { font-size:22px; margin:0; }

.page-subtitle { color:var(--muted); font-size:13px; margin-top:4px; }

.page-actions { gap:10px; }

/* Toolbar */
.toolbar { padding:8px 0 8px; border-bottom:1px solid var(--line); }

.toolbar__inner { align-items:center; justify-content:space-between; gap:12px; }

.toolbar__search { display:flex; gap:10px; align-items:center; }

/* Tabelle */
.table-wrap { padding:14px 0 28px; }

.table { border:1px solid rgba(255,255,255,.08); border-radius:var(--radius); background:var(--card); box-shadow:var(--shadow); overflow:visible; }

.table__head { position:static; top:auto; z-index:auto; background:var(--card_lighter); border-bottom:1px solid var(--line); box-shadow:none; }

.table__row { display:grid; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid var(--line); grid-template-columns:var(--cols,1fr); }

.table__row--head { font-size:12px; text-transform:uppercase; letter-spacing:.4px; }

.table__body .table__row:hover { background-color:rgba(255,255,255,.04); }

.th,.td { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.th--check,.td--check { display:grid; place-items:center; }

.td--main .td__title { font-weight:600; }

.td__meta { color:var(--muted); font-size:12px; margin-top:2px; }

.td--actions { text-align:right; }

.row-actions .chip { padding:8px 10px; font-size:12px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.12); text-decoration:none !important; }

.row-actions .mini { height:30px !important; }

/* Card vuote / messaggi */
.empty__card { text-align:center; background:var(--card); border:1px solid rgba(255,255,255,.08); border-radius:var(--radius); padding:22px 24px; box-shadow:var(--shadow); }

.empty__title { font-weight:800; font-size:18px; }

.empty__subtitle { color:var(--muted); margin:6px 0 14px; }

.badge-group { display:flex; gap:6px; flex-wrap:wrap; }

/* Autenticazione */
.auth { position:relative; width:100%; max-width:440px; padding:24px; }

.auth__card { position:relative; background:var(--card); border:1px solid rgba(255,255,255,.08); border-radius:calc(var(--radius) + 4px); box-shadow:var(--shadow); padding:24px 22px; overflow:hidden; }

.auth__glow { position:absolute; inset:-20% -30% auto -30%; height:320px; background:radial-gradient(closest-side,rgba(124,92,255,.25),transparent 60%),radial-gradient(closest-side,rgba(0,209,255,.18),transparent 60%); filter:blur(28px); opacity:.7; z-index:-1; animation:float 9s ease-in-out infinite alternate; }

.auth__brand { text-align:center; margin-bottom:16px; }

.auth__title { font-weight:800; font-size:22px; margin-top:10px; }

.auth__subtitle { color:var(--muted); font-size:14px; margin-top:6px; }

.auth__actions { margin:16px 0 6px; }

.auth__misc { display:flex; justify-content:center; margin-top:8px; }

.auth__footer { text-align:center; color:var(--muted); margin-top:12px; font-size:12px; }

/* Form fields */
.field { display:grid; gap:6px; margin:12px 0; }

.field__label { font-size:13px; color:var(--muted); letter-spacing:.2px; }

.field__input { background:#0e0f18; border:1px solid rgba(255,255,255,.12); color:var(--text); padding:12px 12px; border-radius:12px; outline:none; transition:140ms; }

.field__input:focus { border-color:rgba(124,92,255,.6); box-shadow:0 0 0 3px rgba(124,92,255,.22); }

/* Alert */
.alert { border-radius:10px; padding:10px 12px; font-size:14px; margin-bottom:10px; border:1px solid rgba(255,255,255,.12); }

.alert--danger { background:rgba(255,94,87,.12); border-color:rgba(255,94,87,.28); color:#fecaca; }

.alert--ok { background:rgba(46,204,113,.12); border-color:rgba(46,204,113,.3); color:#bbf7d0; }

/* Personalizzazioni viste */

/* Table Customers - Inline e corretto */
.table--customers { width:100%; }

.table--customers .table__head { width:100%; }

.table--customers .th, .table--customers .td { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.table--customers .td a { color:inherit; text-decoration:none; }

.table--customers .td a:hover { text-decoration:underline; }

/* Header e body usano la stessa griglia */
.table--customers .table__head .table__row,
.table--customers .table__row--head,
.table--customers .table__body .table__row { display:grid; grid-template-columns:1.6fr 1.2fr 70px 90px 330px; align-items:center; gap:12px; min-width:0; }

/* Azioni allineate a destra anche nell'header */
.table--customers .th.th--actions,
.table--customers .td.td--actions { justify-self:end; }

@media (max-width: 1366px) {
  .table--customers .table__head .table__row,
  .table--customers .table__row--head,
  .table--customers .table__body .table__row { grid-template-columns:1.5fr 1.1fr 60px 80px 280px; gap:10px; }
}

/* Celle che devono andare a capo */
.table--customers .td--stack, .table--customers .td--contacts, .table--customers .td--address { white-space:normal; overflow:visible; text-overflow:initial; word-break:break-word; }

.table--customers .td--stack .line { display:block; }

.table--customers .td--stack .line--muted { color:var(--muted); font-size:12px; }

.table--customers .td--locations .loc-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:inline-block; max-width:22ch; vertical-align:middle; }

/* Azioni a destra */
.table--customers .td--actions { justify-self:end; white-space:nowrap; }

.table--customers .td--actions .row-actions { display:flex; flex-direction:row; align-items:center; gap:8px; flex-wrap:nowrap; white-space:nowrap; }

.table--customers .td--actions .chip { display:inline-flex; }

/* Table Expirations */
.table--expirations { --cols:2fr 1.2fr 1.2fr 1fr .8fr minmax(200px,1fr); }

.table--expirations .table__row { grid-template-columns:2fr 1.5fr 1fr .5fr .5fr 1.5fr; }

.table--expirations .th--center { justify-content:center; }

.table--expirations .td--center { text-align:center; }

.table--expirations .td--nowrap { white-space:nowrap; }

/* Table Expirations - Azioni */
.table--expirations .td--actions { white-space:nowrap; }

.table--expirations .row-actions { display:flex; flex-wrap:nowrap; gap:6px; }

.table--expirations .row-actions .chip { padding:4px 8px; font-size:12px; line-height:1; white-space:nowrap; }

.table--expirations .row-actions .chip.chip--danger { padding:4px 10px; }

/* Table Expirations - Note estese */
.table--expirations .td--notes { grid-column:1 / -1; background:rgba(255,255,255,.03); padding:10px 12px; white-space:normal; overflow:visible; text-overflow:initial; }

.table--expirations .table__row .td--notes:first-of-type { border-top-left-radius:8px; border-top-right-radius:8px; }

.table--expirations .table__row .td--notes:last-child { border-bottom-left-radius:8px; border-bottom-right-radius:8px; }

/* Table Reports */
.table--reports .table__row,.table--reports .table__row--head { display:grid; align-items:center; gap:12px; grid-template-columns:1.1fr 1.2fr 1.2fr 1fr .9fr .9fr .9fr 1.1fr .9fr 1fr 1fr .9fr .9fr 1fr minmax(118px,.7fr); }

.table--reports .td--time { line-height:1.15; }

.table--reports .th--wrap { white-space:nowrap; }

.table--reports { font-size:14px; }

@media (max-width:799px) {
  .table--reports .table__row,.table--reports .table__row--head { grid-template-columns:1.2fr 1fr 1fr 1fr minmax(118px,.7fr); }
  .table--reports .th,.table--reports .td { min-width:0; white-space:nowrap; }
  .table--reports .th:nth-child(n+5):not(:last-child),.table--reports .td:nth-child(n+5):not(:last-child) { display:none; }
  .table.table--list.table--reports .table__row--head,.table.table--list.table--reports .table__body .table__row { display:grid; grid-template-columns:1.2fr 1fr 1fr 1fr minmax(118px,.7fr) !important; gap:10px; }
}

@media (max-width:1279px) {
  .table--reports .table__row,.table--reports .table__row--head { grid-template-columns:1.1fr 1.2fr 1.2fr 1fr .9fr .9fr .9fr 1.1fr 1fr minmax(118px,.7fr); }
  .table--reports .th,.table--reports .td { min-width:0; white-space:nowrap; }
  .table--reports .th:nth-child(n+9):not(:last-child),.table--reports .td:nth-child(n+9):not(:last-child) { display:none; }
}

@media (max-width:1279px) and (min-width:800px) {
  .table--reports .th,.table--reports .td { min-width:0; white-space:nowrap; }
  .table.table--list.table--reports .table__row--head,.table.table--list.table--reports .table__body .table__row { display:grid; grid-template-columns:1.1fr 1.2fr 1.2fr 1fr .9fr .9fr .9fr 1.1fr 1fr minmax(118px,.7fr) !important; gap:12px; }
}

@media (min-width:1280px) {
  .table--reports .th,.table--reports .td { min-width:0; white-space:nowrap; }
  .table--reports .td--time>div { white-space:nowrap; }
  .table.table--list.table--reports .table__head { overflow:hidden; }
  .table.table--list.table--reports .table__row--head,.table.table--list.table--reports .table__body .table__row { display:grid; grid-template-columns:1.1fr 1.2fr 1.2fr 1fr .9fr .9fr .9fr 1.1fr .9fr 1fr 1fr .9fr .9fr 1fr minmax(118px,.7fr) !important; align-items:center; gap:12px; }
}

.row--warn { background:rgba(241,196,15,.15); }

.table__row--highlight { background:rgba(77,187,220,.15); }

.tile { display:flex; align-items:center; gap:12px; padding:20px; border-radius:var(--radius); background:var(--card); border:1px solid rgba(255,255,255,.08); box-shadow:var(--shadow); text-decoration:none; color:var(--text); transition:transform .18s ease,box-shadow .18s ease; }

.tile:hover { transform:translateY(-2px) rotate(-.5deg); box-shadow:0 14px 44px rgba(0,0,0,.45); }

.tile__icon { width:40px; height:40px; display:grid; place-items:center; border-radius:12px; background:rgba(124,92,255,.16); }

.tile__title { font-weight:700; }

.tile__sub { color:var(--muted); font-size:13px; }

.sheet { border:1px solid rgba(255,255,255,.08); background:var(--card); border-radius:16px; padding:16px; }

.sheet-tabs { display:flex; gap:8px; flex-wrap:wrap; }

.sheet-tab { border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.03); color:var(--text); padding:8px 12px; border-radius:12px; font-size:13px; }

.sheet-tab.is-active { background:rgba(124,92,255,.18); }

.sheet__title { font-size:14px; color:var(--muted); margin-bottom:8px; }

.table--list .td--actions .row-actions { display:flex; gap:8px; flex-wrap:wrap; }

.td--actions .row-actions { display:flex; gap:8px; flex-wrap:wrap; }

.table--list .table__row,.table--list .table__row--head { display:grid; grid-template-columns:var(--cols,1.4fr 1fr .9fr .6fr .6fr minmax(180px,.9fr)); align-items:center; gap:12px; }

.table--list .td--main { min-width:0; }

.table--list .td__title { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.table--list .td__meta { color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.table--list .td a,.table--list .th a { color:inherit; text-decoration:none; }

.table--list .td a:hover { text-decoration:underline; }

.table--list .th--actions,.table--list .td--actions { justify-self:end; min-width:200px; }

.table--contracts .td__sedi { white-space:normal; overflow:visible; text-overflow:initial; }

.table--contracts .td--protocol .td__title { white-space:normal; }

.table--tasks .td:nth-child(2),.table--tasks .td:nth-child(3),.table--tasks .th:nth-child(2),.table--tasks .th:nth-child(3) { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.table--tasks .td--client-title { display:flex; flex-direction:column; gap:2px; }

.table--tasks .td--client-title .td__client { font-weight:600; line-height:1.15; }

.table--tasks .td--client-title .td__title { font-size:14px; opacity:.9; line-height:1.25; }

.table--tasks .td--state { white-space:nowrap; }

.table--tasks .td--approved { white-space:nowrap; text-align:center; }

.table--tasks .row-actions { display:flex; flex-wrap:wrap; gap:6px; }

.table--mikrotik-devices .table__row,.table--mikrotik-devices .table__row--head { grid-template-columns:1.5fr .9fr 1fr minmax(200px,1fr); }

.table--mikrotik-commands .td__meta,.table--mikrotik-devices .td:nth-child(2) { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.items-actions .btn { padding:12px 20px; border-radius:12px; }

.list--props .prop__label { font-weight:600; color:var(--muted); }

.list--props .prop__value { color:var(--text); }

.toolbar--actions .toolbar__actions-row { width:100%; }

.toolbar__clock-buttons .toolbar__btn { width:100%; padding:18px 0; font-size:16px; font-weight:700; text-align:center; border-radius:14px; }

.toolbar__clock-buttons .toolbar__btn:nth-child(1) { background:linear-gradient(135deg,#27d17d,#86efac); color:#0b0b12; }

.toolbar__clock-buttons .toolbar__btn:nth-child(2) { background:linear-gradient(135deg,#0bb3d4,#7de3ff); color:#0b0b12; }

.toolbar__clock-buttons .toolbar__btn:nth-child(3) { background:linear-gradient(135deg,#7c5cff,#9da2ff); color:#0b0b12; }

.toolbar__clock-buttons .toolbar__btn:nth-child(4) { background:linear-gradient(135deg,#3b82f6,#67e8f9); color:#0b0b12; }

.toolbar__clock-buttons .toolbar__btn:hover { filter:brightness(1.03); transform:translateY(-1px); transition:filter .15s ease,transform .15s ease; }

.flag--open { background:rgba(56,189,248,.14); color:rgb(56,189,248); }

.flag--in-progress { background:rgba(250,204,21,.14); color:rgb(250,204,21); }

.flag--pending { background:rgba(163,163,163,.14); color:rgb(163,163,163); }

.flag--closed,.flag--done,.flag--close { background:rgba(34,197,94,.14); color:rgb(34,197,94); }

.flag--blocked { background:rgba(244,63,94,.14); color:rgb(244,63,94); }

.flag--active { background:rgba(34,197,94,.14); color:rgb(34,197,94); }

.flag--archived { background:rgba(163,163,163,.14); color:rgb(163,163,163); }

.table--interventions .td--ivhead .td__ivnum { font-size:12px; opacity:.8; letter-spacing:.2px; }

.table--interventions .td--ivhead .td__client { font-weight:600; line-height:1.2; }

.table--interventions .td--nowrap { white-space:nowrap; }

.table--interventions .row-actions { display:flex; flex-wrap:wrap; gap:6px; }

.table--commands .cmd { display:block; max-height:3.6em; overflow:hidden; position:relative; }

.table--commands .cmd--truncated::after { content:""; position:absolute; bottom:0; left:0; width:100%; height:1.2em; background:linear-gradient(to bottom,rgba(24,24,27,0),rgba(24,24,27,1)); }

.table--commands .cmd__hint { font-size:11px; color:var(--muted); margin-top:2px; }

.table--mikrotik-devices .td--client-sede .td__client { font-weight:600; line-height:1.2; }

.table--mikrotik-devices .td--client-sede .td__sede { font-size:12px; opacity:.85; }

.table--mikrotik-devices .td--ip { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; white-space:nowrap; }

.table--mikrotik-devices .row-actions { display:flex; flex-wrap:nowrap; gap:6px; align-items:center; justify-content:flex-start; }

.table--mikrotik-devices .td--actions { white-space:nowrap; }

.table--interventions .td--notes + .td--notes { border-top:1px solid var(--line); padding-top:8px; }

.table--interventions .table__row .td--notes:first-of-type { border-top-left-radius:8px; border-top-right-radius:8px; }

.table--interventions .table__row .td--notes:last-child { border-bottom-left-radius:8px; border-bottom-right-radius:8px; }

.table--tasks .table__row .td--desc:first-of-type { border-top-left-radius:8px; border-top-right-radius:8px; }

.table--tasks .table__row .td--desc:last-child { border-bottom-left-radius:8px; border-bottom-right-radius:8px; }

/* Base */ body.page { margin:0; font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif; color:var(--text); isolation:isolate; min-height:100%; overflow-x:hidden; background-image:linear-gradient(180deg,#0a0a10 0%,#111323 38%,#0b0b12 100%); background-repeat:no-repeat; background-size:cover; background-position:center top; background-color:#0b0b12; }

/* Header */ .site-header { position:sticky; top:0; z-index:2000; backdrop-filter:blur(10px); background:rgba(11,11,18,.5); border-bottom:1px solid var(--line); }

/* Hero */ .hero { padding:44px 0 10px; }

/* Glow visual */ .glow-card { position:relative; height:180px; border-radius:var(--radius); background:linear-gradient(145deg,rgba(124,92,255,.12),rgba(0,209,255,.12)); border:1px solid rgba(255,255,255,.08); box-shadow:var(--shadow); display:grid; place-items:center; overflow:hidden; }

/* KPI */ .kpis { padding:14px 0 6px; }

/* Panels */ .panels { padding:10px 0 42px; }

/* Lists */ .list { margin:0; padding:0; list-style:none; }

/* Badges */ .badge { display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); font-size:12px; }

/* Buttons & Links */ .btn { appearance:none; border:0; border-radius:12px; padding:12px 16px; font-weight:700; cursor:pointer; }

/* Footer */ .site-footer { border-top:1px solid var(--line); padding:16px 0 26px; color:var(--muted); }

/* Lists & Tables (base) */ .page-head { padding:14px 0 8px; }

/* Chips / row actions */ .row-actions { display:inline-flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* Empty state */ .empty { display:grid; place-items:center; padding:40px 0; }

/* Users table extra */ .table--users .table__row { grid-template-columns:1.3fr 1.6fr 1.1fr .9fr 1.1fr 1fr; }

/* Auth */ .auth-page { display:grid; min-height:100vh; place-items:center; }

.badge.badge--brand, .chip.chip--brand { background:var(--chip-brand-bg) !important; border-color:var(--chip-brand-border) !important; color:var(--chip-brand-color) !important; }

.badge.badge--brand:hover, .chip.chip--brand:hover { background:var(--chip-brand-hover) !important; }

.badge.badge--info, .chip.chip--info { background:var(--chip-info-bg) !important; border-color:var(--chip-info-border) !important; color:var(--chip-info-color) !important; }

.badge.badge--info:hover, .chip.chip--info:hover { background:var(--chip-info-hover) !important; }

.badge.badge--danger, .chip.chip--danger { background:var(--chip-danger-bg) !important; border-color:var(--chip-danger-border) !important; color:var(--chip-danger-color) !important; }

.badge.badge--danger:hover, .chip.chip--danger:hover { background:var(--chip-danger-hover) !important; }

.badge.badge--warning, .chip.chip--warning { background:var(--chip-warning-bg) !important; border-color:var(--chip-warning-border) !important; color:var(--chip-warning-color) !important; }

.badge.badge--warning:hover, .chip.chip--warning:hover { background:var(--chip-warning-hover) !important; }

.badge.badge--success, .chip.chip--success { background:var(--chip-success-bg) !important; border-color:var(--chip-success-border) !important; color:var(--chip-success-color) !important; }

.badge.badge--success:hover, .chip.chip--success:hover { background:var(--chip-success-hover) !important; }

/* toglie il sottolineato dai badge */
a.badge,
a.badge:hover,
a.badge:focus { text-decoration:none; }

/* Row highlights */ .row--ok { background:rgba(46,204,113,.15); }

/* Toolbar utils */ .toolbar__actions-row { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.5rem; }

/* Hub tiles */ .tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; }

/* Sheets (Assets) */ .sheets { display:grid; gap:16px; }

/* Tables — list */ .table--list .th,.table--list .td { padding:12px 10px; }

/* Contracts */ .table--contracts .table__row,.table--contracts .table__row--head { grid-template-columns:1.8fr 1.2fr .8fr .6fr .8fr .7fr minmax(200px,.9fr); }

/* Contracts — Protocol column wrap */ .table--contracts .td--protocol { white-space:normal; overflow:visible; text-overflow:initial; word-break:break-word; }

/* Tasks */ .table--tasks .table__row,.table--tasks .table__row--head { grid-template-columns:2.4fr 0.9fr 0.55fr 0.55fr 0.8fr minmax(260px,1fr); }

/* Mikrotik */ .table--mikrotik-commands .table__row,.table--mikrotik-commands .table__row--head { grid-template-columns:1.2fr 1fr minmax(200px,1fr); }

/* Items actions */ .items-actions { display:flex; gap:14px; margin-top:20px; flex-wrap:wrap; }

/* Props list */ .list--props .list__row { grid-template-columns:200px 1fr; }

/* Clock buttons */ .toolbar--actions .toolbar__form { width:100%; }

/* Toolbar clock buttons: unified layout */ .toolbar__clock-buttons { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; width:100%; }

/* Flags (unificato) */ .flag { display:inline-flex; align-items:center; justify-content:center; min-width:54px; height:28px; padding:0 8px; border-radius:14px; font-size:12px; font-weight:700; letter-spacing:.3px; }

/* Interventions index */ .table--interventions .td--ivhead { display:flex; flex-direction:column; gap:2px; }

/* Commands code */ .table--commands .td--cmd { position:relative; font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size:13px; line-height:1.2; white-space:normal; }

/* Mikrotik devices layout */ .table--mikrotik-devices .td--client-sede { display:flex; flex-direction:column; gap:2px; }

/* Interventions notes */ .table--interventions .td--notes { grid-column:1 / -1; background:rgba(255,255,255,.03); padding:10px 12px; white-space:normal; overflow:visible; text-overflow:initial; }

/* Tasks — riga descrizione estesa */ .table--tasks .td--desc { grid-column:1 / -1; background:rgba(255,255,255,.03); padding:10px 12px; white-space:normal; overflow:visible; text-overflow:initial; }

/* Etichetta riutilizzabile (già usata negli interventions) */ .notes-label { font-weight:600; margin-right:8px; color:var(--muted); }

@media (max-width:640px) {
  .header__inner { grid-template-columns:1fr auto; }
  .nav { display:none; }
  .table--users .table__row { grid-template-columns:1fr 1fr; }
  .kpis__grid,.panels__grid { grid-template-columns:1fr; }
  .table--users .th:nth-child(3),.table--users .td:nth-child(3),.table--users .th:nth-child(4),.table--users .td:nth-child(4),.table--users .th:nth-child(5),.table--users .td:nth-child(5),.table--users .th:nth-child(6),.table--users .td:nth-child(6) { display:none; }
  .table--expirations .table__row { grid-template-columns:1fr 1fr; }
  .table--expirations .th:nth-child(2),.table--expirations .td:nth-child(2),.table--expirations .th:nth-child(3),.table--expirations .td:nth-child(3),.table--expirations .th:nth-child(4),.table--expirations .td:nth-child(4),.table--expirations .th:nth-child(5),.table--expirations .td:nth-child(5),.table--expirations .th:nth-child(6),.table--expirations .td:nth-child(6) { display:none; }
  .table--locations .table__row,.table--locations .table__row--head { grid-template-columns:1fr .9fr; }
  .table--locations .th:nth-child(3),.table--locations .td:nth-child(3),.table--locations .th:nth-child(4),.table--locations .td:nth-child(4) { display:none; }
  .items-actions { flex-direction:column; align-items:flex-start; gap:10px; }
  .list--props .table__row,.list--props .list__row { grid-template-columns:1fr; }
  .toolbar__clock-buttons { display:flex; flex-wrap:wrap; gap:8px; }
}

@media (max-width:768px) {
  body.page::before { background-size:145vw 62vh,120vw 48vh; opacity:.95; }
  body.page::after { opacity:.9; }
}

@media (max-width:800px) {
  .toolbar__inner { flex-direction:column; align-items:stretch; }
  .toolbar__search { width:100%; }
  .td__meta { display:none; }
  .table--users .table__row { grid-template-columns:1fr 1.2fr .9fr .9fr; }
  .table--users .th:nth-child(5),.table--users .td:nth-child(5),.table--users .th:nth-child(6),.table--users .td:nth-child(6) { display:none; }
  .table--expirations .table__row { grid-template-columns:1.8fr 1.5fr 1fr .7fr; }
  .table--expirations .th:nth-child(4),.table--expirations .td:nth-child(4),.table--expirations .th:nth-child(5),.table--expirations .td:nth-child(5),.table--expirations .th:nth-child(6),.table--expirations .td:nth-child(6) { display:none; }
  .table--locations .table__row,.table--locations .table__row--head { grid-template-columns:1.6fr 1.4fr .8fr; }
  .table--locations .th:nth-child(4),.table--locations .td:nth-child(4) { display:none; }
  .toolbar__clock-buttons { grid-template-columns:repeat(2,1fr); }
}

@media (max-width:900px) {
  .table--tasks { --cols:2fr 1.3fr .8fr minmax(200px,1fr); }
  .table--tasks .th:nth-child(6),.table--tasks .td:nth-child(6) { display:none; }
}

@media (max-width:1000px) {
  .dashboard-shell__grid { grid-template-columns:1fr; }
  .dashboard-shell__aside { position:relative; top:auto; }
  .kpis__grid,.panels__grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width:1100px) {
  .hero__inner { grid-template-columns:1fr; }
  .table--expirations .table__row { grid-template-columns:1.8fr 1.5fr 1fr .8fr .8fr .6fr; }
  .table--tasks { --cols:1.9fr 1.2fr .7fr .6fr minmax(200px,1fr); }
  .table--tasks .th:nth-child(3),.table--tasks .td:nth-child(3) { display:none; }
  .table--mikrotik-devices .table__row,.table--mikrotik-devices .table__row--head { grid-template-columns:1.6fr 1fr minmax(200px,1fr); }
  .table--mikrotik-devices .th:nth-child(3),.table--mikrotik-devices .td:nth-child(3) { display:none; }
  .table--locations .table__row,.table--locations .table__row--head { grid-template-columns:1.8fr 1.6fr .9fr .7fr; }
}

@media (max-width:1280px) {
  .table--customers .td--locations .loc-name { max-width:18ch; }
  .table--list .table__row,.table--list .table__row--head { grid-template-columns:var(--cols,1.6fr 1fr .9fr .6fr .5fr minmax(160px,.8fr)); }
}

@media (max-width:1500px) {
  .kpis__grid,.panels__grid { grid-template-columns:repeat(3,1fr); }
}

/* === Buttons (base) === */
.btn { display:inline-flex; align-items:center; gap:8px; height:42px; padding:0 16px; border-radius:12px; line-height:1; font-weight:600; text-decoration:none; border:0; cursor:pointer; transition:transform .18s ease,box-shadow .18s ease,background .18s ease; box-shadow:var(--shadow); }

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

.btn[disabled], .btn.is-disabled { opacity:.6; pointer-events:none; filter:grayscale(.2); }

/* === Forms === */
.form { border:1px solid rgba(255,255,255,.08); background:var(--card); border-radius:16px; padding:16px; box-shadow:var(--shadow); margin:16px auto 28px; }

.form__grid { display:grid; grid-template-columns:1fr; gap:12px; }

.form__grid.form__grid--2 { grid-template-columns:1fr; }

@media (min-width:900px) {
  .form__grid { grid-template-columns:repeat(2,1fr); }
  .form__grid.form__grid--2 { grid-template-columns:repeat(2,1fr); }
}

.form__row { display:flex; flex-direction:column; gap:6px; }

.form__row--full { grid-column:1/-1; }

.form__label { font-size:13px; color:var(--muted); }

.form__control { width:100%; background:#0e0f18; border:1px solid rgba(255,255,255,.12); color:var(--text); padding:12px 12px; border-radius:12px; outline:none; -webkit-appearance:none; appearance:none; }

.form__control::placeholder { color:#6f7687; }

.form__control:focus { border-color:rgba(124,92,255,.6); box-shadow:0 0 0 3px rgba(124,92,255,.15); }

textarea.form__control { min-height:100px; resize:vertical; }

select.form__control { padding-right:36px; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'><path d='M7 10l5 5 5-5z'/></svg>"); background-repeat:no-repeat; background-position:right 12px center; background-size:12px; }

.form__check { display:inline-flex; align-items:center; gap:8px; }

.form__check-input { width:18px; height:18px; accent-color:var(--brand); }

.form__check-label { font-size:14px; }

.form-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; padding-top:12px; margin-top:12px; border-top:1px solid var(--line); }

/* === Forms: errori === */
.form__errors { border:1px solid rgba(255,94,87,.25); background:rgba(255,94,87,.08); color:#fff; border-radius:12px; padding:12px; margin-bottom:10px; }

.form__errors-title { margin:0 0 6px; font-size:14px; }

.form__errors-list { margin:0; padding-left:18px; }

.form__errors-item { margin:4px 0; }

/* === Toolbar Filters (select, input allineati) === */
.toolbar__filters { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.search__select { height:42px; padding:0 36px 0 12px; border-radius:12px; background:#0e0f18; border:1px solid rgba(255,255,255,.12); color:var(--text); outline:none; -webkit-appearance:none; appearance:none; line-height:42px; }

.search__select:focus { border-color:rgba(124,92,255,.6); box-shadow:0 0 0 3px rgba(124,92,255,.15); }

.search__select::placeholder { color:#6f7687; }

.search__select { background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'><path d='M7 10l5 5 5-5z'/></svg>"); background-repeat:no-repeat; background-position:right 12px center; background-size:12px; }

/*.search__input { height:42px; }*/
@media (max-width:800px) { .toolbar__filters { width:100%; } .search__select { flex:1 1 220px; } }

/* === Forms: readonly appearance === */
.form__control.is-readonly { opacity:.75; pointer-events:none; }

/* === Form Sections (layout full width) === */
.form__section { margin:16px 0; }

.form__section--full { width:100%; }

/* === Form Sections (disabled look) === */
.form__section--disabled { position:relative; border:1px dashed rgba(255,255,255,.18); background:linear-gradient(0deg, rgba(255,255,255,.03), rgba(255,255,255,.03)); border-radius:12px; padding:12px; }

.form__section--disabled .form__section-title { opacity:.7; }

.form__section--disabled .form__control { opacity:.65; pointer-events:none; }

.form__section--disabled .form__check-input { pointer-events:none; }

/* === Form Sections: larghezza piena === */
.form__section--full { width:100%; max-width:100%; grid-column:1/-1; flex:0 0 100%; }

/* === Form Grid: base === */
.form__grid { display:grid; gap:12px; grid-template-columns:1fr; }

/* === Form Grid: varianti colonne === */
.form__grid.form__grid--2 { grid-template-columns:repeat(2,1fr); }

.form__grid.form__grid--3 { grid-template-columns:repeat(3,1fr); }

.form__grid.form__grid--4 { grid-template-columns:repeat(4,1fr); }

/* === Form Grid: responsive collapse === */
@media (max-width:900px) {
  .form__grid.form__grid--2 { grid-template-columns:1fr; }
  .form__grid.form__grid--3 { grid-template-columns:1fr; }
  .form__grid.form__grid--4 { grid-template-columns:1fr; }
}

/* === Form: spazio verticale tra righe === */
.form__row + .form__grid { margin-top:12px; }

.form__grid + .form__grid { margin-top:12px; }

.form__grid + .form__row { margin-top:12px; }

/* === Form: multiselect look === */
.form__control.form__control--multiselect { min-height:84px; padding-top:8px; padding-bottom:8px; background-image:none; }

.form__control.form__control--multiselect option { padding:4px 6px; }

/* === Forms: allinea altezza Cliente ↔ Sedi === */
.form__control--tall { height:110px; padding-top:8px; padding-bottom:8px; }

/* select Cliente: mantiene la freccia */
.form__control--multiselect { height:110px; padding-top:8px; padding-bottom:8px; background-image:none; }

.form__control--multiselect option { padding:4px 6px; }

/* === Form: hint testuale sotto ai campi === */
.form__hint { margin-top:6px; font-size:12px; color:var(--muted); }

/* === Date Inputs (UX: tutta la input cliccabile) === */
input[type="date"].form__control { cursor:pointer; }

input[type="datetime-local"].form__control { cursor:pointer; }

.table--items { --cols:2fr 1.2fr 1fr .8fr .8fr minmax(200px,1fr); }

.table--interventions { --cols:2fr 1.2fr 1.2fr 1fr .8fr minmax(220px,1fr); }

/* == Utility locali == */
.u-gap-6 { gap:6px; }

.u-gap-8 { gap:8px; }

.u-w-240 { width:240px; }

.u-w-320 { width:320px; }

.u-maxw-600 { max-width:600px; }

/* === Finder / Pills === */
.finder { display:block; max-width:920px; margin:0 auto; }

.finder__label { margin:0 0 6px 0; }

.finder__input { display:block; padding:10px 12px; border:1px solid var(--line,#e5e7eb); outline:none; }

.pill-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; margin:12px 0 0 0; }

.pill { display:flex; justify-content:space-between; padding:12px 14px; border:1px solid var(--line,#e5e7eb); border-radius:12px; background:var(--card,#fff); cursor:pointer; }

.pill:hover { box-shadow:0 1px 0 rgba(0,0,0,0.04),0 0 0 3px rgba(0,0,0,0.03) inset; }

.pill--active { border-color:var(--brand,#7c3aed); box-shadow:0 0 0 2px rgba(124,58,237,0.25) inset; }

.pill__title { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0 8px 0 0; }

.pill__meta { opacity:.7; font-size:.92em; }

.pill-list__empty { padding:10px 0; color:#666; }

.u-mt-24 { margin-top:24px; }

.u-ta-right { text-align:right; }

/* === Tabella Items === */
.table-box { border:1px solid var(--line,#e5e7eb); border-radius:12px; overflow:hidden; background:var(--card,#fff); }

.table { width:100%; border-collapse:separate; border-spacing:0; }

.table__th { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line,#e5e7eb); background:var(--bg-soft,#fafafa); }

.table__td { padding:10px 12px; border-bottom:1px solid var(--line,#e5e7eb); }

.table-box .btn { display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--line,#e5e7eb); border-radius:10px; background:var(--card,#fff); cursor:pointer; text-decoration:none; }

.table-box .btn:hover { box-shadow:0 1px 0 rgba(0,0,0,0.05); }

/* === Modal (dark, high-contrast, scoped) ================================ */

/* Dialog / backdrop */

/* Card */
/* ric  border:1px solid #242938; border-radius:16px; background:#0f1220; color:#e5e7eb; box-shadow:0 20px 50px rgba(0,0,0,.45); */
/* ric  padding:16px; } */

/* Header */
/* ric  border:1px solid #2a3146; border-radius:9999px; background:#14182a; color:#cbd5e1; cursor:pointer; } */

/* Meta (badge) */
/* ric  border:1px solid #2a3146; border-radius:9999px; background:rgba(124,58,237,.14); color:#d6bcff; } */

/* Body & grid proprietà */

/* Footer & buttons */
/* ric  border:1px solid #2a3146; border-radius:10px; background:#161a2b; color:#e5e7eb; cursor:pointer; text-decoration:none; } */

/* Responsive */

/* Sezioni finder */
.finder { margin:20px 0; }

.finder__label { font-weight:600; margin:0 0 6px; display:block; color:#e5e7eb; }

.finder__input { width:100%; padding:10px 14px; border:1px solid #2a3146; border-radius:10px; background:#0f1220; color:#fff; }

/* Tabella migliorata */
.table--clickable .table__td { cursor:pointer; }

.table--clickable tbody tr { transition:background .15s; }

.table thead { background:#161a2b; }

.table__th { font-weight:600; color:#cbd5e1; }

/* Pillole */
.pill { display:inline-flex; flex-direction:column; align-items:flex-start; justify-content:center; background:#161a2b; border:1px solid #2a3146; border-radius:10px; padding:10px 14px; margin:4px 6px 0 0; cursor:pointer; min-width:140px; }

.pill:hover { border-color:#7c3aed; box-shadow:0 0 0 1px rgba(124,58,237,.4); }

.pill--active { border-color:#7c3aed; background:rgba(124,58,237,.12); }

.pill__title { font-weight:600; margin-bottom:4px; color:#e5e7eb; }

.pill__meta { font-size:13px; color:#9ca3af; }

/* Toolbar compatta sopra tabella */
.assets-toolbar { display:flex; gap:24px; align-items:flex-start; margin:8px 0 6px; }

.assets-toolbar .toolbar-col { flex:1; min-width:260px; }

.toolbar-input { margin-bottom:8px; }

/* Chips (pillole larghe, senza conteggi) */
.chips { display:flex; flex-wrap:wrap; gap:10px; }

.chips__empty { color:#9ca3af; padding:4px 0; }

.chip { display:inline-flex; align-items:center; max-width:100%; height:48px; padding:10px 14px; border:1px solid #2a3146; border-radius:14px; background:#161a2b; color:#e5e7eb; cursor:pointer; }

.chip:hover { border-color:#7c3aed; box-shadow:0 0 0 1px rgba(124,58,237,.35); }

.chip.is-active { border-color:#7c3aed; background:rgba(124,58,237,.12); }

/* Label con clamp a 2 righe (nomi lunghi) */
.chip__label { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-overflow:ellipsis; line-height:1.1; font-size:14px; font-weight:600; max-width:420px; }

/* Tabella – riga cliccabile + hover */
.table--clickable .table__td { cursor:pointer; }

.table--clickable tbody tr:hover { background:#1a2036; transition:background .15s; }

/* Responsive: stack toolbar su schermi stretti */
@media (max-width:980px) { .assets-toolbar { flex-direction:column; gap:12px; } }

/* ==== Assets Management overrides (scoped) ================================= */

/* Box e tabella dark (override del blocco "Tabella Items" light) */
.container[data-controller="assets-picker"] .table-box { border-color:#242938; background:#0f1220; }

.container[data-controller="assets-picker"] .table { color:#e5e7eb; }

/* Header dark – serve battere l'impostazione light di .table__th */
.container[data-controller="assets-picker"] .table thead .table__th { background:#161a2b !important; color:#cbd5e1; font-weight:600; padding:10px 12px; border-bottom:1px solid #242938; }

/* Celle body/border */
.container[data-controller="assets-picker"] .table tbody .table__td { border-bottom:1px solid #242938; color:#e5e7eb; }

/* Zebra solo qui */
.container[data-controller="assets-picker"] .table tbody tr:nth-child(even) { background:#111627; }

.container[data-controller="assets-picker"] .table tbody tr:nth-child(odd) { background:#0f1220; }

/* Hover riga cliccabile */
.container[data-controller="assets-picker"] .table--clickable tbody tr:hover { background:#1a2036; }

/* ==== Modal: contenuti lunghi che uscivano ================================= */

/* consenti alla colonna dei valori di stringere e andare correttamente a capo */
/* ric  grid-template-columns:260px minmax(0,1fr); */
/* ric } */
/* ric  min-width:0;             /* fondamentale in grid */
/* ric  overflow-wrap:anywhere;  /* spezza anche parole lunghe (email/URL/pass) */
/* ric  word-break:break-word;   /* fallback */
/* ric  white-space:pre-wrap;    /* rispetta \n */
/* ric } */

/* mobile */

/* === Bottoni primari (tema brand) === */
.btn--primary { border-color:#2563eb; background:#2563eb; color:#ffffff; }

.btn--primary:hover { background:#1e4ed8; border-color:#1e4ed8; }

/* ========== ASSETS MANAGEMENT (SCOPED, STANDARD) ========== */
.container[data-controller="assets-picker"] .u-mb-16 { margin-bottom:16px; }

.container[data-controller="assets-picker"] .box { background:var(--card); border:1px solid rgba(255,255,255,.08); border-radius:12px; }

.container[data-controller="assets-picker"] .box--search { margin-bottom:16px; }

.container[data-controller="assets-picker"] .box__title { display:flex; align-items:center; justify-content:space-between; font-weight:600; padding:12px 14px; border-bottom:1px solid var(--line); }

.container[data-controller="assets-picker"] .box__content { padding:12px 14px; }

.container[data-controller="assets-picker"] .search-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

.container[data-controller="assets-picker"] .search-grid__field { display:flex; flex-direction:column; gap:8px; }

.container[data-controller="assets-picker"] .results-grid { display:grid; grid-template-columns:1fr 2fr; gap:16px; align-items:start; }

.container[data-controller="assets-picker"] .results-col { min-height:320px; }

.container[data-controller="assets-picker"] table { table-layout:fixed; width:100%; border-collapse:separate; border-spacing:0; }

.container[data-controller="assets-picker"] th { text-align:left; font-size:13px; opacity:.7; padding:10px; border-bottom:1px solid var(--line); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }

.container[data-controller="assets-picker"] td { padding:10px; border-bottom:1px solid rgba(255,255,255,.04); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }

.container[data-controller="assets-picker"] .table--nowrap th { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.container[data-controller="assets-picker"] .table--nowrap td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.container[data-controller="assets-picker"] .table__th--actions { width:160px; text-align:right !important; }

.container[data-controller="assets-picker"] .table__td--actions { text-align:right !important; }

.container[data-controller="assets-picker"] .table__td--truncate { max-width:0; }

.container[data-controller="assets-picker"] .table__row { cursor:pointer; }

.container[data-controller="assets-picker"] .table__row:hover { background:rgba(255,255,255,.03); }

.container[data-controller="assets-picker"] .table__row.is-active { background:rgba(124,92,255,.14); }

.container[data-controller="assets-picker"] .chips { display:flex; flex-wrap:wrap; gap:8px; min-height:36px; }

.container[data-controller="assets-picker"] .chips__empty { opacity:.6; font-size:13px; padding:6px 0; }

.container[data-controller="assets-picker"] .chip { padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.15); background:transparent; color:inherit; }

.container[data-controller="assets-picker"] .chip.is-active { background:rgba(95,158,255,.18); border-color:rgba(95,158,255,.35); }

.container[data-controller="assets-picker"] .inline-input { width:100%; height:36px; padding:6px 10px; border-radius:10px; border:1px solid rgba(255,255,255,.18); background:var(--card); color:var(--text); line-height:22px; }

.container[data-controller="assets-picker"] .inline-name { display:inline; }

.container[data-controller="assets-picker"] .inline-value { display:inline; }

.container[data-controller="assets-picker"] .hidden { display:none; }

.container[data-controller="assets-picker"] .row-actions { display:inline-flex; align-items:center; gap:8px; flex-wrap:nowrap; }

.container[data-controller="assets-picker"] .icon-btn { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:8px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.18); font-weight:700; }

.container[data-controller="assets-picker"] .icon-btn:hover { background:rgba(255,255,255,.12); }

.container[data-controller="assets-picker"] .icon-btn.danger { background:rgba(255,80,80,.12); border-color:rgba(255,80,80,.35); }

.container[data-controller="assets-picker"] .icon-btn.success { background:rgba(80,200,120,.12); border-color:rgba(80,200,120,.35); }

.container[data-controller="assets-picker"] .icon { width:16px; height:16px; fill:currentColor; }

.container[data-controller="assets-picker"] .btn--sm { padding:4px 10px; border-radius:10px; }

.container[data-controller="assets-picker"] .btn--primary-ghost { background:transparent; border:1px solid rgba(95,158,255,.5); }

.container[data-controller="assets-picker"] .btn--primary-ghost:hover { background:rgba(95,158,255,.12); }

.container[data-controller="assets-picker"] .is-hidden { display:none !important; }

@media (max-width:1100px) {
  .container[data-controller="assets-picker"] .results-grid { grid-template-columns:1fr; }
}

/* === Assets Management ▸ fix tabelle solo qui ============================= */
/* 1) neutralizza il display:grid globale sulle righe tabella */
.container[data-controller="assets-picker"] .table__row { display:table-row !important; grid-template-columns:unset !important; gap:0 !important; }

/* 2) Items: layout corretto e colonne */
.container[data-controller="assets-picker"] .items-table { table-layout:auto; }

.container[data-controller="assets-picker"] .items-table col.col-name { width:auto; }

.container[data-controller="assets-picker"] .items-table col.col-actions { width:160px; }

/* 3) Celle: nome con ellissi, azioni a destra senza a capo */
.container[data-controller="assets-picker"] .items-table tbody td:first-child { max-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.container[data-controller="assets-picker"] .items-table thead th:last-child,
.container[data-controller="assets-picker"] .items-table tbody td:last-child { width:auto; text-align:left; white-space:nowrap; }

/* 4) Hover riga solo su tabelle cliccabili */
.container[data-controller="assets-picker"] .items-table.table--clickable tbody tr:hover { background:#1a2036; transition:background .15s; }

/* 5) (opzionale) stessa neutralizzazione per la tabella Properties */
.container[data-controller="assets-picker"] .props-table .table__row { display:table-row !important; grid-template-columns:unset !important; gap:0 !important; }

/* -- ASSETS MANAGEMENT: Items drag state -- */
.items-table .table__th--drag { width:28px; text-align:center; }

.items-table .table__td--drag { width:28px; }

.items-table .drag-handle { cursor:grab; user-select:none; display:inline-block; opacity:.85; -webkit-user-drag:element; pointer-events:auto; }

.items-table .is-dragging { opacity:.5; }

/* ===== Modal z-index fix (sempre sopra header, sidebar, sticky, ecc.) ===== */
.modal__dialog { position:relative; z-index:1; }

.modal__backdrop { z-index:0; }

.is-modal-open, .is-modal-open body { overflow:hidden; }

/* riga placeholder più “leggera” */
.contacts-table #contact_row_new .td { opacity:.6; }

/* ===== Contacts in modal: ultra-compact, full-width ===== */
.contacts-table .table { width:100%; }

.contacts-table .th.th--actions,
.contacts-table .td.td--actions { justify-self:end; }

/* niente sticky/overlay sull'header della tabella */
.contacts-table .table__head { position:static !important; z-index:auto !important; }

/* separatore leggero tra righe */
.table--compact .table__row + .table__row { border-top:1px solid rgba(255,255,255,.06); }

/* placeholder riga nuova più discreto */
#contact_row_new .td { opacity:.6; }

/* ===== Inline row edit (contacts) ======================================= */

/* Il form non deve introdurre box/padding/ombre */
.form--inline { background:transparent !important; padding:0 !important; margin:0 !important; border:0 !important; box-shadow:none !important; width:100%; }

/* dove supportato, togliamo proprio il box del form e lasciamo solo le celle */
@supports (display: contents) {
  .form--inline { display: contents; }
}

/* Righe e celle super-compact (stessa altezza di visualizzazione) */
:root { --row-h:34px; }

/* alza/abbassa se vuoi */

.table--compact .table__row { min-height:var(--row-h); }

.table--compact .th,
.table--compact .td { padding:4px 8px; font-size:12.5px; line-height:1.15; }

/* Input che “stanno” dentro la cella senza aumentare altezza */
.form__control--inline { height:var(--row-h); padding:0 8px; font-size:12.5px; line-height:var(--row-h); width:100%; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); border-radius:8px; box-shadow:none; }

/* Bottoni azione compatti come le chip */
.chip--inline { height:var(--row-h); line-height:calc(var(--row-h) - 2px); padding:0 10px; font-size:12.5px; border-radius:10px; }

/* Errori sottili sotto la riga, non influiscono sull’altezza della riga stessa */
.form__errors--inline { margin:4px 8px 0; color:#ffb3b3; font-size:12px; display:flex; gap:8px; flex-wrap:wrap; }

.form__errors--inline .form__error::before { content:"• "; opacity:.7; }

/* == Assets picker ▸ mini dialog templates (SCOPE) == */
.container[data-controller="assets-picker"] .tmpl-pick { position:fixed; inset:0; z-index:var(--z-modal, 10000); display:grid; place-items:center; background:rgba(0,0,0,.5); }

.container[data-controller="assets-picker"] .tmpl-pick.is-hidden { display:none; }

.container[data-controller="assets-picker"] .tmpl-pick__card { width:min(520px, 92vw); border:1px solid var(--line); border-radius:12px; background:var(--card); box-shadow:var(--shadow); padding:12px; }

.container[data-controller="assets-picker"] .tmpl-pick__head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; border-bottom:1px solid var(--line); padding-bottom:8px; }

.container[data-controller="assets-picker"] .tmpl-pick__title { margin:0; font-weight:800; }

.container[data-controller="assets-picker"] .tmpl-pick__body { display:grid; gap:8px; padding:8px 0; }

.container[data-controller="assets-picker"] .tmpl-pick__foot { display:flex; justify-content:flex-end; gap:8px; padding-top:8px; border-top:1px solid var(--line); }

/* bottone accoppiato in header */
.container[data-controller="assets-picker"] .box__title .u-gap-8 { display:inline-flex; gap:8px; margin-left:8px; flex-wrap:wrap; }

/* assets_management — evidenza riga item selezionata */
.container[data-controller="assets-picker"] tr.is-active td { background:color-mix(in oklab, var(--brand,#7c5cff) 14%, var(--card)); }

.container[data-controller="assets-picker"] tr.is-active { box-shadow:inset 3px 0 0 color-mix(in oklab, var(--brand,#7c5cff) 55%, transparent); }

/* === Contacts: colonne più bilanciate e no overflow in edit === */

/*  Nome (flex ma un filo più stretta) | Telefono più largo | Azioni */
.contacts-table .table__head,
.contacts-table .table__body .table__row { grid-template-columns:0.82fr 220px 160px; }

/* evita che il contenuto delle celle “spinga” fuori griglia */
.contacts-table .td { min-width:0; }

/* gli input restano dentro la cella */
.form__control--inline { box-sizing:border-box; max-width:100%; }

/* le azioni non vanno a capo (così la colonna resta stretta ma stabile) */
.contacts-table .td--actions .row-actions { white-space:nowrap; gap:6px; }

/* ===================================================================
   CLEAN CONSOLIDATION — MODAL (generic) + CUSTOMERS TABLE (grid)
   These rules replace legacy scattered blocks and ensure compact layout.
   =================================================================== */

/* Modal (generic) */
.modal { position:fixed; inset:0; display:none; z-index:var(--z-modal) !important; }

.modal--open { display:flex; align-items:center; justify-content:center; }

.modal__backdrop { position:fixed; inset:0; background:rgba(0,0,0,.65); backdrop-filter:none; }

.modal__dialog { position:relative; z-index:1; width:min(1100px,96vw); max-height:80vh; overflow:hidden; border-radius:16px; background:#0f1220; border:1px solid rgba(255,255,255,.08); box-shadow:0 10px 40px rgba(0,0,0,.4); padding:16px; }

.modal__head { display:flex; align-items:center; gap:12px; justify-content:space-between; margin:0 0 10px; }

.modal__title { font-size:20px; font-weight:800; margin:0; color:var(--text,#eef2ff); }

.modal__meta { margin-left:auto; font-size:12px; color:var(--muted,#8b8fa3); }

.modal__body { max-height:calc(80vh - 56px); overflow:auto; }

.is-modal-open { overflow:hidden; }

/* === Locations form: griglia densa e logica (4 colonne) === */
.locations-grid { display:grid; grid-template-columns:2.2fr .8fr 1.4fr 1fr; gap:12px; align-items:end; }

/* utilità di span per occupare meno righe possibili */
.form__row--span-2 { grid-column:span 2; }

.form__row--span-3 { grid-column:span 3; }

.form__row--full { grid-column:1 / -1; }

/* già presente, la ribadisco se serve */

/* utility per allineare il bottone alla base della riga */
.form__row--align-end { align-self:end; }

/* responsive: collassa in colonna singola sotto i 900px (coerente con la tua form grid) */
@media (max-width:900px) {
  .locations-grid { grid-template-columns:1fr; }
  .form__row--span-2, .form__row--span-3, .form__row--full { grid-column: 1 / -1; }
}

/* Locations: Sede | Indirizzo | Azioni */
.table--locations .table__head .table__row,
.table--locations .table__row--head,
.table--locations .table__body .table__row { display:grid; grid-template-columns:1.6fr 2.2fr minmax(200px,.9fr); align-items:center; gap:12px; }

.table--locations .th,.table--locations .td { min-width:0; }

.table--locations .th.th--actions,
.table--locations .td.td--actions { justify-self:end; }

.table--locations .td--actions .row-actions { flex-wrap:nowrap; white-space:nowrap; }

/* meta sotto il titolo in riga compatta */
.table--locations .td--main .td__meta { display:flex; gap:10px; flex-wrap:wrap; }

.table--locations .td--main .td__meta .line { display:inline-flex; gap:6px; }

@media (max-width:1100px) {
  .table--locations .table__head .table__row,
  .table--locations .table__row--head,
  .table--locations .table__body .table__row { grid-template-columns:1.5fr 2fr minmax(180px,.9fr); gap:10px; }
}

@media (max-width:640px) {
  .table--locations .table__head .table__row,
  .table--locations .table__row--head,
  .table--locations .table__body .table__row { grid-template-columns:1fr minmax(150px,.8fr); }
  .table--locations .th:nth-child(2),
  .table--locations .td:nth-child(2) { display:none; }
}

/* ===== Interventi (index) — layout a 4 colonne, meta full-width, azioni in riga ===== */
.table--interventions .table__head .table__row, .table--interventions .table__row--head, .table--interventions .table__body .table__row { display:grid; grid-template-columns:2.6fr 0.9fr 0.8fr minmax(260px,1.2fr); align-items:center; gap:12px; }

@media (max-width:1366px) {
  .table--interventions .table__head .table__row, .table--interventions .table__row--head, .table--interventions .table__body .table__row { grid-template-columns:2.4fr 0.9fr 0.8fr minmax(220px,1.2fr); gap:10px; }
}

.table--interventions .th, .table--interventions .td { min-width:0; }

.table--interventions .td--ivhead { display:flex; flex-direction:column; gap:2px; }

.table--interventions .iv-top { display:flex; gap:10px; align-items:center; font-size:12px; opacity:.9; }

.table--interventions .iv-no { font-weight:600; letter-spacing:.2px; }

.table--interventions .iv-date { padding:2px 6px; border-radius:6px; background:rgba(16,185,129,.20); border:1px solid rgba(16,185,129,.32); font-size:12px; color:var(--text,#eaeefa); }

.table--interventions .td__client { font-weight:700; line-height:1.2; }

.table--interventions .td__location { font-size:13px; color:var(--brand,#6c63ff); font-weight:600; }

.table--interventions .td--actions { justify-self:end; white-space:nowrap; }

.table--interventions .td--actions .row-actions { display:flex; gap:6px; flex-wrap:nowrap; }

.table--interventions .td--actions .chip { padding:3px 10px; font-size:12px; border-radius:10px; }

.table--interventions .td--meta { grid-column:1 / -1; padding:6px 12px; background:rgba(255,255,255,.045); display:flex; flex-wrap:wrap; gap:6px; }

.pill { display:inline-flex; align-items:center; gap:6px; padding:2px 8px; font-size:11.5px; line-height:1.2; border-radius:999px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.10); color:var(--text,#eaeefa); user-select:none; }

.pill--muted { background:rgba(139,143,163,.18); border-color:rgba(139,143,163,.28); }

.pill--brand { background:rgba(108,99,255,.20); border-color:rgba(108,99,255,.32); }

.pill--info { background:rgba(0,172,223,.20); border-color:rgba(0,172,223,.32); }

.pill--success { background:rgba(16,185,129,.20); border-color:rgba(16,185,129,.32); }

.pill--ghost { background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.22); }

.table--interventions .td--notes { grid-column:1 / -1; background:rgba(255,255,255,.04); padding:8px 12px; white-space:normal; overflow:visible; text-overflow:initial; }

.table--interventions .td--notes .notes-label { font-weight:600; margin-right:8px; color:var(--muted); }

.table--interventions .td--meta + .td--notes { margin-top:4px; }

.table--interventions .td__meta { font-size:.85em; color:var(--muted,#8b8fa3); margin-top:2px; }

/* ===== Form summary (info-card) — versione attuale (row + activity) ===== */
.info-card { border:1px solid rgba(255,255,255,.08); background:#0f1220; border-radius:12px; padding:12px; }

.info-card__title { font-weight:700; font-size:14px; margin:0 0 8px; color:var(--muted); }

.info-card__row { display:grid; grid-template-columns:1.4fr 1.2fr 0.9fr; gap:10px; align-items:end; }

.info-kv { display:flex; flex-direction:column; gap:2px; }

.info-label { font-size:12px; color:var(--muted); }

.info-value { font-weight:600; }

.info-activity { margin-top:8px; }

.info-activity__label { font-size:12px; color:var(--muted); font-weight:700; margin-bottom:4px; }

.info-activity__title { font-weight:700; line-height:1.25; }

.info-activity__desc { margin-top:2px; }

@media (max-width:900px) {
  .info-card__row { grid-template-columns:1fr; }
}

/* ===== Form grid a 5 colonne (checkbox in una riga) ===== */
.form__grid.form__grid--5 { grid-template-columns:repeat(5,1fr); }

@media (max-width:900px) {
  .form__grid.form__grid--5 { grid-template-columns:1fr; }
}

/* ===== TASKS — griglia 4 colonne (più aria alle AZIONI) ===== */
.table--tasks .table__head .table__row, .table--tasks .table__row--head, .table--tasks .table__body .table__row { display:grid; grid-template-columns:3.05fr 0.95fr 0.65fr minmax(280px,1.25fr); align-items:center; gap:10px; }

@media (max-width:1366px) {
  .table--tasks .table__head .table__row, .table--tasks .table__row--head, .table--tasks .table__body .table__row { display:grid; grid-template-columns:2.9fr 0.9fr 0.6fr minmax(240px,1.1fr); gap:8px; }
}

.table--tasks .th, .table--tasks .td { min-width:0; }

/* ===== Bordo/gradiente priorità riga ===== */
.task-row { border-left:5px solid transparent; background-image:none; }

.task-row--prio-urgent { border-left-color:rgba(239,68,68,.95); background-image:linear-gradient(90deg, rgba(239,68,68,.14), rgba(239,68,68,.08) 35%, transparent 65%); }

.task-row--prio-normal { border-left-color:rgba(16,185,129,.95); background-image:linear-gradient(90deg, rgba(16,185,129,.16), rgba(16,185,129,.10) 35%, transparent 65%); }

.task-row--prio-force { border-left-color:rgba(108,99,255,.90); background-image:linear-gradient(90deg, rgba(108,99,255,.12), rgba(108,99,255,.07) 35%, transparent 65%); }

/* ===== Colonna 1: entity (cliente+sede) · meta (pill) · titolo · descrizione ===== */
.table--tasks .td--taskhead { display:flex; flex-direction:column; gap:4px; }

.table--tasks .task-top { display:grid; grid-template-columns:1fr; row-gap:6px; }

.table--tasks .task-entity { display:flex; flex-wrap:wrap; gap:6px; }

.table--tasks .task-customer { padding:2px 8px; border-radius:6px; font-size:12px; border:1px solid rgba(234,238,250,.20); background:rgba(139,143,163,.24); color:#eaeefa; font-weight:600; letter-spacing:.2px; }

.table--tasks .task-location { padding:2px 8px; border-radius:6px; font-size:12px; border:1px dashed rgba(234,238,250,.22); background:rgba(234,238,250,.08); color:#eaeefa; font-weight:600; letter-spacing:.2px; }

.table--tasks .task-meta { display:flex; align-items:center; flex-wrap:wrap; column-gap:8px; row-gap:6px; }

.table--tasks .priority-pill { margin:0; padding:2px 8px; font-size:11.5px; }

.table--tasks .pill--mini { padding:2px 8px; font-size:11.5px; }

.table--tasks .task-title { font-weight:700; line-height:1.25; white-space:normal; overflow:visible; text-overflow:initial; }

.table--tasks .task-desc { font-size:13px; color:var(--muted,#8b8fa3); white-space:normal; overflow:visible; text-overflow:initial; word-break:break-word; }

/* ===== Colonna 2: date ===== */
.table--tasks .td--dates { display:flex; flex-direction:column; gap:4px; }

.table--tasks .date-line { display:flex; gap:8px; align-items:center; white-space:nowrap; }

.table--tasks .date-badge { padding:2px 6px; border-radius:6px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); font-size:12px; }

.due-pill { padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid transparent; }

.due-pill--ok { background:rgba(16,185,129,.16); border-color:rgba(16,185,129,.28); }

.due-pill--soon { background:rgba(245,158,11,.18); border-color:rgba(245,158,11,.32); }

.due-pill--overdue { background:rgba(239,68,68,.20); border-color:rgba(239,68,68,.34); }

.due-pill--none { background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.16); }

/* ===== Colonna 3: stato/approved ===== */
.table--tasks .td--status { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }

/* ===== Colonna 4: azioni (condensed, più aria) ===== */
.table--tasks .td--actions { justify-self:end; white-space:nowrap; }

.table--tasks .td--actions .row-actions { display:flex; gap:8px; flex-wrap:nowrap; }

.table--tasks .td--actions .chip { padding:2px 9px; font-size:11.5px; border-radius:9px; }

/* ===== Pills extra (se usate nelle view) ===== */
.pill--danger { background:rgba(239,68,68,.20); border:1px solid rgba(239,68,68,.32); }

.pill--warning { background:rgba(245,158,11,.18); border:1px solid rgba(245,158,11,.32); }

/* Tasks: centra le intestazioni di Date, Stato/Appro, Azioni */
.table--tasks .th--center { text-align:center; justify-self:center; }

/* ===== EXPIRATIONS — edit: righe compatte (Cliente–Scadenza / Servizio–Q.tà–UM / Flag / Note) ===== */
.exp-edit { display:grid; gap:12px; }

.exp-row { display:grid; gap:12px; align-items:end; }

.exp-row-2 { grid-template-columns:1.6fr 1fr; }

.exp-row-3 { grid-template-columns:1.6fr .8fr .6fr; }

.exp-row-4 { grid-template-columns:1.6fr .8fr .6fr .6fr; }

.exp-row-full { grid-template-columns:1fr; }

@media (max-width:1100px) {
  .exp-row-2 { grid-template-columns:1fr; }
  .exp-row-3 { grid-template-columns:1fr; }
}

/* ===== SERVICES — 2 colonne: Nome | Azioni ===== */
.table--services .table__head .table__row, .table--services .table__row--head, .table--services .table__body .table__row { display:grid; grid-template-columns:1fr minmax(180px,0.6fr); align-items:center; gap:10px; }

@media (max-width:1366px) {
  .table--services .table__head .table__row, .table--services .table__row--head, .table--services .table__body .table__row { grid-template-columns:1fr minmax(160px,0.6fr); gap:8px; }
}

.table--services .th, .table--services .td { min-width:0; }

.table--services .td--actions { justify-self:end; white-space:nowrap; }

.table--services .td--actions .row-actions { display:flex; gap:6px; flex-wrap:nowrap; }

.table--services .td--actions .chip { padding:2px 8px; font-size:11.5px; border-radius:9px; }

/* ===== Service form (compatta, coerente con il resto) ===== */
.service-form-grid { display:grid; grid-template-columns:1fr; gap:12px; }

/* ===== Service form (allineata al resto) ===== */
.service-edit { display:grid; gap:12px; }

/* ===== EXPIRATIONS — 6 colonne: Cliente | Servizio | Scadenza | Q.tà/UM | Stato | Azioni ===== */
.table--expirations .table__head .table__row, .table--expirations .table__row--head, .table--expirations .table__body .table__row { display:grid; grid-template-columns:1.9fr 1.2fr 1.1fr 0.9fr 0.9fr minmax(220px,0.9fr); align-items:center; gap:10px; }

@media (max-width:1366px) {
  .table--expirations .table__head .table__row, .table--expirations .table__row--head, .table--expirations .table__body .table__row { grid-template-columns:1.8fr 1.1fr 1.05fr 0.85fr 0.85fr minmax(200px,0.9fr); gap:8px; }
}

.table--expirations .th, .table--expirations .td { min-width:0; }

/* qty/status/actions (celle) coerenti con il resto */
.table--expirations .td--qty { white-space:nowrap; }

.table--expirations .td--status { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }

.table--expirations .td--actions { justify-self:end; white-space:nowrap; }

.table--expirations .td--actions .row-actions { display:flex; gap:6px; flex-wrap:nowrap; }

.table--expirations .td--actions .chip { padding:2px 8px; font-size:11.5px; border-radius:9px; }

/* note (full-width) */
.table--expirations .td--notes { grid-column:1 / -1; background:rgba(255,255,255,.04); padding:8px 12px; white-space:normal; overflow:visible; text-overflow:initial; }

.table--expirations .td--notes .notes-label { font-weight:600; margin-right:8px; color:var(--muted); }

.table--expirations .th--center { text-align:center; justify-self:center; }

/* ===== HelpDesk — layout 2 colonne ===== */
:root { --helpdesk-side-w:520px; --helpdesk-sticky-top:80px; }

@media (max-width:1366px) {
  :root { --helpdesk-side-w:480px; }
}

.helpdesk-grid { display:grid; grid-template-columns:minmax(0,1fr) var(--helpdesk-side-w); gap:16px; align-items:start; }

@media (max-width:1100px) {
  .helpdesk-grid { grid-template-columns:1fr; }
}

.hd-main { display:flex; flex-direction:column; gap:16px; min-width:0; }

.hd-side { position:sticky; top:var(--helpdesk-sticky-top); align-self:start; display:grid; grid-template-rows:auto 1fr; row-gap:16px; }

@media (max-width:1100px) {
  .hd-side { position:static; }
}

.quick-actions { display:flex; flex-direction:column; gap:10px; }

/* ===== Pannelli ===== */
.panel { border:1px solid rgba(255,255,255,.08); background:#0f1220; border-radius:12px; }

.panel__head { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.06); }

.panel__title { margin:0; font-size:14px; font-weight:700; color:#eaeefa; }

.panel__body { padding:12px 14px; }

.map-panel .panel__body { padding:0; }

.map-embed { display:block; width:100%; height:clamp(420px,60vh,720px); border-radius:10px; overflow:hidden; }

#helpdesk-map { display:block; width:100%; height:100%; }

.map-embed .leaflet-container { width:100% !important; height:100% !important; }

.btn--block { width:100%; justify-content:center; }

.map-placeholder { display:flex; align-items:center; justify-content:center; width:100%; height:100%; min-height:360px; color:var(--muted,#8b8fa3); background:rgba(255,255,255,.04); border:1px dashed rgba(255,255,255,.12); border-radius:10px; }

/* ===== Quick actions ===== */
.qa-group { display:flex; flex-direction:column; gap:10px; }

.qa-btn { display:flex; align-items:center; gap:10px; width:100%; padding:10px 14px; border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.06); border-radius:12px; color:#eaeefa; font-weight:600; text-decoration:none; transition:background .18s,border-color .18s,transform .02s; }

.qa-btn:hover { background:rgba(255,255,255,.09); border-color:rgba(255,255,255,.2); }

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

.qa-btn--primary { background:rgba(108,99,255,.16); border-color:rgba(108,99,255,.28); }

.qa-btn--primary:hover { background:rgba(108,99,255,.22); border-color:rgba(108,99,255,.35); }

.qa-btn__glyph { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:999px; background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.16); color:var(--brand,#6c63ff); }

/* ======================================================================
   HELP DESK — Lista task compatta (scope: .helpdesk-grid)
   ====================================================================== */

/* Struttura riga */
.helpdesk-grid .panel .list--lines .list__row { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:8px 12px; }

.helpdesk-grid .panel .list--lines .list__main { display:flex; flex-direction:column; gap:4px; min-width:0; }

.helpdesk-grid .list__row[draggable="true"] { cursor:grab; }

.helpdesk-grid .list__row.is-dragging { opacity:.6; cursor:grabbing; }

.helpdesk-grid .list__row.is-drag-over-before { box-shadow:inset 0 2px 0 0 var(--brand,#7c5cff); }

.helpdesk-grid .list__row.is-drag-over-after { box-shadow:inset 0 -2px 0 0 var(--brand,#7c5cff); }

.helpdesk-grid .panel .list--lines .list__row.is-focused { outline:1px solid var(--brand,#7c5cff); outline-offset:-1px; }

.helpdesk-grid .list__row:hover { background-color:rgba(255,255,255,.02); }

/* Header riga (badge a sx, meta a dx) */
.helpdesk-grid .task-row .task-header { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; margin-bottom:4px; }

.helpdesk-grid .task-row .task-header__left { display:flex; flex-wrap:wrap; align-items:center; gap:4px; }

.helpdesk-grid .task-row .task-header__right { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:4px; }

/* Titolo + actions in linea | descrizione full width sotto */
.helpdesk-grid .task-row .task-titlebar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:2px 0 4px; }

.helpdesk-grid .task-row .task-title { margin:0; font-size:14.5px; line-height:1.18; font-weight:bold; }

.helpdesk-grid .task-row .task-desc { font-size:12.75px; line-height:1.15; opacity:.9; margin-top:0; }

/* Azioni compatte (sempre in linea, no wrap desktop) */
.helpdesk-grid .task-row .task-actions { display:flex; flex-direction:row; align-items:center; gap:6px; white-space:nowrap; margin-left:8px; }

.helpdesk-grid .task-row .task-actions .chip { display:inline-flex; height:26px; padding:0 10px; border-radius:9999px; font-size:12.5px; white-space:nowrap; border:1px solid transparent; transition:140ms; }

.helpdesk-grid .task-row .task-actions .chip--brand { background:color-mix(in oklab,var(--brand) 15%,transparent); border-color:color-mix(in oklab,var(--brand) 38%,transparent); }

.helpdesk-grid .task-row .task-actions .chip--warning { background:color-mix(in oklab,var(--warn) 15%,transparent); border-color:color-mix(in oklab,var(--warn) 38%,transparent); }

.helpdesk-grid .task-row .task-actions .chip--success { background:color-mix(in oklab,var(--ok) 13%,transparent); border-color:color-mix(in oklab,var(--ok) 36%,transparent); }

@media (max-width:980px) {
  .helpdesk-grid .task-row .task-titlebar { flex-direction:column; align-items:flex-start; gap:8px; }
  .helpdesk-grid .task-row .task-actions { white-space:normal; margin-left:0; }
}

/* Pill/Badge — dimensioni e SPACING UNIFICATO e MINIMO */
.helpdesk-grid .task-row .badge,
.helpdesk-grid .task-row .pill,
.helpdesk-grid .task-row .date-badge,
.helpdesk-grid .task-row .due-pill { display:inline-flex; align-items:center; padding:1px 6px; border-radius:999px; font-size:12px; line-height:1.1; margin:0; }

/* Badge base (cliente/sede/assegnatari) */
.helpdesk-grid .panel .list--lines .badge { font-weight:600; color:#eef1ff; background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.18); }

.helpdesk-grid .panel .list--lines .badge--brand { background:rgba(124,92,255,.16); border-color:rgba(124,92,255,.28); color:#ece8ff; }

.helpdesk-grid .task-row .badge--secondary.badge--count { background:var(--card_lighter); border:1px solid var(--line); font-weight:700; }

/* Pill meta (Rich/Scad/Priorità) */
.helpdesk-grid .panel .list--lines .pill,
.helpdesk-grid .panel .list--lines .date-badge,
.helpdesk-grid .panel .list--lines .due-pill { border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.06); color:#eaeefa; }

.helpdesk-grid .panel .list--lines .priority-pill { min-width:auto; margin:0; }

.helpdesk-grid .panel .list--lines .pill--success { background:rgba(16,185,129,.18); border-color:rgba(16,185,129,.32); color:#d7fff0; }

.helpdesk-grid .panel .list--lines .pill--brand { background:rgba(124,92,255,.18); border-color:rgba(124,92,255,.34); color:#e6e0ff; }

.helpdesk-grid .panel .list--lines .pill--danger { background:rgba(239,68,68,.20); border-color:rgba(239,68,68,.36); color:#ffe5e5; }

.helpdesk-grid .panel .list--lines .pill--warn { background:rgba(245,158,11,.22); border-color:rgba(245,158,11,.38); color:#fff2da; }

.helpdesk-grid .panel .list--lines .due-pill--ok { background:rgba(16,185,129,.18); border-color:rgba(16,185,129,.32); color:#d7fff0; }

.helpdesk-grid .panel .list--lines .due-pill--soon { background:rgba(245,158,11,.22); border-color:rgba(245,158,11,.38); color:#fff2da; }

.helpdesk-grid .panel .list--lines .due-pill--overdue { background:rgba(239,68,68,.20); border-color:rgba(239,68,68,.36); color:#ffe5e5; }

.helpdesk-grid .panel .list--lines .due-pill--none { background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.20); color:#eaeefa; }

/* Spaziature ORIZZONTALI MINIME tra tutte le pill/badge della riga */
.helpdesk-grid .task-row .task-header__left > *,
.helpdesk-grid .task-row .task-header__right > * { margin-right:4px; }

.helpdesk-grid .task-row .task-header__left > *:last-child,
.helpdesk-grid .task-row .task-header__right > *:last-child { margin-right:0; }

/* Marker priorità/brand (come prima) */
.helpdesk-grid .panel .list--lines .list__row.task-row { position:relative; border-left:5px solid transparent; --prio-start:transparent; --prio-end:transparent; }

.helpdesk-grid .panel .list--lines .list__row.task-row::before { content:""; position:absolute; inset:0; background-image:linear-gradient(270deg,rgba(124,92,255,.14) 0%,rgba(124,92,255,.08) 32%,rgba(124,92,255,.04) 64%,rgba(124,92,255,0) 100%); background-repeat:no-repeat; pointer-events:none; z-index:0; }

.helpdesk-grid .panel .list--lines .list__row.task-row .list__main { position:relative; z-index:1; padding:8px 10px; background-image:linear-gradient(90deg,var(--prio-start) 0%,var(--prio-start) 22%,var(--prio-end) 72%); background-repeat:no-repeat; border-radius:0; }

.helpdesk-grid .panel .list--lines .list__row.task-row--prio-urgent { border-left-color:rgba(239,68,68,.95); --prio-start:rgba(239,68,68,.22); --prio-end:rgba(239,68,68,0); }

.helpdesk-grid .panel .list--lines .list__row.task-row--prio-normal { border-left-color:rgba(16,185,129,.95); --prio-start:rgba(16,185,129,.22); --prio-end:rgba(16,185,129,0); }

.helpdesk-grid .panel .list--lines .list__row.task-row--prio-force { border-left-color:rgba(108,99,255,.90); --prio-start:rgba(108,99,255,.20); --prio-end:rgba(108,99,255,0); }

/* Iconcina Google (se usi <img class="icon-g">) */
.helpdesk-grid .task-row .icon-g { width:14px; height:14px; margin-left:4px; vertical-align:middle; opacity:.9; }

.helpdesk-grid .task-row .icon-g:hover { opacity:1; }

/* Helpdesk — iPhone switch (alias delle regole .sw-settings) */
.helpdesk-toolbar__mine .sws-switch { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }

.helpdesk-toolbar__mine .sws-switch__input { position:absolute; opacity:0; pointer-events:none; }

.helpdesk-toolbar__mine .sws-switch__track { width:46px; height:26px; border-radius:9999px; background:var(--card_lighter); border:1px solid var(--line); position:relative; transition:.18s ease; }

.helpdesk-toolbar__mine .sws-switch__track::after { content:""; position:absolute; top:50%; left:4px; transform:translateY(-50%); width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:.18s ease; }

.helpdesk-toolbar__mine .sws-switch__input:checked + .sws-switch__track { background:color-mix(in oklab, var(--ok) 25%, transparent); border-color:color-mix(in oklab, var(--ok) 50%, transparent); }

.helpdesk-toolbar__mine .sws-switch__input:checked + .sws-switch__track::after { left:24px; }

.helpdesk-toolbar__mine .sws-switch__text { margin-left:6px; opacity:.9; }

/* == Clockbar (pulsanti Entrata/Uscita) ================================== */
.toolbar--actions .clockbar { display:grid; grid-template-columns:repeat(4, minmax(200px, 1fr)); gap:14px; align-items:center; }

@media (max-width: 1100px) {
  .toolbar--actions .clockbar { grid-template-columns:repeat(2, minmax(220px, 1fr)); }
}

.toolbar--actions .clockbar__btn { appearance:none; -webkit-appearance:none; border:1px solid transparent; border-radius:9999px; padding:12px 18px; height:48px; font-weight:700; letter-spacing:.2px; line-height:1; box-shadow:inset 0 1px 0 rgba(255,255,255,.06),
    0 1px 2px rgba(0,0,0,.18),
    0 6px 20px rgba(0,0,0,.12); transition:transform .12s ease, box-shadow .12s ease, filter .12s ease; color:var(--fg-on-tone, #fff); background:var(--tone-bg, var(--card)); border-color:var(--tone-border, var(--line)); }

/* Hover/active/focus */
.toolbar--actions .clockbar__btn:hover { transform:translateY(-1px); filter:brightness(1.03); }

.toolbar--actions .clockbar__btn:active { filter:brightness(.97); }

.toolbar--actions .clockbar__btn:focus-visible { box-shadow:0 0 0 2px color-mix(in oklab, var(--tone, #6ea8fe) 60%, transparent),
    0 0 0 5px color-mix(in oklab, var(--tone, #6ea8fe) 24%, transparent); }

/* Varianti tono (usa var(--*) se presenti, fallback inclusi) */
.toolbar--actions .clockbar__btn.-morning-in { --tone:var(--ok, #22c55e); --tone-bg:linear-gradient(180deg,
                color-mix(in oklab, var(--tone) 26%, transparent),
                color-mix(in oklab, var(--tone) 16%, transparent)); --tone-border:color-mix(in oklab, var(--tone) 38%, transparent); --fg-on-tone:#ffffff; }

.toolbar--actions .clockbar__btn.-morning-out { --tone:var(--cyan, #22d3ee); --tone-bg:linear-gradient(180deg,
                color-mix(in oklab, var(--tone) 26%, transparent),
                color-mix(in oklab, var(--tone) 16%, transparent)); --tone-border:color-mix(in oklab, var(--tone) 38%, transparent); --fg-on-tone:#0b1f2a; }

.toolbar--actions .clockbar__btn.-afternoon-in { --tone:var(--accent, #a78bfa); --tone-bg:linear-gradient(180deg,
                color-mix(in oklab, var(--tone) 26%, transparent),
                color-mix(in oklab, var(--tone) 16%, transparent)); --tone-border:color-mix(in oklab, var(--tone) 38%, transparent); --fg-on-tone:#101018; }

.toolbar--actions .clockbar__btn.-afternoon-out { --tone:var(--info, #60a5fa); --tone-bg:linear-gradient(180deg,
                color-mix(in oklab, var(--tone) 26%, transparent),
                color-mix(in oklab, var(--tone) 16%, transparent)); --tone-border:color-mix(in oklab, var(--tone) 38%, transparent); --fg-on-tone:#0a1523; }

/* Stato disabled (se mai usato) */
.toolbar--actions .clockbar__btn[disabled] { filter:grayscale(.2) opacity(.7); cursor:not-allowed; transform:none; box-shadow:inset 0 1px 0 rgba(255,255,255,.04); }

/* == Clockbar — variante “bright & legible” ============================== */
.toolbar--actions .clockbar__btn { height:52px; padding:12px 22px; border-radius:9999px; border:1px solid transparent; font-size:.95rem; font-weight:800; letter-spacing:.2px; color:#fff; text-shadow:0 1px 0 rgba(0,0,0,.35); --tone:#6ea8fe; --tone-600:color-mix(in oklab, var(--tone) 65%, black 35%); --tone-700:color-mix(in oklab, var(--tone) 75%, black 25%); --tone-800:color-mix(in oklab, var(--tone) 85%, black 15%); background-image:linear-gradient(180deg, var(--tone-600), var(--tone-800)); border-color:var(--tone-700); box-shadow:inset 0 1px 0 rgba(255,255,255,.08),
    0 1px 2px rgba(0,0,0,.25),
    0 10px 26px rgba(0,0,0,.18); transition:transform .12s ease, filter .12s ease, box-shadow .12s ease; }

.toolbar--actions .clockbar__btn:hover { transform:translateY(-1px); filter:saturate(1.2) brightness(1.05); }

.toolbar--actions .clockbar__btn:active { transform:translateY(0); filter:brightness(.95); }

.toolbar--actions .clockbar__btn:focus-visible { outline:none; box-shadow:0 0 0 3px color-mix(in oklab, var(--tone) 55%, transparent),
    0 0 0 6px color-mix(in oklab, var(--tone) 22%, transparent),
    0 10px 26px rgba(0,0,0,.18); }

/* Toni dedicati (più saturi) */
.toolbar--actions .clockbar__btn.-morning-in { --tone:#22c55e; }

/* green */
.toolbar--actions .clockbar__btn.-morning-out { --tone:#06b6d4; }

/* cyan  */
.toolbar--actions .clockbar__btn.-afternoon-in { --tone:#a78bfa; }

/* violet*/
.toolbar--actions .clockbar__btn.-afternoon-out { --tone:#60a5fa; }

/* blue  */

/* Layout già esistente: aggiungo un filo di gap e auto-stretch, se serve */
.toolbar--actions .clockbar { gap:16px; }

.toolbar--actions .clockbar__btn { justify-self:stretch; }

/* ======================================================================
   DAILY WORK REPORTS — griglia unica + wrapper interno + doppio gradiente
   Stati: .row--ok, .row--warn, .is-dayoff.is-ferie, .is-dayoff.is-fest
   Compat badge legacy: .dwr-date__holiday / .dwr-date__fest
   ====================================================================== */

/* Punto di verità (scope) */
.table.table--list.table--reports.daily-work-reports { --dwr-grid:minmax(200px,1.2fr) minmax(520px,3fr) minmax(120px,.9fr) minmax(120px,.9fr) minmax(140px,.9fr) auto; --dwr-gap:18px; --dwr-pad-x:16px; }

/* Header: griglia allineata al body */
.table.table--list.table--reports.daily-work-reports > .table__head > .table__row--head { display:grid !important; grid-template-columns:var(--dwr-grid) !important; column-gap:var(--dwr-gap) !important; align-items:center; padding-left:0; padding-right:0; }

/* Body: riga esterna (bordo) + wrapper interno con griglia */
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row { position:relative; display:block; border-left:6px solid transparent; background-color:transparent !important; overflow:hidden; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner { position:relative; z-index:0; display:grid; grid-template-columns:var(--dwr-grid); column-gap:var(--dwr-gap); align-items:center; padding:6px 0; isolation:isolate; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner > * { position:relative; z-index:1; }

/* Celle base */
.daily-work-reports .th { padding-left:16px; padding-right:16px; white-space:normal; overflow:visible; text-overflow:initial; }

.daily-work-reports .td { padding-left:16px; padding-right:16px; white-space:normal; overflow:visible; text-overflow:initial; }

/* Allineamenti (header/body coerenti) */
.daily-work-reports .table__row--head .th:nth-child(1),
.daily-work-reports .table__body .table__row .td:nth-child(1) { text-align:left; }

/* Data */
.daily-work-reports .table__row--head .th:nth-child(2),
.daily-work-reports .table__body .table__row .td:nth-child(2) { text-align:left; }

/* Orari */
.daily-work-reports .table__row--head .th:nth-child(3),
.daily-work-reports .table__body .table__row .td:nth-child(3) { text-align:center; }

/* Ore lav. */
.daily-work-reports .table__row--head .th:nth-child(4),
.daily-work-reports .table__body .table__row .td:nth-child(4) { text-align:center; }

/* Saldo */
.daily-work-reports .table__row--head .th:nth-child(5),
.daily-work-reports .table__body .table__row .td:nth-child(5) { text-align:center; }

/* Controllo */
.daily-work-reports .table__row--head .th:nth-child(6),
.daily-work-reports .table__body .table__row .td:nth-child(6) { text-align:right; }

/* Azioni */

/* Orari su una riga (wrappa solo sotto 1100px) */
.daily-work-reports .dwr-times__wrap { display:flex; gap:10px; align-items:center; white-space:nowrap; flex-wrap:nowrap; }

@media (max-width:1100px) {
  .daily-work-reports .dwr-times__wrap { white-space:normal; flex-wrap:wrap; }
}

.daily-work-reports .dwr-times__seg { white-space:nowrap; }

.daily-work-reports .dwr-times__dot { opacity:.35; }

/* Tipografia numerica + colori saldo */
.daily-work-reports .dwr-worked__val { font-variant-numeric:tabular-nums; font-weight:700; }

.daily-work-reports .dwr-balance__val { font-variant-numeric:tabular-nums; font-weight:700; }

.daily-work-reports .dwr-balance__val.is-pos { color:var(--ok); }

.daily-work-reports .dwr-balance__val.is-neg { color:var(--danger); }

.daily-work-reports .dwr-value { font-variant-numeric:tabular-nums; font-weight:700; }

/* Badge: Controllo + FERIE/FESTIVITÀ (nuove e legacy) */
.daily-work-reports .dwr-badge { display:inline-flex; align-items:center; padding:4px 10px; border-radius:9999px; font-size:.875rem; font-weight:600; line-height:1; border:1px solid transparent; vertical-align:middle; }

.table.table--list.table--reports.daily-work-reports .dwr-date__holiday { display:inline-flex; align-items:center; padding:4px 10px; border-radius:9999px; font-size:.875rem; font-weight:600; line-height:1; border:1px solid transparent; vertical-align:middle; }

.table.table--list.table--reports.daily-work-reports .dwr-date__fest { display:inline-flex; align-items:center; padding:4px 10px; border-radius:9999px; font-size:.875rem; font-weight:600; line-height:1; border:1px solid transparent; vertical-align:middle; }

.daily-work-reports .dwr-badge--ok { background:color-mix(in oklab, var(--ok) 18%, transparent); color:var(--ok); border-color:color-mix(in oklab, var(--ok) 35%, transparent); }

.daily-work-reports .dwr-badge--ko { background:color-mix(in oklab, var(--danger) 18%, transparent); color:var(--danger); border-color:color-mix(in oklab, var(--danger) 35%, transparent); }

.daily-work-reports .dwr-badge--ferie,
.table.table--list.table--reports.daily-work-reports .dwr-date__holiday { background:color-mix(in oklab, var(--warn) 18%, transparent); color:var(--warn); border-color:color-mix(in oklab, var(--warn) 35%, transparent); }

.daily-work-reports .dwr-badge--fest,
.table.table--list.table--reports.daily-work-reports .dwr-date__fest { background:color-mix(in oklab, var(--accent, #70a1ff) 18%, transparent); color:var(--accent, #70a1ff); border-color:color-mix(in oklab, var(--accent, #70a1ff) 35%, transparent); }

/* =================== Doppio gradiente sul wrapper (.dwr-inner) ========= */
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner::before { content:""; position:absolute; inset:0; z-index:0; pointer-events:none; background-image:linear-gradient(90deg, var(--hl-start,transparent) 0%, var(--hl-mid,transparent) 38%, var(--hl-end,transparent) 70%, transparent 100%),
    linear-gradient(180deg, color-mix(in oklab, #fff 4%, transparent) 0%, transparent 28%); background-repeat:no-repeat; background-size:100% 100%; background-origin:padding-box; background-clip:padding-box; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row:hover > .dwr-inner::before { filter:saturate(1.02) brightness(1.015); }

/* Stati → bordo + variabili gradiente (intensità medium) */
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.row--ok { border-left-color:color-mix(in oklab, var(--ok) 92%, black 8%); }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.row--ok > .dwr-inner { --hl-start:color-mix(in oklab, var(--ok) 30%, transparent); --hl-mid:color-mix(in oklab, var(--ok) 20%, transparent); --hl-end:color-mix(in oklab, var(--ok) 12%, transparent); }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.row--warn { border-left-color:color-mix(in oklab, var(--danger) 92%, black 8%); }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.row--warn > .dwr-inner { --hl-start:color-mix(in oklab, var(--danger) 32%, transparent); --hl-mid:color-mix(in oklab, var(--danger) 22%, transparent); --hl-end:color-mix(in oklab, var(--danger) 14%, transparent); }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.is-dayoff.is-ferie { border-left-color:color-mix(in oklab, var(--warn) 92%, black 8%); }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.is-dayoff.is-ferie > .dwr-inner { --hl-start:color-mix(in oklab, var(--warn) 28%, transparent); --hl-mid:color-mix(in oklab, var(--warn) 19%, transparent); --hl-end:color-mix(in oklab, var(--warn) 11%, transparent); }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.is-dayoff.is-fest { border-left-color:color-mix(in oklab, var(--accent, #70a1ff) 92%, black 8%); }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row.is-dayoff.is-fest > .dwr-inner { --hl-start:color-mix(in oklab, var(--accent, #70a1ff) 28%, transparent); --hl-mid:color-mix(in oklab, var(--accent, #70a1ff) 19%, transparent); --hl-end:color-mix(in oklab, var(--accent, #70a1ff) 11%, transparent); }

/* =================== Barre secondarie a tutta riga ===================== */
/* “Viaggio / Escluse / …” e “Note” condividono il look */
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra { grid-column:1 / -1; position:relative; z-index:2; margin-top:8px; padding:8px 16px; background:var(--card_lighter); border:1px solid var(--line); border-radius:6px; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra--notes { grid-column:1 / -1; position:relative; z-index:2; margin-top:8px; padding:8px 16px; background:var(--card_lighter); border:1px solid var(--line); border-radius:6px; }

/* Monoriga con ellissi per alloc/rules */
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra .dwr-alloc { display:flex; flex-wrap:nowrap; align-items:center; gap:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra .dwr-rules { display:flex; flex-wrap:nowrap; align-items:center; gap:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra .dwr-dot { opacity:.35; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra .dwr-label { opacity:.65; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra .dwr-value { font-weight:700; font-variant-numeric:tabular-nums; }

/* NOTE inline: "Note: Testo delle note" (testo completo, con wrap) */
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra--notes .dwr-notes { display:flex; flex-wrap:wrap; align-items:baseline; gap:0; column-gap:6px; white-space:normal; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra--notes .dwr-label { display:inline; flex:0 0 auto; font-weight:600; opacity:.80; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra--notes .dwr-label::after { content:":"; margin-right:3px; }

.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra--notes .dwr-notes__text { display:inline; flex:1 1 auto; min-width:0; margin:0; line-height:1.35; }

/* Micro separatore visivo sopra le barre */
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra::before,
.table.table--list.table--reports.daily-work-reports > .table__body > .dwr-row > .dwr-inner .dwr-extra--notes::before { content:""; position:absolute; left:0; right:0; top:-8px; height:8px; background:linear-gradient(180deg, rgba(0,0,0,.06), transparent); border-top-left-radius:6px; border-top-right-radius:6px; pointer-events:none; }

.toolbar--totals { padding-block:8px 0; }

.toolbar--totals .totals-grid { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:12px; }

@media (max-width: 1200px) {
  .toolbar--totals .totals-grid { grid-template-columns:repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .toolbar--totals .totals-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .toolbar--totals .totals-grid { grid-template-columns:1fr; }
}

.toolbar--totals .totals-item { position:relative; border:1px solid var(--line); background:linear-gradient(180deg, rgba(255,255,255,.03), transparent 42%), var(--card); border-radius:12px; padding:12px 14px; box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 6px 18px rgba(0,0,0,.25); transition:transform .18s ease, box-shadow .18s ease, background .18s ease; overflow:hidden; }

@media (pointer: fine) {
  .toolbar--totals .totals-item:hover { transform:translateY(-2px); box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 10px 24px rgba(0,0,0,.30); background:linear-gradient(180deg, rgba(255,255,255,.05), transparent 46%), var(--card); }
}

.toolbar--totals .totals-label { display:block; font-size:12px; letter-spacing:.02em; text-transform:uppercase; opacity:.8; margin-bottom:6px; }

.toolbar--totals .totals-value { font-weight:800; font-size:20px; line-height:1.1; letter-spacing:.2px; color:var(--text); display:inline-flex; align-items:center; gap:8px; }

.toolbar--totals .totals-value.is-pos { color:color-mix(in oklab, #39d98a 80%, var(--text)); }

.toolbar--totals .totals-value.is-warn { color:color-mix(in oklab, #ffb155 80%, var(--text)); }

.toolbar--totals .totals-value.is-alert { color:color-mix(in oklab, #ff5555 80%, var(--text)); }

.toolbar--totals .totals-item::after { content:""; position:absolute; inset:-1px; border-radius:12px; pointer-events:none; background:linear-gradient(180deg, rgba(124,92,255,.22), rgba(124,92,255,0) 55%, rgba(255,255,255,.06) 100%); mask:linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); -webkit-mask:linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); mask-composite:exclude; -webkit-mask-composite:xor; padding:1px; opacity:.5; }

@media (prefers-reduced-motion: reduce) {
  .toolbar--totals .totals-item { transition:none; }
}

/* ======================================================================
   SW SETTINGS — INDEX + FORM (scope: .sw-settings)
   Usa variabili globali: --line, --card, --card_lighter, --ok, --danger, --accent
   ====================================================================== */

.sw-settings { padding:10px 0 40px; }

/* --- Head ------------------------------------------------------------- */
.sw-settings .page-title { margin:0; }

.sw-settings .page-subtitle { margin:2px 0 0; opacity:.8; }

.sw-settings .sws-head { display:grid; grid-template-columns:1fr; gap:10px; align-items:center; margin-bottom:16px; }

.sw-settings .sws-head__titles { display:grid; gap:2px; }

/* --- Card contenitore ------------------------------------------------- */
.sw-settings .sws-card { border:1px solid var(--line); background:var(--card); border-radius:10px; box-shadow:var(--shadow, 0 1px 2px rgba(0,0,0,.06)); padding:0; overflow:hidden; margin-bottom:14px; }

/* --- Griglia dati (INDEX) --------------------------------------------- */
.sw-settings .sws-grid { display:grid; grid-template-columns:1fr; }

.sw-settings .sws-row { display:grid; grid-template-columns:minmax(220px, .9fr) minmax(360px, 2fr); gap:18px; align-items:start; padding:14px 16px; border-bottom:1px solid var(--line); }

.sw-settings .sws-row:last-child { border-bottom:0; }

@media (max-width: 980px) {
  .sw-settings .sws-row { grid-template-columns:1fr; gap:8px; }
}

.sw-settings .sws-label { font-weight:700; white-space:nowrap; align-self:center; }

.sw-settings .sws-value { min-width:0; }

/* --- Pills destinatari ------------------------------------------------ */
.sw-settings .sws-pills { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none; }

.sw-settings .sws-pill { padding:6px 10px; border:1px solid var(--line); border-radius:9999px; background:color-mix(in oklab, var(--card_lighter) 72%, transparent); font-variant-numeric:tabular-nums; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* --- Badge (micro-tuning su globali) ---------------------------------- */
.sw-settings .badge { font-weight:700; }

.sw-settings .badge.badge--success { background:color-mix(in oklab, var(--ok) 20%, transparent); color:var(--ok); border:1px solid color-mix(in oklab, var(--ok) 40%, transparent); }

.sw-settings .badge.badge--secondary { background:var(--card_lighter); color:inherit; border:1px solid var(--line); }

/* --- Stato empty ------------------------------------------------------ */
.sw-settings .sws-empty { text-align:left; padding:20px 16px; background:var(--card); border:1px solid var(--line); border-radius:10px; margin-bottom:14px; }

.sw-settings .sws-empty__title { margin:0; font-weight:800; }

.sw-settings .sws-empty__subtitle { margin:6px 0 0; opacity:.8; }

/* --- Footer azioni (INDEX) -------------------------------------------- */
.sw-settings .sws-foot { margin-top:4px; display:flex; gap:10px; align-items:center; }

/* --- Form (EDIT/NEW) -------------------------------------------------- */
.sw-settings .sws-card .sws-form { display:grid; gap:14px; padding:14px 16px; }

/* Error box */
.sw-settings .sws-errors { border:1px solid color-mix(in oklab, var(--danger) 40%, transparent); background:color-mix(in oklab, var(--danger) 10%, transparent); border-radius:8px; padding:10px 12px; }

.sw-settings .sws-errors__title { margin:0 0 6px; font-weight:800; color:var(--danger); }

.sw-settings .sws-errors__list { margin:0; padding-left:18px; }

/* Campi */
.sw-settings .sws-field { display:grid; gap:8px; }

.sw-settings .sws-field--inline { grid-template-columns:minmax(220px, .9fr) minmax(320px, 2fr); align-items:center; }

@media (max-width: 900px) {
  .sw-settings .sws-field--inline { grid-template-columns:1fr; }
}

.sw-settings .sws-input { width:100%; min-height:42px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--card_lighter); color:inherit; resize:vertical; }

.sw-settings .sws-help { margin:4px 0 0; opacity:.75; }

/* Switch (checkbox -> toggle) */
.sw-settings .sws-switch { display:inline-flex; align-items:center; gap:10px; cursor:pointer; }

.sw-settings .sws-switch__input { position:absolute; opacity:0; pointer-events:none; }

.sw-settings .sws-switch__track { width:46px; height:26px; border-radius:9999px; background:var(--card_lighter); border:1px solid var(--line); position:relative; transition:.18s ease; }

.sw-settings .sws-switch__track::after { content:""; position:absolute; top:50%; left:4px; transform:translateY(-50%); width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:.18s ease; }

.sw-settings .sws-switch__input:checked + .sws-switch__track { background:color-mix(in oklab, var(--ok) 25%, transparent); border-color:color-mix(in oklab, var(--ok) 50%, transparent); }

.sw-settings .sws-switch__input:checked + .sws-switch__track::after { left:24px; }

.sw-settings .sws-switch__text { opacity:.9; }

/* Actions form (in basso a sinistra) */
.sw-settings .sws-actions { display:flex; gap:10px; align-items:center; justify-content:flex-start; margin-top:4px; }

/* Ghost button (Annulla) — contrasto migliore su sfondo scuro */
.sw-settings .btn.btn--ghost { background:transparent; color:var(--text, #e8e8e8); border:1px solid color-mix(in oklab, var(--line) 70%, transparent); border-radius:8px; padding:8px 14px; font-weight:600; transition:background .15s ease, border-color .15s ease, color .15s ease, transform .06s ease; }

.sw-settings .btn.btn--ghost:hover { background:color-mix(in oklab, var(--card_lighter) 55%, transparent); border-color:color-mix(in oklab, var(--line) 100%, transparent); }

.sw-settings .btn.btn--ghost:active { transform:translateY(1px); }

.sw-settings .btn.btn--ghost:focus-visible { outline:2px solid color-mix(in oklab, var(--accent, #70a1ff) 70%, transparent); outline-offset:2px; }

/* --- Utility locali ---------------------------------------------------- */
.sw-settings .text-dim { opacity:.8; }

/* ======================================================================
   TASKS · Publish confirm — card evento calendario (scope .task-publish-confirm)
   Usa variabili globali: --card, --card_lighter, --line, --ok, --danger, --accent,
   --shadow, --ink_on_accent
   ====================================================================== */

.task-publish-confirm { padding-top:10px; padding-bottom:40px; --tpc-max:1080px; }

.task-publish-confirm .tpc-card { max-width:var(--tpc-max); margin:0 auto; border:1px solid var(--line); background:var(--card); border-radius:14px; box-shadow:var(--shadow, 0 1px 2px rgba(0,0,0,.06)); overflow:hidden; }

@media (max-width: 1240px) {
  .task-publish-confirm .tpc-card { margin-left:14px; margin-right:14px; }
}

/* Header */
.task-publish-confirm .tpc-header { display:grid; grid-template-columns:auto 1fr; gap:16px; align-items:center; padding:16px; border-bottom:1px solid var(--line); background:linear-gradient(180deg, color-mix(in oklab, #fff 6%, transparent) 0%, transparent 32%), var(--card); }

@media (max-width: 720px) {
  .task-publish-confirm .tpc-header { grid-template-columns:1fr; justify-items:start; }
}

/* Badge data */
.task-publish-confirm .tpc-date { display:grid; grid-template-rows:auto auto auto; align-items:center; justify-items:center; width:74px; border:1px solid var(--line); border-radius:12px; background:var(--card_lighter); overflow:hidden; }

.task-publish-confirm .tpc-date__day { font-size:28px; font-weight:800; line-height:1; padding-top:8px; }

.task-publish-confirm .tpc-date__month { margin-top:4px; padding:2px 8px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); font-size:11px; font-weight:800; letter-spacing:.6px; background:color-mix(in oklab, var(--accent, #70a1ff) 22%, transparent); color:var(--accent, #70a1ff); }

.task-publish-confirm .tpc-date__year { font-size:11px; opacity:.8; padding:6px 0 8px; }

.task-publish-confirm .tpc-date--empty .tpc-date__month { background:transparent; color:inherit; }

@media (max-width: 720px) {
  .task-publish-confirm .tpc-date { width:68px; }
}

/* Titoli */
.task-publish-confirm .tpc-titles { min-width:0; }

.task-publish-confirm .tpc-title { margin:0; line-height:1.15; }

.task-publish-confirm .tpc-subtitle { margin:4px 0 0 0; }

.task-publish-confirm .tpc-chip { display:inline-block; padding:4px 10px; border-radius:9999px; border:1px solid var(--line); background:var(--card_lighter); font-weight:600; }

/* Corpo */
.task-publish-confirm .tpc-body { padding:14px 16px; }

.task-publish-confirm .tpc-desc { margin:0; line-height:1.45; }

.task-publish-confirm .tpc-desc + .tpc-meta { margin-top:10px; }

.task-publish-confirm .tpc-desc--muted { opacity:.8; }

.task-publish-confirm .tpc-meta { display:grid; gap:8px; margin:0; padding:0; list-style:none; }

.task-publish-confirm .tpc-meta__item { display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }

.task-publish-confirm .tpc-meta__label { opacity:.75; font-weight:600; }

.task-publish-confirm .tpc-meta__value { font-weight:700; }

/* Azioni */
.task-publish-confirm .tpc-actions { display:flex; gap:12px; flex-wrap:wrap; align-items:center; justify-content:flex-start; padding:12px 16px 16px; border-top:1px solid var(--line); background:var(--card); }

.task-publish-confirm .tpc-actions__form { display:inline; }

/* Bottoni (base) */
.task-publish-confirm .tpc-btn { --btn-bg:var(--card_lighter); --btn-fg:inherit; --btn-bd:var(--line); height:42px; min-width:180px; padding:0 14px; border-radius:10px; border:1px solid var(--btn-bd); background:var(--btn-bg); color:var(--btn-fg); display:inline-flex; align-items:center; justify-content:center; gap:10px; font-weight:800; letter-spacing:.2px; text-decoration:none; transition:background-color .18s ease, border-color .18s ease, filter .18s ease, transform .18s ease; cursor:pointer; user-select:none; }

.task-publish-confirm .tpc-btn:hover { filter:brightness(1.04); transform:translateY(-1px); }

.task-publish-confirm .tpc-btn:active { transform:translateY(0); filter:brightness(.98); }

.task-publish-confirm .tpc-btn[disabled] { opacity:.6; cursor:not-allowed; transform:none; }

/* Bottoni (varianti) */
.task-publish-confirm .tpc-btn--ok { --btn-bg:color-mix(in oklab, var(--ok) 20%, transparent); --btn-fg:var(--ink_on_accent, #fff); --btn-bd:color-mix(in oklab, var(--ok) 45%, transparent); color:var(--btn-fg); }

.task-publish-confirm .tpc-btn--ok:hover { --btn-bg:color-mix(in oklab, var(--ok) 26%, transparent); }

.task-publish-confirm .tpc-btn--danger { --btn-bg:color-mix(in oklab, var(--danger) 20%, transparent); --btn-fg:var(--ink_on_accent, #fff); --btn-bd:color-mix(in oklab, var(--danger) 45%, transparent); color:var(--btn-fg); }

.task-publish-confirm .tpc-btn--danger:hover { --btn-bg:color-mix(in oklab, var(--danger) 26%, transparent); }

.task-publish-confirm .tpc-btn--ghost { --btn-bg:color-mix(in oklab, var(--card_lighter) 80%, transparent); --btn-fg:inherit; --btn-bd:var(--line); }

/* Tipografia coerente dei bottoni (<a>, <button>, <input>) */
.task-publish-confirm .tpc-btn,
.task-publish-confirm .tpc-actions .tpc-btn,
.task-publish-confirm .tpc-actions [type="submit"].tpc-btn { font-family:inherit; font-size:.9375rem; font-weight:700; line-height:1; letter-spacing:.2px; text-decoration:none; -webkit-appearance:none; appearance:none; }

/* Icone via CSS mask */
.task-publish-confirm .tpc-ic { width:16px; height:16px; display:inline-block; background:currentColor; font-size:1rem; line-height:0; transform:translateY(1px); }

.task-publish-confirm .tpc-ic--cal { -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2a1 1 0 0 0-1 1v1H5a3 3 0 0 0-3 3v11a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3h-1V3a1 1 0 1 0-2 0v1H8V3a1 1 0 0 0-1-1Zm12 6v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8h15Zm-8 3a1 1 0 0 0-1 1v2H8a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2v-2a1 1 0 0 0-1-1Z'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2a1 1 0 0 0-1 1v1H5a3 3 0 0 0-3 3v11a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3h-1V3a1 1 0 1 0-2 0v1H8V3a1 1 0 0 0-1-1Zm12 6v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8h15Zm-8 3a1 1 0 0 0-1 1v2H8a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2v-2a1 1 0 0 0-1-1Z'/%3E%3C/svg%3E") center/contain no-repeat; }

.task-publish-confirm .tpc-ic--x { -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm3.54 13.46a1 1 0 0 1-1.41 0L12 13.32l-2.13 2.14a1 1 0 1 1-1.41-1.41L10.59 12l-2.13-2.13a1 1 0 0 1 1.41-1.41L12 10.59l2.13-2.13a1 1 0 0 1 1.41 1.41L13.41 12l2.13 2.13a1 1 0 0 1 0 1.41Z'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm3.54 13.46a1 1 0 0 1-1.41 0L12 13.32l-2.13 2.14a1 1 0 1 1-1.41-1.41L10.59 12l-2.13-2.13a1 1 0 0 1 1.41-1.41L12 10.59l2.13-2.13a1 1 0 0 1 1.41 1.41L13.41 12l2.13 2.13a1 1 0 0 1 0 1.41Z'/%3E%3C/svg%3E") center/contain no-repeat; }

/* ======================================================================
   Templates manager (/templates) — SCOPE TOTALE: .tmpl-mgr
   Stile tabellare snello, coerente con assets_management
   ====================================================================== */

.tmpl-mgr { padding:8px 0 20px; }

.tmpl-mgr .tmpl-mgr__grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }

@media (max-width:1100px) {
  .tmpl-mgr .tmpl-mgr__grid { grid-template-columns:1fr; }
}

/* Pannelli */
.tmpl-mgr .tmpl-list,
.tmpl-mgr .props-panel { border:1px solid var(--line); background:var(--card); border-radius:12px; overflow:hidden; box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 1px 12px rgba(0,0,0,.25); }

/* Header pannelli */
.tmpl-mgr .tmpl-list__header,
.tmpl-mgr .props-panel__head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); background:var(--card_lighter); }

.tmpl-mgr .tmpl-title,
.tmpl-mgr .props-title { margin:0; font-size:14px; font-weight:800; }

/* Form header: no-wrap + input elastico + bottone fisso */
.tmpl-mgr .tmpl-list__header form,
.tmpl-mgr .props-panel__head form { display:flex; align-items:center; gap:8px; flex-wrap:nowrap; min-width:0; }

.tmpl-mgr .tmpl-list__header form .input,
.tmpl-mgr .props-panel__head form .input { flex:1 1 auto; min-width:160px; }

.tmpl-mgr .tmpl-list__header form .btn,
.tmpl-mgr .props-panel__head form .btn { flex:0 0 auto; white-space:nowrap; }

/* Liste (UL) tabellari */
.tmpl-mgr .tmpl-list__items,
.tmpl-mgr .props-list { list-style:none; margin:0; padding:0; }

.tmpl-mgr .tmpl-item,
.tmpl-mgr .props-item { margin:0; }

/* Righe compatte, zebra senza bordi */
.tmpl-mgr .tmpl-item__view,
.tmpl-mgr .props-item__view { display:flex; align-items:center; gap:8px; padding:6px 12px; min-height:36px; font-size:14px; line-height:1.25; border:0; }

.tmpl-mgr .tmpl-list__items .tmpl-item:nth-child(odd)  .tmpl-item__view,
.tmpl-mgr .props-list      .props-item:nth-child(odd)  .props-item__view { background:color-mix(in oklab, var(--card) 96%, transparent); }

.tmpl-mgr .tmpl-list__items .tmpl-item:nth-child(even) .tmpl-item__view,
.tmpl-mgr .props-list      .props-item:nth-child(even) .props-item__view { background:color-mix(in oklab, var(--card) 92%, transparent); }

/* Hover */
.tmpl-mgr .tmpl-item__view:hover,
.tmpl-mgr .props-item__view:hover { background:color-mix(in oklab, var(--brand,#7c5cff) 8%, var(--card)); }

/* Riga attiva (solo sfondo, nessun bordo) — posto DOPO zebra/hover per vincere */
.tmpl-mgr .tmpl-item.is-active .tmpl-item__view { background:color-mix(in oklab, var(--brand,#7c5cff) 16%, var(--card)); box-shadow:none; }

/* Testi */
.tmpl-mgr .tmpl-item__title,
.tmpl-mgr .props-item__name { font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Azioni a destra: pill piatte, colori global */
.tmpl-mgr .tmpl-item__actions,
.tmpl-mgr .props-item__actions { display:flex; gap:8px; margin-left:auto; }

.tmpl-mgr .tmpl-item__actions .btn--xs,
.tmpl-mgr .props-item__actions .btn--xs { border-radius:999px; padding:0 10px; border:1px solid transparent; background:transparent; }

.tmpl-mgr .tmpl-item__actions .btn--secondary,
.tmpl-mgr .props-item__actions .btn--secondary { background:color-mix(in oklab, var(--brand,#7c5cff) 10%, transparent); border-color:color-mix(in oklab, var(--brand,#7c5cff) 30%, transparent); }

.tmpl-mgr .tmpl-item__actions .btn--danger,
.tmpl-mgr .props-item__actions .btn--danger { background:color-mix(in oklab, var(--danger,#ff4d4f) 10%, transparent); border-color:color-mix(in oklab, var(--danger,#ff4d4f) 30%, transparent); }

.tmpl-mgr .tmpl-item__actions .btn--secondary:hover,
.tmpl-mgr .props-item__actions .btn--secondary:hover { background:color-mix(in oklab, var(--brand,#7c5cff) 16%, transparent); }

.tmpl-mgr .tmpl-item__actions .btn--danger:hover,
.tmpl-mgr .props-item__actions .btn--danger:hover { background:color-mix(in oklab, var(--danger,#ff4d4f) 16%, transparent); }

/* Inline edit (barra compatta) */
.tmpl-mgr .tmpl-item__edit,
.tmpl-mgr .props-item__edit { padding:6px 12px; background:color-mix(in oklab, #fff 3%, var(--card)); }

.tmpl-mgr .tmpl-item__form,
.tmpl-mgr .props-item__form { display:grid; grid-template-columns:1fr auto auto; gap:8px; align-items:center; }

@media (max-width:1100px) {
  .tmpl-mgr .tmpl-item__form, .tmpl-mgr .props-item__form { grid-template-columns:1fr; }
}

.tmpl-mgr .tmpl-item__form-actions,
.tmpl-mgr .props-item__form-actions { display:flex; gap:8px; justify-content:flex-end; }

/* Inputs & Buttons (solo scope) */
.tmpl-mgr .input { width:100%; background:#0e0f18; border:1px solid rgba(255,255,255,.12); color:var(--text); padding:6px 10px; border-radius:8px; outline:none; transition:140ms; }

.tmpl-mgr .input:focus { border-color:rgba(124,92,255,.6); box-shadow:0 0 0 2px rgba(124,92,255,.14); }

.tmpl-mgr .input::placeholder { color:#6f7687; }

.tmpl-mgr .input.input--sm { height:30px; padding:0 10px; font-size:13.5px; }

.tmpl-mgr .btn--sm { height:32px; padding:0 10px; border-radius:8px; font-size:13.5px; }

.tmpl-mgr .btn--xs { height:28px; padding:0 8px; border-radius:8px; font-size:12.5px; }

/* Badge proprietà (nome template): allineato e troncato */
.tmpl-mgr .props-title { margin:0; font-size:14px; font-weight:800; display:flex; align-items:center; gap:8px; }

.tmpl-mgr .props-title .badge { max-width:34ch; display:inline-block; padding:2px 8px; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Utility scoped */
.tmpl-mgr .form-error { margin-bottom:6px; padding:6px 8px; border:1px solid color-mix(in oklab, var(--danger) 35%, transparent); background:color-mix(in oklab, var(--danger) 10%, transparent); color:var(--danger); border-radius:6px; }

.tmpl-mgr .hidden, .tmpl-mgr .is-hidden, .tmpl-mgr [hidden] { display:none !important; }

.tmpl-mgr .visually-hidden { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }

/* === FIX finale: zebra, hover, active (alta specificità) ============= */

/* Righe alterne (template + proprietà) */
.tmpl-mgr .tmpl-list__items > .tmpl-item:nth-child(odd)  > .tmpl-item__view,
.tmpl-mgr .props-list       > .props-item:nth-child(odd) > .props-item__view { background:color-mix(in oklab, #fff 4.5%, var(--card)) !important; }

.tmpl-mgr .tmpl-list__items > .tmpl-item:nth-child(even) > .tmpl-item__view,
.tmpl-mgr .props-list       > .props-item:nth-child(even)> .props-item__view { background:color-mix(in oklab, #000 3%, var(--card)) !important; }

/* Hover (solo quando NON attiva) */
.tmpl-mgr .tmpl-list__items > .tmpl-item:not(.is-active) > .tmpl-item__view:hover,
.tmpl-mgr .props-list       > .props-item             > .props-item__view:hover { background:color-mix(in oklab, var(--brand,#7c5cff) 12%, var(--card)) !important; }

/* Riga attiva: solo sfondo (vince su zebra/hover) */
.tmpl-mgr .tmpl-list__items > .tmpl-item.is-active > .tmpl-item__view { background:color-mix(in oklab, var(--brand,#7c5cff) 20%, var(--card)) !important; box-shadow:none !important; }

/* === CONTRATTI CONTROL (dark theme) === */

.contracts-control { display:flex; flex-direction:column; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); color:var(--text); }

/* intestazione */
.contracts-control__head,
.contracts-control__main { display:grid; grid-template-columns:1.5fr 2.5fr 1fr 1fr 1fr 1.5fr; align-items:center; gap:0.5rem; padding:0.75rem 1rem; }

.contracts-control__head { background:var(--card_lighter); font-weight:600; color:var(--text); border-bottom:1px solid var(--line); }

.contracts-control__main { cursor:pointer; transition:background 0.2s ease; }

.contracts-control__main:hover { background:rgba(255,255,255,0.05); }

.contracts-control__row + .contracts-control__row { border-top:1px solid var(--line); }

/* area interventi */
.contracts-control__interventions { background:var(--card_lighter); border-top:1px solid var(--line); padding:0.5rem 1rem 1rem 1rem; }

.contracts-control__interventions-table { display:flex; flex-direction:column; gap:0.25rem; }

.contracts-control__interventions-row { display:grid; grid-template-columns:1fr 1fr 3fr 0.5fr 0.5fr; align-items:center; padding:0.4rem 0; border-bottom:1px solid var(--line); }

.contracts-control__interventions-row:last-child { border-bottom:none; }

/* icona toggle */
.contracts-control__toggle-icon { transition:transform 0.2s ease; color:var(--muted); }

.contracts-control__main:hover .contracts-control__toggle-icon { color:var(--text); }

[data-accordion-open] .contracts-control__toggle-icon { transform:rotate(180deg); }

/* testo secondario */
.u-muted { color:var(--muted); font-size:0.85em; }

/* contenuto nascosto */
.is-hidden { display:none; }

/* vuoto */
.contracts-control__interventions-empty { color:var(--muted); font-style:italic; padding:0.5rem 0; }

.form__row--group { display:flex; flex-wrap:wrap; gap:1rem; }

.form__group { flex:1; min-width:150px; }

.form__row--center { display:flex; justify-content:center; align-items:center; gap:2rem; }

/* == Reminders (SirPix³) – light & wow (WIDE+) [SCOPED] =================== */

/* Overlay scuro con blur */
#reminders-container ~ #reminders-overlay,
#reminders-overlay { position:fixed; inset:0; background:rgba(6, 8, 18, .60); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); z-index:calc(var(--z-modal) - 1); }

/* Contenitore centrale */
#reminders-container { position:fixed; inset:0; display:grid; place-items:center; z-index:var(--z-modal); padding:32px; }

/* Pannello (ancora più largo) */
#reminders-container .reminders-panel { width:min(1280px, 98vw); max-height:min(86vh, 1000px); display:grid; grid-template-rows:auto 1fr; background:var(--card); border:1px solid color-mix(in oklab, var(--brand) 28%, var(--line)); border-radius:calc(var(--radius) + 8px); box-shadow:0 26px 84px rgba(0,0,0,.55), var(--shadow); overflow:hidden; animation:remIn .16s ease-out; }

/* Header */
#reminders-container .reminders-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 20px; background:linear-gradient(180deg,
    color-mix(in oklab, var(--brand) 22%, transparent), transparent 75%); border-bottom:1px solid var(--line); }

#reminders-container .reminders-title { margin:0; font-size:18px; font-weight:900; letter-spacing:.2px; color:var(--text); }

#reminders-container .reminders-silence-all { height:40px; padding:0 16px; border-radius:10px; }

/* Lista */
#reminders-container .reminders-list { margin:0; padding:18px 20px; list-style:none; overflow:auto; display:flex; flex-direction:column; gap:16px; }

/* -------- Item chiaro e luminoso ---------------------------------------- */
#reminders-container .reminder-item { --rem-card:#f7f8fb; --rem-text:#0f1222; --rem-muted:#5c6279; --rem-border:#e6e8f0; --accent:var(--brand); position:relative; display:grid; grid-template-columns:1fr auto; gap:12px 18px; background:radial-gradient(700px 140px at 0% 0%,
      color-mix(in oklab, var(--accent) 14%, #fff) 0%, transparent 60%),
    var(--rem-card); color:var(--rem-text); border:1px solid var(--rem-border); border-radius:calc(var(--radius) + 2px); padding:18px 20px 18px 22px; box-shadow:0 1px 0 rgba(255,255,255,.7) inset, 0 18px 36px rgba(0,0,0,.10); transition:box-shadow .18s ease, transform .18s ease, border-color .18s ease; overflow:hidden; }

/* Barra di accento a sinistra con glow */
#reminders-container .reminder-item::before { content:""; position:absolute; left:0; top:0; bottom:0; width:6px; background:linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 85%, #ffffff) 0%, var(--accent) 100%); filter:drop-shadow(0 0 10px color-mix(in oklab, var(--accent) 55%, transparent)); }

#reminders-container .reminder-item:hover { box-shadow:0 1px 0 rgba(255,255,255,.9) inset,
    0 24px 48px rgba(0,0,0,.16),
    0 0 0 2px color-mix(in oklab, var(--accent) 24%, transparent); transform:translateY(-1px); }

/* Colori per frequenza */
#reminders-container .reminder-item.is-daily { --accent:#39a9ff; }

#reminders-container .reminder-item.is-weekly { --accent:#3ed66b; }

#reminders-container .reminder-item.is-monthly { --accent:#ff9a2b; }

#reminders-container .reminder-item.is-other { --accent:#a06bff; }

/* Head + pill */
#reminders-container .reminder-item__head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }

#reminders-container .reminder-item__title { font-weight:900; font-size:1.12rem; margin:0; line-height:1.24; }

#reminders-container .reminder-item__desc { color:var(--rem-muted); margin-top:8px; }

#reminders-container .reminder-item__content { grid-column:1 / -1; }

/* Pill (SCOPED: rem-pill / rem-pills) */
#reminders-container .rem-pills { display:inline-flex; gap:10px; flex-wrap:wrap; }

#reminders-container .rem-pill { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 12px; border-radius:999px; font-size:12.5px; font-weight:800; letter-spacing:.2px; color:var(--rem-text); background:#ffffff; border:1px solid #e7e9f2; box-shadow:0 1px 0 rgba(255,255,255,.8) inset, 0 2px 6px rgba(16,22,48,.06); }

#reminders-container .rem-pill--brand { background:color-mix(in oklab, var(--accent) 18%, #fff); border-color:color-mix(in oklab, var(--accent) 36%, #e7e9f2); }

/* Azioni */
#reminders-container .reminder-item__actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-self:end; }

/* Pulsanti SCOPED */
#reminders-container .rem-btn { display:inline-flex; align-items:center; gap:8px; height:38px; padding:0 16px; border-radius:10px; font-size:.95rem; font-weight:800; letter-spacing:.2px; color:#101421; border:1px solid transparent; cursor:pointer; transition:transform .12s ease, box-shadow .12s ease, filter .12s ease; }

#reminders-container .rem-btn:active { transform:translateY(1px); }

/* fino a domani → arancio */
#reminders-container .rem-btn--tomorrow { background:linear-gradient(180deg, #ffb657, #ff9822); border-color:#ff8e0e; color:#291300; box-shadow:0 2px 0 rgba(255,255,255,.6) inset, 0 6px 16px rgba(255,152,34,.35); }

#reminders-container .rem-btn--tomorrow:hover { filter:brightness(1.02); box-shadow:0 2px 0 rgba(255,255,255,.7) inset, 0 8px 20px rgba(255,152,34,.45); }

/* per sempre → verde */
#reminders-container .rem-btn--forever { background:linear-gradient(180deg, #69e18a, #34c759); border-color:#22b24a; color:#00240e; box-shadow:0 2px 0 rgba(255,255,255,.6) inset, 0 6px 16px rgba(52,199,89,.32); }

#reminders-container .rem-btn--forever:hover { filter:brightness(1.02); box-shadow:0 2px 0 rgba(255,255,255,.7) inset, 0 8px 20px rgba(52,199,89,.44); }

/* Animazione ingresso */
@keyframes remIn { from { transform: translateY(8px); opacity: .0; } to { transform: translateY(0); opacity: 1; } }

/* Mobile */
@media (max-width: 720px) {
  #reminders-container { padding: 14px; }
  #reminders-container .reminders-panel { width: 96vw; max-height: 78vh; }
  #reminders-container .reminder-item { grid-template-columns: 1fr; }
  #reminders-container .reminder-item__actions { justify-self: start; }
}

/* ==========================================================================
   SirPix³ — Pagination (Kaminari) — global style
   Aderente a: var(--brand), --text, --line, --card, --radius, --shadow
   ========================================================================== */

nav.pagination[role="navigation"] { --pg-gap:8px; --pg-h:36px; --pg-pad-x:12px; --pg-radius:calc(var(--radius) + 6px); --pg-bg:var(--card); --pg-fg:var(--text); --pg-border:var(--line); --pg-bg-hover:color-mix(in oklab, var(--brand) 8%, var(--card)); --pg-border-hover:color-mix(in oklab, var(--brand) 28%, var(--line)); --pg-current-bg:var(--brand); --pg-current-fg:#fff; --pg-shadow:var(--shadow); display:flex; align-items:center; justify-content:center; gap:var(--pg-gap); padding:10px 0; user-select:none; }

nav.pagination .page,
nav.pagination .prev,
nav.pagination .next,
nav.pagination .first,
nav.pagination .last,
nav.pagination .gap { display:inline-flex; align-items:center; justify-content:center; height:var(--pg-h); min-width:var(--pg-h); padding:0 var(--pg-pad-x); font-weight:700; font-size:.95rem; color:var(--pg-fg); background:var(--pg-bg); border:1px solid var(--pg-border); border-radius:var(--pg-radius); box-shadow:0 1px 0 rgba(255,255,255,.5) inset; }

nav.pagination .page a,
nav.pagination .prev a,
nav.pagination .next a,
nav.pagination .first a,
nav.pagination .last a { display:inline-flex; align-items:center; justify-content:center; height:100%; color:inherit; text-decoration:none; font-weight:700; padding:0 2px; }

/* Hover + focus (link) */
nav.pagination a:hover { color:var(--pg-fg); }

nav.pagination .page a:hover,
nav.pagination .prev a:hover,
nav.pagination .next a:hover,
nav.pagination .first a:hover,
nav.pagination .last a:hover { background:var(--pg-bg-hover); border-color:var(--pg-border-hover); }

nav.pagination a:focus-visible { outline:2px solid color-mix(in oklab, var(--brand) 52%, transparent); outline-offset:2px; border-radius:calc(var(--pg-radius) - 2px); }

/* Corrente */
nav.pagination .page.current { background:var(--pg-current-bg); color:var(--pg-current-fg); border-color:color-mix(in oklab, var(--pg-current-bg) 72%, black); box-shadow:0 1px 0 rgba(255,255,255,.35) inset, var(--pg-shadow); cursor:default; }

/* Gap “…” */
nav.pagination .gap { padding:0 10px; background:transparent; border:1px dashed var(--pg-border); color:color-mix(in oklab, var(--pg-fg) 72%, transparent); }

/* Disabled (quando Kaminari rende .disabled) */
nav.pagination .prev.disabled,
nav.pagination .next.disabled,
nav.pagination .first.disabled,
nav.pagination .last.disabled { opacity:.45; pointer-events:none; background:color-mix(in oklab, var(--pg-bg) 70%, #0000); }

/* Variante compatta (opzionale): aggiungi .is-compact su <nav> per liste dense */
nav.pagination.is-compact { --pg-gap:6px; --pg-h:32px; --pg-pad-x:10px; font-size:.9rem; }

/* Mobile: rendi tutto più “tap-friendly” e centrato */
@media (max-width: 480px) {
  nav.pagination[role="navigation"]{ flex-wrap: wrap; gap: 6px; padding: 8px 0 14px; }
  nav.pagination .page,
  nav.pagination .prev,
  nav.pagination .next,
  nav.pagination .first,
  nav.pagination .last{ height: 40px; min-width: 40px; padding: 0 12px; border-radius: calc(var(--radius) + 10px); }
  nav.pagination .gap{ padding: 0 8px; border-style: dotted; }
}

/* Dark-mode friendly (se usi tema scuro via :root o data-theme) */
@media (prefers-color-scheme: dark) {
  nav.pagination[role="navigation"]{
    --pg-bg: color-mix(in oklab, #000 6%, var(--card));
    --pg-border: color-mix(in oklab, var(--line) 70%, #ffffff00);
    --pg-bg-hover: color-mix(in oklab, var(--brand) 14%, var(--pg-bg));
  }
}

/* Table Economic Analysis */
.table--economic-analysis { width:100%; }

.table--economic-analysis .table__head { width:100%; }

/* Celle: evita overflow e mantiene allineamento */
.table--economic-analysis .th,
.table--economic-analysis .td { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Testo e link coerenti con lo stile generale */
.table--economic-analysis .td a { color:inherit; text-decoration:none; }

.table--economic-analysis .td a:hover { text-decoration:underline; }

/* Griglia comune per head e body */
.table--economic-analysis .table__head .table__row,
.table--economic-analysis .table__row--head,
.table--economic-analysis .table__body .table__row { display:grid; grid-template-columns:1.4fr   
    0.8fr   
    1fr     
    1fr     
    1fr     
    1.2fr   
    1.2fr   
    1.3fr; align-items:center; gap:12px; min-width:0; }

/* Centra i valori numerici */
.table--economic-analysis .th--center,
.table--economic-analysis .td--center { text-align:center; }

/* Versione compatta per schermi medi */
@media (max-width: 1366px) {
  .table--economic-analysis .table__head .table__row,
  .table--economic-analysis .table__row--head,
  .table--economic-analysis .table__body .table__row {
    grid-template-columns:
      1.3fr 0.8fr 0.9fr 0.9fr 0.9fr 1.1fr 1.1fr 1.2fr;
    gap: 10px;
  }
}

/* Versione mobile semplificata (scroll orizzontale consigliato) */
@media (max-width: 900px) {
  .table--economic-analysis {
    overflow-x: auto;
    display: block;
  }

  .table--economic-analysis .table__head .table__row,
  .table--economic-analysis .table__body .table__row {
    min-width: 900px;
  }
}

.toast { border-radius:12px; font-weight:500; padding:1rem 1.25rem; box-shadow:0 8px 16px rgba(0,0,0,0.12); border:none; }

.toast-success { background:linear-gradient(135deg, #22c55e, #16a34a); color:#fff !important; }

.toast-error { background:linear-gradient(135deg, #ef4444, #b91c1c); color:#fff !important; }

.toast-info { background:linear-gradient(135deg, #3b82f6, #1d4ed8); color:#fff !important; }

.toast-warning { background:linear-gradient(135deg, #facc15, #ca8a04); color:#222 !important; }

#toast-container { position:fixed !important; top:80px !important; right:100px !important; z-index:9999 !important; }

/* ================================
   SirPix³ — Tasks Attachments Modal (scoped)
   Scope: solo dentro #modal (turbo-frame del dialog)
   ================================ */

/* -- card & layout -- */
#modal .modal__card { background:var(--card,#101114); color:var(--text,#eef0f3); border:1px solid var(--border,#2a2d34); border-radius:var(--radius,14px); box-shadow:var(--shadow-2,0 10px 30px rgba(0,0,0,.35)); max-width:min(980px,92vw); width:100%; margin-inline:auto; overflow:hidden; }

#modal .modal__head { display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--border,#2a2d34); background:linear-gradient(0deg,transparent,rgba(255,255,255,.02)); }

#modal .modal__title { font-size:16px; line-height:1.2; font-weight:700; margin:0; letter-spacing:.2px; }

#modal .modal__close { appearance:none; border:0; background:transparent; color:var(--muted,#9aa2ad); font-size:22px; line-height:1; padding:6px; cursor:pointer; border-radius:10px; }

#modal .modal__close:hover { background:rgba(255,255,255,.06); color:var(--text,#eef0f3); }

#modal .modal__close:focus-visible { outline:2px solid var(--brand,#4da3ff); outline-offset:2px; }

#modal .modal__body { padding:18px; display:grid; gap:16px; max-height:min(70vh,720px); overflow:auto; background:var(--surface,transparent); }

#modal .modal__foot { display:flex; justify-content:flex-end; gap:10px; padding:14px 18px; border-top:1px solid var(--border,#2a2d34); background:linear-gradient(180deg,transparent,rgba(255,255,255,.02)); }

/* -- sections & headings -- */
#modal .section-title { font-size:13px; letter-spacing:.25px; font-weight:700; color:var(--muted,#a8b0ba); text-transform:uppercase; margin:8px 0 0 0; }

/* -- chips & buttons -- */
#modal .chip { vertical-align:middle; }

#modal .btn { background:var(--brand,#4da3ff); color:#fff; border:0; border-radius:calc(var(--radius,14px) - 6px); padding:8px 12px; font-weight:600; cursor:pointer; }

#modal .btn:hover { filter:brightness(.96); }

#modal .btn:focus-visible { outline:2px solid var(--brand,#4da3ff); outline-offset:2px; }

/* -- grid anteprime immagini -- */
#modal .thumbs-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:10px; }

#modal .thumb { background:rgba(255,255,255,.03); border:1px solid var(--border,#2a2d34); border-radius:calc(var(--radius,14px) - 6px); overflow:hidden; display:flex; flex-direction:column; }

#modal .thumb a { display:block; aspect-ratio:4/3; max-height:160px; overflow:hidden; }

#modal .thumb img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .2s ease; }

#modal .thumb:hover img { transform:scale(1.02); }

#modal .thumb__name { padding:8px 10px; font-size:12px; color:var(--muted,#a8b0ba); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border-top:1px solid var(--border,#2a2d34); }

/* -- lista file non immagine -- */
#modal .file-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; }

#modal .file-list__item { display:flex; align-items:center; justify-content:space-between; gap:10px; background:rgba(255,255,255,.03); border:1px solid var(--border,#2a2d34); border-radius:calc(var(--radius,14px) - 6px); padding:10px 12px; }

#modal .file-list__name { font-size:13px; color:var(--text,#eef0f3); opacity:.9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

#modal .file-list__item .chip { white-space:nowrap; }

/* -- empty state -- */
#modal .empty-hint { padding:14px 12px; border:1px dashed var(--border,#2a2d34); border-radius:calc(var(--radius,14px) - 6px); font-size:13px; color:var(--muted,#9aa2ad); text-align:center; }

/* -- small screens -- */
@media (max-width:640px) {
  #modal .modal__head{padding:12px 14px;}
  #modal .modal__body{padding:14px;}
  #modal .modal__title{font-size:15px;}
  #modal .thumbs-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* ================================
   SirPix³ — modal shell (dialog)
   ================================ */
dialog#app-modal[open] { padding:0; border:0; background:transparent; }

dialog#app-modal::backdrop { background:rgba(8,9,12,.65); backdrop-filter:saturate(120%) blur(2px); }

/* ================================
   SirPix³ — modal widen + max-height
   ================================ */
#modal .modal__card { max-width:min(1180px,96vw); }

#modal .modal__body { max-height:min(78vh,820px); }

@media (min-width:1440px) {
  #modal .modal__card { max-width:min(1320px,96vw); }
  #modal .thumb a { max-height:180px; }
}

/* ================================
   SirPix³ — Tasks Index badges (safe)
   ================================ */
#tasks-index .task-location { display:inline-flex; align-items:center; gap:.4rem; vertical-align:middle; }

#tasks-index .task-location + .chip { margin-left:.4rem; }

#tasks-index .task-location ~ .chip + .chip { margin-left:.3rem; }

#tasks-index .chip { vertical-align:middle; text-decoration:none; }

#tasks-index a.chip:focus-visible { outline:2px solid var(--brand,#4da3ff); outline-offset:2px; }

#tasks-index .chip .icon { display:inline-block; vertical-align:middle; }

/* ================================
   SirPix³ — Badge Note & Allegati (global)
   ================================ */
.task-note { --c:var(--accent-amber,#ffd666); display:inline-block; vertical-align:middle; padding:2px 8px; border-radius:6px; font-size:12px; font-weight:600; letter-spacing:.2px; line-height:1.6; text-decoration:none; user-select:none; border:1px dashed color-mix(in srgb,var(--c) 35%,transparent); background:color-mix(in srgb,var(--c) 14%,transparent); color:color-mix(in srgb,var(--c) 85%,white 15%); }

.task-note:hover { background:color-mix(in srgb,var(--c) 20%,transparent); }

.task-attach { --c:var(--brand,#4da3ff); display:inline-block; vertical-align:middle; padding:2px 8px; border-radius:6px; font-size:12px; font-weight:600; letter-spacing:.2px; line-height:1.6; text-decoration:none; user-select:none; border:1px dashed color-mix(in srgb,var(--c) 35%,transparent); background:color-mix(in srgb,var(--c) 14%,transparent); color:color-mix(in srgb,var(--c) 85%,white 15%); }

.task-attach:hover { background:color-mix(in srgb,var(--c) 20%,transparent); }

.task-location+.task-note { margin-left:.4rem; }

.task-location+.task-attach { margin-left:.4rem; }

.task-note+.task-attach { margin-left:.3rem; }

/* Table Calendar Lists - Inline e coerente con SirPix³ */
.table--calendar-lists { width:100%; margin-bottom:40px; }

/* spazio sotto tabella */
.table--calendar-lists .table__head { width:100%; }

.table--calendar-lists .th,
.table--calendar-lists .td { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.table--calendar-lists .td a { color:inherit; text-decoration:none; }

.table--calendar-lists .td a:hover { text-decoration:underline; }

/* Header e body usano la stessa griglia */
.table--calendar-lists .table__head .table__row,
.table--calendar-lists .table__row--head,
.table--calendar-lists .table__body .table__row { display:grid; grid-template-columns:1.8fr 2.2fr 90px 130px 130px 180px; align-items:center; gap:12px; min-width:0; }

/* Celle centrate e azioni a destra */
.table--calendar-lists .th.th--center,
.table--calendar-lists .td.td--center { text-align:center; }

.table--calendar-lists .th.th--actions,
.table--calendar-lists .td.td--actions { justify-self:end; }

/* Badge */
.table--calendar-lists .badge { display:inline-block; padding:3px 8px; border-radius:12px; font-size:12px; font-weight:500; }

.table--calendar-lists .badge--ok { background:var(--success-bg, #d1fae5); color:var(--success-text, #065f46); }

.table--calendar-lists .badge--neutral { background:var(--muted-bg, #f3f4f6); color:var(--muted-text, #6b7280); }

/* Azioni */
.table--calendar-lists .td--actions { justify-self:end; white-space:nowrap; }

.table--calendar-lists .td--actions .row-actions { display:flex; flex-direction:row; align-items:center; gap:8px; flex-wrap:nowrap; white-space:nowrap; }

/* Bottone "Nuovo" in alto a destra */
.page-head__inner { display:flex; align-items:center; justify-content:space-between; }

/* Responsività */
@media (max-width: 1366px) {
  .table--calendar-lists .table__head .table__row,
  .table--calendar-lists .table__row--head,
  .table--calendar-lists .table__body .table__row {
    grid-template-columns: 1.6fr 2fr 80px 110px 110px 160px;
    gap: 10px;
  }
}

@media (max-width: 1024px) {
  .table--calendar-lists .table__head .table__row,
  .table--calendar-lists .table__row--head,
  .table--calendar-lists .table__body .table__row { grid-template-columns:1.5fr 2fr 70px 1fr 1fr; }
  .table--calendar-lists .th:nth-child(6),
  .table--calendar-lists .td:nth-child(6) { display:none; }
}

/* Allinea a destra le azioni nella testata impostazioni software */
.sws-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; }

.sws-head__titles { flex:1; }

.page-actions { display:flex; justify-content:flex-end; gap:12px; align-items:center; }

/* ===========================
   TABELLA PROMEMORIA
   =========================== */

.table--reminders {
  width: 100%;
  border-collapse: collapse;
}

.table--reminders .table__row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1.2fr 2fr 1fr;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease-in-out;
}

.table--reminders .table__row:hover {
  background-color: var(--hover);
}

.table--reminders .table__row--head {
  font-weight: 600;
  color: var(--text-strong);
  background-color: var(--card);
  border-bottom: 2px solid var(--border-strong);
  text-transform: uppercase;
  font-size: 0.85rem;
}

.table--reminders .th,
.table--reminders .td {
  padding: 0.4rem 0.6rem;
  overflow-wrap: anywhere;
}

.table--reminders .td--center {
  text-align: center;
}

.table--reminders .badge-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.table--reminders .badge-group:last-child {
  margin-bottom: 0;
}

/* ===========================
   TOOLBAR CHECKBOX (Filtro)
   =========================== */

.toolbar__checkbox { display:flex; align-items:center; gap:6px; margin-left:10px; font-size:0.9rem; color:var(--text-muted); }

.toolbar__checkbox .checkbox { width:18px; height:18px; cursor:pointer; accent-color:var(--brand); transform:translateY(1px); }

.checkbox-inline { display:flex; align-items:center; gap:6px; }

/* Per rendere il layout reattivo */
@media (max-width: 992px) {
  .table--reminders .table__row {
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1.5fr 0.8fr;
  }

  .toolbar__checkbox {
    margin-top: 8px;
    margin-left: 0;
  }
}

.form-note { --c:var(--accent-amber,#ffd666); display:block; margin:.5rem 0; padding:.6rem .75rem; border-radius:8px; font-size:.95rem; line-height:1.4; font-weight:600; letter-spacing:.2px; background:color-mix(in srgb,var(--c) 14%,transparent); border:1px dashed color-mix(in srgb,var(--c) 35%,transparent); color:color-mix(in srgb,var(--c) 85%,white 15%); }

/* === TomSelect Integration (SirPix³) === */

/* Assicura che il wrapper prenda tutta la larghezza del campo */
.form__row .ts-wrapper { width:100%; }

/* Wrapper principale */
.ts-wrapper.form__control { padding:0; border:1px solid rgba(255, 255, 255, .12) !important; border-radius:12px !important; background:#0e0f18; color:var(--text); outline:none; box-shadow:none; min-height:42px; height:auto; appearance:none; }

/* Focus state */
.ts-wrapper.form__control.focus,
.ts-wrapper.form__control.input-active { border-color:rgba(124, 92, 255, .6); box-shadow:0 0 0 3px rgba(124, 92, 255, .15); }

/* Area visibile del controllo */
.ts-control { background:#0e0f18 !important; border:none !important; padding:6px 12px; border-radius:12px; color:var(--text); display:flex; flex-wrap:wrap; align-items:center; min-height:40px; line-height:1.3; cursor:text; }

/* Input interno (digitazione singola o multipla) */
.ts-control input { background:transparent; color:#fff !important; border:none; outline:none; box-shadow:none; padding:0; flex-grow:1; height:22px; min-width:40px; }

/* Placeholder coerente */
.ts-control input::placeholder { color:rgba(255, 255, 255, 0.5); }

/* Dropdown */
.ts-dropdown { background:#0e0f18 !important; border:1px solid rgba(255, 255, 255, .12); border-radius:12px; box-shadow:0 6px 12px rgba(0, 0, 0, .4); margin-top:4px; overflow:hidden; z-index:var(--z-modal); }

/* Opzioni del menu */
.ts-dropdown .option { padding:10px 12px; color:var(--text) !important; cursor:pointer; transition:background .15s ease; }

.ts-dropdown .option.active,
.ts-dropdown .option:hover { background:var(--chip-brand-bg); color:#fff; }

.ts-dropdown .option.selected { background:rgba(124, 92, 255, .25); color:#fff; }

.ts-dropdown .option.disabled { opacity:0.5; cursor:not-allowed; }

/* === Multi-select items (dark theme) === */
.ts-wrapper.form__control.multi .ts-control > div { cursor:pointer; margin:0 3px 3px 0; padding:4px 8px; background:rgba(124, 92, 255, .18); color:#fff; border:none; border-radius:8px; font-size:14px; line-height:1.2; transition:background .15s ease, color .15s ease; }

.ts-wrapper.form__control.multi .ts-control > div:hover { background:rgba(124, 92, 255, .25); }

.ts-wrapper.form__control.multi.input-active .ts-control > div { background:rgba(124, 92, 255, .3); }

/* Rimozione (X) coerente */
.ts-wrapper.form__control.multi .ts-control > div .remove { color:#fff; margin-left:6px; font-weight:bold; opacity:0.7; transition:opacity .15s ease; cursor:pointer; }

.ts-wrapper.form__control.multi .ts-control > div .remove:hover { opacity:1; }

/* Items selezionati (fallback generico, single o multi) */
.ts-control .item { display:inline-flex; align-items:center; background:rgba(124, 92, 255, .18); color:#fff; padding:5px 8px !important; border-radius:8px; margin:2px 4px 2px 0; font-size:14px; line-height:1.2; transition:background .15s ease; }

.ts-control .item:hover { background:rgba(124, 92, 255, .25); }

/* Pulsante di rimozione per item (anche single) */
.ts-control .item .remove { color:#fff; margin-left:6px; cursor:pointer; font-weight:bold; opacity:0.7; transition:opacity .15s ease; }

.ts-control .item .remove:hover { opacity:1; }

/* Freccia dropdown */
.ts-wrapper.form__control.single .ts-control::after { content:""; position:absolute; right:12px; top:50%; margin-top:-2px; border:5px solid transparent; border-top-color:var(--muted); pointer-events:none; transition:transform .15s ease; }

.ts-wrapper.form__control.single.dropdown-active .ts-control::after { transform:rotate(180deg); }

/* === Multi-select typing color fix === */
.ts-wrapper.form__control.multi .ts-control { background:#0e0f18 !important; color:#fff; }

.ts-wrapper.form__control.multi .ts-control input { color:#fff !important; background:transparent; }

.ts-wrapper.form__control.multi .ts-control input::placeholder { color:rgba(255, 255, 255, 0.5); }

/* Sovrascrive lo stile default di Tom Select per gli item multipli */
.ts-wrapper.multi .ts-control > div { background:rgba(124, 92, 255, .18) !important; color:#fff !important; cursor:pointer; margin:0 3px 3px 0; padding:2px 6px; border:none !important; }

.qr-container { display:flex; justify-content:center; align-items:center; margin:2rem auto; padding:0; overflow:visible; text-align:center; }

.qr-wrapper { background:#ffffff; padding:12px; border-radius:8px; box-shadow:0 0 10px rgba(0, 0, 0, 0.15); display:inline-block; max-width:100%; }

.qr-wrapper svg { display:block; height:auto; width:auto; max-width:350px; max-height:350px; margin:0 auto; }

/* ============================
   Cyber Items Table (scoped)
   ============================ */

.cyber-page .table--cyber-items { --cols:.4fr 2fr 3fr .7fr 1fr; }

.cyber-page .table--cyber-items .table__row { grid-template-columns:var(--cols); }

.cyber-page .table--cyber-items .th--center,
.cyber-page .table--cyber-items .td--center { text-align:center; }

.cyber-page .table--cyber-items .td--actions { white-space:nowrap; }

.cyber-page .table--cyber-items .row-actions { display:flex; flex-wrap:nowrap; gap:6px; }

.cyber-page .table--cyber-items .chip { padding:4px 10px; font-size:12px; white-space:nowrap; }

.cyber-page .table--cyber-items .td--desc { overflow:hidden; text-overflow:ellipsis; }

.cyber-page .table--cyber-items .td--title { font-weight:600; }

.cyber-page .ref-icon { font-size:18px; font-weight:bold; }

.cyber-page .ref-icon--ok { color:#27ae60; }

.cyber-page .ref-icon--no { color:#e74c3c; }

/* ===== Form elements (scoped) ===== */

.cyber-page .form__image-preview { border-radius:8px; margin-bottom:10px; box-shadow:0 0 6px rgba(0,0,0,.15); max-width:100%; height:auto; }

.cyber-page .form__control--multiselect { min-height:180px; }

/* ===== Rende il Trix Editor identico agli altri campi nei moduli Cyber ===== */
.cyber-richtext-resizable .trix-content { min-height:150px; resize:vertical; overflow:auto; background:#0d0d0d; border:1px solid #444; padding:10px; border-radius:6px; color:#fff; }

/* ===== Hover e Focus per uniformità con .form__control ===================== */
.cyber-richtext-resizable .trix-content:focus { border-color:#666; outline:none; }

/* ===== Placeholder stile input ============================================ */
.cyber-richtext-resizable .trix-content:empty:before { content:attr(data-placeholder); color:#777; }

/* === Table Cyber Sessions (senza descrizione) ============================ */
.cyber-table--sessions { --cols:2fr .6fr .8fr; }

.cyber-table--sessions .table__row { grid-template-columns:2fr .6fr .8fr; }

/* ========================================================================== */
/*                 Cyber Templates Table (scoped)                              */
/* ========================================================================== */

.cyber-page .table--cyber-templates { --cols:3fr .7fr .9fr; }

.cyber-page .table--cyber-templates .table__row { grid-template-columns:var(--cols); }

.cyber-page .table--cyber-templates .td--center,
.cyber-page .table--cyber-templates .th--center { text-align:center; justify-content:center; }

.cyber-page .table--cyber-templates .td--actions { white-space:nowrap; }

.cyber-page .table--cyber-templates .row-actions { display:flex; flex-wrap:nowrap; gap:6px; }

.cyber-page .table--cyber-templates .chip { padding:4px 10px; font-size:12px; white-space:nowrap; }

/* Numero sessioni come pill */
.cyber-page .table--cyber-templates .pill { padding:4px 8px; font-size:12px; }

/* ========================================================================== */
/*                 Form Template Cybersecurity                                */
/* ========================================================================== */

.cyber-page .template-form .form__row { margin-bottom:20px; }

.cyber-page .template-form .form__control { background:#0d0d0d; border:1px solid #444; color:#fff; }

.cyber-page .template-form .form__control:focus { border-color:#666; }

.cyber-page .template-form .form__label { margin-bottom:6px; font-weight:500; display:inline-block; }

.cyber-page .template-form .form__actions { margin-top:20px; }

.cyber-session-boxes { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px; margin-top:10px; }

.cyber-session-box { background:#0d0d0d; border:1px solid #333; padding:12px; border-radius:8px; cursor:pointer; display:flex; flex-direction:column; justify-content:space-between; min-height:90px; transition:border-color .2s, background-color .2s; position:relative; }

.cyber-session-box__title { font-size:14px; font-weight:600; color:#fff; margin-bottom:8px; }

.cyber-session-box__icon { position:absolute; top:8px; right:8px; font-size:20px; }

.icon-ok { color:#27ae60; font-weight:bold; }

.icon-no { color:#e74c3c; font-weight:bold; }

.cyber-session-box__input { display:none; }

.cyber-session-box.is-selected { border-color:#27ae60; background:#111; }

/* ===== DND Layout principale ===== */
.cyber-dnd-page { display:grid; grid-template-columns:260px 1fr; gap:20px; }

/* ===== Items list (sinistra) ===== */
.items-pool { background:#111; padding:15px; border:1px solid #333; border-radius:8px; max-height:80vh; overflow-y:auto; }

.items-list .item-card { background:#222; border:1px solid #444; padding:6px 10px; border-radius:6px; margin-bottom:6px; cursor:grab; font-size:13px; }

/* Stile per gli item con riferimento */
.items-list .item-card--linked { background:rgba(138, 43, 226, 0.25) !important; border:1px solid rgba(138, 43, 226, 0.4) !important; color:#e0d4ff !important; }

/* Icona link */
.item-link-icon { margin-left:8px; font-size:0.8rem; opacity:0.9; }

/* ===== Sessioni (destra) ===== */
.sessions-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:16px; }

/* BOX SESSIONE — altezza ridotta */
.session-column { background:#151515; border:1px solid #444; padding:10px; border-radius:8px; min-height:200px; max-height:400px; display:flex; flex-direction:column; }

.session-column.drag-over { border-color:#2980b9; background:#1a1a1a; }

/* Titolo più piccolo e compatto */
.session-column h3 { margin-bottom:8px; font-size:14px; font-weight:600; }

/* LISTA ITEM ALL’INTERNO DELLA SESSIONE */
.session-items { overflow-y:auto; flex-grow:1; max-height:300px; padding-right:5px; }

/* Oggetti assegnati */
.session-items .assigned-item { background:#1e1e1e; border:1px solid #444; padding:5px 8px; border-radius:6px; margin-bottom:4px; display:flex; justify-content:space-between; font-size:12px; }

/* Item assegnato con riferimento → stile viola come a sinistra */
.session-items .assigned-item--linked { background:rgba(138, 43, 226, 0.25) !important; border:1px solid rgba(138, 43, 226, 0.4) !important; color:#e0d4ff !important; }

/* Icona link */
.session-items .assigned-item--linked .item-link-icon { color:#d8c0ff; margin-right:6px; font-size:0.8rem; opacity:0.9; }

.remove-btn { background:none; border:none; color:#e74c3c; cursor:pointer; font-size:14px; }

/* ========================================================================== */
/*                 Cyber Reports Table (scoped)                               */
/* ========================================================================== */

.cyber-page .table--cyber-reports { --cols:minmax(320px,2fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(470px,1.8fr); overflow:visible; }

.cyber-page .table--cyber-reports .table__head .table__row, .cyber-page .table--cyber-reports .table__row--head, .cyber-page .table--cyber-reports .table__body .table__row { display:grid; grid-template-columns:var(--cols); align-items:center; gap:14px; min-width:0; }

.cyber-page .table--cyber-reports .th, .cyber-page .table--cyber-reports .td { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.cyber-page .table--cyber-reports .td--title { font-weight:600; }

.cyber-page .table--cyber-reports .td:nth-child(2), .cyber-page .table--cyber-reports .td:nth-child(3) { display:flex; align-items:center; justify-content:center; }

.cyber-page .table--cyber-reports .td:nth-child(4) { display:flex; align-items:center; justify-content:flex-start; }

.cyber-page .table--cyber-reports .pill { min-width:140px; justify-content:center; text-align:center; }

.cyber-page .table--cyber-reports .td--actions { justify-self:end; overflow:visible; white-space:nowrap; }

.cyber-page .table--cyber-reports .td--actions .row-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; align-items:center; gap:8px; white-space:nowrap; }

.cyber-page .table--cyber-reports .td--actions .btn, .cyber-page .table--cyber-reports .td--actions .chip { height:44px; padding:0 12px; font-size:13px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; white-space:nowrap; }

.cyber-page .table--cyber-reports .td--actions .btn { background:var(--card_lighter); color:var(--text); border:1px solid var(--line); text-decoration:none; }

.cyber-page .table--cyber-reports .td--actions .btn:hover { background:rgba(255,255,255,.08); }

@media (max-width:1366px) { .cyber-page .table--cyber-reports { --cols:minmax(280px,1.8fr) minmax(130px,.7fr) minmax(130px,.7fr) minmax(130px,.7fr) minmax(440px,1.7fr); } .cyber-page .table--cyber-reports .table__head .table__row, .cyber-page .table--cyber-reports .table__row--head, .cyber-page .table--cyber-reports .table__body .table__row { gap:10px; } .cyber-page .table--cyber-reports .td--actions .btn, .cyber-page .table--cyber-reports .td--actions .chip { padding:0 10px; font-size:12px; } }

@media (max-width:1100px) { .cyber-page .table--cyber-reports { overflow-x:auto; } .cyber-page .table--cyber-reports .table__head .table__row, .cyber-page .table--cyber-reports .table__row--head, .cyber-page .table--cyber-reports .table__body .table__row { min-width:1250px; } }

/***************************************************
 * CYBER MODAL (dark theme)
 ***************************************************/

/* Sfondo oscurato */
.cyber-modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,0.65); z-index:9000 !important; backdrop-filter:blur(2px); animation:cyber-fade-in 0.2s ease-out; }

/* Contenitore del modal */
.cyber-modal { position:fixed; top:50%; left:50%; transform:translate(-50%, -50%); background:#111; color:#eee; width:min(1400px, 98vw); max-width:1400px; max-height:95vh; overflow-y:auto; border-radius:10px; padding:20px; z-index:9001 !important; box-shadow:0 12px 40px rgba(0,0,0,0.75); animation:cyber-zoom-in 0.15s ease-out; }

/* Header del modal */
.cyber-modal__header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; border-bottom:1px solid #333; padding-bottom:8px; }

.cyber-modal__title { font-size:1.4rem; font-weight:600; color:#fff; }

/* Bottone chiusura */
.cyber-modal__close { background:transparent; border:none; font-size:22px; color:#bbb; cursor:pointer; transition:0.15s; }

.cyber-modal__close:hover { color:#fff; transform:scale(1.15); }

/* Corpo del modal */
.cyber-modal__body { margin-top:10px; }

/* Form group */
.cyber-form-group { margin-bottom:20px; }

.cyber-form-group label { display:block; margin-bottom:6px; font-weight:500; color:#ccc; }

/* Rich text editor */
.cyber-richtext { background:#222 !important; color:#eee !important; border-radius:6px; padding:10px; min-height:auto !important; height:auto !important; resize:vertical; }

/* 👉 Altezza minima quando è vuoto (≈ 3 righe) */
.cyber-richtext:empty:not(:focus)::before { content:attr(placeholder); color:#777; }

.cyber-richtext:empty { min-height:3.2em !important; display:block; }

/* Checkbox implementazione */
.cyber-flags label { display:inline-flex; align-items:center; gap:6px; margin-right:18px; color:#ddd; }

/* File upload */
.cyber-file { background:#222; color:#ccc; border-radius:6px; padding:8px; }

/* Lista documenti allegati */
.cyber-doc-list { margin-top:12px; padding-left:18px; }

.cyber-doc-list li { margin-bottom:6px; }

.cyber-doc-list a { color:#4da3ff; text-decoration:none; }

.cyber-doc-list a:hover { text-decoration:underline; }

/* Footer / Azioni */
.cyber-modal__actions { display:flex; justify-content:flex-end; gap:12px; margin-top:20px; }

/***************************************************
 * ANIMAZIONI
 ***************************************************/
@keyframes cyber-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cyber-zoom-in {
  from { opacity:0; transform:translate(-50%, -50%) scale(0.92); }
  to { opacity:1; transform:translate(-50%, -50%) scale(1); }
}

.cyber-doc-item { display:flex; justify-content:space-between; align-items:center; padding:4px 0; }

.cyber-doc-remove { color:#e74c3c; font-size:18px; font-weight:bold; margin-left:12px; text-decoration:none; cursor:pointer; }

.cyber-doc-remove:hover { color:#ff6b6b; }

/*-----------------------------------------------------*/
.table.table--customers-missing-hourly-rate { width:100%; }

/* La tabella è costruita a div: rendiamo la row una griglia coerente */
.table--customers-missing-hourly-rate .table__row { display:grid; grid-template-columns:1.6fr 0.7fr 0.6fr 0.9fr; gap:12px; align-items:center; padding:12px 14px; }

/* ============================================================
   Reports — Table: Interventions Analysis (date range)
   Class: .table--interventions-analysis
   ============================================================ */

.table.table--interventions-analysis { width:100%; }

/* Head + body rows */
.table--interventions-analysis .table__row { display:grid; grid-template-columns:0.5fr 0.5fr 0.5fr 0.5fr 0.5fr 3fr; gap:12px; align-items:center; padding:12px 14px; }

/* Header row */
.table--interventions-analysis .table__row--head { position:sticky; top:0; z-index:2; border-bottom:1px solid rgba(0, 0, 0, 0.10); padding-top:10px; padding-bottom:10px; }

.table--interventions-analysis .th { font-weight:700; font-size:13px; letter-spacing:0.2px; opacity:0.9; white-space:nowrap; }

/* Cells */
.table--interventions-analysis .td { font-size:14px; min-width:0; }

/* Center alignment helpers */
.table--interventions-analysis .th--center,
.table--interventions-analysis .td--center { text-align:center; }

.table--interventions-analysis .td--center { display:flex; justify-content:center; align-items:center; }

/* Body row separators + zebra + hover */
.table--interventions-analysis .table__body .table__row { border-bottom:1px solid rgba(0, 0, 0, 0.06); }

.table--interventions-analysis .table__body .table__row:nth-child(odd) { background:rgba(0, 0, 0, 0.02); }

.table--interventions-analysis .table__body .table__row:hover { background:rgba(0, 0, 0, 0.04); }

/* Description column: ellipsis (keeps row height tidy) */
.table--interventions-analysis .table__body .table__row .td:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Slight emphasis for key columns */
.table--interventions-analysis .table__body .table__row .td:nth-child(1) { font-weight:700; }

.table--interventions-analysis .table__body .table__row .td:nth-child(3) { font-weight:600; }

.table--interventions-analysis .table__row--group { background:rgba(0,0,0,0.06); border-bottom:1px solid rgba(0,0,0,0.1); }

.table--interventions-analysis .td--group { padding:4px 0; }

/* Responsive: collapse to “card rows” */
@media (max-width: 980px) {
  .table--interventions-analysis .table__row {grid-template-columns: 1fr; gap: 6px; align-items: start;}

  .table--interventions-analysis .table__row--head {display: none;}

  .table--interventions-analysis .td--center {justify-content: flex-start;}

  /* add simple labels on mobile using data attributes if you want
     (optional enhancement, not required) */
}

/* Optional: make table container scroll nicely on small screens */
@media (max-width: 720px) {
  .table-wrap .container {overflow-x: auto;}
}

/*---- backup dashboard ----*/

.backup-dashboard { padding:28px 0 60px; }
.backup-date-form { display:flex; gap:10px; align-items:center; }
.backup-date-input { max-width:170px; }
.backup-dashboard__grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px; margin-bottom:28px; }
.backup-card, .backup-table-card { background:var(--card); border:1px solid rgba(255,255,255,.10); border-radius:18px; box-shadow:var(--shadow); }
.backup-card { min-height:420px; padding:28px; }
.backup-card__title { margin:0 0 24px; font-size:20px; font-weight:800; color:var(--text); }
.backup-chart { width:170px; height:170px; border-radius:50%; margin:0 auto 26px; box-shadow:0 18px 40px rgba(0,0,0,.25); }
.backup-legend { display:grid; gap:12px; }
.backup-mini-list { display:grid; gap:12px; }
.backup-mini-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:16px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius:14px; }
.backup-mini-item > div { min-width:0; }
.backup-empty { display:flex; justify-content:center; align-items:center; min-height:86px; padding:18px; text-align:center; font-weight:800; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius:14px; }
.backup-table-card { overflow:hidden; }
.backup-table { width:100%; }
.backup-table__head, .backup-table__row { display:grid; grid-template-columns:minmax(280px,1.8fr) minmax(70px,.45fr) minmax(80px,.5fr) minmax(85px,.55fr) minmax(260px,1.4fr) minmax(80px,.5fr) minmax(80px,.5fr) minmax(80px,.5fr) minmax(90px,.55fr) minmax(170px,.9fr) minmax(130px,.75fr); align-items:center; gap:12px; }
.backup-table__head { padding:18px 24px; background:rgba(255,255,255,.12); border-bottom:1px solid rgba(255,255,255,.08); color:var(--text); font-size:12px; font-weight:800; text-transform:uppercase; }
.backup-table__row { min-height:86px; padding:16px 24px; border-top:1px solid rgba(255,255,255,.06); }
.backup-table__row:first-child { border-top:0; }
.backup-table__head > div:not(:first-child), .backup-table__row > div:not(:first-child) { text-align:center; }
.backup-client { min-width:0; }
.backup-client strong { display:block; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.backup-aliases { margin-top:7px; display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
.backup-aliases--center { justify-content:center; margin-top:0; }
.backup-date-cell { font-size:12px; line-height:1.35; white-space:normal; }
.backup-table .pill, .backup-mini-item .pill, .backup-legend .pill { max-width:100%; white-space:nowrap; }
.backup-table .pill { min-width:32px; justify-content:center; text-align:center; line-height:1; }
.backup-table .backup-aliases .pill { max-width:none; min-width:max-content; padding:3px 10px; overflow:visible; text-overflow:initial; white-space:nowrap; }
.backup-table__row > div { min-width:0; }
.backup-table__row > div:nth-child(2) .pill, .backup-table__row > div:nth-child(3) .pill, .backup-table__row > div:nth-child(4) .pill, .backup-table__row > div:nth-child(6) .pill, .backup-table__row > div:nth-child(7) .pill, .backup-table__row > div:nth-child(8) .pill, .backup-table__row > div:nth-child(9) .pill { width:32px; height:24px; padding:0; display:inline-flex; align-items:center; }
.backup-table__row > div:nth-child(11) .pill { min-width:72px; padding:4px 10px; }

@media (max-width:1500px) { .backup-dashboard__grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; } .backup-table__head, .backup-table__row { grid-template-columns:minmax(240px,1.6fr) minmax(60px,.45fr) minmax(70px,.5fr) minmax(75px,.55fr) minmax(230px,1.3fr) minmax(70px,.5fr) minmax(70px,.5fr) minmax(70px,.5fr) minmax(80px,.55fr) minmax(150px,.9fr) minmax(110px,.7fr); gap:10px; padding-left:18px; padding-right:18px; } }
@media (max-width:1300px) { .backup-dashboard__grid { grid-template-columns:1fr; } .backup-card { min-height:auto; } .backup-table__head { display:none; } .backup-table__row { grid-template-columns:1fr 1fr; gap:12px; min-height:auto; } .backup-table__row > div { text-align:left !important; } .backup-table__row > div::before { display:block; margin-bottom:4px; color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; } .backup-table__row > div:nth-child(1)::before { content:"Cliente"; } .backup-table__row > div:nth-child(2)::before { content:"Attesi"; } .backup-table__row > div:nth-child(3)::before { content:"Ricevuti"; } .backup-table__row > div:nth-child(4)::before { content:"Mancanti"; } .backup-table__row > div:nth-child(5)::before { content:"Alias mancanti"; } .backup-table__row > div:nth-child(6)::before { content:"Success"; } .backup-table__row > div:nth-child(7)::before { content:"Warning"; } .backup-table__row > div:nth-child(8)::before { content:"Failed"; } .backup-table__row > div:nth-child(9)::before { content:"Unknown"; } .backup-table__row > div:nth-child(10)::before { content:"Ultimo backup"; } .backup-table__row > div:nth-child(11)::before { content:"Stato"; } .backup-aliases--center { justify-content:flex-start; } }
@media (max-width:700px) { .backup-date-form { flex-direction:column; align-items:stretch; } .backup-date-input { max-width:none; } .backup-table__row { grid-template-columns:1fr; } .backup-mini-item { grid-template-columns:1fr; } }

/*---- backup emails ----*/

.backup-mails { padding:24px 0 60px; }
.backup-mail-filters { padding:18px; margin-bottom:24px; }
.backup-mail-filters__form { display:grid; grid-template-columns:minmax(260px,1.4fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(180px,.9fr) auto; gap:14px; align-items:end; }
.filter-field { display:grid; gap:6px; min-width:0; }
.filter-field label { color:var(--muted); font-size:12px; font-weight:700; text-transform:uppercase; }
.backup-mail-filters__actions { display:flex; gap:10px; align-items:end; white-space:nowrap; }
.backup-mail-filters__actions .btn { height:42px; }
.backup-mails-table-card { overflow:hidden; background:var(--card); border:1px solid rgba(255,255,255,.10); border-radius:18px; box-shadow:var(--shadow); }
.backup-mails-table { width:100%; }
.backup-mails-table__head, .backup-mails-table__row { display:grid; grid-template-columns:minmax(140px,.8fr) minmax(360px,2.2fr) minmax(150px,.8fr) minmax(250px,1.3fr) minmax(160px,.9fr) minmax(210px,1fr) minmax(170px,.9fr) minmax(140px,.8fr); gap:12px; align-items:center; }
.backup-mails-table__head { padding:18px 24px; background:rgba(255,255,255,.12); border-bottom:1px solid rgba(255,255,255,.08); color:var(--text); font-size:12px; font-weight:800; text-transform:uppercase; }
.backup-mails-table__row { min-height:104px; padding:18px 24px; border-top:1px solid rgba(255,255,255,.06); }
.backup-mails-table__row:first-child { border-top:0; }
.backup-mail-date, .backup-mail-template, .backup-mail-customer, .backup-mail-error { font-size:13px; line-height:1.35; }
.backup-mail-subject strong { display:block; line-height:1.25; margin-bottom:4px; }
.backup-mail-subject, .backup-mail-customer, .backup-mail-template, .backup-mail-error { min-width:0; overflow-wrap:anywhere; }
.backup-mail-status { display:grid; gap:7px; justify-items:center; }
.backup-mails-table .pill { max-width:100%; min-width:140px; white-space:normal; justify-content:center; text-align:center; line-height:1; }
.backup-mails-table__head > div:nth-child(3), .backup-mails-table__head > div:nth-child(6), .backup-mails-table__head > div:nth-child(7), .backup-mails-table__row > div:nth-child(3), .backup-mails-table__row > div:nth-child(6), .backup-mails-table__row > div:nth-child(7) { text-align:center; }
.backup-mails-table__row > div:nth-child(6), .backup-mails-table__row > div:nth-child(7) { display:flex; flex-direction:column; align-items:center; justify-content:center; }
.backup-mail-show { padding:24px 0 60px; }
.backup-mail-show__grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,420px); gap:18px; align-items:start; }
.backup-mail-show__card { background:var(--card); border:1px solid rgba(255,255,255,.10); border-radius:18px; box-shadow:var(--shadow); padding:20px; min-width:0; }
.backup-mail-show__head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding-bottom:16px; border-bottom:1px solid rgba(255,255,255,.08); }
.backup-mail-show__label { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; }
.backup-mail-show__subject { margin:0; font-size:22px; line-height:1.25; color:var(--text); overflow-wrap:anywhere; }
.backup-mail-show__status { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.backup-mail-show__meta-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.backup-mail-show__meta-grid > div { display:grid; gap:5px; padding:12px; border:1px solid rgba(255,255,255,.08); border-radius:12px; background:rgba(255,255,255,.035); min-width:0; }
.backup-mail-show__meta-grid span, .backup-mail-show__details dt { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.35px; }
.backup-mail-show__meta-grid strong, .backup-mail-show__details dd { color:var(--text); font-weight:600; overflow-wrap:anywhere; }
.backup-mail-show__section { margin-top:18px; }
.backup-mail-show__section h3, .backup-mail-show__card--side > h3 { margin:0 0 10px; font-size:15px; color:var(--text); }
.backup-mail-show__body, .backup-mail-show__code { margin:0; max-height:70vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; border:1px solid rgba(255,255,255,.10); border-radius:12px; background:#0e0f18; color:var(--text); padding:14px; font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; }
.backup-mail-show__code { max-height:360px; }
.backup-mail-show__code--danger { border-color:rgba(255,94,87,.28); background:rgba(255,94,87,.08); color:#fecaca; }
.backup-mail-show__empty { padding:14px; border:1px dashed rgba(255,255,255,.16); border-radius:12px; color:var(--muted); background:rgba(255,255,255,.03); }
.backup-mail-show__details { display:grid; gap:10px; margin:0; }
.backup-mail-show__details > div { display:grid; gap:4px; padding-bottom:10px; border-bottom:1px solid rgba(255,255,255,.07); }
.backup-mail-show__details > div:last-child { border-bottom:0; padding-bottom:0; }
.backup-mail-show__details dd { margin:0; }

@media (max-width:1500px) { .backup-mail-filters__form { grid-template-columns:minmax(220px,1.4fr) minmax(140px,.8fr) minmax(140px,.8fr) minmax(140px,.8fr) minmax(140px,.8fr) minmax(160px,.8fr) auto; } .backup-mails-table__head, .backup-mails-table__row { grid-template-columns:minmax(130px,.8fr) minmax(300px,2fr) minmax(140px,.8fr) minmax(220px,1.2fr) minmax(140px,.8fr) minmax(190px,.9fr) minmax(160px,.8fr) minmax(120px,.7fr); gap:10px; padding-left:18px; padding-right:18px; } }
@media (max-width:1200px) { .backup-mail-filters__form { grid-template-columns:repeat(3,minmax(0,1fr)); } .backup-mail-filters__actions { grid-column:1 / -1; } }
@media (max-width:1100px) { .backup-mails-table__head { display:none; } .backup-mails-table__row { grid-template-columns:1fr 1fr; min-height:auto; gap:14px; } .backup-mails-table__row > div { text-align:left !important; align-items:flex-start !important; } .backup-mails-table__row > div::before { display:block; margin-bottom:5px; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; } .backup-mails-table__row > div:nth-child(1)::before { content:"Ricevuta"; } .backup-mails-table__row > div:nth-child(2)::before { content:"Mail"; } .backup-mails-table__row > div:nth-child(3)::before { content:"Alias"; } .backup-mails-table__row > div:nth-child(4)::before { content:"Cliente"; } .backup-mails-table__row > div:nth-child(5)::before { content:"Template"; } .backup-mails-table__row > div:nth-child(6)::before { content:"Backup"; } .backup-mails-table__row > div:nth-child(7)::before { content:"Parsing"; } .backup-mails-table__row > div:nth-child(8)::before { content:"Errori"; } .backup-mail-show__grid { grid-template-columns:1fr; } }
@media (max-width:700px) { .backup-mail-filters__form { grid-template-columns:1fr; } .backup-mail-filters__actions { flex-direction:column; align-items:stretch; } .backup-mails-table__row { grid-template-columns:1fr; } .backup-mail-show__head { flex-direction:column; } .backup-mail-show__status { justify-content:flex-start; } .backup-mail-show__meta-grid { grid-template-columns:1fr; } }

/*---- backup customer aliases ----*/

.table--backup-aliases .table__head .table__row, .table--backup-aliases .table__row--head, .table--backup-aliases .table__body .table__row { display:grid; grid-template-columns:minmax(280px,1.3fr) minmax(360px,1.6fr) minmax(120px,.5fr) minmax(180px,.7fr); align-items:center; gap:14px; min-width:0; }
.table--backup-aliases .th, .table--backup-aliases .td { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.table--backup-aliases .td:nth-child(2) { white-space:normal; overflow:visible; text-overflow:initial; }
.table--backup-aliases .td:nth-child(2) > div { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.table--backup-aliases .th--center, .table--backup-aliases .td--qty { text-align:center; justify-self:center; }
.table--backup-aliases .td--qty .pill { min-width:110px; justify-content:center; text-align:center; }
.table--backup-aliases .td--actions { justify-self:end; overflow:visible; white-space:nowrap; }
.table--backup-aliases .td--actions .row-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; align-items:center; gap:8px; white-space:nowrap; }
.table--backup-aliases .td--actions .chip { height:42px; padding:0 14px; font-size:13px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; white-space:nowrap; }

@media (max-width:1100px) { .table--backup-aliases { overflow-x:auto; } .table--backup-aliases .table__head .table__row, .table--backup-aliases .table__row--head, .table--backup-aliases .table__body .table__row { min-width:950px; } }

/*---- backup software templates ----*/

.table--backup-templates .table__head .table__row, .table--backup-templates .table__row--head, .table--backup-templates .table__body .table__row { display:grid; grid-template-columns:minmax(240px,1.2fr) minmax(180px,.9fr) minmax(140px,.7fr) minmax(120px,.5fr) minmax(360px,1.7fr) minmax(220px,.9fr); align-items:center; gap:14px; min-width:0; }
.table--backup-templates .th, .table--backup-templates .td { min-width:0; overflow:visible; text-overflow:ellipsis; white-space:nowrap; }
.table--backup-templates .td--status .pill, .table--backup-templates .td--qty .pill { display:inline-flex; align-items:center; justify-content:center; line-height:1; }
.table--backup-templates .td--status, .table--backup-templates .td--qty { display:flex; justify-content:center; align-items:center; }
.table--backup-templates .td--qty .pill, .table--backup-templates .td--status .pill { min-width:140px; justify-content:center; text-align:center; }
.table--backup-templates code { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:none; border:none; padding:0; margin:0; font-size:12px; color:var(--text); }
.table--backup-templates code::before, .table--backup-templates code::after { content:none !important; display:none !important; }
.table--backup-templates .td--actions { justify-self:end; overflow:visible; white-space:nowrap; }
.table--backup-templates .td--actions .row-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; align-items:center; gap:8px; white-space:nowrap; }
.table--backup-templates .td--actions .chip { height:42px; padding:0 14px; font-size:13px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; white-space:nowrap; }

@media (max-width:1100px) { .table--backup-templates { overflow-x:auto; } .table--backup-templates .table__head .table__row, .table--backup-templates .table__row--head, .table--backup-templates .table__body .table__row { min-width:1200px; } }

/*---- backup customer templates ----*/

.table--backup-customer-templates .table__head .table__row, .table--backup-customer-templates .table__row--head, .table--backup-customer-templates .table__body .table__row { display:grid; grid-template-columns:minmax(280px,1.5fr) minmax(220px,1fr) minmax(160px,.7fr) minmax(160px,.7fr) minmax(220px,.8fr); align-items:center; gap:14px; min-width:0; }
.table--backup-customer-templates .th, .table--backup-customer-templates .td { min-width:0; overflow:visible; text-overflow:ellipsis; white-space:nowrap; }
.table--backup-customer-templates .td:nth-child(1) { overflow:hidden; text-overflow:ellipsis; }
.table--backup-customer-templates .td:nth-child(2), .table--backup-customer-templates .td--status { display:flex; justify-content:center; align-items:center; }
.table--backup-customer-templates .pill { min-width:140px; justify-content:center; text-align:center; line-height:1; }
.table--backup-customer-templates .td--actions { justify-self:end; overflow:visible; white-space:nowrap; }
.table--backup-customer-templates .td--actions .row-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; align-items:center; gap:8px; white-space:nowrap; }
.table--backup-customer-templates .td--actions .chip { height:42px; padding:0 14px; font-size:13px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; white-space:nowrap; }

@media (max-width:1100px) { .table--backup-customer-templates { overflow-x:auto; } .table--backup-customer-templates .table__head .table__row, .table--backup-customer-templates .table__row--head, .table--backup-customer-templates .table__body .table__row { min-width:1050px; } }

/*---- backup expectations ----*/

.table--backup-expectations .table__head .table__row, .table--backup-expectations .table__row--head, .table--backup-expectations .table__body .table__row { display:grid; grid-template-columns:minmax(280px,1.1fr) minmax(520px,2fr) minmax(150px,.6fr) minmax(380px,1fr); align-items:center; gap:18px; min-width:0; }
.table--backup-expectations .th, .table--backup-expectations .td { min-width:0; overflow:visible; text-overflow:ellipsis; white-space:nowrap; }
.table--backup-expectations .td--aliases { white-space:normal; overflow:visible; }
.table--backup-expectations .backup-days { display:flex; flex-direction:column; gap:8px; max-width:100%; overflow:hidden; }
.table--backup-expectations .backup-day-row { display:grid; grid-template-columns:90px minmax(0,1fr); align-items:start; gap:8px; }
.table--backup-expectations .backup-day-row strong { white-space:nowrap; }
.table--backup-expectations .backup-day-aliases { display:flex; flex-wrap:wrap; gap:6px; min-width:0; max-height:70px; overflow:hidden; }
.table--backup-expectations .backup-day-aliases .pill { max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; justify-content:center; }
.table--backup-expectations .td--status { display:flex; justify-content:center; align-items:center; }
.table--backup-expectations .td--status .pill { min-width:140px; justify-content:center; text-align:center; line-height:1; }
.table--backup-expectations .td--actions { justify-self:end; overflow:visible; white-space:nowrap; }
.table--backup-expectations .td--actions .row-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; align-items:center; gap:10px; white-space:nowrap; }
.table--backup-expectations .td--actions .chip { height:42px; min-width:110px; padding:0 16px; font-size:13px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; white-space:nowrap; }
.table--backup-expectations .td--actions .chip--info { background:rgba(0,180,255,.14); border:1px solid rgba(0,180,255,.45); color:#6fd6ff; }
.table--backup-expectations .td--actions .chip--success { background:rgba(46,204,113,.14); border:1px solid rgba(46,204,113,.35); color:#7dffb2; }
.table--backup-expectations .td--actions .chip--danger { background:rgba(255,94,87,.12); border:1px solid rgba(255,94,87,.35); color:#ffb3ae; }

@media (max-width:1100px) { .table--backup-expectations { overflow-x:auto; } .table--backup-expectations .table__head .table__row, .table--backup-expectations .table__row--head, .table--backup-expectations .table__body .table__row { min-width:1350px; } }

/*---- backup trend ----*/

.backup-trend { padding:28px 0 60px; }
.backup-trend-head { padding-top:14px; }
.backup-trend-head__inner { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.backup-trend-titlebox { display:flex; align-items:center; gap:16px; }
.backup-trend-titlebox__icon { width:64px; height:64px; display:grid; place-items:center; border-radius:16px; background:linear-gradient(135deg,rgba(59,130,246,.38),rgba(124,92,255,.18)); color:#7db7ff; font-size:32px; box-shadow:0 16px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12); }
.backup-trend__kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:18px; margin-bottom:18px; }
.backup-trend-kpi { min-height:116px; display:grid; grid-template-columns:78px 1fr; align-items:center; gap:16px; padding:20px 22px; border-radius:18px; background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.012)),var(--card); border:1px solid rgba(255,255,255,.12); box-shadow:0 18px 50px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.06); }
.backup-trend-kpi__icon { width:64px; height:64px; display:grid; place-items:center; border-radius:50%; font-size:34px; font-weight:900; border:1px solid rgba(255,255,255,.10); box-shadow:inset 0 1px 0 rgba(255,255,255,.12), 0 12px 30px rgba(0,0,0,.28); }
.backup-trend-kpi span { display:block; color:var(--muted); font-size:12px; font-weight:900; text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; }
.backup-trend-kpi strong { display:block; font-size:34px; line-height:1; font-weight:900; color:var(--text); }
.backup-trend-kpi small { display:block; margin-top:8px; color:rgba(255,255,255,.78); font-size:14px; }
.backup-trend-kpi--total .backup-trend-kpi__icon { color:#8bb8ff; background:rgba(59,130,246,.22); }
.backup-trend-kpi--ok .backup-trend-kpi__icon { color:#34d176; background:rgba(46,204,113,.18); }
.backup-trend-kpi--warn .backup-trend-kpi__icon { color:#ffcc33; background:rgba(241,196,15,.18); }
.backup-trend-kpi--danger .backup-trend-kpi__icon { color:#ff5e57; background:rgba(255,94,87,.18); }
.backup-trend-kpi--missing .backup-trend-kpi__icon { color:#c084fc; background:rgba(168,85,247,.22); }
.backup-trend-kpi--ok strong { color:#34d176; }
.backup-trend-kpi--warn strong { color:#ffcc33; }
.backup-trend-kpi--danger strong { color:#ff5e57; }
.backup-trend-kpi--missing strong { color:#c084fc; }
.backup-trend-card, .backup-trend-table-card { background:var(--card); border:1px solid rgba(255,255,255,.10); border-radius:18px; box-shadow:var(--shadow); overflow:hidden; }
.backup-trend-card { margin-bottom:22px; padding:22px 24px; }
.backup-trend-card__head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:22px; }
.backup-trend-card__head h3 { margin:0; font-size:20px; font-weight:800; }
.backup-trend-chart { height:300px; display:flex; align-items:end; gap:10px; padding:16px 8px 0; border-bottom:1px solid rgba(255,255,255,.08); }
.backup-trend-day { flex:1 1 0; min-width:22px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.backup-trend-bar { width:100%; max-width:42px; height:240px; display:flex; flex-direction:column-reverse; justify-content:flex-start; overflow:hidden; border-radius:10px 10px 4px 4px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.10); }
.backup-trend-bar__seg { display:block; min-height:0; }
.backup-trend-bar__seg--success { background:var(--ok); }
.backup-trend-bar__seg--warning { background:var(--warn); }
.backup-trend-bar__seg--failed { background:var(--danger); }
.backup-trend-bar__seg--unknown { background:#95a5a6; }
.backup-trend-bar__seg--missing { background:#a855f7; background-image:radial-gradient(rgba(255,255,255,.28) 1px, transparent 1px); background-size:7px 7px; }
.backup-trend-day__label { font-size:11px; color:var(--muted); white-space:nowrap; }
.backup-trend-legend { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; padding-top:16px; }
.pill--missing { background:rgba(168,85,247,.18); border-color:rgba(168,85,247,.38); color:#d8b4fe; }
.backup-trend-table { width:100%; }
.backup-trend-table__head, .backup-trend-table__row { display:grid; grid-template-columns:minmax(160px,1fr) repeat(7,minmax(90px,.6fr)); align-items:center; gap:10px; }
.backup-trend-table__head { padding:16px 22px; background:rgba(255,255,255,.12); border-bottom:1px solid rgba(255,255,255,.08); color:var(--text); font-size:12px; font-weight:800; text-transform:uppercase; }
.backup-trend-table__row { padding:14px 22px; border-top:1px solid rgba(255,255,255,.06); }
.backup-trend-table__row:first-child { border-top:0; }
.backup-trend-table__head > div:not(:first-child), .backup-trend-table__row > div:not(:first-child) { text-align:center; }
.backup-trend-table .pill { min-width:70px; justify-content:center; text-align:center; line-height:1; }

@media (max-width:1300px) { .backup-trend__kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:1100px) { .backup-trend-head__inner { flex-direction:column; align-items:flex-start; } .backup-trend-card__head { flex-direction:column; align-items:flex-start; } .backup-trend-chart { overflow-x:auto; justify-content:flex-start; } .backup-trend-day { min-width:38px; } .backup-trend-table-card { overflow-x:auto; } .backup-trend-table__head, .backup-trend-table__row { min-width:950px; } }
@media (max-width:700px) { .backup-trend__kpis { grid-template-columns:1fr; } .backup-trend-titlebox__icon { width:52px; height:52px; font-size:26px; } }

/*---- tools hub ----*/

.tools-hub { width:min(1440px,calc(100% - 48px)); margin:0 auto; padding:48px 0 72px; }
.tools-hero { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:24px; }
.tools-hero__eyebrow { margin:0 0 8px; color:var(--brand-2); font-size:12px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.tools-hero__title { margin:0; font-size:clamp(34px,6vw,56px); line-height:1; }
.tools-hero__subtitle { max-width:720px; margin:14px 0 0; color:var(--muted); font-size:18px; line-height:1.5; }
.tools-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; align-items:stretch; margin-bottom:24px; }
.tools-grid--compact { grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); }
.tool-card { position:relative; display:grid; align-content:start; min-height:220px; padding:24px; overflow:hidden; border:1px solid rgba(255,255,255,.12); border-radius:14px; background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.018)),var(--card); color:inherit; text-decoration:none; box-shadow:var(--shadow); transition:transform 160ms ease,border-color 160ms ease,box-shadow 160ms ease; }
.tool-card:hover, .tool-card:focus { transform:translateY(-2px); border-color:rgba(124,92,255,.48); box-shadow:0 20px 52px rgba(0,0,0,.36); outline:none; }
.tool-card::after { content:""; position:absolute; right:-34px; bottom:-42px; width:130px; height:130px; border-radius:50%; background:rgba(255,255,255,.045); pointer-events:none; }
.tool-card__symbol { width:58px; height:58px; display:grid; place-items:center; margin-bottom:18px; border-radius:16px; color:#fff; font-size:26px; font-weight:900; box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 14px 34px rgba(0,0,0,.28); }
.tool-card__kicker { width:max-content; max-width:100%; margin-bottom:12px; padding:5px 9px; border-radius:999px; background:rgba(124,92,255,.14); color:#c8bbff; font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }
.tool-card strong { display:block; color:var(--text); font-size:24px; line-height:1.1; }
.tool-card p { margin:12px 0 0; color:var(--muted); line-height:1.45; }
.favorite-card-wrap { position:relative; min-width:0; }
.favorite-card-wrap .tool-card { height:100%; padding-right:56px; }
.favorite-card-wrap .dashboard-favorite-star { top:14px; right:14px; }
.tool-card--daily .tool-card__symbol { background:linear-gradient(135deg,#7c5cff,#00d1ff); }
.tool-card--assets .tool-card__symbol { background:linear-gradient(135deg,#2ecc71,#22d3ee); }
.tool-card--pixtik .tool-card__symbol { background:linear-gradient(135deg,#70a1ff,#7c5cff); }
.tool-card--cyber .tool-card__symbol { background:linear-gradient(135deg,#ff5e57,#ffd666); color:#1a1212; }
.tool-card--backup .tool-card__symbol { background:linear-gradient(135deg,#60a5fa,#c084fc); }
.tool-card--customers .tool-card__symbol { background:linear-gradient(135deg,#22c55e,#14b8a6); }
.tool-card--contracts .tool-card__symbol { background:linear-gradient(135deg,#f59e0b,#ef4444); }
.tool-card--contracts-analysis .tool-card__symbol { background:linear-gradient(135deg,#38bdf8,#6366f1); font-size:22px; }
.tool-card--helpdesk .tool-card__symbol { background:linear-gradient(135deg,#2563eb,#22d3ee); }
.tool-card--requests .tool-card__symbol { background:linear-gradient(135deg,#8b5cf6,#ec4899); }
.tool-card--interventions .tool-card__symbol { background:linear-gradient(135deg,#f97316,#facc15); color:#1a1212; }
.tool-card--reminders .tool-card__symbol { background:linear-gradient(135deg,#10b981,#84cc16); color:#102015; }
.tool-card--report-economic .tool-card__symbol { background:linear-gradient(135deg,#0ea5e9,#22c55e); font-size:22px; }
.tool-card--report-hours .tool-card__symbol { background:linear-gradient(135deg,#6366f1,#a855f7); font-size:22px; }
.tool-card--report-billing .tool-card__symbol { background:linear-gradient(135deg,#f59e0b,#f97316); color:#1a1212; font-size:22px; }
.tool-card--report-rates .tool-card__symbol { background:linear-gradient(135deg,#ef4444,#ec4899); font-size:22px; }
.tool-card--admin-users .tool-card__symbol { background:linear-gradient(135deg,#64748b,#22d3ee); }
.tool-card--admin-settings .tool-card__symbol { background:linear-gradient(135deg,#7c3aed,#2563eb); font-size:22px; }
.tool-card--admin-calendars .tool-card__symbol { background:linear-gradient(135deg,#16a34a,#eab308); color:#102015; font-size:22px; }
.tool-card--whatsapp .tool-card__symbol { background:linear-gradient(135deg,#25d366,#128c7e); color:#07130d; }
@media (max-width:1280px) { .tools-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:820px) { .tools-hub { width:min(100% - 32px,1440px); padding-top:32px; } .tools-grid { grid-template-columns:1fr; } .tools-hero__subtitle { font-size:16px; } }

/*---- dashboard favorites ----*/

.dashboard-favorite-star {
  position:absolute;
  z-index:8;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  padding:0;
  border:1px solid rgba(255,255,255,.14);
  border-radius:999px;
  background:rgba(8,9,13,.62);
  color:rgba(233,236,241,.48);
  font-size:21px;
  font-weight:900;
  line-height:1;
  cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,.26);
  transition:transform .16s ease,color .16s ease,border-color .16s ease,background .16s ease;
}
.dashboard-favorite-star:hover {
  transform:scale(1.08);
  border-color:rgba(250,204,21,.42);
  color:#facc15;
  background:rgba(250,204,21,.12);
}
.dashboard-favorite-star--active {
  border-color:rgba(250,204,21,.56);
  background:rgba(250,204,21,.16);
  color:#facc15;
}
.panel--favorites { min-height:260px; }
.page-actions__favorite {
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
}
.page-actions__favorite .dashboard-favorite-star {
  position:static;
}
.dashboard-favorites-grid { display:grid; gap:8px; padding:12px 14px 14px; }
.dashboard-favorite-card {
  position:relative;
  min-height:66px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:10px;
  background:rgba(255,255,255,.045);
}
.dashboard-favorite-card__link {
  display:grid;
  gap:2px;
  min-height:66px;
  padding:10px 48px 10px 14px;
  color:inherit;
  text-decoration:none;
}
.dashboard-favorite-card__link .dashboard-card__kicker {
  width:max-content;
  max-width:100%;
  padding:3px 7px;
  border-radius:999px;
  background:rgba(124,92,255,.14);
  color:#c8bbff;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.dashboard-favorite-card__link strong { color:var(--text); font-size:14px; line-height:1.12; }
.dashboard-favorite-card__link > span:last-child { color:var(--muted); font-size:11px; line-height:1.2; }
.dashboard-favorite-card .dashboard-favorite-star { top:10px; right:10px; width:30px; height:30px; font-size:18px; }
.dashboard-favorites-empty {
  margin:14px 16px 16px;
  padding:18px;
  border:1px dashed rgba(250,204,21,.34);
  border-radius:12px;
  color:var(--muted);
  line-height:1.45;
}

/*---- coherent surfaces ----*/

.record-section { padding:0 0 40px; }
.record-card { padding:22px; border:1px solid rgba(255,255,255,.12); border-radius:14px; background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.016)),var(--card); box-shadow:var(--shadow); }
.record-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin:0; }
.record-list > div { padding:14px; border:1px solid rgba(255,255,255,.08); border-radius:12px; background:rgba(255,255,255,.035); }
.record-list dt { margin:0 0 6px; color:var(--muted); font-size:12px; font-weight:900; letter-spacing:.05em; text-transform:uppercase; }
.record-list dd { margin:0; color:var(--text); font-size:18px; font-weight:700; overflow-wrap:anywhere; }
.table--items .table__head .table__row,
.table--items .table__row--head,
.table--items .table__body .table__row { display:grid; grid-template-columns:minmax(220px,1.4fr) minmax(130px,.7fr) minmax(180px,1fr) minmax(90px,.45fr) minmax(260px,.9fr); align-items:center; gap:14px; }

.btn, .chip, .tool-card, .panel, .card, .record-card, .table { transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background-color .16s ease; }
.btn:hover, .chip:hover { transform:translateY(-1px); }
.table__body .table__row:hover { background:rgba(255,255,255,.035); }
.form__control:focus, .search__input:focus, .input:focus { border-color:rgba(0,209,255,.48); box-shadow:0 0 0 3px rgba(0,209,255,.12); }

@media (prefers-reduced-motion:reduce) {
  .btn, .chip, .tool-card, .panel, .card, .record-card, .table { transition:none; }
  .btn:hover, .chip:hover, .tool-card:hover { transform:none; }
}

/*---- table action system ----*/

.table .row-actions,
.table--list .td--actions .row-actions,
.td--actions .row-actions { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:nowrap; white-space:nowrap; }

.table .th--actions,
.table .td--actions { justify-self:center; text-align:center; min-width:max-content; overflow:visible; white-space:nowrap; }

.table .th--center,
.table .td--center,
.table .text-center { justify-self:center; text-align:center; }

.table .th--actions,
.table .td--actions { justify-self:center; text-align:center; }

.table .td--center,
.table .td--qty,
.table .td--status,
.table .td--approved,
.table .td--state {
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.table .td--qty,
.table .td--status { justify-self:center; }

.table-wrap > .container { overflow-x:auto; }

.table--customers .table__head .table__row,
.table--customers .table__row--head,
.table--customers .table__body .table__row { grid-template-columns:minmax(240px,1.5fr) minmax(180px,1.1fr) minmax(72px,.35fr) minmax(90px,.4fr) minmax(430px,1.15fr); }

.table--expirations .table__head .table__row,
.table--expirations .table__row--head,
.table--expirations .table__body .table__row { grid-template-columns:minmax(240px,1.65fr) minmax(170px,1fr) minmax(150px,.85fr) minmax(110px,.55fr) minmax(120px,.6fr) minmax(390px,1.35fr); }

.table--tasks .table__head .table__row,
.table--tasks .table__row--head,
.table--tasks .table__body .table__row { grid-template-columns:minmax(320px,2fr) minmax(180px,.8fr) minmax(160px,.65fr) minmax(420px,1.25fr); }

.table--interventions .table__head .table__row,
.table--interventions .table__row--head,
.table--interventions .table__body .table__row { grid-template-columns:minmax(320px,1.8fr) minmax(130px,.55fr) minmax(130px,.55fr) minmax(430px,1.15fr); }

.table--items .table__head .table__row,
.table--items .table__row--head,
.table--items .table__body .table__row { grid-template-columns:minmax(220px,1.35fr) minmax(130px,.7fr) minmax(180px,1fr) minmax(90px,.45fr) minmax(300px,.95fr); }

.table--whatsapp-conversations .table__head .table__row,
.table--whatsapp-conversations .table__row--head,
.table--whatsapp-conversations .table__body .table__row { grid-template-columns:minmax(260px,1.4fr) minmax(140px,.8fr) minmax(110px,.55fr) minmax(170px,.8fr) minmax(220px,.9fr); }

.whatsapp-thread { display:flex; flex-direction:column; gap:14px; }
.whatsapp-message { max-width:760px; padding:14px 16px; border:1px solid rgba(255,255,255,.12); border-radius:14px; background:rgba(255,255,255,.045); }
.whatsapp-message--incoming { align-self:flex-start; }
.whatsapp-message--outgoing { align-self:flex-end; background:rgba(37,211,102,.12); border-color:rgba(37,211,102,.28); }
.whatsapp-message__meta { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:8px; color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; }
.whatsapp-message__body { color:var(--text); line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }

.whatsapp-admin { padding-top:42px; }
.whatsapp-admin-hero { align-items:center; margin-bottom:18px; }
.whatsapp-admin-actions {
  min-width:280px;
  padding:14px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.018)),rgba(15,16,26,.72);
  box-shadow:var(--shadow);
}
.whatsapp-admin-actions__status { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.whatsapp-admin-actions__label { color:var(--muted); font-size:11px; font-weight:900; letter-spacing:.06em; text-transform:uppercase; }
.whatsapp-admin-actions__buttons { display:grid; grid-template-columns:1fr; gap:10px; }
.whatsapp-admin-actions__buttons form,
.whatsapp-admin-actions__buttons .btn { width:100%; }
.whatsapp-admin-actions__buttons .btn { justify-content:center; box-shadow:none; }
.whatsapp-admin-strip {
  display:grid;
  grid-template-columns:1.1fr 1.4fr .9fr;
  gap:14px;
  margin-bottom:20px;
}
.whatsapp-admin-strip article {
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  padding:16px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02)),var(--card);
  box-shadow:var(--shadow);
}
.whatsapp-admin-strip__icon {
  flex:0 0 46px;
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:linear-gradient(135deg,#25d366,#128c7e);
  color:#07130d;
  font-size:13px;
  font-weight:900;
}
.whatsapp-admin-strip strong { display:block; color:var(--text); font-size:18px; line-height:1.2; overflow-wrap:anywhere; }
.whatsapp-admin-strip span:not(.whatsapp-admin-strip__icon) { color:var(--muted); font-size:12px; }
.whatsapp-admin-section { padding-bottom:20px; }
.whatsapp-admin-card {
  padding:0;
  overflow:hidden;
  border-color:rgba(255,255,255,.16);
  background:linear-gradient(180deg,rgba(255,255,255,.065),rgba(255,255,255,.022)),var(--card);
}
.whatsapp-admin-card__head,
.whatsapp-admin-panel__head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.whatsapp-admin-facts {
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:0;
  border-top:1px solid rgba(255,255,255,.08);
}
.whatsapp-admin-facts > div {
  border:0;
  border-right:1px solid rgba(255,255,255,.08);
  border-radius:0;
  background:rgba(255,255,255,.025);
}
.whatsapp-admin-facts > div:last-child { border-right:0; }
.whatsapp-admin-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  align-items:start;
  margin-bottom:20px;
}
.whatsapp-admin-panel {
  padding:0;
  overflow:hidden;
  border-color:rgba(255,255,255,.14);
  background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.018)),var(--card);
}
.record-list--compact { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); padding:16px; }
.whatsapp-admin-checks { gap:10px; }
.whatsapp-admin-checks > div {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:78px;
  padding:14px 16px;
}
.whatsapp-admin-checks dt { margin:0; }
.whatsapp-admin-checks dd { flex:0 0 auto; }
.whatsapp-admin-checks__single { max-width:320px; }
.whatsapp-admin-webhook {
  margin:16px 16px 0;
  padding:16px;
  border:1px solid rgba(37,211,102,.24);
  border-radius:14px;
  background:rgba(37,211,102,.07);
}
.whatsapp-admin-webhook span {
  display:block;
  margin-bottom:8px;
  color:#86efac;
  font-size:11px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.whatsapp-admin-webhook code {
  display:block;
  color:var(--text);
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:14px;
  font-weight:800;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.whatsapp-admin-code,
.whatsapp-admin-json {
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:13px;
}
.whatsapp-admin-code { overflow-wrap:anywhere; }
.whatsapp-admin-json {
  max-height:420px;
  margin:0;
  padding:16px;
  overflow:auto;
  border-radius:12px;
  background:rgba(0,0,0,.22);
  color:var(--text);
}
.whatsapp-admin-error {
  margin:0;
  padding:16px;
  color:var(--chip-danger-color);
  line-height:1.45;
  overflow-wrap:anywhere;
}
@media (max-width:1180px) {
  .whatsapp-admin-facts { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .whatsapp-admin-facts > div:nth-child(3n) { border-right:0; }
}
@media (max-width:900px) {
  .whatsapp-admin-hero { align-items:flex-start; }
  .whatsapp-admin-actions { width:100%; }
  .whatsapp-admin-strip,
  .whatsapp-admin-grid { grid-template-columns:1fr; }
  .whatsapp-admin-facts { grid-template-columns:1fr; }
  .whatsapp-admin-facts > div { border-right:0; border-bottom:1px solid rgba(255,255,255,.08); }
  .whatsapp-admin-facts > div:last-child { border-bottom:0; }
}

.table .row-actions form { display:inline-flex; margin:0; }

.table .th.th--actions,
.table .td.td--actions,
.cyber-page .table .th.th--actions,
.cyber-page .table .td.td--actions,
.contacts-table .th.th--actions,
.contacts-table .td.td--actions,
.table__th--actions,
.table__td--actions {
  justify-self:center;
  text-align:center !important;
}

.table .td.td--actions .row-actions,
.cyber-page .table .td.td--actions .row-actions,
.contacts-table .td.td--actions .row-actions,
.table__td--actions .row-actions {
  justify-content:center;
}

.table .th.th--center,
.table .td.td--center,
.table .td.td--qty,
.table .td.td--status,
.table .td.td--approved,
.table .td.td--state {
  justify-self:center;
  text-align:center;
}

.table .row-actions .chip,
.table .td--actions .chip,
.table .td--actions .btn,
.cyber-page .table .td--actions .chip,
.cyber-page .table .td--actions .btn,
.backup-mails-table .td--actions .chip,
.backup-mails-table .td--actions .btn,
.table button.chip {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:84px;
  height:34px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:10px;
  background:rgba(255,255,255,.055);
  color:var(--text);
  font-size:12px;
  font-weight:800;
  line-height:1;
  text-decoration:none !important;
  white-space:nowrap;
  box-shadow:none;
}

.table .row-actions .chip:hover,
.table .td--actions .chip:hover,
.table .td--actions .btn:hover,
.cyber-page .table .td--actions .chip:hover,
.cyber-page .table .td--actions .btn:hover,
.table button.chip:hover { border-color:rgba(255,255,255,.24); background:rgba(255,255,255,.09); color:#fff; }

.badge,
.table .pill,
.page-subtitle .pill,
.backup-table .pill,
.backup-mini-item .pill,
.backup-legend .pill,
.due-pill,
.date-badge,
.dwr-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:26px;
  padding:4px 10px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:999px;
  background:rgba(255,255,255,.075);
  color:var(--text);
  font-size:12px;
  font-weight:800;
  line-height:1.15;
  text-decoration:none;
  white-space:nowrap;
  box-shadow:none;
}

.table .pill,
.page-subtitle .pill,
.backup-table .pill,
.backup-mini-item .pill,
.backup-legend .pill { margin:0; cursor:default; min-width:auto; flex-direction:row; }
.filter-pill { margin-left:8px; vertical-align:middle; }

.badge--brand, .pill--brand, .chip--brand { background:var(--chip-brand-bg) !important; border-color:var(--chip-brand-border) !important; color:var(--chip-brand-color) !important; }
.badge--info, .pill--info, .chip--info { background:var(--chip-info-bg) !important; border-color:var(--chip-info-border) !important; color:var(--chip-info-color) !important; }
.badge--success, .badge--ok, .pill--success, .chip--success, .dwr-badge--ok { background:var(--chip-success-bg) !important; border-color:var(--chip-success-border) !important; color:var(--chip-success-color) !important; }
.badge--warning, .pill--warning, .chip--warning, .dwr-badge--ferie { background:var(--chip-warning-bg) !important; border-color:var(--chip-warning-border) !important; color:var(--chip-warning-color) !important; }
.badge--danger, .pill--danger, .chip--danger, .dwr-badge--ko { background:var(--chip-danger-bg) !important; border-color:var(--chip-danger-border) !important; color:var(--chip-danger-color) !important; }
.badge--secondary, .badge--neutral, .badge--light, .badge--gray, .bg-secondary,
.pill--ghost, .pill--muted, .pill--gray {
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.16) !important;
  color:rgba(233,236,241,.82) !important;
}

.due-pill--ok, .date-badge { background:var(--chip-success-bg) !important; border-color:var(--chip-success-border) !important; color:var(--chip-success-color) !important; }
.due-pill--soon { background:var(--chip-warning-bg) !important; border-color:var(--chip-warning-border) !important; color:var(--chip-warning-color) !important; }
.due-pill--overdue { background:var(--chip-danger-bg) !important; border-color:var(--chip-danger-border) !important; color:var(--chip-danger-color) !important; }
.due-pill--none { background:rgba(255,255,255,.08) !important; border-color:rgba(255,255,255,.16) !important; color:rgba(233,236,241,.72) !important; }

.table .row-actions .chip--danger,
.table .td--actions .chip--danger { min-width:78px; }

.table .row-actions .chip:focus-visible,
.table .td--actions .btn:focus-visible,
.badge:focus-visible,
.pill:focus-visible {
  outline:2px solid rgba(0,209,255,.55);
  outline-offset:2px;
}
