/* ════════════════════════════════════════════════════════════════════════
   Veriax — Agente · Generale · DIREZIONE C ("cockpit reinventato")
   Stravolgimento positivo della tab Generale: editor a due pannelli con una
   SCHEDA AGENTE LIVE che si compone mentre scrivi. Stesso chrome (breadcrumb,
   tab, footer sticky), stessi controlli (.idn-*, .ty-card) e token, ma
   un'orchestrazione completamente diversa.
   Linguaggio visivo: cockpit (griglia, gradiente in-famiglia, glow) — eredita
   home.css + next-theme.css via skin-b.css.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Split editor ───────────────────────────────────────────────────────── */
.gc-split {
  display: grid;
  grid-template-columns: 392px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) { .gc-split { grid-template-columns: 1fr; } }

/* La scheda viva resta in vista mentre si scorre il form */
.gc-aside { position: sticky; top: 184px; }
@media (max-width: 1100px) { .gc-aside { position: static; top: auto; } }

/* ── Scheda agente live (il "wow") ──────────────────────────────────────── */
.gc-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(78,124,255,.16), transparent 60%),
    var(--card-toplight), var(--bg-card);
  box-shadow: var(--glow-accent);
}
.gc-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 55%);
  mask-image: linear-gradient(180deg, #000, transparent 55%);
}
.gc-card-top {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 20px 20px 16px;
}
.gc-thumb {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 16px;
  display: grid; place-items: center;
  background-image: var(--grad-accent);
  color: #fff; font-weight: 700; font-size: 22px; letter-spacing: -.02em;
  box-shadow: var(--glow-accent);
  position: relative; overflow: hidden;
}
.gc-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transform: translateX(-120%);
}
@media (prefers-reduced-motion: no-preference) {
  .gc-thumb::after { animation: gcSheen 5.5s ease-in-out 1.2s infinite; }
  @keyframes gcSheen { 0%,70%{transform:translateX(-120%)} 86%,100%{transform:translateX(120%)} }
}
.gc-id { min-width: 0; flex: 1; }
.gc-tipo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 4px;
}
.gc-tipo-dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px -1px currentColor; }
.gc-name {
  font-size: 19px; font-weight: 600; letter-spacing: -.015em;
  color: var(--text-strong); line-height: 1.15;
  word-break: break-word;
}
.gc-name.placeholder { color: var(--text-faint); font-style: italic; font-weight: 500; }
.gc-slug {
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  margin-top: 5px; display: flex; align-items: center; gap: 5px; min-width: 0;
}
.gc-slug .pfx { color: color-mix(in oklab, var(--accent) 70%, var(--text-faint)); }
.gc-slug b { color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* status strip */
.gc-strip {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 0 20px 16px;
}
.gc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 540; white-space: nowrap;
  background: var(--bg-elev); border: 1px solid var(--border-faint); color: var(--text-muted);
}
.gc-pill .d { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.gc-pill.live { color: var(--live); border-color: color-mix(in oklab, var(--live) 32%, transparent); background: var(--live-soft); }
.gc-pill.live .d { background: var(--live); }
@media (prefers-reduced-motion: no-preference) {
  .gc-pill.live .d { animation: gcLive 2.4s ease-out infinite; }
  @keyframes gcLive { 0%{box-shadow:0 0 0 0 var(--live-ring)} 70%{box-shadow:0 0 0 6px transparent} 100%{box-shadow:0 0 0 0 transparent} }
}
.gc-pill .pfg { color: var(--accent); }

/* description preview */
.gc-prevwrap {
  position: relative;
  margin: 0 14px; padding: 14px 16px;
  border-top: 1px solid var(--border-faint);
}
.gc-prev-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 9px;
  display: flex; align-items: center; gap: 7px;
}
.gc-prev-label .ln { flex: 1; height: 1px; background: var(--border-faint); }
.gc-prev {
  font-size: 13px; line-height: 1.6; color: var(--text);
  max-height: 168px; overflow: auto;
}
.gc-prev.empty { color: var(--text-faint); font-style: italic; }
.gc-prev p { margin: 0 0 8px; } .gc-prev p:last-child { margin-bottom: 0; }
.gc-prev ul { margin: 0 0 8px; padding-left: 20px; }
.gc-prev code { font-family: var(--mono); font-size: 12px; background: var(--bg-elev); border: 1px solid var(--border-faint); padding: 1px 5px; border-radius: 5px; }
.gc-prev strong { color: var(--text-strong); }

