:root {
  --bg: #0A0A0F;
  --bg-2: #101018;
  --panel: #13131D;
  --panel-2: #191926;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --text: #F4F2FA;
  --muted: #9C98B0;
  --dim: #6B6880;
  --violet: #7C3AED;
  --violet-2: #A855F7;
  --violet-soft: rgba(124,58,237,.16);
  --glow: 0 0 0 1px rgba(168,85,247,.35), 0 10px 40px -10px rgba(124,58,237,.55);
  --radius: 16px;
  --radius-sm: 10px;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;

  --st-bozza: #6B6880;
  --st-da_approvare: #F5B83D;
  --st-modifiche: #F0566A;
  --st-approvato: #2FD08A;
  --st-pubblicato: #A855F7;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(168,85,247,.08), transparent 60%);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
#app { position: relative; z-index: 1; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--violet-2); }
img { display: block; max-width: 100%; }
.display { font-family: var(--display); letter-spacing: -.01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: .15s ease; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: rgba(168,85,247,.5); background: #1e1d2e; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }
.btn.primary { background: linear-gradient(135deg, var(--violet), var(--violet-2)); border-color: transparent; box-shadow: 0 8px 24px -8px rgba(124,58,237,.7); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8394; }
.btn.danger:hover { border-color: rgba(240,86,106,.6); background: rgba(240,86,106,.08); }
.btn.ok { background: rgba(47,208,138,.14); border-color: rgba(47,208,138,.45); color: #6ff0b6; }
.btn.warn { background: rgba(240,86,106,.12); border-color: rgba(240,86,106,.45); color: #ff9aa8; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; transition: .15s; color: var(--text);
}
.icon-btn:hover { border-color: rgba(168,85,247,.5); }
.icon-btn svg, .btn svg { width: 16px; height: 16px; }

/* ---------- campi ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line-2); transition: .15s;
}
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--violet-2); background: rgba(124,58,237,.06); outline: none; }
.input[readonly] { opacity: .75; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239C98B0' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
select.input option { background: var(--panel); }
input[type=color].input { padding: 4px; width: 56px; cursor: pointer; }
input[type=date].input, input[type=time].input { color-scheme: dark; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 420px; padding: 40px 32px 32px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(25,25,38,.9), rgba(19,19,29,.9));
  border: 1px solid var(--line-2); box-shadow: var(--glow); backdrop-filter: blur(16px); text-align: center;
}
.login-logos { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 28px; }
.login-logos .x { color: var(--dim); font-size: 18px; }
.login-logo-011 { height: 46px; width: auto; }
.login-card h1 { font: 700 22px/1.25 var(--display); margin: 0 0 8px; }
.login-card p { margin: 0 0 28px; color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-card .btn { height: 46px; }
.login-foot { margin-top: 24px; font-size: 11px; color: var(--dim); letter-spacing: .14em; text-transform: uppercase; }
.err { color: #ff8394; font-size: 13px; min-height: 18px; text-align: center; }

/* ---------- logo cliente ---------- */
.clogo {
  --c: var(--violet); width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; overflow: hidden; background: #fff;
  border: 1px solid var(--line-2);
}
.clogo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.clogo.mono { background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); color: #fff; font: 700 15px var(--display); }
.clogo.lg { width: 64px; height: 64px; border-radius: 18px; }
.clogo.lg.mono { font-size: 22px; }
.clogo.xl { width: 84px; height: 84px; border-radius: 22px; }
.clogo.xl.mono { font-size: 28px; }

/* ---------- layout app ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 24px 16px; border-right: 1px solid var(--line); background: rgba(10,10,15,.7); backdrop-filter: blur(12px);
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.side-logo img { height: 30px; width: auto; }
.side-logo span { font: 600 10px var(--display); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; line-height: 1.3; }
.side-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; padding: 18px 10px 8px; display: flex; justify-content: space-between; align-items: center; }
.side-label button { background: none; border: 0; color: var(--violet-2); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  color: var(--muted); text-decoration: none; font-weight: 500; border: 1px solid transparent; transition: .15s;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-item.active { color: var(--text); background: var(--violet-soft); border-color: rgba(168,85,247,.3); }
.nav-item .clogo { width: 28px; height: 28px; border-radius: 8px; }
.nav-item .clogo.mono { font-size: 11px; }
.nav-item .ico { width: 28px; height: 28px; display: grid; place-items: center; }
.nav-item .ico svg { width: 18px; height: 18px; }
.nav-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--violet); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }

.main { min-width: 0; padding: 28px 32px 48px; }
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.topbar h1 { font: 700 26px/1.15 var(--display); margin: 0; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.topbar .grow { flex: 1; }
.client-head { display: flex; align-items: center; gap: 16px; min-width: 0; }

/* client-only header */
.cbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 32px; border-bottom: 1px solid var(--line); background: rgba(10,10,15,.78); backdrop-filter: blur(14px);
}
.cbar .brand-011 { display: flex; align-items: center; gap: 10px; margin-left: auto; color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.cbar .brand-011 img { height: 22px; width: auto; opacity: .9; }
.client-main { max-width: 1440px; margin: 0 auto; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi {
  position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
}
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(var(--k, rgba(124,58,237,.35)), transparent 70%); }
.kpi .lbl { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .val { font: 700 32px/1.1 var(--display); margin-top: 10px; }
.kpi .hint { color: var(--dim); font-size: 12px; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.section-title { font: 600 13px var(--display); letter-spacing: .04em; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; }
.ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ccard {
  position: relative; border-radius: 20px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); transition: .2s;
}
.ccard:hover { transform: translateY(-2px); box-shadow: var(--glow); border-color: transparent; }
.ccard-top { position: relative; height: 92px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 30%, #0A0A0F)); }
.ccard-top::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent, #000); }
.ccard-top .unread { position: absolute; top: 12px; right: 12px; z-index: 1; }
.ccard .clogo { position: absolute; left: 20px; top: 56px; z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.ccard-body { padding: 44px 20px 18px; }
.ccard h3 { margin: 0; font: 700 17px var(--display); }
.ccard .handle { color: var(--muted); font-size: 12px; }
.progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; display: flex; margin: 16px 0 8px; }
.progress i { display: block; height: 100%; }
.ccard .mini { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ccard .mini b { color: var(--text); }
.ccard .next { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.ccard .next b { color: var(--text); font-weight: 600; }
.ccard-actions { display: flex; gap: 8px; margin-top: 14px; }
.ccard-actions .btn { flex: 1; }
.ccard.add { display: grid; place-items: center; min-height: 260px; border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--muted); text-align: center; }
.ccard.add:hover { color: var(--text); }
.ccard.add .plus { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet-2); font-size: 28px; }

.panel { border-radius: 20px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); padding: 20px; }
.feed-act { display: flex; flex-direction: column; }
.act { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.act:last-child { border-bottom: 0; }
.act .clogo { width: 32px; height: 32px; border-radius: 9px; }
.act .clogo.mono { font-size: 11px; }
.act .txt { flex: 1; min-width: 0; font-size: 13px; }
.act .txt b { font-weight: 600; }
.act .when { color: var(--dim); font-size: 11px; margin-top: 2px; }
.act .quote { color: var(--muted); font-size: 12px; margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--violet); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.act.unread .txt::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--violet-2); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px var(--violet-2); }
.empty { padding: 32px 16px; text-align: center; color: var(--dim); font-size: 13px; }

/* ---------- toolbar calendario ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-label { font: 700 20px var(--display); min-width: 210px; text-align: center; text-transform: capitalize; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--violet-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(168,85,247,.35); }
.seg svg { width: 14px; height: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--muted); cursor: pointer; transition: .15s; }
.chip b { color: var(--text); }
.chip.on { border-color: rgba(168,85,247,.55); background: var(--violet-soft); color: var(--text); }
.chip:hover { border-color: var(--line-2); }

/* ---------- calendario ---------- */
.cal { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 10px 12px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day {
  min-height: 150px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; transition: background .15s; position: relative; min-width: 0;
}
.day:nth-child(7n) { border-right: 0; }
.day.out { background: rgba(0,0,0,.25); }
.day.out .dnum { color: var(--dim); }
.day.weekend { background: rgba(255,255,255,.012); }
.day.today .dnum { background: var(--violet); color: #fff; box-shadow: 0 0 16px rgba(168,85,247,.7); }
.day.drop { background: rgba(124,58,237,.14); box-shadow: inset 0 0 0 2px var(--violet-2); }
.day-top { display: flex; align-items: center; justify-content: space-between; }
.dnum { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 600 12px var(--display); color: var(--muted); }
.day .add-day { opacity: 0; width: 24px; height: 24px; border-radius: 7px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 15px; line-height: 1; transition: .15s; }
.day:hover .add-day { opacity: 1; }
.day .add-day:hover { color: var(--violet-2); border-color: var(--violet-2); }

.pc {
  position: relative; display: flex; gap: 8px; align-items: center; padding: 5px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); transition: .15s; min-width: 0;
}
.pc::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sc); }
.pc:hover { border-color: rgba(168,85,247,.5); transform: translateY(-1px); }
.pc.dragging { opacity: .4; }
.pc-thumb { width: 38px; height: 46px; border-radius: 7px; overflow: hidden; flex: none; background: #1d1c2b; display: grid; place-items: center; position: relative; }
.pc-thumb img, .pc-thumb video { width: 100%; height: 100%; object-fit: cover; }
.pc-thumb .ph { color: var(--dim); }
.pc-thumb .ph svg { width: 16px; height: 16px; }
.pc-thumb .multi { position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; color: #fff; filter: drop-shadow(0 1px 2px #000); }
.pc-info { min-width: 0; flex: 1; }
.pc-meta { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pc-title { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.pc .pc-meta { overflow: hidden; white-space: nowrap; }
.pc .plat { display: none; }
.pc .cm { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; color: var(--muted); }
.pc .cm svg { width: 11px; height: 11px; }
.plat { display: inline-flex; gap: 3px; }
.plat svg { width: 11px; height: 11px; opacity: .8; }

/* ---------- lista ---------- */
.list { display: flex; flex-direction: column; gap: 22px; }
.list-day h4 { margin: 0 0 10px; font: 600 13px var(--display); text-transform: capitalize; color: var(--muted); }
.list-day h4 b { color: var(--text); }
.lrow { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; margin-bottom: 8px; transition: .15s; }
.lrow:hover { border-color: rgba(168,85,247,.5); }
.lrow .pc-thumb { width: 64px; height: 80px; border-radius: 10px; }
.lrow .body { flex: 1; min-width: 0; }
.lrow .cap { color: var(--muted); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 4px; }

/* ---------- pill stato ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--sc) 16%, transparent); color: color-mix(in srgb, var(--sc) 80%, #fff); border: 1px solid color-mix(in srgb, var(--sc) 40%, transparent); white-space: nowrap; }
.pill .dot { background: var(--sc); }
.st-bozza { --sc: var(--st-bozza); }
.st-da_approvare { --sc: var(--st-da_approvare); }
.st-modifiche { --sc: var(--st-modifiche); }
.st-approvato { --sc: var(--st-approvato); }
.st-pubblicato { --sc: var(--st-pubblicato); }

/* ---------- feed IG ---------- */
.ig { max-width: 620px; margin: 0 auto; border-radius: 24px; background: #000; border: 1px solid var(--line-2); overflow: hidden; }
.ig-head { display: flex; align-items: center; gap: 22px; padding: 26px 24px 18px; }
.ig-head .clogo { width: 86px; height: 86px; border-radius: 50%; box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--violet-2); }
.ig-head .clogo.mono { font-size: 26px; }
.ig-head .handle { font-weight: 700; font-size: 16px; }
.ig-head .counts { display: flex; gap: 18px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.ig-head .counts b { color: #fff; }
.ig-tabs { display: flex; justify-content: center; border-top: 1px solid #262626; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.ig-tabs span { padding: 12px 0; border-top: 1px solid #fff; margin-top: -1px; display: flex; gap: 6px; align-items: center; }
.ig-tabs svg { width: 12px; height: 12px; }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-cell { position: relative; aspect-ratio: 4/5; background: #121212; cursor: pointer; overflow: hidden; }
.ig-cell img, .ig-cell video { width: 100%; height: 100%; object-fit: cover; transition: .25s; }
.ig-cell:hover img, .ig-cell:hover video { transform: scale(1.03); filter: brightness(.8); }
.ig-cell .ico { position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }
.ig-cell .date { position: absolute; left: 8px; bottom: 8px; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.ig-cell .sdot { position: absolute; left: 8px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.ig-cell .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--muted); font-size: 12px; }
.ig-note { text-align: center; color: var(--dim); font-size: 12px; margin-top: 12px; }

/* ---------- modale ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(5,5,10,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal { width: 100%; max-width: 1100px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; border-radius: 24px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(168,85,247,.15); overflow: hidden; animation: pop .2s ease; }
.modal.narrow { max-width: 520px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 16px var(--display); margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { overflow: auto; flex: 1; }
.modal-foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.modal-foot .grow { flex: 1; }
.pm { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100%; }
.pm-media { background: #07070b; padding: 20px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); }
@media (min-width: 901px) { .pm-media { position: sticky; top: 0; align-self: start; min-height: 100%; } }
.pm-form { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.viewer { position: relative; aspect-ratio: 4/5; border-radius: 16px; overflow: hidden; background: #111; display: grid; place-items: center; }
.viewer { max-height: calc(100dvh - 300px); min-height: 280px; }
.viewer.story { aspect-ratio: 9/16; max-height: 62vh; margin: 0 auto; width: auto; }
.viewer img, .viewer video { width: 100%; height: 100%; object-fit: contain; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #000; cursor: pointer; display: grid; place-items: center; }
.viewer .nav.l { left: 10px; } .viewer .nav.r { right: 10px; }
.viewer .nav svg { width: 16px; height: 16px; }
.viewer .count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.65); padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.viewer .vdots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.viewer .vdots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); }
.viewer .vdots i.on { background: #fff; }
.viewer-empty { color: var(--dim); text-align: center; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.viewer-empty svg { width: 36px; height: 36px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.strip .th { position: relative; width: 64px; height: 80px; border-radius: 10px; overflow: hidden; flex: none; cursor: pointer; border: 2px solid transparent; background: #1a1a26; }
.strip .th.on { border-color: var(--violet-2); }
.strip .th img, .strip .th video { width: 100%; height: 100%; object-fit: cover; }
.strip .th .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; display: none; place-items: center; font-size: 13px; line-height: 1; }
.strip .th:hover .x { display: grid; }
.strip .addm { width: 64px; height: 80px; flex: none; border-radius: 10px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 22px; background: transparent; }
.strip .addm:hover { color: var(--violet-2); border-color: var(--violet-2); }
.media-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-tools .muted { font-size: 12px; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.drop { border-color: var(--violet-2); background: var(--violet-soft); color: var(--text); }

.toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; transition: .15s; }
.toggle svg { width: 14px; height: 14px; }
.toggle.on { background: var(--violet-soft); border-color: rgba(168,85,247,.55); color: var(--text); }
.toggle[disabled] { cursor: default; }
.counter { font-size: 11px; color: var(--dim); text-align: right; margin-top: -2px; }
.counter.over { color: #ff8394; }
.status-box { padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.status-box .row { align-items: center; }
.approve-row { display: flex; gap: 8px; flex-wrap: wrap; }
.approve-row .btn { flex: 1; }

.comments { display: flex; flex-direction: column; gap: 10px; }
.cmt { padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; max-width: 92%; }
.cmt.me { align-self: flex-end; background: var(--violet-soft); border-color: rgba(168,85,247,.3); }
.cmt .who { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; }
.cmt .who span { font-weight: 400; color: var(--dim); }
.cmt .b { white-space: pre-wrap; word-wrap: break-word; }
.cmt-new { display: flex; gap: 8px; }
.cmt-new textarea.input { min-height: 42px; height: 42px; flex: 1; }

.cred { padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid rgba(168,85,247,.35); font-size: 13px; }
.cred code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #e7d9ff; word-break: break-all; }
.cred .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-top: 10px; }
.cred .l:first-child { margin-top: 0; }
.logo-pick { display: flex; align-items: center; gap: 14px; }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 12px; background: #1d1c2c; border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13px; font-weight: 500; animation: pop .2s ease; display: flex; align-items: center; gap: 10px; }
.toast.err { border-color: rgba(240,86,106,.6); color: #ffb3bd; }
.toast.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-approvato); box-shadow: 0 0 8px var(--st-approvato); }
.loading { opacity: .55; pointer-events: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--violet-2); animation: spin .7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.upbar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--violet), var(--violet-2)); z-index: 300; transition: width .2s; box-shadow: 0 0 10px var(--violet-2); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { background: var(--sc); }
.powered { text-align: center; color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 32px 0 8px; }
.powered b { color: var(--muted); font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  .side-logo { padding: 0 8px 0 0; }
  .side-logo span, .side-label { display: none; }
  .nav-item { flex: none; padding: 6px 8px; }
  .nav-item .nm { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .main { padding: 20px 16px 40px; }
  .cbar { padding: 12px 16px; }
  .cbar .brand-011 span { display: none; }
  .pm { grid-template-columns: 1fr; }
  .pm-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .viewer { max-height: 56vh; margin: 0 auto; width: auto; }
  .overlay { padding: 0; align-items: end; }
  .modal { max-height: 94dvh; border-radius: 22px 22px 0 0; }
}
@media (max-width: 760px) {
  .topbar h1 { font-size: 20px; }
  .month-label { font-size: 16px; min-width: 150px; }
  .kpi .val { font-size: 26px; }
  .cal-head div { padding: 8px 4px; text-align: center; font-size: 10px; letter-spacing: .04em; }
  .day { min-height: 76px; padding: 4px; gap: 3px; }
  .dnum { width: 22px; height: 22px; font-size: 11px; margin: 0 auto; }
  .day .add-day { display: none; }
  .pc { padding: 0; border: 0; background: transparent; }
  .pc::before { display: none; }
  .pc-info { display: none; }
  .pc-thumb { width: 100%; height: auto; aspect-ratio: 4/5; box-shadow: 0 0 0 2px var(--sc); border-radius: 6px; }
  .ig-head { gap: 14px; padding: 18px 14px 14px; }
  .ig-head .clogo { width: 64px; height: 64px; }
  .row.wrap-sm { flex-direction: column; }
}
@media (max-width: 480px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .toolbar .grow { display: none; }
}
