/* FVG Film Commission Uploader — stile ispirato a crowdm.ai */
:root {
  --bg: #0F002B;
  --bg-2: #18004A;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --surface-solid: #1c0752;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .22);
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, .62);
  --faint: rgba(255, 255, 255, .38);
  --accent: #703CFF;
  --accent-2: #8a5cff;
  --cyan: #2DEDF0;
  --green: #99E451;
  --red: #FF3B6A;
  --pink: #FD5FE4;
  --orange: #FF5300;
  --radius: 22px;
  --radius-sm: 14px;
  --pill: 99px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }

/* glow di sfondo */
.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-glow span { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .55; }
.bg-glow .g1 { width: 46vw; height: 46vw; background: var(--accent); top: -18vw; right: -12vw; opacity: .45; }
.bg-glow .g2 { width: 32vw; height: 32vw; background: var(--cyan); bottom: -16vw; left: -10vw; opacity: .18; }
.bg-glow .g3 { width: 22vw; height: 22vw; background: var(--pink); top: 40%; left: 45%; opacity: .10; }

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.boot { flex: 1; display: grid; place-items: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--cyan); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tipografia ---------- */
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan);
}
h1, h2, h3 { margin: 0; letter-spacing: -1px; line-height: 1.1; }
h1 { font-size: clamp(30px, 4vw, 48px); font-weight: 700; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--pill);
  border: 1px solid transparent; background: var(--accent); color: #fff;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .2s ease;
  text-decoration: none;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(112, 60, 255, .8); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.cta { background: var(--orange); }
