/* Servizio e accessi · «Scuro premium» (DESIGN-V6). Prefix sv-. */
.module-service .page-header { margin-bottom: 16px; }
.sv-tabs { margin-bottom: 0; }
.sv-tabs .tab .icon { color: var(--text-3); }
.sv-tabs .tab[aria-selected="true"] .icon { color: var(--text-1); }
.sv-tab-off { font-size: 12px; font-weight: 400; color: var(--text-4); }
.sv-tab-short { display: none; }
.sv-tab-count { height: 18px; min-width: 18px; padding: 0 5px; line-height: 18px; }
.sv-tab-count.is-green { color: var(--green); background: var(--green-soft); }
.sv-lead { max-width: 760px; margin: 16px 0 14px; font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.sv-banner { margin-bottom: 14px; }
.sv-body .panel + .panel { margin-top: 16px; }
.sv-foot { gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.sv-foot .icon { flex: none; margin-top: 1px; color: var(--text-3); }
.sv-off .empty { padding: 48px 24px; }
.sv-state { padding: 12px 16px; }

/* Toolbar inside a panel */
.sv-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.sv-toolbar[hidden] { display: none; }
.sv-search { width: min(260px, 100%); }
.sv-room { width: auto; min-width: 168px; max-width: 240px; }
.sv-filter { margin-left: auto; }
.sv-filter-n { margin-left: 2px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.sv-filter [aria-pressed="true"] .sv-filter-n { color: var(--text-2); }

/* Tables (QR service) */
.sv-tables { min-height: 120px; }
.sv-group + .sv-group { border-top: 1px solid var(--line-soft); }
.sv-group-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 4px; }
.sv-group-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.sv-group-count { font-size: 12px; color: var(--text-3); }
.sv-rows { padding: 2px 0 6px; }
.sv-row {
  position: relative; display: grid; grid-template-columns: minmax(130px, .8fr) minmax(170px, 1fr) minmax(190px, 1fr) 236px;
  align-items: center; gap: 10px 16px; min-height: 60px; padding: 8px 16px; transition: background-color var(--t-fast) var(--ease);
}
.sv-row + .sv-row::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--line-soft); }
.sv-row:hover { background: rgba(255, 255, 255, .02); }
.sv-row.is-live { background: linear-gradient(90deg, rgba(108, 212, 158, .045), transparent 42%); }
.sv-row.is-live::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 0 2px 2px 0; background: var(--green); opacity: .7; }
.sv-row.is-busy { opacity: .78; }
.sv-t-name { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sv-t-name > b { font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-t-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.sv-orders {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 7px 0 6px; border: 0; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--amber); background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber-line);
}
.sv-orders:hover { background: rgba(232, 182, 90, .16); }
.sv-orders .dot { width: 5px; height: 5px; box-shadow: none; }
.sv-t-state { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.sv-t-time { font-size: 12.5px; line-height: 18px; color: var(--text-3); white-space: nowrap; }
.sv-t-pin { min-width: 0; display: flex; align-items: center; gap: 8px; }
.sv-pin-label { font-size: 11.5px; font-weight: 500; letter-spacing: .04em; color: var(--text-3); }
.sv-pin { min-width: 74px; font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--text-1); white-space: nowrap; }
.sv-pin.is-hidden { color: var(--text-3); letter-spacing: .12em; }
.sv-pin-toggle { width: 30px; height: 30px; }
.sv-pin-none { font-size: 12.5px; color: var(--text-4); }
.sv-t-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.sv-t-actions .btn { white-space: nowrap; }
.sv-start .icon { color: var(--green); }
.sv-more { width: 30px; height: 30px; }
.sv-more-gap { width: 30px; flex: none; }
.sv-skeleton { padding: 8px 16px 12px; }
.sv-skel-row { display: flex; align-items: center; gap: 24px; min-height: 56px; border-bottom: 1px solid var(--line-soft); }
.sv-skel-row:last-child { border-bottom: 0; }
.sv-menu { min-width: 260px; }
.sv-menu .menu-item { align-items: flex-start; }
.sv-menu .menu-item > .icon { margin-top: 1px; }
.sv-menu .menu-item-text > small { white-space: normal; }
.sv-menu-warn > .icon { color: var(--amber); }

/* App camerieri */
.sv-app-body { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 28px; align-items: start; padding: 20px; }
.sv-app-qr { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.sv-qr-frame { display: grid; place-items: center; width: 192px; height: 192px; padding: 12px; border-radius: var(--r-lg); background: #fff; box-shadow: 0 0 0 1px var(--line-strong), 0 10px 30px rgba(0, 0, 0, .35); }
.sv-qr-frame img { display: block; width: 100%; height: 100%; }
.sv-app-qr figcaption { display: flex; flex-direction: column; gap: 2px; }
.sv-app-qr figcaption b { font-size: 13px; font-weight: 500; color: var(--text-1); }
.sv-app-host { font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.sv-qr-missing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 192px; height: 192px; padding: 16px; border-radius: var(--r-lg); font-size: 12.5px; line-height: 18px; color: var(--text-3); background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); }
.sv-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin: 4px 0 0; padding: 0; list-style: none; }
.sv-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; }
.sv-step-n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sv-steps li > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sv-steps b { font-size: 14px; line-height: 22px; font-weight: 500; color: var(--text-1); }
.sv-steps span { font-size: 13px; line-height: 19px; color: var(--text-2); }
.sv-steps a { color: var(--text-1); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px; overflow-wrap: anywhere; }
.sv-steps a:hover { text-decoration-color: var(--accent); }

