/* ============================================================================
   NoiseCheck — stili applicativo (sopra colors_and_type.css + styles.css)
   ========================================================================== */

#root { height: 100%; }
.nc-app { height: 100vh; display: grid; grid-template-rows: 56px 1fr; overflow: hidden; }

/* density tweak: comoda (default) / compatta */
.nc-app { --pad-card: 22px; --pad-row: 14px; --gap-stack: 18px; }
.nc-app[data-density="compact"] { --pad-card: 16px; --pad-row: 10px; --gap-stack: 12px; }

/* display font tweak */
.nc-app[data-display="grotesk"] { --font-display: 'Space Grotesk', 'Inter Tight', sans-serif; }

/* ---- Top bar ----------------------------------------------------------- */
.nc-topbar { background: var(--teal-600); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 18px; }
.nc-topbar .sep { width: 1px; height: 26px; background: rgba(255,255,255,.15); }
.nc-search { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); padding: 7px 12px; border-radius: 4px; min-width: 260px; }
.nc-search input { background: transparent; border: none; outline: none; color: #fff; font-size: 13px; font-family: inherit; flex: 1; }
.nc-search input::placeholder { color: #B7C7CD; }
.nc-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-400); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; }

/* ---- Body grid --------------------------------------------------------- */
.nc-body { display: grid; grid-template-columns: 244px 1fr; min-height: 0; }

/* ---- Sidebar ----------------------------------------------------------- */
.nc-side { background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: auto; }
.nc-side-sec { padding: 14px 14px 6px; }
.nc-nav { display: flex; flex-direction: column; gap: 2px; }
.nc-nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 4px; cursor: pointer; color: var(--fg); font-size: 13.5px; font-weight: 500; border: none; background: transparent; font-family: inherit; text-align: left; width: 100%; transition: background var(--dur-fast) var(--ease-standard); position: relative; }
.nc-nav-item:hover { background: var(--bg-sunken); }
.nc-nav-item.active { background: var(--teal-50); color: var(--teal-700); box-shadow: inset 2px 0 0 var(--red-500); }
.nc-nav-item .ix { font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); margin-left: auto; font-variant-numeric: tabular-nums; }
.nc-nav-item.active .ix { color: var(--teal-500); }

.nc-side-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--fg-muted); }

/* ---- Main scroll area --------------------------------------------------- */
.nc-main { overflow: auto; }
.nc-main-inner { max-width: 1040px; margin: 0 auto; padding: 26px 30px 60px; }
.nc-page-enter { animation: ncFade var(--dur-slow) var(--ease-standard); }
@keyframes ncFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Page header ------------------------------------------------------- */
.nc-phead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.nc-phead h1 { font-family: var(--font-sans); font-size: 26px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 3px; color: var(--fg); }
.nc-phead p { margin: 0; color: var(--fg-muted); font-size: 14px; max-width: 62ch; }
.nc-phead .ico-tile { width: 44px; height: 44px; border-radius: 8px; background: var(--teal-50); color: var(--teal-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- Two-column work grid ---------------------------------------------- */
.nc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 880px) { .nc-grid { grid-template-columns: 1fr; } }

.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(1,68,85,.06), inset 0 0 0 1px var(--border); }
.card-head { padding: var(--pad-row) var(--pad-card); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-body { padding: var(--pad-card); }
.card-title { font-size: 14.5px; font-weight: 600; margin: 0; color: var(--fg); }

/* ---- Result readout ("instrument display") ----------------------------- */
.nc-readout { background: var(--teal-700); border-radius: 8px; padding: 22px var(--pad-card); color: #fff; position: relative; overflow: hidden; }
.nc-readout::before, .nc-readout::after { content: ''; position: absolute; left: 16px; right: 16px; height: 2px; background: rgba(255,255,255,.16); }
.nc-readout::before { top: 12px; } .nc-readout::after { bottom: 12px; }
.nc-readout .ro-label { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-inverse-muted); }
.nc-readout .ro-value { font-family: var(--font-mono); font-weight: 600; font-size: 52px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 6px; display: flex; align-items: baseline; gap: 8px; }
.nc-readout .ro-unit { font-size: 20px; color: var(--fg-inverse-muted); font-weight: 500; }
.nc-readout.placeholder .ro-value { color: var(--fg-inverse-muted); }

/* secondary stat row */
.nc-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.nc-stat { background: #fff; padding: 14px 16px; }
.nc-stat .s-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); }
.nc-stat .s-value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--teal-700); font-variant-numeric: tabular-nums; margin-top: 2px; }
.nc-stat .s-value .u { font-size: 12px; color: var(--fg-muted); font-weight: 400; margin-left: 3px; }

