/* Archivio MM — V 1.6 — stile comune, allineato al design system michelamezzetti.com (brand book 21/09/2026) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,600;1,9..144,600&family=Nunito+Sans:wght@400;600;700&display=swap');
:root {
  --ink: #1E1C1A;
  --ink-2: #665C64;
  --line: #e9dfe8;
  --bg: #ffffff;
  --soft: #f7f2f6;
  --accent: #D62718;
  --accent-ink: #ffffff;
  --title: #D61500;
  --ok: #1f7a4d;
  --warn: #9a6a00;
  --bad: #b3261e;
  --radius: 0;
  --grad: linear-gradient(0deg, #f2fad3 0%, #fee6fb 62.1%, #94cae1 96.5%);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--grad) fixed;
  color: var(--ink);
  font: 16px/1.5 "Nunito Sans", "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--ink); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { background: rgba(255,255,255,.82); padding: 8px 20px 28px; margin-top: 18px; border: 1px solid rgba(255,255,255,.9); }
@media (max-width: 640px) { main.wrap { margin-top: 0; padding: 4px 14px 24px; border-left: 0; border-right: 0; } }
header.top {
  border-bottom: 1px solid rgba(214,21,0,.18);
  padding: 18px 0;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: Fraunces, Georgia, serif; font-size: 20px; letter-spacing: .02em; font-weight: 600; color: var(--title); text-transform: none; }
.brand span { font-style: italic; color: var(--title); }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 600; color: var(--title); font-size: 32px; line-height: 1.15; margin: 28px 0 8px; letter-spacing: 0; }
h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; color: var(--title); font-size: 21px; margin: 24px 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
button, .btn {
  font: inherit; font-weight: 600; font-size: 15px;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  min-height: 44px;
}
button.ghost, .btn.ghost { background: #fff; color: var(--ink); }
button.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, textarea, select {
  font: inherit; width: 100%; padding: 11px 12px; border: 1px solid #CBB8C9;
  border-radius: var(--radius); background: #fff; color: var(--ink); min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 1px 0 rgba(214,21,0,.06); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.thumb {
  aspect-ratio: 4 / 5; background: var(--soft); display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; border-bottom: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.thumb .ico { font-size: 13px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-2); }
.thumb .badge {
  position: absolute; left: 8px; top: 8px; background: rgba(30,28,26,.82); color: #fff;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px; border-radius: 2px;
}
.meta { padding: 10px 12px; font-size: 14px; }
.meta .name { font-weight: 600; word-break: break-word; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); }
.pill.pending { background: #fff4d6; color: var(--warn); }
.pill.approved { background: #e3f3ea; color: var(--ok); }
.pill.direct { background: #ecebee; color: #665C64; }
.card.req.direct { border-left: 4px solid #665C64; }
.pill.rejected { background: #fbe4e2; color: var(--bad); }
.notice { padding: 12px 14px; border-left: 3px solid var(--accent); background: rgba(255,255,255,.85); margin: 16px 0; font-size: 14px; }
.error { color: var(--bad); font-size: 14px; margin-top: 8px; }
.hidden { display: none !important; }
footer.foot { border-top: 1px solid rgba(214,21,0,.18); margin-top: 48px; padding: 20px 0 32px; font-size: 12px; color: var(--ink-2); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; max-width: 560px; width: calc(100% - 24px); background: #fff; }
dialog::backdrop { background: rgba(30,28,26,.55); }
.viewer { background: #111; }
.viewer img { display: block; max-width: 100%; margin: 0 auto 8px; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.chk { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; min-height: 0; accent-color: var(--accent); }
@media print { body { display: none; } }

/* Lingua: html[lang] decide cosa mostrare; default bilingue finché lo script non decide */
html[lang="en"] .it { display: none !important; }
html[lang="it"] .en { display: none !important; }
.langpick { font-size: 12px; letter-spacing: .08em; }
.langpick button { min-height: 30px; padding: 3px 9px; font-size: 12px; border-radius: 0; }
/* Sfogliatore PDF */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px; color: #ddd; font-size: 14px; position: sticky; bottom: 0; background: #111; }
.pager button { min-height: 36px; padding: 6px 14px; background: #fff; color: var(--ink); border-color: #fff; }
.pager button:disabled { opacity: .35; }
