/* L'ufficio è una scena da videogioco gestionale: sempre scuro, come la scena. Le posizioni dei gatti sono
   in pixel della scena (1672 x 941): si cambiano qui senza fare calcoli. */
:root {
  color-scheme: dark;
  --ink: #e9f1f5;
  --ink-soft: #a9bcc9;
  --page: #0a1a29;
  --surface: #11293c;
  --line: #27495f;
  --night: #081521;
  --on-night: #eaf5f7;
  --accent: #5ce6d3;
  --kraft: #c9a173;
  --kraft-deep: #a87c4c;
  --on-kraft: #20150a;
  --gold: #f0c14b;
  --red: #ff8a75;
  --green: #63dba6;
  --action: #5ce6d3;
  --on-action: #06222a;
  --stop: #a5301f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 1rem/1.5 "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
}
a { color: inherit; text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
h1, h2, .brand { font-family: "Trebuchet MS", "Segoe UI", Roboto, system-ui, sans-serif; line-height: 1.2; }
h1 { font-size: 1.6rem; margin: 1.5rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
main { max-width: 52rem; margin: 0 auto; padding: 0 16px 3rem; width: 100%; }
main.wide { max-width: none; padding-bottom: 1rem; }
.stop { padding: .45rem .95rem; border-radius: 6px; background: var(--stop); color: #fff; font-weight: 700; text-decoration: none; }
.halt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding: .6rem 16px; background: var(--stop); color: #fff; }
.halt p { margin: 0; }
.halt button { margin: 0; background: #fff; color: #7a1f12; border-color: #fff; }
button.danger { background: var(--stop); border-color: var(--stop); color: #fff; }
.big-number { font-size: 1.25rem; margin: .25rem 0 .75rem; }
.ledger { width: 100%; border-collapse: collapse; margin: 0 0 .75rem; }
.ledger th, .ledger td { padding: .4rem .5rem .4rem 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: top; }
.ledger thead th { font-weight: 700; }
.sim { margin: 0; padding: .4rem 16px; background: var(--kraft); color: var(--on-kraft); text-align: center; font-size: .92rem; }
.callout { margin: 1.1rem 0 0; padding: .7rem .9rem; background: var(--surface); border-left: 4px solid var(--gold); font-weight: 600; }
.hint { color: var(--ink-soft); font-size: .92rem; margin: .2rem 0; }
.notice { padding: .7rem .9rem; background: var(--surface); border-left: 4px solid var(--red); }
.desks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.desk { border-bottom: 1px solid var(--line); }
.desk a {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; padding: .75rem .2rem; text-decoration: none;
}
.desk a:hover .desk-name { text-decoration: underline; }
.desk-name { font-weight: 600; }
.desk-task { grid-column: 1 / -1; }
.desk-money { grid-column: 1 / -1; color: var(--ink-soft); font-size: .88rem; font-variant-numeric: tabular-nums; }
.state { display: inline-flex; align-items: center; gap: .4em; font-size: .92rem; white-space: nowrap; }
.mark { width: .7em; height: .7em; display: inline-block; border: 2px solid var(--ink-soft); border-radius: 50%; }
.state-lavoro .mark { background: var(--green); border-color: var(--green); }
.state-riposo .mark { border-color: var(--green); }
.state-attesa .mark { background: var(--gold); border-color: var(--gold); border-radius: 0; }
.state-errore .mark { background: var(--red); border-color: var(--red); border-radius: 0; transform: rotate(45deg); }
.state-fermo .mark { background: var(--ink-soft); border-radius: 0; }
.state-spento .state, .state-spento .desk-name, .state-spento .desk-task { color: var(--ink-soft); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain > li { padding: .65rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.event-errore { color: var(--red); }
.thread { list-style: none; margin: 0; padding: 0; }
.thread li { margin: 0 0 .7rem; padding: .6rem .8rem; background: var(--surface); border-left: 3px solid var(--line); }
.thread .from-leo { border-left-color: var(--kraft-deep); }
.thread .kind-avviso { border-left-color: var(--red); }
.meta { margin: 0 0 .2rem; color: var(--ink-soft); font-size: .86rem; }
.body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
label { display: block; margin: .7rem 0 .2rem; font-weight: 600; font-size: .95rem; }
input, textarea, select {
  width: 100%; padding: .6rem; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--ink-soft); border-radius: 3px;
}
button {
  margin-top: .7rem; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--action); color: var(--on-action); border: 1px solid var(--action); border-radius: 3px;
}
button.quiet { background: transparent; color: var(--ink); border-color: var(--ink-soft); }
.approval form button { margin-right: .4rem; }
.label { font-size: .78rem; font-weight: 700; padding: .05rem .35rem; border: 1px solid var(--ink-soft); border-radius: 2px; }
.label-DECISIONE { background: var(--kraft); color: var(--on-kraft); border-color: var(--kraft); }
.login { max-width: 24rem; margin: 3rem auto 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 40rem) {
  .desk a { grid-template-columns: 15rem 1fr 11rem; align-items: baseline; }
  .desk-name { grid-column: 1; grid-row: 1; }
  .desk-task { grid-column: 2; grid-row: 1; }
  .desk .state { grid-column: 3; grid-row: 1; justify-self: end; }
  .desk-money { grid-column: 2 / -1; grid-row: 2; }
}

/* Guscio: menu a sinistra, barra sempre visibile in alto */
.shell { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); min-height: 100vh; }
.rail {
  display: flex; flex-direction: column; align-items: stretch; gap: .3rem; padding: .7rem .45rem;
  background: var(--night); border-right: 1px solid var(--line);
}
.brand {
  font-weight: 800; text-decoration: none; letter-spacing: .04em; text-align: center; color: var(--accent);
  padding: .2rem 0 .6rem; line-height: 1.1;
}
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .1rem; border-radius: 8px;
  text-decoration: none; font-size: .78rem; border: 1px solid transparent; color: var(--ink-soft);
}
.rail-item:hover { color: var(--ink); background: var(--surface); }
.rail-item.on { color: var(--accent); border-color: var(--accent); background: #103743; font-weight: 600; }
.logout { margin: auto 0 0; }
.logout button { width: 100%; padding: .35rem 0; font-size: .85rem; margin: 0; }
.work { display: flex; flex-direction: column; min-width: 0; }
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.6rem; padding: .5rem 16px;
  background: var(--night); border-bottom: 1px solid var(--line);
}
.bar-item { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.bar-item strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.bar-item strong + strong { margin-top: .1rem; }
.bar-label { font-size: .74rem; color: var(--ink-soft); }
.bar-item:hover strong { color: var(--accent); }
.bar-item.due strong { color: var(--gold); }
.bar-item .bad { color: var(--red); }
.bar-gap { flex: 1 1 auto; }
.away { margin: 0; }
.away button { margin: 0; padding: .4rem .9rem; }

/* Pagina Ufficio */
.home {
  --scene-w: max(44rem, calc((100vh - 17rem) * 1672 / 941));
  display: grid; grid-template-columns: minmax(0, var(--scene-w)) minmax(15rem, 1fr); gap: 16px; margin-top: 12px;
}
.side { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .1rem .9rem .6rem; font-size: .9rem;
  height: 0; min-height: 100%; overflow-y: auto; }
.side h2 { font-size: 1rem; margin: .8rem 0 .3rem; }
.side .plain > li { padding: .45rem 0; }

.scene {
  --sw: 1672; --sh: 941;
  position: relative; container-type: inline-size; aspect-ratio: 1672 / 941; border-radius: 10px; overflow: hidden;
  width: 100%; background: var(--night);
}
.scene-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cat, .bed, .sign { position: absolute; left: calc(var(--x) / var(--sw) * 100%); top: calc(var(--y) / var(--sh) * 100%); }
.cat, .bed { transform: translate(-50%, -100%); height: calc(var(--h, 132) / var(--sh) * 100%); display: block; }
.cat img, .bed img { height: 100%; width: auto; display: block; filter: drop-shadow(0 .3cqw .25cqw #0009); }
.cat:hover img, .bed:hover img { filter: drop-shadow(0 0 .5cqw var(--accent)); }
.cat:focus-visible, .bed:focus-visible { outline-offset: 0; }
.sign {
  transform: translate(-50%, -50%); width: 11.6cqw; text-align: center; padding: .28cqw 0; border-radius: .7cqw;
  background: #082b2c; border: .12cqw solid #9ff3e6; color: #f1fffc; font-weight: 700; font-size: 1.22cqw; line-height: 1.25;
  text-decoration: none; white-space: nowrap;
}
.sign:hover { background: #0f4a49; }
.signal {
  position: absolute; top: 2%; right: -6%; width: 2cqw; height: 2cqw; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.4cqw; line-height: 1;
  border: .12cqw solid #20150a; color: #20150a;
}
.signal-attesa { background: var(--gold); }
.signal-errore { background: #ff5a44; color: #fff; }

/* Cartelli */
.sign-direzione { --x: 385; --y: 72; }
.sign-operations { --x: 370; --y: 476; }
.sign-art { --x: 672; --y: 476; }
.sign-contenuti { --x: 963; --y: 476; }
.sign-ecommerce { --x: 1250; --y: 476; }
.sign-performance { --x: 388; --y: 673; }
.sign-b2b { --x: 686; --y: 673; }
.sign-amministrazione { --x: 975; --y: 673; }
.sign-controllo { --x: 1272; --y: 673; }
.sign-hacker { --x: 1540; --y: 905; }

/* Scrivanie */
.place-desk-operations { --x: 372; --y: 642; }
.place-desk-art { --x: 672; --y: 642; }
.place-desk-contenuti { --x: 966; --y: 642; }
.place-desk-ecommerce { --x: 1254; --y: 642; }
.place-desk-performance { --x: 390; --y: 850; }
.place-desk-b2b { --x: 686; --y: 850; }
.place-desk-amministrazione { --x: 982; --y: 850; }
.place-desk-controllo { --x: 1279; --y: 850; }
.place-desk-hacker { --x: 1535; --y: 880; --h: 128; }

/* Il Director alla sua scrivania: la scrivania gli copre le zampe */
.place-direzione { --x: 340; --y: 338; --h: 124; clip-path: inset(0 -5% 44% -5%); }
.place-direzione .signal { top: 0; right: -12%; }
/* Il Director che controlla il lavoro di un agente */
.place-visit-operations, .place-visit-art, .place-visit-contenuti, .place-visit-ecommerce,
.place-visit-performance, .place-visit-b2b, .place-visit-amministrazione, .place-visit-controllo, .place-visit-hacker { --h: 118; }
.place-visit-operations { --x: 505; --y: 668; }
.place-visit-art { --x: 805; --y: 668; }
.place-visit-contenuti { --x: 1097; --y: 668; }
.place-visit-ecommerce { --x: 1125; --y: 668; }
.place-visit-performance { --x: 525; --y: 880; }
.place-visit-b2b { --x: 825; --y: 880; }
.place-visit-amministrazione { --x: 1115; --y: 880; }
.place-visit-controllo { --x: 1140; --y: 880; }
.place-visit-hacker { --x: 1440; --y: 890; }

/* Caffè */
.place-coffee-1 { --x: 1335; --y: 322; --h: 96; }
.place-coffee-2 { --x: 1405; --y: 322; --h: 96; }
.place-coffee-3 { --x: 1476; --y: 322; --h: 96; }
.place-coffee-4 { --x: 1392; --y: 452; --h: 100; }
.place-coffee-5 { --x: 1552; --y: 452; --h: 100; }
.place-coffee-6 { --x: 1290; --y: 428; --h: 100; }
.place-coffee-7 { --x: 1440; --y: 540; --h: 104; }
.place-coffee-8 { --x: 1525; --y: 540; --h: 104; }
.place-coffee-9 { --x: 1250; --y: 340; --h: 96; }
.place-coffee-10 { --x: 1600; --y: 545; --h: 100; }

/* Cuccia */
.bed { --x: 137; --y: 832; --h: 94; }
.bed-count {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding: .1cqw .7cqw; white-space: nowrap;
  background: #082b2c; border: .12cqw solid #9ff3e6; border-radius: .7cqw; color: #f1fffc; font-weight: 700; font-size: 1.1cqw;
}

/* Bacheca nella sala caffè */
.board { --x: 1415; --y: 196; position: absolute; left: calc(var(--x) / var(--sw) * 100%); top: calc(var(--y) / var(--sh) * 100%);
  transform: translate(-50%, -50%); width: 7cqw; display: block; text-decoration: none; }
.board img { width: 100%; height: auto; display: block; filter: drop-shadow(0 .2cqw .2cqw #0009); }
.board:hover img { filter: drop-shadow(0 0 .5cqw var(--accent)); }
.board-name {
  position: absolute; left: 50%; bottom: -.5cqw; transform: translateX(-50%); padding: 0 .5cqw; border-radius: .5cqw; white-space: nowrap;
  background: #082b2c; border: .1cqw solid #9ff3e6; color: #f1fffc; font-weight: 700; font-size: .95cqw; line-height: 1.35;
}

/* Bacheca: schede */
.tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--line); margin: 0 0 .8rem; }
.tab { padding: .45rem 1rem; text-decoration: none; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; color: var(--ink-soft); }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-color: var(--line); background: var(--surface); font-weight: 600; }
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .5rem; align-items: end; }
.search label { grid-column: 1 / -1; margin-top: 0; }
.search button { margin: 0; }

/* Pannello del team */
.team { margin-top: 12px; }
.team h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.team .hint { margin: 0 0 .4rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(7.6rem, 1fr)); }
.card a {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .1rem; padding: .3rem .25rem .35rem; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; text-decoration: none;
}
.card a:hover { border-color: var(--accent); }
.card img { width: 3.1rem; height: 3.1rem; object-fit: cover; object-position: top; }
.card-name { font-weight: 700; font-size: .88rem; line-height: 1.2; white-space: nowrap; }
.card .state { font-size: .72rem; gap: .3em; color: var(--ink-soft); line-height: 1.2; white-space: nowrap; }
.card.chief a { border-color: var(--gold); }
.card.state-spento img, .card.state-fermo img { filter: grayscale(.8) brightness(.65); }
.card.state-lavoro a { border-color: var(--green); }
.card.state-attesa a { border-color: var(--gold); }
.card.state-errore a { border-color: var(--red); }

@media (max-width: 75rem) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .side { height: auto; min-height: 0; }
}
@media (max-width: 48rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: .4rem 16px; }
  .brand { padding: 0 .6rem 0 0; }
  .brand br { display: none; }
  .rail-item { flex-direction: row; padding: .3rem .45rem; gap: .3rem; font-size: .85rem; }
  .rail-item svg { display: none; }
  .logout { margin: 0 0 0 auto; }
  .logout button { padding: .25rem .6rem; }
  main.wide { padding-left: 0; padding-right: 0; }
  .team, .side { margin-left: 16px; margin-right: 16px; }
  .scene { border-radius: 0; }
}

.inline { margin: 0; }
button.small { margin: 0; padding: .15rem .5rem; font-size: .8rem; }
.tick { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.tick input { width: 1.1rem; height: 1.1rem; }

.table-scroll { overflow-x: auto; }
.report-card { font-size: .85rem; white-space: nowrap; }
.jobs li { margin-bottom: .75rem; }
.verdict { display: inline-flex; gap: .4rem; margin-top: .25rem; }
