:root { --red: #d12031; --ink: #1d1f23; --muted: #6b7078; --line: #e3e5e8; --bg: #f4f5f7; --card: #fff; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--red); }
h1 { font-size: 1.6rem; margin: .4em 0 .6em; }
h2 { font-size: 1.2rem; margin: 0 0 .6em; }
h3 { font-size: 1.05rem; margin: .2em 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: #fff; border-bottom: 3px solid var(--red); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand img { height: 26px; }
.topbar nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.topbar nav a { text-decoration: none; color: var(--ink); }
.topbar nav form { margin: 0; }
.linklike { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 14px; }
.card.link { text-decoration: none; color: inherit; transition: border-color .15s; }
.card.link:hover { border-color: var(--red); }
.card.hero { border-left: 5px solid var(--red); }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.danger summary { color: var(--red); cursor: pointer; }
.kicker { text-transform: uppercase; letter-spacing: 1px; font-size: .75rem; color: var(--muted); }
.muted { color: var(--muted); }
.warn { background: #fff4e0; border: 1px solid #f3d29a; border-radius: 10px; padding: 10px 12px; }
.crumbs { margin: 0; font-size: .9rem; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; background: #e8f5e9; border: 1px solid #b7dfb9; }
.flash.error { background: #fdecea; border-color: #f5c2bd; }
.flash.info { background: #e8f0fe; border-color: #bcd0f7; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.list .card { margin-bottom: 8px; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid #cfd3d8; border-radius: 10px; background: #fff; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
.form label, .form > div > label { display: block; font-weight: 600; margin: 10px 0 4px; }
.form label input, .form label select, .form label textarea { margin-top: 4px; font-weight: 400; }
.form .helptext { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.form .errorlist { color: var(--red); margin: 4px 0; padding-left: 18px; }
.form > .btn, .form button.btn { margin-top: 14px; }
.row label { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; margin: 6px 0 !important; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; margin: 8px 0; }
.presence { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.presence .radio { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.presence .sub { flex: 1 1 260px; font-size: .9rem; }
form.inline { display: inline; }
details summary { cursor: pointer; margin: 6px 0; }
.pill { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: #eef0f3; white-space: nowrap; }
.pill.open { background: #e8f5e9; color: #1b7a2e; }
.pill.locked { background: #fff4e0; color: #9a5b00; }
.pill.draft { background: #eef0f3; }
.copy { display: flex; gap: 8px; margin: 10px 0; }

/* anteprime slide */
.stage-host { position: relative; overflow: hidden; background: #000; aspect-ratio: 16 / 9; border-radius: 8px; margin: 8px 0; }
.stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.play-badge { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 110px; display: flex; align-items: center; justify-content: center; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.preview-grid.wide figure { margin: 0; }
.preview-grid figcaption { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-grid .grid-title { grid-column: 1 / -1; margin: 14px 0 0; color: var(--red); }

/* upload */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 2px dashed #cfd3d8; border-radius: 14px;
  text-align: center; cursor: pointer; background: #fafbfc; }
.dropzone.over, .dropzone:hover { border-color: var(--red); background: #fff5f6; }
.dropzone input { display: none; }
.dropzone strong { color: var(--red); }
.transfer { display: grid; grid-template-columns: 1fr 120px 70px; gap: 8px; align-items: center; font-size: .9rem; margin: 8px 0; }
.transfer .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer progress { width: 100%; accent-color: var(--red); }
.transfer.failed { color: var(--red); grid-template-columns: 1fr auto; }
.transfer.failed progress { display: none; }
.items { margin-top: 12px; }
.item { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item .thumb { position: relative; display: block; width: 120px; aspect-ratio: 16 / 9; background: #eee; border-radius: 6px; overflow: hidden; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.item .badge { position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 4px; }
.item .meta { min-width: 0; }
.item .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.item .meta small { color: var(--muted); }
.item.error .meta small { color: var(--red); }
.item .actions { display: flex; gap: 4px; }
.item .actions button, .tbl button { min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.item .actions button:disabled, .tbl button:disabled { opacity: .35; cursor: default; }
.spinner { width: 22px; height: 22px; border: 3px solid #ddd; border-top-color: var(--red); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* gestione */
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.off td { opacity: .5; }
.tbl .num { color: var(--muted); width: 28px; }
.nowrap { white-space: nowrap; text-align: right; }
.toggle { min-width: 52px !important; font-weight: 700; font-size: .75rem !important; color: var(--muted); }
.toggle.on { background: var(--red) !important; color: #fff; border-color: var(--red) !important; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.member { display: flex !important; gap: 12px; align-items: center; margin: 0 !important; }
.member img, .member .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.member .avatar { display: flex; align-items: center; justify-content: center; background: var(--red); color: #fff; font-weight: 700; }
.member.off { opacity: .5; }
.account { padding: 12px 0; border-bottom: 1px solid var(--line); }
.grid-rows { display: flex; flex-direction: column; gap: 8px; }
.grid-row, .grid-head { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: 8px; }
.grid-rows.two .grid-row { grid-template-columns: 1fr 1fr; }
.grid-head { font-size: .8rem; color: var(--muted); }
.grid-row .stack { display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 720px) {
  .columns { grid-template-columns: 1fr; }
  .grid-row, .grid-head { grid-template-columns: 1fr; }
  .grid-head { display: none; }
  .grid-row { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .item { grid-template-columns: 96px 1fr; }
  .item .thumb { width: 96px; }
  .item .actions { grid-column: 1 / -1; justify-content: flex-end; }
  h1 { font-size: 1.35rem; }
}

/* barra superadmin "agisci come" */
.imp-bar { background: #23262b; color: #ddd; font-size: .85rem; padding: 6px 16px; }
.imp-bar.active { background: #ffd54a; color: #3a2d00; }
.imp-bar form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; }
.imp-bar select { width: auto; max-width: 340px; padding: 4px 8px; font-size: .85rem; }
.imp-bar a { color: inherit; margin-left: auto; }
.imp-btn { background: #3a2d00; color: #ffd54a; border: 0; border-radius: 6px; padding: 5px 12px; font-weight: 700; cursor: pointer; }

/* team */
.role-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #f1f2f4; border-radius: 999px; padding: 3px 4px 3px 12px; font-size: .9rem; }
.chip button { border: 0; background: #fff; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.chip.add { background: none; padding: 0; }
.chip.add select { padding: 4px 8px; font-size: .85rem; border-radius: 999px; }
.preview-grid.one { grid-template-columns: 1fr; }
