/* Compliance Prodotti — styles. No external CDN: works from Italy and China alike. */
@font-face { font-family: 'Inter Tight'; font-weight: 400; font-display: swap; src: url('../fonts/inter-tight-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url('../fonts/inter-tight-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url('../fonts/inter-tight-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 700; font-display: swap; src: url('../fonts/inter-tight-latin-700-normal.woff2') format('woff2'); }

:root {
  --ink: #141a26; --muted: #4a5468; --soft: #8a93a6; --bg: #f8f9fc; --white: #fff;
  --line: #eceff5; --line-2: #d6dbe6; --violet: #6f49e9; --violet-bg: #f6f3ff; --blue: #1670b0;
  --grad: linear-gradient(90deg, #2fb4f5 0%, #8a5cf6 100%);
  --grad-deep: linear-gradient(160deg, #1e8cd7 0%, #6f49e9 100%);
  --ok: #1f6b44; --ok-bg: #e3f3ea; --rev: #8a4b00; --rev-bg: #fcefd8; --bad: #b42318; --bad-bg: #fdecea;
  --shadow: 0 16px 48px rgba(20, 26, 38, .06); --r: 20px;
  --font: 'Inter Tight', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
a { color: var(--violet); }
a:hover { color: var(--ink); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.zh { color: var(--muted); font-weight: 400; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }

/* Shell */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.sidebar { flex: 1 1 240px; max-width: 100%; background: var(--white); border-right: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; gap: 24px; }
.brandmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brandmark .sq { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); flex: none; }
.brandmark b { display: block; font-size: 17px; letter-spacing: -.02em; }
.brandmark span { font-size: 13px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 15px; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--ink); color: #fff; font-weight: 500; }
.nav a .count { margin-left: auto; font-size: 13px; color: var(--muted); }
.nav a.active .count { color: #fff; }
.nav a .badge-n { margin-left: auto; font-size: 12px; font-weight: 600; color: #fff; background: var(--violet); border-radius: 999px; padding: 2px 9px; }
.nav svg { flex: none; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.me .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me .who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 36px 56px; display: flex; flex-direction: column; gap: 24px; }
.main.narrow { max-width: 1360px; }
.pagehead { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.pagehead .t { display: flex; flex-direction: column; gap: 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: #2a3347; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.icon { width: 40px; min-height: 40px; padding: 0; border-radius: 10px; }
.btn[disabled] { background: var(--line-2); border-color: var(--line-2); color: var(--muted); cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--violet); cursor: pointer; font-weight: 600; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; }
.input, .select, .textarea { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; padding: 0 12px; font: inherit; font-size: 15px; color: var(--ink); }
.textarea { padding: 10px 12px; resize: vertical; min-height: 88px; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--violet); outline-offset: 0; border-color: var(--violet); }
.input.sm, .select.sm { min-height: 38px; font-size: 14px; padding: 0 10px; border-radius: 8px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--violet); }
.errors { color: var(--bad); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.search { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); min-width: 260px; }
.search input { border: 0; outline: 0; font: inherit; font-size: 15px; background: transparent; flex: 1; min-width: 0; color: var(--ink); }

/* Cards */
.card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { min-width: 0; }
fieldset.card { min-width: 0; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.kpi .v { font-size: 42px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.kpi .v small { font-size: 18px; color: var(--muted); font-weight: 500; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); }

.avatar { flex: none; width: 36px; height: 36px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

/* Status */
.st { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; font-weight: 700; font-size: 13px; }
.st-done, .st-available { background: var(--ok-bg); color: var(--ok); }
.st-review { background: var(--rev-bg); color: var(--rev); }
.st-todo { background: var(--line); color: var(--muted); }
.st-missing { background: var(--bad-bg); color: var(--bad); }
.st-na { background: transparent; color: var(--soft); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.outline { background: #fff; border: 1px solid var(--line-2); color: var(--muted); font-weight: 400; }
.tag.violet { background: #f0ecfe; color: #5a3cc4; }
.tag.blue { background: #e8f1fb; color: var(--blue); }

/* Tables */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: .04em; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t.compact td { padding: 6px; }
table.matrix th, table.matrix td { text-align: center; }
table.matrix th.l, table.matrix td.l { text-align: left; }
table.matrix th.grp { border-bottom: 2px solid; font-weight: 600; color: var(--ink); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
table.matrix th.col { white-space: normal; line-height: 1.25; width: 72px; font-size: 12px; letter-spacing: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 14px; text-decoration: none; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bg); font-weight: 600; }

.alert { padding: 12px 16px; border-radius: 14px; font-size: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.info { background: #fff; border: 1px solid var(--line); color: var(--muted); }

.req { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); }
.req .body { flex: 999 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.req .owner { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.req .tools { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; max-width: 100%; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.more > summary { cursor: pointer; list-style: none; color: var(--violet); font-weight: 600; font-size: 14px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.feed { display: flex; flex-direction: column; gap: 14px; }
.feed .it { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.bubble { background: var(--bg); border-radius: 14px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }

.brandpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.brandpick label { display: flex; align-items: center; gap: 16px; min-height: 84px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.brandpick input { accent-color: var(--violet); width: 18px; height: 18px; }
.brandpick label:has(input:checked) { border: 2px solid var(--violet); background: var(--violet-bg); }
.logo-ph { flex: none; width: 120px; height: 48px; border: 1.5px dashed var(--soft); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 11px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; overflow: hidden; }
.logo-ph img { max-width: 100%; max-height: 100%; }
.photo { border-radius: 16px; background: var(--bg); border: 1.5px dashed #b8bfcc; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 13px; text-align: center; }
.photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Auth pages */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth .hero { flex: 1 1 420px; min-height: 320px; background: var(--grad-deep); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth .hero h1 { font-size: 48px; line-height: 1.04; letter-spacing: -.04em; max-width: 540px; }
.auth .hero p { font-size: 18px; max-width: 520px; }
.auth .hero .roles span { display: inline-block; font-size: 13px; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.6); margin: 0 6px 6px 0; }
.auth .panel { flex: 1 1 460px; padding: 48px 24px; display: flex; align-items: center; justify-content: center; }
.auth form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.auth .input { min-height: 52px; border-radius: 14px; font-size: 16px; }
.auth .btn.primary { min-height: 54px; font-size: 17px; }
.langs { display: flex; justify-content: flex-end; gap: 6px; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 28px !important; font-weight: 600; }

@media (max-width: 720px) {
  .main { padding: 20px 16px 48px; }
  .sidebar { padding: 16px; gap: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { min-height: 40px; padding: 0 12px; font-size: 14px; }
  .nav a .count, .nav a .badge-n { margin-left: 6px; }
  .me { margin-top: 0; }
  h1 { font-size: 28px; }
  .auth .hero { padding: 32px 24px; }
  .auth .hero h1 { font-size: 34px; }
  .search { min-width: 0; flex: 1 1 100%; }
}
@media print {
  .sidebar, .actions, .noprint { display: none !important; }
  .card { box-shadow: none; border: 1px solid var(--line-2); break-inside: avoid; }
  body { background: #fff; }
}