/* "scheda tecnica" mini-grid at the bottom of the card */
.gc-specs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin-top: 4px;
  background: var(--border-faint);
  border-top: 1px solid var(--border-faint);
}
.gc-spec { background: var(--bg-card); padding: 11px 16px; }
.gc-spec .k { font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.gc-spec .v { font-size: 13px; color: var(--text); font-weight: 540; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.gc-spec .v svg { color: var(--accent); }

/* capability teaser row (echo del cockpit) */
.gc-cap {
  position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 13px 16px; border-top: 1px solid var(--border-faint);
}
.gc-cap-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 10px; border-radius: 8px;
  font-size: 12px; font-weight: 540;
  background: var(--grad-accent-soft); border: 1px solid var(--accent-ring); color: var(--text);
}
.gc-cap-chip svg { color: var(--accent); }
.gc-cap-more { font-size: 11.5px; color: var(--text-faint); margin-left: auto; }

/* ── Colonna form ───────────────────────────────────────────────────────── */
.gc-form { display: flex; flex-direction: column; gap: 16px; }
.gc-grid3 { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1.12fr) minmax(0,1.34fr); gap: 16px; }
@media (max-width: 720px) { .gc-grid3 { grid-template-columns: 1fr; } }

/* segmented priorità (no <select> nativi) */
.gc-seg { display: flex; gap: 3px; padding: 3px; background: var(--bg-app); border: 1px solid var(--border); border-radius: 10px; height: 42px; }
.gc-seg button {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: transparent; border: 0; border-radius: 7px; cursor: pointer; padding: 0 4px;
  color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 540; white-space: nowrap;
}
.gc-seg button:hover { color: var(--text); }
.gc-seg button.on { color: var(--text-strong); background-image: var(--grad-accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.gc-seg .pdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* titoli sezione su una riga (evita che “Tipo agente” vada a capo) */
.idn-card-head h3 { flex-wrap: nowrap; }
.idn-card-head h3 .badge-ico { flex-shrink: 0; }
.idn-card-head h3 .idn-h3-txt { white-space: nowrap; }

/* slug field: prefisso mono attaccato */
.gc-slug-input { display: flex; align-items: center; height: 42px; background: var(--bg-app); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.gc-slug-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gc-slug-input .pfx { padding: 0 2px 0 12px; font-family: var(--mono); font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.gc-slug-input input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: var(--text); font-family: var(--mono); font-size: 13px; padding: 0 12px 0 0; }
.gc-slug-input .lock { padding: 0 10px; color: var(--text-faint); display: flex; }

/* badge "live" sull'header sezione */
.gc-livebadge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent);
}
.gc-livebadge .d { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .gc-livebadge .d { animation: gcLive 2.2s ease-out infinite; }
}

/* the tipo cards already styled by skin-b (.ty-card). Add a live "in uso" tick. */
.ty-card .ty-live { position: absolute; top: 10px; right: 12px; display: none; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--accent); }
.ty-card.on .ty-live { display: inline-flex; }

/* entrance */
@media (prefers-reduced-motion: no-preference) {
  @keyframes gcIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  .gc-aside { animation: gcIn .5s cubic-bezier(.2,.85,.25,1) both; }
  .gc-form > * { animation: gcIn .46s cubic-bezier(.2,.85,.25,1) both; }
  .gc-form > *:nth-child(2) { animation-delay: .06s; }
  .gc-form > *:nth-child(3) { animation-delay: .12s; }
}
html[data-still] .gc-aside, html[data-still] .gc-form > *, html[data-still] .gc-thumb::after { animation: none !important; }
