/* Munaciello: enjinia.it's tokens (ink, paper, the gears' colours, Bricolage Grotesque + Instrument Sans) on top
   of Bootstrap 5. */
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/BricolageGrotesque.ttf") format("truetype");
             font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans.ttf") format("truetype");
             font-weight: 400 700; font-display: swap; }

:root {
  --ink: #121318; --ink-2: #1b1d24; --ink-3: #262933; --line: #e3dfd5;
  --paper: #f6f4ef; --paper-2: #ece8df; --text: #1b1d24; --muted: #5c6070; --muted-d: #9aa0ae;
  --blue: #27aae1; --red: #ed1c24; --green: #2bb673; --yellow: #ffd23f; --robe: #8c6040;
  --display: "Bricolage Grotesque", "Instrument Sans", sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bs-body-font-family: var(--body); --bs-body-bg: var(--paper); --bs-body-color: var(--text);
  --bs-primary: var(--ink); --bs-primary-rgb: 18, 19, 24; --bs-link-color: #0b6e9c; --bs-link-hover-color: var(--ink);
  --bs-border-radius: 14px; --bs-border-color: var(--line);
}
body { background: var(--paper); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .h1, .h2, .h3, .display { font-family: var(--display); letter-spacing: -.02em; font-weight: 800; }
h1, .h1 { font-size: clamp(28px, 4vw, 42px); }
.kick { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); }
.text-muted, .text-secondary { color: var(--muted) !important; }

