/*
 * La simulazione dell'interfaccia di EUCMT (pagina /solutions/eucmt/demo, dentro un iframe della
 * landing). Colori, misure e caratteri sono quelli di src/EUCMT.App/Theme/Tokens.axaml e Styles.axaml
 * del repository EUCMT (stile tecnico, ADR-0013), con il tema scuro; la struttura e' quella di
 * Views/MainWindow.axaml. I caratteri (IBM Plex Sans e IBM Plex Mono: SIL Open Font License, testo in
 * fonts/) sono ridotti all'alfabeto latino. Se l'interfaccia vera cambia, va riallineato anche questo file.
 */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); }

:root {
    color-scheme: light;
    --ground: #eceef1;
    --surface: #ffffff;
    --surface-alt: #f5f6f8;
    --header: #f3f5f7;
    --row-hover: #f2f5fa;
    --divider: #eef0f3;
    --border: #d3d8df;
    --border-strong: #aeb6c2;
    --text: #14181f;
    --text-2: #3b4350;
    --caption: #576070;
    --status: #e3e6ea;
    --accent: #2c4a9a;
    --accent-hover: #233c80;
    --on-accent: #ffffff;
    --accent-soft: #e4e9f5;
    --accent-soft-text: #22397a;
    --accent-soft-border: #a3b3db;
    --sidebar: #1b1f27;
    --sidebar-hover: #252a34;
    --sidebar-active: #2e3440;
    --sidebar-text: #c9ced6;
    --sidebar-muted: #8d95a2;
    --sidebar-badge: #343a46;
    --sidebar-edge: #0e1116;
    --overlay: rgba(20, 24, 32, 0.6);
    --veil: rgba(11, 13, 17, 0.55);
    --log-bg: #111419;
    --log-text: #c9cfd8;
    --log-muted: #8b94a2;
    --log-border: #262b33;
    --mark-missing: #0b6e85;
    --mark-different: #d08a1e;
    --mark-equal: #9aa3af;
    --info-bg: #eaf4f7; --info-fg: #0b5e73; --info-bd: #8dbbc8;
    --ok-bg: #e6f3ec; --ok-fg: #0e5c40; --ok-bd: #a9d2bc;
    --warn-bg: #fbf3e6; --warn-fg: #8a4b00; --warn-bd: #ddb27c;
    --error-bg: #fbedec; --error-fg: #a1231b; --error-bd: #e2a09a;
    --manual-bg: #f3effb; --manual-fg: #5a3d99; --manual-bd: #bbaae0;
    --muted-bg: #f4f5f7; --muted-fg: #4d5563; --muted-bd: #c6ccd5;
    --fresh: rgba(44, 74, 154, 0.12);
    --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --ground: #0f1115;
        --surface: #161a20;
        --surface-alt: #1b2028;
        --header: #1a1f27;
        --row-hover: #1e242d;
        --divider: #20252d;
        --border: #2a303a;
        --border-strong: #3a414d;
        --text: #e3e7ed;
        --text-2: #b4bcc8;
        --caption: #9aa3b0;
        --status: #0b0d11;
        --accent: #7c96e8;
        --accent-hover: #93aaf0;
        --on-accent: #0b0d11;
        --accent-soft: #172036;
        --accent-soft-text: #9db1f0;
        --accent-soft-border: #34477a;
        --sidebar: #0b0d11;
        --sidebar-hover: #1a1e25;
        --sidebar-active: #222833;
        --sidebar-text: #b4bcc8;
        --sidebar-muted: #8b94a2;
        --sidebar-badge: #2a303a;
        --sidebar-edge: #23282f;
        --overlay: rgba(0, 0, 0, 0.7);
        --veil: rgba(0, 0, 0, 0.7);
        --log-bg: #0b0d11;
        --log-border: #20252d;
        --mark-missing: #3ba7bf;
        --mark-different: #e0a040;
        --mark-equal: #6e7785;
        --info-bg: #12262c; --info-fg: #6cc6da; --info-bd: #2c5560;
        --ok-bg: #13281f; --ok-fg: #7fd3a6; --ok-bd: #2a5a43;
        --warn-bg: #2a2114; --warn-fg: #f0b464; --warn-bd: #5e4520;
        --error-bg: #2e1716; --error-fg: #ff9c93; --error-bd: #6b2a26;
        --manual-bg: #221c33; --manual-fg: #c3aef5; --manual-bd: #4a3d6e;
        --muted-bg: #1a1f26; --muted-fg: #9aa3b0; --muted-bd: #343b46;
        --fresh: rgba(124, 150, 232, 0.18);
    }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); color: var(--text); font-family: var(--sans); font-size: 13px; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow: hidden; }