/* ---- Compliance rows --------------------------------------------------- */
.nc-comp { display: flex; flex-direction: column; gap: 8px; }
.nc-comp-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--border); }
.nc-comp-row.ok { background: var(--success-bg); border-color: #BFE0CD; }
.nc-comp-row.no { background: var(--danger-bg); border-color: #F4C7C7; }
.nc-comp-row .ci { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.nc-comp-row.ok .ci { background: var(--success); }
.nc-comp-row.no .ci { background: var(--red-500); }
.nc-comp-row .cm { flex: 1; }
.nc-comp-row .ct { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.nc-comp-row .cs { font-size: 12px; color: var(--fg-muted); font-family: var(--font-mono); }
.nc-comp-verdict { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.nc-comp-row.ok .nc-comp-verdict { color: var(--success); }
.nc-comp-row.no .nc-comp-verdict { color: var(--red-600); }

/* ---- Source rows (dynamic) --------------------------------------------- */
.nc-src-row { display: grid; align-items: center; gap: 8px; margin-bottom: 8px; }
.nc-src-num { width: 26px; height: 26px; border-radius: 4px; background: var(--teal-50); color: var(--teal-700); font-family: var(--font-mono); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-rm { width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--border); background: #fff; color: var(--fg-subtle); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all var(--dur-fast); }
.btn-rm:hover { color: var(--red-500); border-color: var(--red-200); background: var(--red-50); }
.btn-rm:disabled { opacity: .4; cursor: not-allowed; }

/* ---- Segmented control -------------------------------------------------- */
.nc-seg { display: inline-flex; background: var(--bg-sunken); padding: 3px; border-radius: 6px; gap: 2px; }
.nc-seg button { border: none; background: transparent; padding: 7px 14px; border-radius: 4px; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--fg-muted); cursor: pointer; display: flex; align-items: center; gap: 7px; transition: all var(--dur-fast); }
.nc-seg button.on { background: #fff; color: var(--teal-700); box-shadow: var(--shadow-1); font-weight: 600; }

/* ---- Timeline (intervals) ---------------------------------------------- */
.nc-timeline { display: flex; flex-direction: column; gap: 6px; }
.nc-tl-row { display: grid; grid-template-columns: 92px 1fr 56px; align-items: center; gap: 12px; }
.nc-tl-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-muted); }
.nc-tl-bar-wrap { height: 22px; background: var(--bg-sunken); border-radius: 3px; position: relative; overflow: hidden; }
.nc-tl-bar { position: absolute; inset: 0 auto 0 0; background: var(--teal-400); border-radius: 3px; display: flex; align-items: center; padding-left: 8px; }
.nc-tl-bar.hot { background: var(--red-400); }
.nc-tl-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--fg); text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Tool cards (home) ------------------------------------------------- */
.nc-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px) { .nc-tools { grid-template-columns: 1fr; } }
.nc-tool { background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border); padding: 20px; cursor: pointer; transition: box-shadow var(--dur-med), transform var(--dur-med); display: flex; flex-direction: column; gap: 12px; text-align: left; border: none; font-family: inherit; }
.nc-tool:hover { box-shadow: var(--shadow-2), inset 0 0 0 1px var(--teal-200); transform: translateY(-2px); }
.nc-tool .t-ico { width: 42px; height: 42px; border-radius: 8px; background: var(--teal-600); color: #fff; display: flex; align-items: center; justify-content: center; }
.nc-tool h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--fg); }
.nc-tool p { margin: 0; font-size: 13px; color: var(--fg-muted); line-height: 1.5; flex: 1; }
.nc-tool .t-go { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--red-500); }

/* ---- Misc -------------------------------------------------------------- */
.nc-note { display: flex; gap: 10px; padding: 12px 14px; background: var(--info-bg); border-radius: 6px; font-size: 12.5px; color: var(--teal-700); line-height: 1.5; }
.nc-note .ni { color: var(--teal-500); flex-shrink: 0; margin-top: 1px; }
.nc-divider { height: 1px; background: var(--border); margin: var(--gap-stack) 0; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--red-500); }
.nc-formula { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); background: var(--bg-sunken); padding: 8px 12px; border-radius: 4px; border: 1px solid var(--border); }
.nc-err { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--danger-bg); border: 1px solid #F4C7C7; border-radius: 6px; font-size: 12.5px; color: var(--red-700); }
.input-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.btn { white-space: nowrap; }
.field-label { display: flex; align-items: center; gap: 6px; }