/* top bar */
.topbar { background: var(--ink); color: #fff; }
.topbar .navbar-brand { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: #fff; }
.topbar .navbar-brand img { width: 34px; height: 34px; margin-right: 8px; }
.topbar .nav-link { color: #c3c7d2; font-weight: 600; }
.topbar .nav-link:hover, .topbar .nav-link.active { color: #fff; }
.topbar .badge-count { background: var(--yellow); color: var(--ink); font-weight: 800; border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.topbar .navbar-toggler { border-color: rgba(255,255,255,.3); }
.topbar .navbar-toggler-icon { filter: invert(1); }

/* buttons: pills like enjinia.it */
.btn { border-radius: 999px; font-weight: 700; padding: .5rem 1.15rem; }
.btn-sm { padding: .3rem .8rem; }
.btn-primary { background: var(--ink); border-color: var(--ink); }
.btn-primary:hover, .btn-primary:focus { background: var(--ink-3); border-color: var(--ink-3); }
.btn-approve { background: var(--green); border-color: var(--green); color: #fff; }
.btn-approve:hover { background: #229a60; color: #fff; }
.btn-reject { background: #fff; border: 2px solid rgba(237,28,36,.35); color: #b3121a; }
.btn-reject:hover { border-color: var(--red); color: var(--red); }
.btn-outline-dark { border-width: 2px; }

/* cards */
.card { border: 0; border-radius: 20px; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 12px 30px rgba(18,19,24,.06); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 700; }
.stat { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; }
.list-group-item { border-color: var(--line); }

/* agents */
.agent-ico { width: 52px; height: 52px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 22px;
             background: color-mix(in srgb, var(--blue) 14%, #fff); color: #0b6e9c; flex: none; }
.agent-ico.agent-pic { padding: 0; background: none; object-fit: cover; }
.agent-ico.agent-pic.off { filter: grayscale(1); opacity: .6; }
.agent-ico.lg { width: 84px; height: 84px; font-size: 30px; border-radius: 18px; }
.agent-ico.off { background: var(--paper-2); color: var(--muted-d); }
.state { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
         border-radius: 999px; padding: 2px 9px; background: var(--paper-2); color: var(--muted); }
.state.attivo, .state.approvato, .state.approvata, .state.fatto, .state.chiusa { background: #dff5ea; color: #17784a; }
.state.in_attesa, .state.proposto, .state.proposta, .state.aperta, .state.in_coda, .state.presa, .state.inviata { background: #fff4cc; color: #7a5a00; }
.state.in_corso, .state.risposta { background: #dcf1fb; color: #0b6e9c; }
.state.errore, .state.rifiutato, .state.rifiutata { background: #fde2e3; color: #a3121a; }

/* the line-up: field and bench */
.field { background: radial-gradient(ellipse at 50% 0%, #20232c 0, var(--ink) 70%); color: #fff; border-radius: 24px;
         min-height: 240px; padding: 22px; position: relative; }
.field.drop-ok { outline: 3px dashed var(--yellow); outline-offset: -8px; }
.field h2 { color: #fff; }
.field .slot { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; }
.field .slot .text-muted { color: #c3c7d2 !important; }
.bench { background: var(--paper-2); border-radius: 24px; padding: 18px; min-height: 140px; }
.bench.drop-ok { outline: 3px dashed var(--ink); outline-offset: -8px; }
.slot { border-radius: 18px; padding: 14px; background: #fff; display: flex; gap: 12px; align-items: flex-start;
        transition: transform .15s, box-shadow .15s; }
.slot[draggable="true"] { cursor: grab; }
.slot[draggable="true"]:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(18,19,24,.12); }
.slot.dragging { opacity: .45; }
.slot.coming { opacity: .55; filter: grayscale(1); }
.slot .name { font-weight: 800; font-family: var(--display); font-size: 18px; }
.slot .role { font-size: 14px; line-height: 1.35; }
.peppino-note { font-size: 14px; color: var(--muted); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; border-radius: 18px; padding: 10px 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.utente { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.agente { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 6px 16px rgba(18,19,24,.06); }
.msg.incarico { align-self: flex-start; background: #fff8dc; border: 1px dashed #d8b400; }
.msg.sistema { align-self: center; background: transparent; color: var(--muted); font-size: 14px; text-align: center; max-width: 92%; }
.msg.agente { white-space: normal; } .msg .md p:last-child, .msg .md ul:last-child { margin-bottom: 0; }
.msg .md p { margin-bottom: .5em; }
.msg .meta { font-size: 11px; opacity: .65; margin-top: 4px; font-family: var(--mono); white-space: normal; }
.proposal { border-left: 5px solid var(--yellow); border-radius: 16px; background: #fff; padding: 14px; align-self: stretch; }
.proposal.decided { border-left-color: var(--paper-2); opacity: .8; }
.doc-chip { display: inline-flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px;
            padding: 4px 12px; text-decoration: none; color: var(--text); font-size: 14px; }
.working { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.working .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }
.composer textarea { border-radius: 18px; resize: vertical; min-height: 54px; }

/* documents */
.doc-body { background: #fff; border-radius: 20px; padding: clamp(18px, 4vw, 40px); box-shadow: 0 12px 30px rgba(18,19,24,.06); }
.doc-body h1 { font-size: 30px; } .doc-body h2 { font-size: 22px; margin-top: 1.4em; } .doc-body h3 { font-size: 18px; }
.doc-body table { width: 100%; margin: 1em 0; font-size: 14px; } .doc-body th, .doc-body td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.doc-body pre { background: var(--paper); padding: 12px; border-radius: 12px; }
.prose-sm { font-size: 15px; } .prose-sm h1 { font-size: 22px; } .prose-sm h2 { font-size: 18px; } .prose-sm h3 { font-size: 16px; }

/* onboarding steps */
.steps { display: flex; gap: 6px; flex-wrap: wrap; counter-reset: s; padding: 0; list-style: none; }
.steps li { counter-increment: s; font-size: 14px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
                    background: #fff; margin-right: 6px; font-weight: 800; font-size: 12px; }
.steps li.done { background: #dff5ea; color: #17784a; } .steps li.now { background: var(--ink); color: #fff; }
.steps li.now::before { background: var(--yellow); color: var(--ink); }
.steps a { color: inherit; text-decoration: none; }

.warn-box { background: #fff4cc; border-radius: 14px; padding: 10px 14px; }
.form-control, .form-select { border-radius: 12px; border-color: #d8d3c7; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .2rem rgba(39,170,225,.2); }
footer.site { color: var(--muted); font-size: 13px; }

@media (max-width: 767.98px) {
  .msg { max-width: 94%; }
  .slot[draggable="true"] { cursor: default; }
}
@media print {
  .topbar, .no-print, footer.site { display: none !important; }
  .doc-body { box-shadow: none; padding: 0; }
  body { background: #fff; }
}