/* Accounts and permissions */
.sv-acc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.sv-acc-grid .panel + .panel { margin-top: 0; }
.sv-users { min-height: 80px; }
.sv-user-list { padding: 4px 0; }
.sv-user {
  position: relative; display: grid; grid-template-columns: 32px minmax(160px, 1fr) minmax(130px, auto) auto;
  align-items: center; gap: 8px 14px; min-height: 64px; padding: 10px 16px; transition: background-color var(--t-fast) var(--ease);
}
.sv-user + .sv-user::before { content: ""; position: absolute; left: 62px; right: 16px; top: 0; height: 1px; background: var(--line-soft); }
.sv-user:hover { background: rgba(255, 255, 255, .02); }
.sv-user.is-off .avatar { opacity: .5; }
.sv-user.is-off .sv-user-main b { color: var(--text-2); }
.sv-user-main { min-width: 0; display: flex; flex-direction: column; }
.sv-user-main b { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-1); white-space: nowrap; }
.sv-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sv-user-main b > .tag, .sv-user-main b > .pill { flex: none; }
.sv-user-main > span { font-size: 12.5px; line-height: 18px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-user-main .sep { margin: 0 6px; color: var(--text-4); }
.sv-user-role { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.sv-user-role .icon { color: var(--text-3); }
.sv-user-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 196px; }
.sv-user-note { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.sv-deactivate:hover { color: var(--red); }
.sv-matrix { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.sv-matrix th, .sv-matrix td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.sv-matrix thead th { padding-top: 10px; padding-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.sv-matrix tbody th { font-weight: 400; color: var(--text-1); }
.sv-matrix th:first-child { padding-left: 16px; }
.sv-matrix td { width: 96px; text-align: center; }
.sv-matrix thead th:not(:first-child) { text-align: center; }
.sv-matrix tr:last-child th, .sv-matrix tr:last-child td { border-bottom: 0; }
.sv-perm { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; vertical-align: middle; }
.sv-perm.is-yes { color: var(--green); }
.sv-perm.is-no { color: var(--text-4); }
.sv-perm.is-partial { color: var(--amber); }
.sv-perm small { font-size: 11.5px; line-height: 14px; color: var(--text-3); white-space: nowrap; }

/* Dialogs: new account, password */
.sv-roles { margin: 0 0 16px; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sv-roles legend { margin-bottom: 6px; padding: 0; }
.sv-role-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r-md); cursor: pointer; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.sv-role-card:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.sv-role-card:has(input:checked) { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--accent-line); }
.sv-role-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sv-role-card input { margin-top: 2px; }
.sv-role-card > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sv-role-card b { font-size: 13.5px; font-weight: 500; color: var(--text-1); }
.sv-role-card small { font-size: 12.5px; line-height: 17px; color: var(--text-3); }
.sv-pass-row { display: flex; align-items: center; gap: 6px; }
.sv-pass-row .input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sv-pass-eye { width: var(--control-h, 36px); height: var(--control-h, 36px); flex: none; }
.sv-pass-gen { flex: none; }
.sv-pass-gen .icon { color: var(--text-3); }
.sv-pass-note { margin: 0 0 16px; }
.sv-copy-area { font-variant-numeric: tabular-nums; }

/* QR sheet (dialog + print) */
.sv-qr-dialog { width: min(440px, calc(100% - 32px)); }
.sv-sheet { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 24px 22px; border-radius: var(--r-lg); color: #1C1F24; background: #FCFCFB; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.sv-sheet-brand { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #5F646B; overflow-wrap: anywhere; }
.sv-sheet-kicker { margin-top: 12px; font-size: 12px; font-weight: 500; color: #878C94; }
.sv-sheet-table { margin: 2px 0 14px; font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; color: #111316; overflow-wrap: anywhere; }
.sv-sheet-brand + .sv-sheet-table { margin-top: 12px; }
.sv-sheet-qr { display: block; width: min(232px, 100%); height: auto; aspect-ratio: 1; }
.sv-sheet-claim { margin: 16px 0 4px; font-size: 16px; line-height: 22px; font-weight: 600; color: #111316; }
.sv-sheet-help { max-width: 300px; margin: 0; font-size: 13px; line-height: 19px; color: #5F646B; }
.sv-sheet-test { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid #E4E5E7; font-size: 12px; font-weight: 600; color: #A4512A; }
.sv-sheet-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.sv-sheet-note { max-width: 340px; margin: 0 auto 6px; text-align: center; }
.sv-sheet-note .icon { display: inline-block; vertical-align: -2px; color: var(--text-3); }
.sv-qr-dialog [data-submit] .icon { margin-right: 2px; }

/* Responsive */
@media (max-width: 1280px) {
  .sv-acc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .sv-row { grid-template-columns: minmax(110px, .7fr) minmax(160px, 1fr) minmax(180px, 1fr) 236px; gap: 10px 12px; }
}
@media (max-width: 900px) {
  .sv-app-body { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .sv-app-qr { justify-self: center; }
  .sv-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .sv-lead { margin: 14px 0 12px; }
  .sv-filter { margin-left: 0; }
  .sv-search { flex: 1 1 200px; width: auto; }
  .sv-room { flex: 1 1 140px; max-width: none; }
  .sv-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name state" "pin actions"; align-items: center;
    gap: 10px 12px; padding: 12px 16px;
  }
  .sv-row.is-live::after { top: 12px; bottom: 12px; }
  .sv-t-name { grid-area: name; }
  .sv-t-state { grid-area: state; align-items: flex-end; text-align: right; }
  .sv-t-pin { grid-area: pin; }
  .sv-t-actions { grid-area: actions; }
  .sv-user { grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "avatar main" "avatar role" "actions actions"; gap: 4px 12px; padding: 12px 16px; }
  .sv-user .avatar { grid-area: avatar; align-self: start; margin-top: 2px; }
  .sv-user-main { grid-area: main; }
  .sv-user-role { grid-area: role; font-size: 12.5px; }
  .sv-user-main > span { white-space: normal; }
  .sv-user-actions { grid-area: actions; justify-content: flex-start; min-width: 0; margin: 6px 0 0 44px; }
  .sv-user-actions:has(.sv-user-note) { margin-top: 0; }
  .sv-user + .sv-user::before { left: 16px; }
}
@media (max-width: 560px) {
  .sv-tabs .tab { padding: 0 10px; }
  .sv-tabs .tab > .icon { display: none; }
  .sv-tab-full { display: none; }
  .sv-tab-short { display: inline; }
  .sv-row:not(.is-live) .sv-t-pin { display: none; }
  .sv-row:not(.is-live) { grid-template-areas: "name state" "actions actions"; }
  .sv-more-gap { display: none; }
  .sv-toolbar { padding: 12px; }
  .sv-filter { width: 100%; }
  .sv-filter > button { flex: 1; justify-content: center; }
  .sv-row { grid-template-areas: "name state" "pin pin" "actions actions"; padding: 12px; }
  .sv-row + .sv-row::before { left: 12px; right: 12px; }
  .sv-t-actions { justify-content: stretch; }
  .sv-t-actions .btn { flex: 1; justify-content: center; }
  .sv-app-body { padding: 16px; gap: 20px; }
  .sv-roles { grid-template-columns: minmax(0, 1fr); }
  .sv-pass-row { flex-wrap: wrap; }
  .sv-pass-row .input { flex: 1 1 calc(100% - 46px); }
  .sv-pass-gen { flex: 1; justify-content: center; }
  .sv-panel-actions-label { display: none; }
  .sv-app .panel-header { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .sv-app .panel-actions { width: 100%; margin-left: 0; }
  .sv-app .panel-actions > * { flex: 1; justify-content: center; }
  .sv-matrix td { width: 92px; padding-left: 8px; padding-right: 8px; }
  .sv-perm small { display: none; }
  .sv-acc-grid .sv-accounts .panel-header { flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .sv-pin-toggle, .sv-more { width: 40px; height: 40px; }
  .sv-more-gap { width: 40px; }
  .sv-row .sv-t-actions .btn { --btn-h: 40px; }
  .sv-user-actions .btn { --btn-h: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .sv-row, .sv-user, .sv-role-card { transition: none; }
}

@media print {
  body.sv-print-qr { background: #fff !important; color: #000 !important; overflow: visible !important; height: auto !important; }
  body.sv-print-qr > :not(dialog.sv-qr-dialog) { display: none !important; }
  body.sv-print-qr dialog.sv-qr-dialog { display: block !important; position: static !important; inset: auto !important; width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: #fff !important; overflow: visible !important; animation: none !important; }
  body.sv-print-qr dialog::backdrop { background: transparent !important; }
  body.sv-print-qr .modal-header, body.sv-print-qr .modal-actions, body.sv-print-qr .modal-error, body.sv-print-qr .sv-sheet-tools, body.sv-print-qr .sv-sheet-note { display: none !important; }
  body.sv-print-qr .modal-form, body.sv-print-qr .modal-body { display: block !important; padding: 0 !important; overflow: visible !important; max-height: none !important; }
  body.sv-print-qr .sv-sheet { width: 105mm; margin: 15mm auto; padding: 12mm 10mm; border: 1px solid #ddd; border-radius: 4mm; box-shadow: none; background: #fff; break-inside: avoid; }
  body.sv-print-qr .sv-sheet-qr { width: 72mm; height: 72mm; }
}