.btn.cta:hover { background: #ff6a22; box-shadow: 0 10px 30px -10px rgba(255, 83, 0, .8); }
.btn.ghost { background: transparent; border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, .4); box-shadow: none; }
.btn.danger { background: transparent; border-color: rgba(255, 59, 106, .5); color: #ff8aa6; }
.btn.danger:hover { background: rgba(255, 59, 106, .14); box-shadow: none; }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.input, select.input {
  height: 48px; padding: 0 18px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--border);
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s; width: 100%;
}
.input:focus { border-color: var(--accent); background: rgba(255, 255, 255, .09); box-shadow: 0 0 0 4px rgba(112, 60, 255, .25); }
.input::placeholder { color: var(--faint); }
select.input option { background: var(--bg-2); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { color: #ff8aa6; font-size: 14px; min-height: 20px; margin: -4px 0 10px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }

/* ---------- Login ---------- */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 16px; }
.login-side { width: 100%; display: flex; justify-content: center; }
.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.login-card { width: 100%; max-width: 520px; padding: 64px 56px 56px; border-radius: 32px; }
.login-logo { width: 300px; max-width: 80%; height: auto; margin: 0 auto 16px; }
.login-client { text-align: center; font-size: 18px; color: var(--muted); margin-bottom: 44px; }
.login-card .field { gap: 8px; margin-bottom: 22px; }
.login-card .field label { font-size: 15px; }
.login-card .input { height: 58px; font-size: 17px; padding: 0 20px; border-radius: 16px; }
.login-card .btn { width: 100%; height: 60px; font-size: 18px; margin-top: 8px; }
@media (max-width: 560px) {
  .login-card { padding: 44px 24px 32px; border-radius: 24px; }
  .login-logo { width: 220px; }
  .login-client { margin-bottom: 32px; }
}

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: rgba(15, 0, 43, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none !important; }
.brand img { height: 30px; width: auto; }
.brand .brand-sub { font-size: 14px; font-weight: 500; color: var(--muted); border-left: 1px solid var(--border-strong); padding-left: 14px; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 9px 16px; border-radius: var(--pill); color: var(--muted); font-weight: 500; font-size: 15px;
  text-decoration: none; transition: background .15s, color .15s;
}
.nav a:hover { color: #fff; background: var(--surface); }
.nav a.active { color: #fff; background: var(--surface-2); }
.topbar .spacer { flex: 1; }
.usermenu { position: relative; }
.userbtn {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 16px;
  border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.userbtn:hover { background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--pink));
}
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.dropdown .dd-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown .dd-head small { color: var(--faint); display: block; }
.dropdown button, .dropdown a {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none;
  border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); font-size: 15px; text-decoration: none;
}
.dropdown button:hover, .dropdown a:hover { background: var(--surface-2); }
.dropdown svg { width: 18px; height: 18px; opacity: .8; }
.hamb { display: none; }

@media (max-width: 820px) {
  .brand .brand-sub { display: none; }
  .nav {
    position: fixed; top: 71px; left: 0; right: 0; flex-direction: column; margin: 0; padding: 10px 16px 16px;
    background: rgba(15, 0, 43, .96); border-bottom: 1px solid var(--border); display: none;
  }
  .nav.open { display: flex; }
  .hamb { display: inline-flex; }
  .userbtn .uname { display: none; }
  .topbar { gap: 10px; }
}

/* ---------- Layout pagine ---------- */
main.page { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 40px) 120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .titles { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.crumbs a:hover { color: #fff; background: var(--surface); text-decoration: none; }
.crumbs .sep { color: var(--faint); }
.crumbs .cur { color: #fff; padding: 4px 8px; font-weight: 600; }

.owner-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; margin-bottom: 20px;
  border-radius: var(--radius-sm); background: rgba(45, 237, 240, .08); border: 1px solid rgba(45, 237, 240, .25); font-size: 15px;
}
.owner-banner b { color: var(--cyan); }

/* ---------- Dropzone ---------- */
.dropzone {
  position: relative; border-radius: var(--radius); padding: 28px;
  border: 1.5px dashed rgba(255, 255, 255, .22);
  background:
    radial-gradient(600px 160px at 50% 0%, rgba(112, 60, 255, .18), transparent 70%),
    var(--surface);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 28px;
  transition: border-color .2s, background .2s, transform .2s;
}
.dropzone.big { flex-direction: column; text-align: center; padding: 64px 24px; justify-content: center; }
.dropzone.hover { border-color: var(--cyan); background: rgba(45, 237, 240, .07); transform: scale(1.005); }
.dz-icon {
  width: 64px; height: 64px; border-radius: 20px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #4a1fd1); box-shadow: 0 14px 40px -10px rgba(112, 60, 255, .9);
}
.dz-icon svg { width: 30px; height: 30px; }
.dz-text { flex: 1; min-width: 220px; }
.dz-text h3 { margin-bottom: 4px; }
.dz-text p { margin: 0; color: var(--muted); font-size: 15px; }
.dz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dropzone.big .dz-actions { justify-content: center; margin-top: 8px; }
.dropzone.big .dz-text { flex: none; }

/* overlay globale drag */
#drop-overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(15, 0, 43, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.drop-overlay-inner {
  width: min(640px, calc(100% - 48px)); padding: 64px 32px; text-align: center; border-radius: 32px;
  border: 2px dashed var(--cyan); background: rgba(45, 237, 240, .06);
  animation: pop .18s ease-out;
}
.drop-overlay-inner .drop-icon { color: var(--cyan); display: inline-flex; margin-bottom: 18px; animation: bob 1.2s ease-in-out infinite; }
.drop-overlay-inner p { color: var(--muted); margin: 10px 0 0; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ---------- Griglia file ---------- */
.section-label { margin: 6px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-label .count { font-size: 13px; color: var(--faint); font-weight: 500; letter-spacing: 0; text-transform: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 32px; }
.grid.folders { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

.folder {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; position: relative;
  transition: background .15s, border-color .15s, transform .15s; color: #fff; text-decoration: none !important; min-width: 0;
}
.folder:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-2px); }
.folder .ficon { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; background: rgba(112, 60, 255, .22); color: #b59bff; }
.folder .ficon svg { width: 22px; height: 22px; }
.folder .fmeta { min-width: 0; flex: 1; }
.folder .fname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder .fsub { font-size: 13px; color: var(--faint); }

.tile {
  position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); }
.tile .thumb { aspect-ratio: 4 / 3; background: linear-gradient(135deg, rgba(112, 60, 255, .18), rgba(45, 237, 240, .06)); display: grid; place-items: center; overflow: hidden; }
.tile .thumb { position: relative; }
.tile .thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.tile .thumb img.loaded { opacity: 1; }
.tile .thumb .ph { position: absolute; font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.tile .thumb.noimg .ph { padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 10px; }
.tile .tinfo { padding: 10px 12px 12px; }
.tile .tname { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tsub { font-size: 12px; color: var(--faint); }

.item-menu {
  position: absolute; top: 8px; right: 8px; z-index: 2; opacity: 0; transition: opacity .15s;
  width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(15, 0, 43, .78); color: #fff; backdrop-filter: blur(6px);
}
.folder .item-menu { position: static; opacity: 0; background: transparent; }
.tile:hover .item-menu, .folder:hover .item-menu, .item-menu:focus-visible { opacity: 1; }
.item-menu:hover { background: var(--accent); }
.item-menu svg { width: 18px; height: 18px; }
@media (hover: none) { .item-menu { opacity: 1 !important; } }

/* vista lista */
.list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 32px; }
.list .lrow { display: grid; grid-template-columns: 44px 1fr 110px 150px 40px; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--border); cursor: pointer; }
.list .lrow:first-child { border-top: 0; }
.list .lrow:hover { background: var(--surface); }
.list .lrow .lthumb { width: 44px; height: 34px; border-radius: 6px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 10px; color: var(--faint); }
.list .lrow .lthumb img { width: 100%; height: 100%; object-fit: cover; }
.list .lrow .lname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.list .lrow .lsize, .list .lrow .ldate { font-size: 13px; color: var(--faint); }
.list .lrow .item-menu { position: static; opacity: 1; background: transparent; }
@media (max-width: 640px) { .list .lrow { grid-template-columns: 44px 1fr 80px 40px; } .list .lrow .ldate { display: none; } }

.seg { display: inline-flex; padding: 4px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border); }
.seg button { border: 0; background: none; width: 36px; height: 32px; border-radius: var(--pill); cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.seg button.on { background: var(--surface-2); color: #fff; }
.seg svg { width: 17px; height: 17px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- Menu contestuale ---------- */
.ctx {
  position: fixed; z-index: 120; min-width: 200px; padding: 6px; border-radius: 14px;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font-size: 14px; }
.ctx button:hover { background: var(--surface-2); }
.ctx button.danger { color: #ff8aa6; }
.ctx svg { width: 17px; height: 17px; opacity: .85; }

/* ---------- Pannello upload ---------- */
#upload-panel {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  width: min(430px, calc(100vw - 32px)); max-height: min(560px, 70vh); display: flex; flex-direction: column;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  overflow: hidden; animation: pop .2s ease-out;
}
.up-head { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.up-head-row { display: flex; align-items: center; gap: 10px; }
.up-head-row h3 { flex: 1; font-size: 16px; letter-spacing: 0; }
.up-head-row .btn.icon { width: 32px; height: 32px; }
.up-stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width .25s ease; }
.bar.done > i { background: var(--green); }
.bar.err > i { background: var(--red); }
.up-list { overflow-y: auto; padding: 6px 8px 10px; }
.up-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 10px; border-radius: 12px; align-items: center; }
.up-item:hover { background: var(--surface); }
.up-item .n { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-item .n small { color: var(--faint); }
.up-item .s { font-size: 12px; color: var(--faint); text-align: right; white-space: nowrap; }
.up-item .s.ok { color: var(--green); }
.up-item .s.err { color: #ff8aa6; }
.up-item .s.skip { color: var(--cyan); }
.up-item .bar { grid-column: 1 / -1; height: 4px; }
.up-item .mini { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 0 0 0 6px; }
.up-item .mini:hover { color: #fff; }
.up-more { text-align: center; font-size: 13px; color: var(--faint); padding: 8px; }
.up-foot { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
#upload-panel.min .up-list, #upload-panel.min .up-foot { display: none; }

/* ---------- Tabelle admin ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255, 255, 255, .025); }
.tbl .ucell { display: flex; align-items: center; gap: 12px; }
.tbl .ucell small { display: block; color: var(--faint); font-size: 13px; }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); white-space: nowrap; }
.badge.admin { color: var(--pink); border-color: rgba(253, 95, 228, .35); background: rgba(253, 95, 228, .08); }
.badge.user { color: var(--cyan); border-color: rgba(45, 237, 240, .3); background: rgba(45, 237, 240, .06); }
.badge.on { color: var(--green); border-color: rgba(153, 228, 81, .35); }
.badge.off { color: #ff8aa6; border-color: rgba(255, 59, 106, .35); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { padding: 20px 22px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.stat .v { font-size: 34px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat .bar { margin-top: 12px; }

.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ucard { padding: 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; color: #fff; text-decoration: none !important; transition: transform .15s, border-color .15s, background .15s; }
.ucard:hover { transform: translateY(-2px); background: var(--surface-2); border-color: var(--border-strong); }
.ucard .top { display: flex; gap: 12px; align-items: center; }
.ucard .avatar { width: 42px; height: 42px; font-size: 15px; }
.ucard .nums { display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
.ucard .nums b { display: block; font-size: 20px; color: #fff; }

/* ---------- Modali ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(8, 0, 24, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 480px; padding: 30px; background: var(--surface-solid); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .18s ease-out; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal h2 { font-size: 24px; margin-bottom: 8px; }
.modal p { color: var(--muted); margin: 0 0 20px; }
.modal .mfoot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.secret { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(153, 228, 81, .08); border: 1px solid rgba(153, 228, 81, .3); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 17px; margin-bottom: 16px; word-break: break-all; }
.secret span { flex: 1; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(6, 0, 18, .94); display: flex; flex-direction: column; animation: fade .15s; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.lb-top .lb-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-top .lb-name small { color: var(--faint); font-weight: 400; margin-left: 8px; }
.lb-stage { flex: 1; position: relative; display: grid; place-items: center; min-height: 0; padding: 0 70px 24px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lb-stage .lb-msg { color: var(--muted); text-align: center; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .06); cursor: pointer; display: grid; place-items: center; color: #fff; }
.lb-nav:hover { background: var(--accent); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-nav svg { width: 22px; height: 22px; }
@media (max-width: 640px) { .lb-stage { padding: 0 10px 70px; } .lb-nav { top: auto; bottom: 14px; transform: none; } .lb-nav.prev { left: calc(50% - 60px); } .lb-nav.next { right: calc(50% - 60px); } }

/* ---------- Toast ---------- */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { pointer-events: auto; max-width: 520px; padding: 12px 20px; border-radius: var(--pill); background: #fff; color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: pop .2s ease-out; text-align: center; }
.toast.err { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #102000; }

footer.foot { position: relative; z-index: 1; text-align: center; padding: 20px; font-size: 13px; color: var(--faint); border-top: 1px solid var(--border); }

/* fix: lightbox, credenziali, griglia mobile */
.lb-stage img { max-height: calc(100vh - 110px); width: auto; height: auto; }
.secret span { white-space: pre-wrap; }
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.folders { grid-template-columns: 1fr; }
  .dz-actions .btn { flex: 1; }
}
