/* Area riservata: riusa style.css (sezione 11) e aggiunge solo l'impaginazione. */
body.admin { min-height: 100vh; }
.admin-main { padding: 32px var(--gutter) 96px; }
.admin-narrow { max-width: 520px; margin-inline: auto; }
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.admin-bar strong { font-weight: 500; }
.admin-bar .studio-actions { gap: 16px; }
.admin-status { color: var(--muted); font-size: 12px; }
.admin-status.is-dirty { color: var(--accent, #e10600); }
.admin-list { display: grid; margin: 0; padding: 0; list-style: none; max-height: 60vh; overflow: auto; border-block: 1px solid var(--line); }
.admin-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 6px 0;
  font-weight: 400;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.admin-list button[aria-current="true"] { text-decoration: underline; }
.admin-list small { color: var(--muted); }
.admin-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.admin-media li { display: grid; gap: 6px; font-size: 11px; }
.admin-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface); }
.admin-media input { min-height: 36px; padding: 6px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; }
.admin-media .edit-media-actions { gap: 0 12px; }
.admin-media .edit-media-actions button { min-height: 32px; font-size: 11px; font-weight: 400; }
.admin-portraits { display: grid; grid-template-columns: repeat(2, minmax(0, 160px)); gap: 16px; }
.admin-portraits img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface); }
.bookmarklet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px dashed var(--ink);
  font-weight: 500;
  cursor: grab;
}
.admin-help { max-width: 62ch; color: var(--muted); font-size: 13px; }
.admin-help ol { padding-left: 18px; }
.upload-progress { font-size: 12px; color: var(--muted); }
.save-page { max-width: 560px; margin-inline: auto; padding: 24px 20px 48px; }
.save-page h1 { font-size: 20px; margin-bottom: 4px; }
.save-preview { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: top; background: var(--surface); margin: 16px 0; }
.tag-suggestions { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.tag-suggestions button { min-height: 32px; font-weight: 400; color: var(--muted); }
.tag-suggestions button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; }
/* Ritaglio a formato fisso. */
.cropper { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .55); }
.cropper-box { display: grid; gap: 12px; max-width: 100%; padding: 20px; background: var(--paper); }
.cropper-frame { position: relative; overflow: hidden; background: var(--surface); cursor: grab; touch-action: none; outline: 1px solid var(--ink); }
.cropper-frame.is-dragging { cursor: grabbing; }
.cropper-frame img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; transform-origin: 0 0; }
.cropper-zoom { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.cropper-zoom input { width: 100%; accent-color: var(--ink); }
.cropper strong { color: var(--ink); font-weight: 500; }
.cropper-fit { min-height: 32px; }
.cropper-frame.is-fit { cursor: default; background: repeating-conic-gradient(#e6e6e3 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
/* Doppio controllo. */
.qr { width: 200px; margin: 16px 0; padding: 8px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
code.secret { color: var(--ink); font-size: 13px; letter-spacing: .04em; word-break: break-all; }
.backup-codes { margin: 16px 0; padding: 16px; border: 1px solid var(--ink); }
.backup-codes ol { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 32px; margin: 12px 0; }
.backup-codes code { color: var(--ink); font-size: 15px; }
.admin-media video { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface); }
.admin-media select { min-height: 32px; margin-left: 6px; font-size: 12px; }
.admin-portraits button { min-height: 32px; font-size: 11px; font-weight: 400; justify-self: start; }
.link-tool { margin: -6px 0 0; }
.link-tool button { min-height: 32px; font-size: 12px; font-weight: 400; color: var(--muted); }
.link-tool button:hover { color: var(--ink); }
/* Statistiche. */
.stats { display: grid; gap: 32px; }
.stats-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.stats-head button { min-height: 32px; font-weight: 400; }
.stats-periods { margin: 0; }
.stats-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 0; }
.stats-totals p { display: grid; gap: 4px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.stats-totals strong { font-size: clamp(32px, 4vw, 52px); font-weight: 500; line-height: 1; letter-spacing: -.03em; color: var(--ink); }
.stats-chart { margin: 0; }
.stats-bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--ink); }
.stats-bars span { flex: 1 1 0; min-width: 1px; background: var(--ink); }
.stats-bars span:hover { background: var(--accent, #e10600); }
.stats-chart figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px 40px; }
.stats-block h3 { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.stats-list { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.stats-list li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stats-list li > span:first-child { overflow-wrap: anywhere; }
.stats-list li .micro { flex: none; }
.cv-pdf ol { margin: 8px 0 12px; padding-left: 18px; }
.cv-pdf a { text-decoration: underline; }
.cv-pdf button { min-height: 32px; font-size: 12px; font-weight: 400; justify-self: start; }