#eu-app { height: 100%; position: relative; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ico { display: block; flex-shrink: 0; }
.mono { font-family: var(--mono); }
.caption { color: var(--caption); font-size: 12px; }
.muted { color: var(--caption); }
.overline, .colhead { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--caption); }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.count { font-family: var(--mono); font-size: 11px; color: var(--caption); }

/* ---------------------------------------------------------------- finestra (MainWindow.axaml) */
.window { height: 100%; display: flex; flex-direction: column; }
.stripe { height: 3px; flex-shrink: 0; }
.appbar { flex-shrink: 0; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; background: var(--sidebar); color: var(--sidebar-text); border-bottom: 1px solid var(--sidebar-edge); min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand img { width: 18px; height: 18px; }
.brand strong { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: 0.12em; color: #fff; }
.vsep { width: 1px; height: 16px; background: var(--sidebar-badge); flex-shrink: 0; }
.customer { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; border: 0; border-radius: 3px; background: none; color: #fff; font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.customer:hover { background: var(--sidebar-hover); }
.customer .dot, .status .dot { width: 8px; height: 8px; flex-shrink: 0; }
.slash { color: var(--sidebar-muted); }
.project-picker { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 26px; min-width: 220px; padding: 0 8px; border: 1px solid var(--sidebar-badge); border-radius: 3px; background: var(--sidebar-hover); color: #e6e9ee; font-size: 12.5px; font-weight: 600; }
.project-picker .ico { color: var(--sidebar-muted); }
.project-picker > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.project-picker select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.spacer { flex: 1; }
.appbar .icon-btn { width: 28px; height: 26px; display: inline-grid; place-items: center; border: 0; border-radius: 3px; background: none; color: var(--sidebar-text); cursor: pointer; }
.appbar .icon-btn:hover { background: var(--sidebar-hover); color: #fff; }

.body { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 196px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text); border-right: 1px solid var(--sidebar-edge); padding: 6px; display: flex; flex-direction: column; justify-content: space-between; overflow-y: auto; }
.nav-top, .nav-bottom { display: flex; flex-direction: column; gap: 1px; }
.nav-bottom { border-top: 1px solid var(--sidebar-badge); padding-top: 5px; }
.nav-group { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-muted); padding: 10px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border: 0; border-radius: 3px; background: none; color: var(--sidebar-text); font-size: 13px; text-align: left; cursor: pointer; white-space: nowrap; }
.nav-item .ico { color: var(--sidebar-muted); }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item.active .ico { color: #fff; }
.corellix { display: block; width: 112px; margin: 12px 8px 4px; }
.content { flex: 1; min-width: 0; overflow-y: auto; position: relative; }
.page { min-height: 100%; display: flex; flex-direction: column; }
.pagebody { padding: 12px 16px 46px; }
.page.fill { height: 100%; padding-bottom: 22px; }

.statusbar { flex-shrink: 0; height: 24px; display: flex; align-items: center; gap: 14px; padding: 0 10px; background: var(--status); border-top: 1px solid var(--border); font-family: var(--mono); font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.statusbar .status { display: inline-flex; align-items: center; gap: 6px; }
.statusbar button { height: 20px; padding: 0 6px; border: 0; border-radius: 2px; background: none; font-family: var(--mono); font-size: 10.5px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.statusbar button:hover { background: var(--divider); }

.logpanel { flex-shrink: 0; height: 180px; background: var(--log-bg); color: var(--log-text); border-top: 1px solid var(--log-border); display: flex; flex-direction: column; }
.logpanel[hidden] { display: none; }
.log-head { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--log-border); }
.log-head .overline { color: var(--log-muted); }
.log-lines { flex: 1; overflow-y: auto; padding: 4px 12px 8px; font-family: var(--mono); font-size: 11.5px; }
.log-line { display: grid; grid-template-columns: 66px 36px 120px 1fr; gap: 6px; padding: 1px 0; }
.log-line span:not(:last-child) { color: var(--log-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- pagina */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; min-height: 44px; padding: 7px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pagehead .title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 340px; }
.pagehead .title .caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
h1 { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; }
h2, h3 { font-size: 13px; font-weight: 600; margin: 0; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 6px 16px; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.toolbar .tool { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 260px; }
.toolbar .tool .overline { flex-shrink: 0; }
.toolbar .tool .select { flex: 1; }
.guide-btn { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 0; border-radius: 3px; background: none; color: var(--text-2); cursor: pointer; flex-shrink: 0; }
.guide-btn:hover { background: var(--divider); color: var(--text); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.panelhead { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 12px; border-bottom: 1px solid var(--border); }
.panelhead .end { margin-left: auto; }
.panelfoot { min-height: 26px; display: flex; align-items: center; padding: 4px 12px; border-top: 1px solid var(--border); background: var(--surface-alt); font-family: var(--mono); font-size: 11px; color: var(--caption); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 3px; font-size: 12.5px; cursor: pointer; white-space: nowrap; border: 1px solid transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-alt); }
.btn.danger { background: var(--error-fg); border-color: var(--error-fg); color: #fff; font-weight: 600; }
.btn.danger-outline { background: var(--surface); border-color: var(--error-bd); color: var(--error-fg); }
.btn.danger-outline:hover { background: var(--error-bg); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.wide { width: 100%; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 12.5px; }
.link.danger { color: var(--error-fg); }
.link.light { color: var(--sidebar-text); }
.mini { width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); color: var(--accent); cursor: pointer; flex-shrink: 0; }
.mini.quiet { border-color: transparent; background: none; color: var(--text-2); }
.mini:hover { background: var(--divider); }
.badge { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border: 1px solid; border-radius: 2px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.tone-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.tone-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.tone-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bd); }
.tone-error { background: var(--error-bg); color: var(--error-fg); border-color: var(--error-bd); }
.tone-manual { background: var(--manual-bg); color: var(--manual-fg); border-color: var(--manual-bd); }
.tone-muted { background: var(--muted-bg); color: var(--muted-fg); border-color: var(--muted-bd); }
.tone-accent { background: var(--accent-soft); color: var(--accent-soft-text); border-color: var(--accent-soft-border); }
.banner { border: 1px solid; border-radius: 3px; padding: 8px 10px; margin-bottom: 10px; font-size: 12.5px; text-transform: none; font-family: var(--sans); letter-spacing: 0; height: auto; display: block; }
.banner .badge { margin-right: 6px; }
.lockline { display: flex; gap: 10px; align-items: flex-start; }
input[type="text"], input[type="password"], input[type="search"] { width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); font-size: 12.5px; }
input:disabled { opacity: 0.6; }
.select { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); min-width: 0; font-size: 12.5px; }
.select > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select .ico { color: var(--caption); }
.select select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.select.disabled { opacity: 0.6; }
.field { min-width: 0; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12.5px; }
.checkbox input, .check-item input, .cut input, .choice input { width: 15px; height: 15px; accent-color: var(--accent); }
.row-gap { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--caption); padding: 0 12px; height: 24px; background: var(--header); border-bottom: 1px solid var(--border); }
td { padding: 7px 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-card { padding: 0; overflow: hidden; margin-bottom: 12px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .link { margin-left: 14px; }
.progress { height: 4px; background: var(--divider); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width 0.3s ease; }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.fresh { animation: fresh 1.8s ease-out; }
@keyframes fresh { from { background: var(--fresh); } to { background: transparent; } }
.mark { display: inline-block; width: 8px; height: 8px; border: 1px solid var(--mark-equal); flex-shrink: 0; }
.mark.missing { background: var(--mark-missing); border-color: var(--mark-missing); }
.mark.different { background: var(--mark-different); border-color: var(--mark-different); }
.mark.mapped { background: var(--accent-soft); border-color: var(--accent); }

/* Panoramica */
.phases { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--divider); }
.phase { background: var(--surface); padding: 7px 10px; min-width: 0; }
.phase strong { display: flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; color: var(--text-2); }
.phase strong .num { font-family: var(--mono); font-weight: 400; font-size: 11px; }
.phase .caption { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-done { background: var(--ok-bg); }
.phase-done strong { color: var(--ok-fg); }
.phase-current { background: var(--accent-soft); }
.phase-current strong { color: var(--accent-soft-text); }
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; margin-top: 12px; }
.overview .stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.project-row { cursor: pointer; }
.project-row:hover td { background: var(--row-hover); }
.project-row.active td { background: var(--accent-soft); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.kv > span { padding: 7px 12px; border-bottom: 1px solid var(--divider); }
.kv > span:nth-last-child(-n+2) { border-bottom: 0; }
.kv .v { font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; }
.act { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 5px 12px; border-bottom: 1px solid var(--divider); font-size: 12.5px; }
.act:last-child { border-bottom: 0; }

/* Progetto (ProjectView.axaml) */
.form { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.form p { margin: 0; font-size: 12.5px; }
.form > .btn { align-self: flex-start; }
.form .field > .overline { display: block; margin-bottom: 4px; }
.form .field > .caption { display: block; margin-top: 5px; }
textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); font-size: 12.5px; resize: vertical; }
.direction { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; }
.swapbtn { margin-top: 19px; padding: 0 9px; }
.suggestion { display: flex !important; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 0; }

/* Inventario, confronto, mappature, piano */
.inv { display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1.05fr); gap: 8px; align-items: start; }
.inv .card, .cmp .card, .plan .card { padding: 0; overflow: hidden; }
.types { display: flex; flex-direction: column; max-height: 540px; overflow-y: auto !important; }
.type { display: flex; justify-content: space-between; gap: 6px; padding: 6px 12px; border: 0; border-bottom: 1px solid var(--divider); background: none; text-align: left; cursor: pointer; font-size: 12.5px; }
.type:hover { background: var(--row-hover); }
.type.active { background: var(--accent-soft); color: var(--accent-soft-text); }
.search { padding: 4px 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; min-height: 36px; }
.search.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.items { display: flex; flex-direction: column; max-height: 440px; overflow-y: auto; }
.item { display: flex; flex-direction: column; gap: 0; padding: 6px 12px; border: 0; border-bottom: 1px solid var(--divider); background: none; text-align: left; cursor: pointer; min-width: 0; font-size: 12.5px; }
.item:hover { background: var(--row-hover); }
.item.active { background: var(--accent-soft); }
.item strong { font-weight: 600; }
.item strong.t { display: flex; align-items: center; gap: 8px; }
.item .caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.item.row { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; }
.item.row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.stack-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.list-foot { padding: 5px 12px; border-top: 1px solid var(--border); background: var(--surface-alt); font-family: var(--mono); font-size: 11px; color: var(--caption); }
.details { min-height: 200px; }
.details-head { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.details-body { padding: 8px 12px 12px; }
.obj-title { font-size: 14px; font-weight: 600; margin: 2px 0; }
.obj-title.small { font-size: 13px; margin-bottom: 8px; }
.tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--border); padding: 0 12px; }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 7px 0; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
table.props td { padding: 5px 10px 5px 0; font-size: 12.5px; vertical-align: top; overflow-wrap: anywhere; border-bottom: 1px solid var(--divider); }
table.props td:first-child { width: 42%; font-family: var(--mono); font-size: 11px; color: var(--caption); }
pre.json { margin: 0; max-height: 380px; overflow: auto; font-family: var(--mono); font-size: 11.5px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 3px; padding: 8px 10px; }
.dep { display: flex; flex-direction: column; padding: 5px 0; border-bottom: 1px solid var(--divider); font-size: 12.5px; }
.dep.row { flex-direction: row; justify-content: space-between; align-items: center; }
.dep.row > span { display: flex; flex-direction: column; }
.details .overline + .dep, .details .label { margin-top: 10px; }
details.warnings { margin-bottom: 10px; padding: 7px 12px; border-color: var(--warn-bd); }
details.warnings summary { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; color: var(--warn-fg); list-style: none; font-size: 12.5px; }
details.warnings p { margin: 6px 0 0; font-size: 12.5px; }
.picker { min-width: 300px; max-width: 420px; }
.notes { margin-bottom: 10px; padding: 0; }
.notes-head { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 12px; border: 0; background: none; cursor: pointer; font-size: 12.5px; text-align: left; }
.notes.open .notes-head .ico { transform: rotate(180deg); }
.notes-table td { padding: 6px 12px; font-size: 12.5px; vertical-align: top; }
.notes-table td:first-child, .notes-table td:nth-child(2) { width: 1%; white-space: nowrap; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 1px; background: var(--border); border: 1px solid var(--border-strong); border-radius: 3px; overflow: hidden; }
.segmented button { border: 0; background: var(--surface); padding: 0 10px; height: 24px; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.segmented button:hover { background: var(--row-hover); }
.segmented button.active { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 600; }
.segmented button:disabled { cursor: default; }
.segmented .count { margin-left: 4px; }
.filters { margin-bottom: 10px; }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }
table.diff td { padding: 6px 8px; font-size: 12.5px; overflow-wrap: anywhere; }
table.diff td:first-child { font-family: var(--mono); font-size: 11px; color: var(--caption); }
.map-side { display: flex; flex-direction: column; gap: 8px; }
.map-side .btn { margin-top: 8px; }
.map-side .field { margin-top: 8px; }
.plan-name { width: 180px !important; }
.plan-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; align-items: start; }
.item.step { display: grid; grid-template-columns: 30px 82px minmax(0, 1fr); align-items: center; gap: 8px; }
.item.step > span:nth-child(3) { display: flex; flex-direction: column; min-width: 0; }
.item.step .num { align-self: start; padding-top: 1px; }
.item.step > .badge { justify-self: start; }
.note { color: var(--manual-fg) !important; white-space: normal !important; }
.empty { text-align: left; padding: 16px; }
.empty .btn { margin-top: 10px; }
.cut td:first-child, .cut th:first-child { width: 44px; }
.checklist { padding: 0; }
.check-item { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--divider); cursor: pointer; align-items: flex-start; }
.check-item:last-child { border-bottom: 0; }
.check-item input { margin-top: 2px; flex-shrink: 0; }
.check-item > span { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }

/* Mappa di migrazione (MigrationMapView.axaml) */
.mapgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px; gap: 8px; padding: 8px; flex: 1; min-height: 0; }
.pane { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; min-height: 0; }
.pane.over { border: 2px solid var(--accent); }
.pane-head { padding: 6px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.pane-head .line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pane-head .line strong { white-space: nowrap; font-size: 12.5px; }
.pane-head .line .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pane-head .line .end { margin-left: auto; }
.rows { flex: 1; overflow-y: auto; }
.grp { display: flex; align-items: center; gap: 6px; width: 100%; height: 24px; padding: 0 10px 0 8px; border: 0; border-bottom: 1px solid var(--border); background: var(--header); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); cursor: pointer; text-align: left; }
.grp .ico { transform: rotate(-90deg); }
.grp.open .ico { transform: none; }
.grp .end { margin-left: auto; }
.grp.hint { background: var(--accent-soft); color: var(--accent-soft-text); }
.mrow { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 24px; gap: 6px; align-items: center; height: 28px; padding: 0 4px 0 6px; border-bottom: 1px solid var(--divider); background: var(--surface); cursor: grab; position: relative; }
.mrow.target { grid-template-columns: minmax(0, 1fr) auto 24px; padding-left: 10px; cursor: default; }
.mrow:hover { background: var(--row-hover); }
.mrow.origin { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.mrow.chain { background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--border-strong); }
.mrow.ghost { background: var(--info-bg); outline: 1px dashed var(--info-bd); outline-offset: -2px; }
.mrow.dragged { opacity: 0.45; }
.mrow .grip { color: var(--border-strong); }
.mrow .name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mrow .name strong { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .name .caption { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile { width: 16px; height: 16px; flex-shrink: 0; border-radius: 2px; display: grid; place-items: center; font-family: var(--mono); font-size: 8px; font-weight: 600; color: #fff; }
.dropzone { margin: 6px 8px; height: 28px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--border-strong); border-radius: 3px; background: var(--surface-alt); font-size: 11.5px; color: var(--caption); }
.pane.over .dropzone { border-color: var(--accent); color: var(--accent-soft-text); background: var(--accent-soft); }
.plan-pane .counts { display: flex; flex-wrap: wrap; gap: 4px; }
.prow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 22px 22px; gap: 6px; align-items: center; padding: 4px 4px 4px 10px; border-bottom: 1px solid var(--divider); }
.prow > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.prow strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .caption { font-size: 11px; }
.prow .custom { color: var(--manual-fg); font-family: var(--mono); font-size: 10px; }
.prow .pn { display: flex; align-items: center; gap: 6px; min-width: 0; }
.prow.active { background: var(--accent-soft); }
.blocker { margin: 8px 8px 0; padding: 7px 10px; border: 1px solid var(--error-bd); border-radius: 3px; background: var(--error-bg); color: var(--error-fg); font-size: 12px; }
.blocker .btn { margin-top: 6px; height: 24px; font-size: 12px; padding: 0 8px; }
.plan-foot { margin-top: auto; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-alt); display: flex; flex-direction: column; gap: 6px; }
.plan-foot .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.plan-empty { margin: 8px; padding: 18px 14px; border: 1px solid var(--border-strong); border-radius: 3px; text-align: center; color: var(--caption); font-size: 12px; }
.plan-empty .ico { margin: 0 auto 6px; color: var(--accent); }
.chainbar { flex-shrink: 0; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; background: var(--surface); border-top: 1px solid var(--border); overflow-x: auto; white-space: nowrap; }
.chainbar .nodes { display: flex; align-items: center; gap: 4px; }
.cnode { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 3px 0 8px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-alt); font-size: 12.5px; }
.cnode .caption { font-size: 11px; }
.cnode strong { font-weight: 600; }
.chev { color: var(--caption); }
.toast { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 30; max-width: 520px; padding: 7px 10px; border-radius: 3px; background: var(--text); color: var(--surface); font-size: 12.5px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); pointer-events: none; }
.choice { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.choice .badge { margin-left: auto; }
.choices { border: 1px solid var(--border); border-radius: 3px; padding: 4px 8px; margin-bottom: 10px; }

/* Esecuzione (RunView.axaml): tabella dei passi con la corsia sorgente · clone · destinazione */
.kpis { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.kpi { display: inline-flex; gap: 5px; align-items: baseline; }
.kpi b { font-family: var(--mono); font-weight: 400; font-size: 12px; }
.kpi span { font-size: 11.5px; color: var(--caption); }
.runbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.runbar .pct { font-family: var(--mono); font-size: 13px; min-width: 40px; }
.runbar .mid { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.runbar .mid .caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runtable { margin: 0 0 10px; }
.runtable .colheads, .srow { display: grid; grid-template-columns: 34px 84px 130px minmax(0, 1fr) 190px 210px; gap: 0 8px; align-items: center; padding: 0 12px; }
.runtable .colheads { height: 24px; background: var(--header); border-bottom: 1px solid var(--border); }
.srow { height: 28px; border-bottom: 1px solid var(--divider); font-size: 12.5px; }
.srow.gate { background: var(--accent-soft); }
.srow.held { background: var(--warn-bg); }
.srow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.runtable .colheads > span, .srow > .caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.runtable .panelhead { white-space: nowrap; overflow: hidden; }
.runtable .panelhead strong, .runtable .panelhead .end { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.srow .res { display: flex; gap: 6px; align-items: center; min-width: 0; }
.srow .res .caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 11px; }
.sgrp { display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 12px; background: var(--header); border-bottom: 1px solid var(--border); }
.sgrp > * { flex-shrink: 0; }
.sgrp > .overline, .sgrp > .caption { flex-shrink: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgrp.done { background: var(--ok-bg); }
.sgrp.done .overline { color: var(--ok-fg); }
.rail { position: relative; width: 168px; height: 16px; }
.rail .line { position: absolute; left: 21px; right: 21px; top: 7.5px; height: 1px; background: var(--border); }
.rail.active .line { background: var(--accent); }
.rail.held .line { background: var(--warn-fg); }
.rail.done .line { background: var(--ok-bd); }
.rail .tick { position: absolute; left: 83.5px; top: 2px; width: 1px; height: 12px; background: var(--border-strong); }
.rail .node { position: absolute; top: 4px; width: 8px; height: 8px; border: 1px solid var(--caption); background: var(--caption); }
.rail .node.src { left: 17px; }
.rail .node.src.away { background: transparent; }
.rail .node.dst { left: 143px; background: transparent; border-color: var(--border-strong); }
.rail .node.dst.filled { background: var(--ok-fg); border-color: var(--ok-fg); }
.rail .node.dst.flash { animation: landed 0.7s ease-out; }
@keyframes landed { from { box-shadow: 0 0 0 5px rgba(63, 174, 124, 0.45); } to { box-shadow: 0 0 0 0 rgba(63, 174, 124, 0); } }
.rail .tok { position: absolute; top: 5px; width: 6px; height: 6px; margin-left: -3px; background: var(--accent); }
.rail .tok.out { animation: out 0.38s ease-in-out forwards; }
.rail .tok.gate { left: 84px; animation: pulse 0.9s ease-in-out infinite; }
.rail .tok.held { left: 84px; top: 3px; width: 10px; height: 10px; margin-left: -5px; background: var(--warn-bg); border: 2px solid var(--warn-fg); }
.rail .tok.back { animation: back 0.38s ease-in-out forwards; }
.rail .tok.clone { background: var(--ok-fg); animation: in 0.38s ease-in-out forwards; }
@keyframes out { from { left: 21px; } to { left: 84px; } }
@keyframes back { from { left: 84px; opacity: 1; } to { left: 21px; opacity: 0; } }
@keyframes in { from { left: 84px; } to { left: 147px; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(44, 74, 154, 0.35); } 50% { box-shadow: 0 0 0 4px rgba(44, 74, 154, 0.2); } }
.held-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-bd); }
.held-banner strong { color: var(--warn-fg); font-size: 12.5px; }
.held-banner .caption { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--sans); }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--caption); }
.legend i { display: inline-block; width: 6px; height: 6px; background: var(--accent); }
.legend i.clone { background: var(--ok-fg); }
.legend i.todo { width: 8px; height: 8px; border: 1px solid var(--border-strong); background: transparent; }
.console { margin: 0; background: var(--log-bg); color: var(--log-text); border: 1px solid var(--log-border); border-radius: 4px; }
.console-head { height: 30px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-bottom: 1px solid var(--log-border); }
.console-head .overline { color: var(--log-text); }
.console-head .caption { color: var(--log-muted); }
.console-lines { height: 130px; overflow-y: auto; padding: 4px 12px 8px; font-family: var(--mono); font-size: 11.5px; }
.cl { display: grid; grid-template-columns: 70px 46px 1fr; gap: 6px; line-height: 18px; }
.cl .t { color: var(--log-muted); }
.cl .c-REST { color: #7c96e8; } .cl .c-JRNL { color: #7fd3a6; } .cl .c-WARN { color: #f0b464; } .cl .c-SKIP { color: #8b94a2; } .cl .c-VRFY { color: #c3aef5; } .cl .c-RBCK { color: #ff9c93; }

/* Guide delle pagine (GuideLayer.axaml, ADR-0014) */
.guide-layer { position: absolute; inset: 0; z-index: 60; }
.guide-spot { position: absolute; border: 2px solid var(--accent); border-radius: 4px; box-shadow: 0 0 0 9999px var(--veil); pointer-events: none; transition: all 0.15s ease; }
.guide-spot.none { width: 0 !important; height: 0 !important; border: 0; }
.guide-card { position: absolute; width: 340px; max-width: calc(100% - 32px); padding: 10px 14px 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.guide-card .head { display: flex; justify-content: space-between; align-items: center; }
.guide-card h3 { font-size: 14px; margin: 6px 0 4px; }
.guide-card p { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--text-2); }
.guide-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.dots { display: flex; gap: 4px; align-items: center; }
.dots i { width: 6px; height: 6px; background: var(--border); }
.dots i.done { background: var(--accent-soft-border); }
.dots i.active { width: 14px; background: var(--accent); }

/* Finestre di dialogo */
.overlay { position: absolute; inset: 0; background: var(--overlay); z-index: 40; }
.dialog { position: absolute; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.dialog.wide { width: min(680px, calc(100% - 32px)); }
.dialog.xl { width: min(900px, calc(100% - 32px)); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 15px; }
.icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); cursor: pointer; flex-shrink: 0; }
.dialog-body { padding: 12px 18px; overflow-y: auto; font-size: 12.5px; }
.dialog-body p { margin: 0 0 10px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-alt); }
.ct { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ct li { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; }
.ct-dot { width: 16px; height: 16px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 10px; font-weight: 700; margin-top: 1px; }
.ct-ok .ct-dot { background: var(--ok-fg); border-color: var(--ok-fg); color: var(--surface); }
.ct-warn .ct-dot { background: var(--warn-bg); border-color: var(--warn-fg); color: var(--warn-fg); }
.ct-busy .ct-dot { border-color: var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.ct-wait { color: var(--caption); }
.cert { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--warn-bd); border-radius: 3px; background: var(--warn-bg); }
.cert h3 { color: var(--warn-fg); }
.cert dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 12px; }
.cert dd { margin: 0; overflow-wrap: anywhere; }
.addenv { display: grid; grid-template-columns: 240px 1fr; gap: 0; margin: -12px -18px; }
.platforms { padding: 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.platform { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); text-align: left; cursor: pointer; }
.platform.active { border-color: var(--accent); background: var(--accent-soft); }
.envfields { padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.envfields .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.about { display: flex; gap: 16px; align-items: flex-start; }
.about h2 { font-size: 15px; }
.about p { margin: 8px 0 0; }
.brand-logo { display: block; width: 160px; margin-top: 12px; }
.brand-logo.on-dark { display: none; }
@media (prefers-color-scheme: dark) { .brand-logo.on-light { display: none; } .brand-logo.on-dark { display: block; } }

/* La fascia che dice che cosa si sta guardando */
.sim-banner { position: absolute; left: 0; right: 0; bottom: 24px; z-index: 50; padding: 4px 16px; background: rgba(27, 31, 39, 0.92); color: #e3e7ed; font-size: 11.5px; text-align: center; pointer-events: none; }

/* ---------------------------------------------------------------- larghezze */
@media (max-width: 1240px) {
    .sidebar { width: 52px; }
    .nav-item span, .nav-group, .corellix { display: none; }
    .nav-item { justify-content: center; padding: 0; }
    .phases { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .inv { grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr); }
    .mapgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px; }
    .runtable .colheads, .srow { grid-template-columns: 30px 78px 110px minmax(0, 1fr) 176px 150px; }
}

@media (max-width: 900px) {
    .inv, .cmp, .plan, .overview { grid-template-columns: minmax(0, 1fr); }
    .mapgrid { grid-template-columns: minmax(0, 1fr); }
    .page.fill { height: auto; }
    .pane { min-height: 320px; max-height: 460px; }
    .types { flex-direction: row; flex-wrap: wrap; max-height: none; }
    .project-picker { min-width: 150px; }
    .runtable .colheads, .srow { grid-template-columns: 26px 70px minmax(0, 1fr) 176px; }
    .runtable .colheads > :nth-child(3), .srow > :nth-child(3), .runtable .colheads > :nth-child(6), .srow > :nth-child(6) { display: none; }
}

@media (max-width: 640px) {
    .appbar { gap: 6px; padding: 0 6px; }
    .brand strong, .vsep, .slash { display: none; }
    .customer { max-width: 40vw; }
    .project-picker { min-width: 0; flex: 1; }
    .pagebody { padding: 10px 10px 46px; }
    .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    table, thead, tbody, tr, td { display: block; }
    thead { display: none; }
    td { border: 0; padding: 3px 12px; }
    tr { border-bottom: 1px solid var(--divider); padding: 6px 0; }
    .row-actions { text-align: left; }
    .row-actions .link { margin: 0 14px 0 0; }
    .addenv { grid-template-columns: 1fr; }
    .direction { grid-template-columns: 1fr; }
    .swapbtn { margin-top: 0; justify-self: start; }
    .platforms { border-right: 0; border-bottom: 1px solid var(--border); }
    .envfields .two { grid-template-columns: 1fr; }
    .log-line { grid-template-columns: 58px 30px 1fr; }
    .log-line span:nth-child(3) { display: none; }
    .statusbar .hide-s { display: none; }
    .runbar { grid-template-columns: auto minmax(0, 1fr); }
    .runbar .kpis { grid-column: 1 / -1; }
    .runbar .kpis > .caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
