/* =====================================================================
 * UGC Partner — Design system (demo)
 * Tema white-label: --brand e --accent vengono impostate da app.js per agenzia.
 * ===================================================================== */
:root {
  --brand: #424b82;
  --brand-700: #353c6b;
  --accent: #60afff;
  --accent-soft: #c1dce8;
  --bg: #f2f5fb;
  --surface: #ffffff;
  --ink: #1f2547;
  --ink-2: #4b5277;
  --muted: #868dab;
  --line: #e4e8f3;
  --line-2: #eef2f9;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(31,37,71,.05), 0 10px 28px rgba(31,37,71,.07);
  --shadow-sm: 0 1px 2px rgba(31,37,71,.06);
  --ok: #15a37a; --warn: #e08a2a; --info: #3b82f6; --danger: #e5484d;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
.muted { color: var(--muted); }
.boot { padding: 60px; text-align: center; color: var(--muted); }
.i { width: 18px; height: 18px; flex: none; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ----------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 650; cursor: pointer; background: var(--surface); color: var(--ink);
  border-color: var(--line); transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 17px; height: 17px; }
.btn--brand { background: var(--brand); color: #fff; border-color: transparent; }
.btn--brand:hover { filter: brightness(1.05); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn--ghost { background: color-mix(in srgb, var(--brand) 8%, transparent); color: var(--brand); border-color: transparent; }
.btn--lg { padding: 13px 20px; font-size: 15px; border-radius: 13px; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; font-weight: 600; padding: 0; }
.link { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link .i { width: 15px; height: 15px; }

/* ----------------------------- Badges ----------------------------- */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--line-2); color: var(--ink-2); }
.badge--lg { padding: 7px 14px; font-size: 13px; }
.badge--info { background: #e9f0ff; color: var(--info); }
.badge--warn { background: #fdf0df; color: var(--warn); }
.badge--ok { background: #e3f6ec; color: var(--ok); }
.badge--accent { background: color-mix(in srgb, var(--accent) 18%, white); color: color-mix(in srgb, var(--accent) 75%, black); }

/* ------------------------ Tags / thumbs / avatar ------------------ */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 8px; background: var(--line-2); color: var(--ink-2); font-weight: 550; }
.flag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 16%, white); color: color-mix(in srgb, var(--accent) 70%, black); font-weight: 600; }
.thumb {
  position: relative; aspect-ratio: 9 / 12; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, var(--t), color-mix(in srgb, var(--t) 55%, #2a2150));
  display: flex; flex-direction: column; justify-content: flex-end; padding: 8px; color: #fff;
}
.thumb__kind { position: absolute; top: 7px; left: 7px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; background: rgba(0,0,0,.28); padding: 2px 6px; border-radius: 6px; }
.thumb__label { font-size: 11px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.avatar {
  width: 56px; height: 56px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(150deg, var(--t), color-mix(in srgb, var(--t) 50%, #221a45));
}

/* ------------------------------ Cards ----------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.empty { padding: 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty--sm { padding: 14px; border: none; background: var(--line-2); border-radius: 10px; }
.empty a, .empty .link-btn { color: var(--brand); font-weight: 600; }

/* ============================ PUBLIC ============================== */
.public { max-width: 1080px; margin: 0 auto; padding: 22px 22px 60px; }
.public__nav { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 28px; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brandmark__dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.public__domain { color: var(--muted); font-size: 14px; }

.hero { text-align: center; padding: 26px 0 14px; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); font-weight: 650; font-size: 13px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 850; letter-spacing: -.03em; }
.grad { background: linear-gradient(115deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { max-width: 620px; margin: 18px auto 0; font-size: 17px; color: var(--ink-2); }
.hero__quote { max-width: 640px; margin: 26px auto 0; padding: 16px 20px; border-left: 3px solid var(--brand); background: var(--surface); border-radius: 12px; text-align: left; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.hero__quote strong { color: var(--ink); }

.section-title { font-size: 20px; font-weight: 800; margin-top: 50px; }
.section-sub { color: var(--muted); margin: 6px 0 18px; font-size: 14px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.portal-card { --b: var(--brand); --a: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .15s ease; position: relative; overflow: hidden; }
.portal-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--b), var(--a)); }
.portal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.portal-card__logo { font-weight: 800; font-size: 18px; color: var(--b); margin-top: 4px; }
.portal-card__name { font-weight: 700; margin-top: 10px; }
.portal-card__sub { color: var(--muted); font-size: 13px; }
.portal-card__cta { display: flex; align-items: center; gap: 6px; color: var(--b); font-weight: 650; font-size: 14px; margin-top: 16px; }
.portal-card__cta .i { width: 16px; height: 16px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 26px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.feature__ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); margin-bottom: 12px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 14px; }
.public__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 50px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; flex-wrap: wrap; }

/* ============================= AUTH ============================== */
.auth { --b: var(--brand); --a: var(--accent); min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; position: relative; background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--b) 14%, var(--bg)), var(--bg)); }
.auth__back { position: absolute; top: 22px; left: 22px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.auth__back .i { width: 16px; height: 16px; }
.auth__card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); text-align: center; }
.auth__logo { font-weight: 850; font-size: 24px; color: var(--b); }
.auth__sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.auth__card h1 { font-size: 22px; }
.auth__tag { color: var(--ink-2); margin: 6px 0 22px; }
.auth__card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth__card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.auth__card input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfbfe; }
.auth__card input:focus { outline: none; border-color: var(--b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b) 18%, transparent); }
.auth__card .btn--brand { background: var(--b); margin-top: 4px; }
.auth__err { background: #fdecec; color: #c0392b; padding: 9px 12px; border-radius: 10px; font-size: 13px; }
.auth__demo { margin-top: 18px; color: var(--muted); font-size: 13px; }
.auth__powered { margin-top: 22px; color: var(--muted); font-size: 13px; }

/* ----------------------- Home = login (split) --------------------- */
.login-page { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-brand {
  min-height: 100vh;
  padding: 64px 60px; display: flex; flex-direction: column; justify-content: center; gap: 22px;
  background:
    radial-gradient(900px 500px at 12% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%),
    radial-gradient(700px 520px at 90% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(160deg, #242b54, #141831);
  color: #fff;
}
.brandmark--lg { font-size: 22px; color: #fff; }
.brandmark--lg .brandmark__dot { width: 14px; height: 14px; box-shadow: 0 0 0 5px rgba(255,255,255,.08); }
.login-brand h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 850; letter-spacing: -.03em; }
.login-brand .grad { background: linear-gradient(110deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-brand__lead { font-size: 17px; color: rgba(255,255,255,.78); max-width: 460px; }
.login-feats { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.login-feats li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255,255,255,.9); }
.login-feats .i { width: 20px; height: 20px; color: var(--accent); flex: none; }
.login-brand .hero__quote { background: rgba(255,255,255,.06); border-left-color: var(--accent); color: rgba(255,255,255,.85); box-shadow: none; max-width: 520px; margin: 6px 0 0; }
.login-brand .hero__quote strong { color: #fff; }
.login-logo { height: 42px; width: auto; display: block; }
.login-brand__sub { font-size: 13px; color: rgba(255,255,255,.6); margin-top: -12px; letter-spacing: .04em; }
.auth__logo-img { height: 34px; width: auto; display: block; margin: 0 auto 16px; }

.login-form-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 28px; background: var(--bg); }
.login-form-wrap .auth__card { box-shadow: var(--shadow); }
.login-form-wrap .auth__card form { margin-top: 4px; }
.demo-access { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-access__label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; text-align: center; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.demo-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .06s; }
.demo-chip:hover { border-color: var(--c); box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 22%, transparent); color: var(--ink); }
.demo-chip:active { transform: translateY(1px); }
.demo-chip__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.login-reset { color: var(--muted); font-size: 13px; }
.login-reset:hover { color: var(--ink-2); }

@media (max-width: 880px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 44px 26px 36px; gap: 16px; text-align: center; align-items: center; }
  .login-brand__lead { margin-left: auto; margin-right: auto; }
  .login-form-wrap { min-height: auto; padding: 36px 20px 48px; }
  .login-brand h1 { font-size: 30px; }
  .login-feats { display: none; }
  .login-brand .hero__quote { display: none; }
}

/* ============================ PORTAL ============================= */
.portal { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side__brand { display: flex; flex-direction: column; padding: 6px 10px 18px; }
.side__logo { font-weight: 850; font-size: 19px; color: var(--brand); }
.side__powered { font-size: 11px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav__item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: var(--ink-2); font-weight: 600; font-size: 14px; transition: background .12s ease, color .12s ease; }
.nav__item:hover { background: var(--line-2); color: var(--ink); }
.nav__item.is-active { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.nav__item .i { width: 19px; height: 19px; }
.nav__item--new { margin-top: 10px; color: var(--brand); border: 1px dashed color-mix(in srgb, var(--brand) 40%, var(--line)); }
.nav__item--new:hover { background: color-mix(in srgb, var(--brand) 8%, white); }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.nav__sub { color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.nav__sub:hover { color: var(--ink); }
.nav__sub .i { width: 15px; height: 15px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--line-2); }
.dot { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.notif { position: relative; }
.notif__panel { position: absolute; right: 0; top: 46px; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 30; }
.notif__head { font-weight: 700; font-size: 13px; padding: 8px 10px; color: var(--ink-2); }
.notif__item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.notif__item:hover { background: var(--line-2); }
.notif__ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--ink-2); }
.notif__ic .i { width: 16px; height: 16px; }
.notif__ic.warn { background: #fdf0df; color: var(--warn); }
.notif__ic.accent { background: color-mix(in srgb, var(--accent) 16%, white); color: color-mix(in srgb, var(--accent) 70%, black); }
.notif__ic.info { background: #e9f0ff; color: var(--info); }
.notif__item div { display: flex; flex-direction: column; }
.notif__item b { font-size: 13px; }
.notif__item span { font-size: 12px; color: var(--muted); }
.notif__empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.who { font-weight: 650; font-size: 14px; color: var(--ink-2); }

.content { padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.back .i { width: 16px; height: 16px; }
.cd-h { margin: 20px 0 10px; }

/* --------------------------- Dashboard ---------------------------- */
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; transition: transform .1s ease, box-shadow .15s ease; }
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric__n { font-size: 30px; font-weight: 820; letter-spacing: -.02em; }
.metric__l { color: var(--muted); font-size: 13px; font-weight: 600; }

.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); transition: background .12s ease, border-color .12s; }
.row:hover { background: var(--line-2); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row__id { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.row__title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { font-size: 12px; color: var(--muted); }
.row__side { display: flex; align-items: center; gap: 14px; flex: none; }
.row__price { font-weight: 750; }
.card--promo { background: linear-gradient(165deg, color-mix(in srgb, var(--brand) 9%, var(--surface)), var(--surface)); }
.card--promo h2 { margin-bottom: 8px; }
.card--promo p { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.promo__creators { display: flex; gap: 8px; margin-top: 18px; }
.promo__creators .avatar { width: 46px; height: 46px; font-size: 13px; }

/* ---------------------------- Catalog ----------------------------- */
.catalog { display: grid; grid-template-columns: 264px 1fr; gap: 20px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; }
.filters__head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding: 4px 4px 10px; }
.filters__toggle { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; padding: 0; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
.filters__toggle .chev { display: none; }
.filters__head .i { width: 17px; height: 17px; }
.filters__search { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 6px; color: var(--muted); }
.filters__search .i { width: 16px; height: 16px; }
.filters__search input { border: none; background: none; outline: none; width: 100%; color: var(--ink); }
.fgroup { border-top: 1px solid var(--line-2); padding: 10px 2px; }
.fgroup summary { cursor: pointer; font-weight: 650; font-size: 13px; list-style: none; display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::after { content: "+"; color: var(--muted); font-weight: 600; }
.fgroup[open] summary::after { content: "–"; }
.fgroup[open] summary { margin-bottom: 8px; color: var(--ink); }
.chk { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chk input { accent-color: var(--brand); width: 15px; height: 15px; }
.chk--toggle { padding: 6px 2px; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; font-size: 13px; color: var(--ink-2); }
.field span { font-weight: 600; }
.field select, .order select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfe; color: var(--ink); }

.results__bar { margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.results__bar strong { color: var(--ink); }
.creator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; transition: transform .12s ease, box-shadow .15s ease, border-color .12s; }
.ccard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.ccard__top { display: flex; align-items: center; gap: 12px; }
.ccard__id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ccard__code { font-weight: 750; }
.ccard__meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard__rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 13px; color: var(--ink-2); flex: none; }
.ccard__rating .i { width: 15px; height: 15px; color: #f5b301; }
.ccard__thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ccard__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.ccard__flags { display: flex; gap: 5px; flex-wrap: wrap; }
.ccard__price { font-weight: 750; font-size: 14px; white-space: nowrap; }

/* ------------------------- Creator detail ------------------------- */
.cdetail { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.cdetail__hero { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.cdetail__hero .avatar { width: 72px; height: 72px; font-size: 18px; }
.cdetail__hero h1 { font-size: 24px; }
.rating-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 650; color: var(--ink-2); font-size: 14px; }
.rating-line .i { width: 16px; height: 16px; color: #f5b301; }
.privacy-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: color-mix(in srgb, var(--brand) 7%, white); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); border-radius: 12px; font-size: 13px; color: var(--ink-2); }
.privacy-note .i { width: 18px; height: 18px; color: var(--brand); flex: none; }
.cdetail__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.facts { display: flex; flex-direction: column; }
.fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.fact:last-child { border-bottom: none; }
.fact span { color: var(--muted); }
.fact b { text-align: right; font-weight: 650; }
.price-box { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.price-box span { color: var(--muted); font-size: 13px; }
.price-box strong { font-size: 24px; font-weight: 820; }
.side-note { margin-top: 14px; }

/* ----------------------------- Order ------------------------------ */
.order { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.order__main { display: flex; flex-direction: column; gap: 14px; }
.order__main > label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.order__main input, .order__main textarea, .order__main select { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); }
.order__main input:focus, .order__main textarea:focus, .order__main select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.order-creator { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.order-creator b { display: block; }
.order-creator .muted { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.order-generic-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: color-mix(in srgb, var(--accent) 8%, white); border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 12px; }
.order-generic-note .i { color: color-mix(in srgb, var(--accent) 70%, black); flex: none; }
.order-generic-note b { display: block; }
.order-generic-note span { font-size: 13px; }
.pkgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pkg { cursor: pointer; }
.pkg input { position: absolute; opacity: 0; pointer-events: none; }
.pkg__body { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; height: 100%; display: flex; flex-direction: column; gap: 8px; transition: border-color .12s, box-shadow .12s; position: relative; }
.pkg input:checked + .pkg__body { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.pkg__head { display: flex; align-items: center; justify-content: space-between; }
.pkg__badge { font-size: 10px; font-weight: 700; background: var(--brand); color: #fff; padding: 2px 7px; border-radius: 6px; }
.pkg__price { font-size: 22px; font-weight: 820; }
.pkg__body ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pkg__body li { display: flex; gap: 7px; font-size: 12.5px; color: var(--ink-2); align-items: flex-start; }
.pkg__body li .i { width: 15px; height: 15px; color: var(--accent); flex: none; margin-top: 1px; }
.pkg__meta { font-size: 12px; color: var(--muted); margin-top: auto; }
.order__side .card { position: sticky; top: 84px; }
.order__side h3 { margin-bottom: 12px; }
.sumline { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.sumline span { color: var(--muted); }
.sumline--total { border-bottom: none; padding-top: 12px; font-size: 16px; }
.sumline--total b { font-size: 20px; font-weight: 820; }
.order__side .btn { margin-top: 12px; }

/* Pagamento — PayPal Card Fields */
.pay-area { margin-top: 10px; }
.pay-loading { padding: 12px; text-align: center; color: var(--muted); font-size: 14px; }
.cardfields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.cf-lab { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.cf-field { border: 1px solid var(--line); border-radius: 11px; background: #fbfbfe; height: 46px; padding: 0 10px; transition: border-color .12s, box-shadow .12s; }
.cf-field:focus-within, .cf-field.card-field-focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-amount { font-variant-numeric: tabular-nums; }

/* Ordine — durata / extra / urgenza / fascia */
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.opts--tier { grid-template-columns: repeat(2, 1fr); }
.opt { cursor: pointer; position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__body { display: flex; flex-direction: column; gap: 4px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color .12s, box-shadow .12s; }
.opt input:checked + .opt__body { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.opt__price { font-size: 13px; color: var(--muted); font-weight: 650; }
.opt input:checked + .opt__body .opt__price { color: var(--brand); }
.ex-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.chk--ex { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; }
.chk--ex input { accent-color: var(--brand); width: 16px; height: 16px; }
.chk--ex > span:first-of-type { flex: 1; }
.ex__price { color: var(--muted); font-weight: 650; font-size: 13px; }
.chk--urgent { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--warn) 6%, white); cursor: pointer; }
.chk--urgent input { accent-color: var(--warn); width: 16px; height: 16px; }
.chk--urgent em { color: var(--warn); font-style: normal; font-weight: 650; }
.price-preview { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.price-preview span { font-size: 13px; color: var(--ink-2); }
.price-preview strong { color: var(--ink); }
.cd-h--first { margin-top: 2px; }

/* ---------------------------- Project ----------------------------- */
.proj { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.proj__main { display: flex; flex-direction: column; gap: 18px; }
.proj-creator { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; background: var(--line-2); border-radius: 12px; font-weight: 650; margin-bottom: 12px; }
.proj-creator .avatar { width: 38px; height: 38px; font-size: 12px; }
.proj-creator .i { width: 16px; height: 16px; color: var(--muted); }
.proj-creator--generic { color: var(--ink-2); }
.brief { white-space: pre-wrap; color: var(--ink-2); margin: 4px 0 8px; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; padding: 4px; }
.msg { max-width: 78%; }
.msg--me { align-self: flex-end; text-align: right; }
.msg__b { padding: 10px 13px; border-radius: 13px; background: var(--line-2); color: var(--ink); display: inline-block; text-align: left; }
.msg--me .msg__b { background: var(--brand); color: #fff; }
.msg__at { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chat__form { display: flex; gap: 8px; margin-top: 14px; }
.chat__form input { flex: 1; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.chat__form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.files { display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; }
.file__ic { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 9%, white); color: var(--brand); display: grid; place-items: center; flex: none; }
.file b { display: block; font-size: 14px; }
.file div { flex: 1; min-width: 0; }
.file .muted { font-size: 12px; }
.rev { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.rev:last-of-type { border-bottom: none; }
.rev span:nth-child(2) { flex: 1; }
.rev__form { display: flex; gap: 8px; margin-top: 12px; }
.rev__form input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.rev__form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.proj__side .card { position: sticky; top: 84px; }
.proj__side h3 { margin-bottom: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl { display: flex; align-items: center; gap: 11px; padding: 7px 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: -7px; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; background: var(--surface); color: #fff; }
.tl__dot .i { width: 13px; height: 13px; }
.tl.is-done .tl__dot { background: var(--accent); border-color: var(--accent); }
.tl__lab { font-size: 14px; flex: 1; color: var(--ink-2); }
.tl.is-done .tl__lab { color: var(--ink); font-weight: 600; }
.tl__at { font-size: 12px; color: var(--muted); }
.proj__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ============================= ADMIN ============================= */
.metrics--admin { grid-template-columns: repeat(5, 1fr); }
.metrics--admin .metric__n { font-size: 24px; }

.arows { display: flex; flex-direction: column; gap: 8px; }
.arow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .12s, box-shadow .12s; }
.arow:hover { border-color: color-mix(in srgb, var(--brand) 28%, var(--line)); box-shadow: var(--shadow-sm); }
.arow .avatar { width: 46px; height: 46px; font-size: 13px; flex: none; }
.arow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.arow__title { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arow__meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow__econ { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; font-size: 13px; }
.arow__price { font-weight: 750; }
.arow__margin { color: var(--ok); font-weight: 750; }

.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.acard { --b: var(--brand); border-top: 3px solid var(--b); }
.acard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.acard__logo { font-weight: 800; color: var(--b); font-size: 17px; }
.acard__name { font-weight: 600; color: var(--muted); margin-bottom: 10px; }

.admin-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.admin-form .card h2 { margin-bottom: 14px; font-size: 16px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 12px; }
.admin-form input, .admin-form select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfe; color: var(--ink); font-weight: 500; }
.admin-form input:focus, .admin-form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.econ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-form__toggles { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2px; }
.admin-form__toggles .chk { margin: 0; }
.card--reserved { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 18%, var(--line)); }
.card--reserved h2 .i { width: 17px; height: 17px; color: var(--brand); vertical-align: -3px; }
.margin-box { margin-top: 6px; padding: 12px 14px; background: color-mix(in srgb, var(--ok) 10%, white); border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.margin-box strong { color: var(--ok); font-size: 18px; }
.admin-form__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.assign-lab { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.proj__actions select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfe; margin-bottom: 10px; }

.login-foot-links { display: flex; align-items: center; gap: 10px; }
.login-foot-sep { color: var(--muted); }

.acard__actions { display: flex; gap: 8px; margin-top: 14px; }
.acard__actions .btn { flex: 1; justify-content: center; }
.subdomain-field { display: flex; align-items: stretch; }
.subdomain-field input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; flex: 1; min-width: 0; }
.subdomain-suffix { display: inline-flex; align-items: center; padding: 0 12px; background: var(--line-2); border: 1px solid var(--line); border-left: none; border-radius: 0 10px 10px 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.admin-form input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }

/* ----------------------------- Toast ------------------------------ */
#toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 999; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: toastIn .25s ease; }
.toast--ok { background: var(--ok); }
.toast--warn { background: var(--warn); }
.toast--accent { background: color-mix(in srgb, var(--accent) 80%, black); }
.toast--out { opacity: 0; transform: translateY(8px); transition: all .35s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------- Responsive --------------------------- */
@media (max-width: 1080px) {
  .split, .cdetail, .order, .proj { grid-template-columns: 1fr; }
  .order__side .card, .proj__side .card, .filters { position: static; max-height: none; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metrics--admin { grid-template-columns: repeat(3, 1fr); }
  .admin-form__grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .portal { grid-template-columns: 1fr; }

  /* Header mobile: una barra pulita brand + nav + esci */
  .side {
    position: static; height: auto;
    flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 4px;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 8px 12px;
  }
  .side__brand { padding: 0; flex: none; }
  .side__powered { display: none; }
  .side__logo { font-size: 16px; }
  .nav { flex-direction: row; gap: 2px; margin-left: 6px; }
  .nav__item { padding: 9px 10px; }
  .nav__item span { display: none; }
  .nav__item--new { display: none; }
  .side__foot { margin-left: auto; flex-direction: row; gap: 8px; border-top: none; padding: 0; }
  .side__foot .nav__sub:first-child { display: none; }

  /* Topbar slim: solo campanella notifiche a destra */
  .topbar { padding: 6px 12px; }
  .topbar__title { display: none; }
  .who { display: none; }
  .topbar__right { width: 100%; justify-content: flex-end; }

  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .pkgs { grid-template-columns: 1fr; }

  /* Filtri collassabili: di default chiusi, si aprono col tasto "Filtri" */
  .filters .filters__search,
  .filters .fgroup { display: none; }
  .filters.is-open .filters__search { display: flex; }
  .filters.is-open .fgroup { display: block; }
  .filters__toggle .chev { display: inline; color: var(--muted); transition: transform .15s ease; }
  .filters.is-open .filters__toggle .chev { transform: rotate(180deg); }
}
@media (max-width: 560px) {
  .content { padding: 18px 14px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics--admin { grid-template-columns: repeat(2, 1fr); }
  .econ-grid { grid-template-columns: 1fr; }
  .arow__econ { font-size: 12px; }
  /* Righe ordine: impila titolo e stato per evitare overflow */
  .row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .row__main { width: 100%; }
  .row__title { white-space: normal; }
  .row__side { width: 100%; justify-content: space-between; }
}
