:root { --fondo:#f6f7f9; --testo:#1c2430; --bordo:#cfd5de; --prim:#1d4f91; --warn:#a15c00; --err:#a01818; --ok:#1c6b32; }
* { box-sizing: border-box; }
body { margin:0; font:16px/1.4 system-ui, sans-serif; background:var(--fondo); color:var(--testo); }
#banner { background:#fff3cd; border-bottom:2px solid var(--warn); padding:.5rem 1rem; font-size:.9rem; }
#banner.sim { background:#ffe3e3; border-color:var(--err); }
#banner p { margin:.15rem 0; }
header { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; justify-content:space-between; padding:.6rem 1rem; background:#fff; border-bottom:1px solid var(--bordo); }
main { max-width:1000px; margin:0 auto; padding:1rem; }
h1,h2,h3 { margin:.6rem 0 .4rem; }
button, .bottone { font:inherit; padding:.55rem .9rem; min-height:44px; border:1px solid var(--prim); background:var(--prim); color:#fff; border-radius:6px; cursor:pointer; }
button.sec { background:#fff; color:var(--prim); }
button.pericolo { background:#fff; color:var(--err); border-color:var(--err); }
button:disabled { opacity:.5; cursor:not-allowed; }
input, select, textarea { font:inherit; padding:.5rem; border:1px solid var(--bordo); border-radius:6px; width:100%; max-width:30rem; }
label { display:block; margin:.5rem 0 .15rem; font-weight:600; }
.riquadri { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:.6rem; margin:.8rem 0; }
.riquadro { background:#fff; border:1px solid var(--bordo); border-radius:8px; padding:.7rem; }
.riquadro b { font-size:1.6rem; display:block; }
.scheda { background:#fff; border:1px solid var(--bordo); border-radius:8px; padding:.8rem; margin:.6rem 0; }
.lista a { display:block; padding:.6rem .8rem; background:#fff; border:1px solid var(--bordo); border-radius:6px; margin:.3rem 0; color:inherit; text-decoration:none; }
.etichetta { display:inline-block; padding:.05rem .5rem; border-radius:99px; background:#e4e9f1; font-size:.8rem; }
.err { color:var(--err); font-weight:600; } .ok { color:var(--ok); font-weight:600; } .warn { color:var(--warn); font-weight:600; }
table { border-collapse:collapse; width:100%; background:#fff; }
th,td { border:1px solid var(--bordo); padding:.35rem .5rem; text-align:left; vertical-align:top; }
.miniature { display:flex; flex-wrap:wrap; gap:.4rem; }
.miniature img { height:90px; border:1px solid var(--bordo); border-radius:4px; }
canvas.ritaglio { max-width:100%; border:2px solid var(--warn); }
.riga { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin:.5rem 0; }
code.invito { word-break:break-all; background:#eef; padding:.3rem; display:block; }
@media (max-width:600px) { main { padding:.6rem; } }

/* GOLDEN INFISSI — Desktop UI V1 */
:root {
  --fondo: #101114;
  --testo: #eee9dd;
  --bordo: #34302a;
  --prim: #b99754;
  --warn: #e1b866;
  --err: #f18c8c;
  --ok: #83c7a0;
}

body {
  background: var(--fondo);
  color: var(--testo);
}

header {
  background: #17181b;
  border-bottom: 1px solid var(--bordo);
}

main {
  max-width: 1600px;
  padding: 24px;
}

h1, h2, h3 {
  color: #e9c98a;
}

button, .bottone {
  background: #b99754;
  border-color: #b99754;
  color: #141414;
  font-weight: 600;
}

button:hover:not(:disabled) {
  filter: brightness(1.12);
}

button.sec {
  background: #252321;
  color: #e9c98a;
}

button.pericolo {
  background: #302020;
  color: #f18c8c;
}

input, select, textarea {
  background: #202125;
  color: #eee9dd;
  border-color: #49433a;
}

.scheda, .riquadro {
  background: #1b1c20;
  border: 1px solid #39342c;
  border-radius: 12px;
  padding: 18px;
}

.riquadri {
  gap: 16px;
}

.riquadro b {
  color: #e9c98a;
  font-size: 2rem;
}

.lista a {
  background: #1b1c20;
  border: 1px solid #39342c;
  color: #eee9dd;
  border-radius: 10px;
  padding: 16px;
}

.lista a:hover {
  border-color: #b99754;
}

.etichetta {
  background: #343025;
  color: #e9c98a;
}

table {
  background: #1b1c20;
}

th, td {
  border-color: #39342c;
  padding: 12px;
}

th {
  color: #e9c98a;
}

#banner {
  background: #342c1e;
  color: #f3d99f;
  border-bottom: 1px solid #705b35;
}

#banner.sim {
  background: #392225;
  color: #ffb9b9;
}

code.invito {
  background: #292a30;
  color: #e9c98a;
}

@media (max-width: 600px) {
  main {
    padding: 12px;
  }
  .scheda, .riquadro {
    padding: 14px;
  }
}

/* GOLDEN INFISSI — Workspace desktop */
.workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 320px;
  min-height: calc(100vh - 110px);
  background: #101114;
}

.menu-laterale {
  background: #151619;
  border-right: 1px solid #39342c;
  padding: 24px 16px;
  min-width: 0;
}

.workspace > main {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 28px;
}

.ufficio-agentico {
  background: #17181b;
  border-left: 1px solid #39342c;
  padding: 24px 18px;
  min-width: 0;
}

.menu-laterale,
.ufficio-agentico {
  color: #eee9dd;
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .ufficio-agentico {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid #39342c;
  }
}

@media (max-width: 700px) {
  .workspace {
    display: block;
  }

  .menu-laterale {
    border-right: 0;
    border-bottom: 1px solid #39342c;
    padding: 12px;
  }

  .workspace > main {
    padding: 14px;
  }

  .ufficio-agentico {
    padding: 16px;
  }
}

/* GOLDEN INFISSI — Navigazione e ufficio agentico */

.workspace.senza-sessione {
  display: block;
}

.senza-sessione .menu-laterale,
.senza-sessione .ufficio-agentico {
  display: none;
}

.senza-sessione > main {
  max-width: 520px;
  margin: 60px auto;
}


/* GOLDEN INFISSI — Navigazione desktop */

.golden-brand {
  padding: 12px 10px 26px;
  border-bottom: 1px solid #38342d;
  margin-bottom: 24px;
}

.golden-brand strong {
  display: block;
  color: #e5c68d;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.golden-brand small {
  display: block;
  margin-top: 7px;
  color: #aaa296;
  font-size: 11px;
  letter-spacing: .3px;
}

.golden-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.golden-nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 43px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #bdb9b2;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.golden-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  font-size: 17px;
  line-height: 1;
}

.golden-menu-text {
  flex: 1;
  min-width: 0;
}

.golden-nav-link:hover,
.golden-nav-link:focus-visible {
  background: #302b23;
  border-color: #554832;
  color: #f0d6a5;
}

.golden-nav-active,
.golden-nav-active:hover {
  background: #3b3225;
  border-color: #735b37;
  color: #e9c98f;
  font-weight: 700;
}

.golden-nav-disabled {
  opacity: .48;
  cursor: not-allowed;
}

.golden-nav-disabled:hover {
  background: transparent;
  border-color: transparent;
  color: #bdb9b2;
}

.golden-footer {
  margin-top: auto;
  padding: 22px 10px 10px;
  border-top: 1px solid #38342d;
  color: #8f887b;
  font-size: 11px;
  letter-spacing: .4px;
}

.workspace.layout-ufficio > .menu-laterale {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
}
.golden-agent-header {
  padding-bottom: 20px;
  border-bottom: 1px solid #39342c;
}

.golden-agent-header h2 {
  font-size: 19px;
  margin-bottom: 12px;
}

.golden-muted {
  color: #a8a39a;
  font-size: 13px;
  line-height: 1.6;
  margin: 20px 0;
}

.golden-agent-card {
  background: #202125;
  border: 1px solid #39342c;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.golden-agent-card strong {
  display: block;
  color: #e9c98a;
  font-size: 14px;
}

.golden-agent-card small {
  display: block;
  color: #aaa49a;
  margin-top: 6px;
}

.golden-agent-status {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  color: #99948b;
}

@media (max-width: 700px) {
  .golden-brand {
    padding-bottom: 14px;
    margin-bottom: 12px;
  }

  .golden-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .golden-nav-link {
    padding: 10px 12px;
  }

  .golden-footer {
    margin-top: 15px;
  }
}

/* GOLDEN INFISSI — Layout distinti per ruolo */

/* UFFICIO: composizione desktop anche da browser mobile */
.workspace.layout-ufficio {
  display: grid;
  grid-template-columns: 248px minmax(650px, 1fr) 320px;
  min-width: 1250px;
  align-items: stretch;
}

.workspace.layout-ufficio > .menu-laterale {
  grid-column: 1;
}

.workspace.layout-ufficio > main {
  grid-column: 2;
}

.workspace.layout-ufficio > .ufficio-agentico {
  grid-column: 3;
  border-top: 0;
  border-left: 1px solid #39342c;
}

/* TECNICO: interfaccia verticale */
.workspace.layout-tecnico {
  display: block;
  min-width: 0;
}

.workspace.layout-tecnico > .menu-laterale {
  display: none;
}

.workspace.layout-tecnico > main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

.workspace.layout-tecnico > .ufficio-agentico {
  display: none;
}

.workspace.layout-tecnico .golden-nav {
  flex-direction: row;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .workspace.layout-ufficio {
    display: grid;
    grid-template-columns: 248px minmax(650px, 1fr) 320px;
    min-width: 1250px;
  }
}

/* GOLDEN INFISSI — Dashboard Office */

.golden-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.golden-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 4px;
}

.golden-eyebrow {
  display: block;
  color: #9c8a69;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 9px;
}

.golden-page-heading h1 {
  font-size: 30px;
  font-weight: 650;
  color: #f0e8d8;
  margin: 0;
}

.golden-page-heading p {
  color: #99958e;
  font-size: 13px;
  margin: 8px 0 0;
}

.golden-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.golden-kpi {
  background: linear-gradient(145deg, #202124, #191a1d);
  border: 1px solid #3a342a;
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
}

.golden-kpi-label {
  display: block;
  color: #aaa49a;
  font-size: 12px;
  min-height: 30px;
}

.golden-kpi-value {
  display: block;
  font-size: 34px;
  line-height: 1.3;
  color: #e5c17b;
  margin: 8px 0;
}

.golden-kpi-note {
  display: block;
  color: #817d77;
  font-size: 11px;
}

.golden-panel {
  background: #1b1c1f;
  border: 1px solid #37332d;
  border-radius: 12px;
  overflow: hidden;
}

.golden-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid #34312b;
}

.golden-panel-heading h2 {
  margin: 0;
  font-size: 19px;
  color: #e8dfce;
}

.golden-count {
  color: #c3a56c;
  font-size: 12px;
}

.golden-table-scroll {
  overflow-x: auto;
}

.golden-commesse-table {
  border-collapse: collapse;
  width: 100%;
  background: transparent;
}

.golden-commesse-table th {
  color: #928c82;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #202124;
}

.golden-commesse-table td {
  font-size: 12px;
  color: #ddd8cf;
}

.golden-commesse-table th,
.golden-commesse-table td {
  padding: 15px 14px;
  border: 0;
  border-bottom: 1px solid #302e2a;
}

.golden-table-action {
  color: #e1bc77;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.golden-table-action:hover {
  text-decoration: underline;
}

.golden-operativo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 22px;
}

.golden-operativo-grid > div {
  background: #222327;
  border: 1px solid #38332b;
  border-radius: 9px;
  padding: 18px;
}

.golden-operativo-grid strong {
  display: block;
  font-size: 25px;
  color: #e5c17b;
}

.golden-operativo-grid span {
  display: block;
  color: #a9a49b;
  font-size: 12px;
  margin-top: 6px;
}

@media (max-width: 1450px) {
  .golden-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* GOLDEN INFISSI — Pannello agentico compatto */

.workspace.layout-ufficio > .ufficio-agentico {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.golden-eyebrow {
  display: block;
  color: #bda16b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.golden-agent-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding-bottom: 18px;
}

.golden-agent-header h2 {
  margin: 0;
  font-size: 19px;
  color: #eee7da;
}

.golden-agent-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.golden-agent-tab {
  min-width: 0;
  padding: 12px 7px;
  border: 1px solid #454036;
  border-radius: 8px;
  background: #222326;
  color: #bdb8ae;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.golden-agent-tab:hover,
.golden-agent-tab:focus-visible {
  border-color: #b99a60;
  color: #f1d7a0;
}

.golden-agent-tab.selezionato {
  background: #3b3223;
  border-color: #c4a66b;
  color: #f3d49b;
}

.golden-chat-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 220px;
  padding: 18px;
  border: 1px solid #3b3935;
  border-radius: 12px;
  background: #1b1c1f;
}

.golden-chat-area h3 {
  margin: 0;
  color: #ebd1a0;
  font-size: 17px;
}

.golden-chat-area .golden-muted {
  margin: 0;
}

.golden-chat-empty {
  margin-top: auto;
  padding: 16px 12px;
  border: 1px dashed #514938;
  border-radius: 9px;
  background: #242321;
  text-align: center;
}

.golden-chat-empty strong {
  color: #d5bc89;
  font-size: 12px;
}

.golden-chat-empty p {
  margin: 9px 0 0;
  color: #aaa399;
  font-size: 11px;
  line-height: 1.5;
}

.golden-chat-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #39342c;
  color: #8f897e;
  font-size: 10px;
}


/* GOLDEN INFISSI — Dashboard desktop v2 */

.layout-ufficio .golden-desktop-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.layout-ufficio .golden-desktop-dashboard .golden-page-heading {
  margin-bottom: 0;
  gap: 16px;
}

.layout-ufficio .golden-desktop-dashboard .golden-page-heading h1 {
  font-size: 25px;
  line-height: 1.2;
}

.layout-ufficio .golden-desktop-dashboard .golden-page-heading p {
  margin-top: 5px;
  font-size: 12px;
}

.layout-ufficio .golden-desktop-dashboard .golden-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.layout-ufficio .golden-desktop-dashboard .golden-kpi {
  min-width: 0;
  padding: 15px 16px;
  border-radius: 9px;
  background: #202124;
  border: 1px solid #37332d;
}

.layout-ufficio .golden-desktop-dashboard .golden-kpi-label {
  min-height: 0;
  font-size: 11px;
}

.layout-ufficio .golden-desktop-dashboard .golden-kpi-value {
  font-size: 27px;
  margin: 7px 0 3px;
  line-height: 1.15;
}

.layout-ufficio .golden-desktop-dashboard .golden-kpi-note {
  font-size: 10px;
}

.layout-ufficio .golden-desk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.layout-ufficio .golden-desk-panel {
  min-width: 0;
  min-height: 190px;
  background: #1c1d20;
  border: 1px solid #38342e;
  border-radius: 10px;
  overflow: hidden;
}

.layout-ufficio .golden-desk-panel .golden-panel-heading {
  padding: 15px 17px;
  min-height: 54px;
}

.layout-ufficio .golden-desk-panel .golden-panel-heading h2 {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.layout-ufficio .golden-panel-body {
  padding: 13px 17px;
}

.layout-ufficio .golden-work-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: #e6dfd3;
  text-decoration: none;
  border-bottom: 1px solid #302e2b;
}

.layout-ufficio .golden-work-row:last-child {
  border-bottom: 0;
}

.layout-ufficio .golden-work-row:hover,
.layout-ufficio .golden-work-row:focus-visible {
  color: #f2d49d;
}

.layout-ufficio .golden-work-row > div {
  min-width: 0;
}

.layout-ufficio .golden-work-row strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.layout-ufficio .golden-work-row small {
  display: block;
  margin-top: 5px;
  color: #99938a;
  font-size: 10px;
}

.layout-ufficio .golden-work-status {
  flex: 0 0 auto;
  max-width: 45%;
  color: #c8a76c;
  font-size: 10px;
  text-align: right;
  overflow-wrap: anywhere;
}

.layout-ufficio .golden-agent-notice {
  padding: 12px;
  background: #252420;
  border: 1px solid #40392d;
  border-radius: 7px;
}

.layout-ufficio .golden-agent-notice strong {
  color: #e4c58c;
  font-size: 12px;
}

.layout-ufficio .golden-agent-notice p,
.layout-ufficio .golden-empty {
  margin: 9px 0;
  color: #a49d92;
  font-size: 12px;
  line-height: 1.6;
}

.layout-ufficio .golden-status-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.layout-ufficio .golden-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #302e2b;
  font-size: 12px;
  color: #bdb6aa;
}

.layout-ufficio .golden-status-row:last-child {
  border-bottom: 0;
}

.layout-ufficio .golden-status-row strong {
  color: #e5c17b;
  font-size: 13px;
}

@media (min-width: 1600px) {
  .layout-ufficio .golden-desk-panel {
    min-height: 215px;
  }
}


/* GOLDEN INFISSI — Header desktop v2 */

#testata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 24px;
  min-height: 78px;
  padding: 14px 28px;
  background: #17181b;
  border-bottom: 1px solid #38342e;
}

.golden-header-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.golden-header-intro > strong {
  color: #eee7db;
  font-size: 18px;
  font-weight: 650;
}

.golden-header-intro > small {
  color: #b69b6b;
  font-size: 11px;
  letter-spacing: .5px;
}

.golden-header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.golden-header-profile {
  display: flex;
  align-items: center;
  gap: 11px;
}

.golden-profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: #4b3b26;
  border: 1px solid #8e7041;
  color: #e9c98a;
  font-size: 15px;
  font-weight: 700;
}

.golden-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.golden-profile-info strong {
  color: #eee7db;
  font-size: 12px;
}

.golden-profile-info small {
  color: #999187;
  font-size: 10px;
}

#testata .golden-header-exit {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 12px;
}


/* GOLDEN INFISSI — Agent workspace desktop v3 */

.workspace.layout-ufficio > .ufficio-agentico {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: calc(100vh - 78px);
  padding: 22px 18px 16px;
  background: #18191c;
}

.layout-ufficio .golden-agent-header {
  gap: 7px;
  padding-bottom: 14px;
  border-bottom: 1px solid #38342e;
}

.layout-ufficio .golden-agent-header h2 {
  font-size: 18px;
  line-height: 1.3;
}

.layout-ufficio .golden-agent-header .etichetta {
  background: #343025;
  border: 1px solid #51442f;
  color: #d4b77d;
  font-size: 10px;
}

.layout-ufficio .golden-agent-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.layout-ufficio .golden-agent-tab {
  min-height: 38px;
  padding: 9px 5px;
  font-size: 11px;
  border-radius: 7px;
}

.layout-ufficio .golden-agent-tab:first-child {
  grid-column: 1 / -1;
}

.layout-ufficio .golden-chat-area {
  flex: 1 1 auto;
  min-height: 230px;
  gap: 10px;
  padding: 15px;
  border-radius: 9px;
}

.layout-ufficio .golden-chat-area h3 {
  font-size: 15px;
}

.layout-ufficio .golden-chat-area .golden-muted {
  font-size: 11px;
  line-height: 1.5;
  color: #a9a297;
}

.layout-ufficio .golden-chat-empty {
  margin-top: auto;
  padding: 14px 10px;
}

.layout-ufficio .golden-agent-approvals {
  padding: 13px;
  border: 1px solid #433b2e;
  border-radius: 8px;
  background: #22211f;
}

.layout-ufficio .golden-agent-approvals strong {
  display: block;
  color: #ddc08c;
  font-size: 12px;
}

.layout-ufficio .golden-agent-approvals p {
  margin: 7px 0 0;
  color: #aaa296;
  font-size: 11px;
  line-height: 1.5;
}

.layout-ufficio .golden-chat-composer {
  padding: 12px;
  border: 1px solid #3c3831;
  border-radius: 9px;
  background: #202124;
}

.layout-ufficio .golden-chat-compose-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.layout-ufficio .golden-chat-compose-row textarea {
  flex: 1;
  min-width: 0;
  min-height: 58px;
  max-width: none;
  resize: none;
  padding: 10px;
  font-size: 11px;
}

.layout-ufficio .golden-chat-compose-row button {
  flex: 0 0 32px;
  width: 32px;
  min-height: 36px;
  padding: 5px;
  border-radius: 7px;
}

.layout-ufficio .golden-chat-composer small {
  display: block;
  margin-top: 8px;
  color: #938b80;
  font-size: 10px;
}

.layout-ufficio .golden-chat-footer {
  padding-top: 11px;
  font-size: 9px;
}


/* GOLDEN INFISSI — miniature dashboard */
.layout-ufficio .golden-work-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
}

.layout-ufficio .golden-work-thumb {
  width: 72px;
  height: 56px;
  flex: 0 0 72px;
  border: 1px solid #514532;
  border-radius: 7px;
  background: linear-gradient(145deg, #302b23, #17191c);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.layout-ufficio .golden-work-thumb span {
  color: #bda16b;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
}

.layout-ufficio .golden-work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.layout-ufficio .golden-work-info {
  flex: 1;
  min-width: 0;
}

.layout-ufficio .golden-work-card .golden-work-status {
  flex: 0 0 auto;
  max-width: 105px;
  text-align: right;
}

.layout-ufficio .golden-work-card:hover .golden-work-thumb {
  border-color: #c6a56c;
}


/* GOLDEN STATUS DONUT — dashboard */
.layout-ufficio .golden-status-dashboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 12px 0;
}

.layout-ufficio .golden-status-donut {
  background: var(--golden-donut-fill, #38342e);
  width: 148px;
  height: 148px;
  flex: 0 0 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.layout-ufficio .golden-status-donut-center {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #1c1d20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.layout-ufficio .golden-status-donut-center strong {
  color: #e4c184;
  font-size: 32px;
  line-height: 1.1;
}

.layout-ufficio .golden-status-donut-center span {
  color: #a9a39a;
  font-size: 11px;
  margin-top: 5px;
}

.layout-ufficio .golden-status-dashboard .golden-status-list {
  flex: 1;
  min-width: 0;
}

.layout-ufficio .golden-status-row span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.layout-ufficio .golden-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.layout-ufficio .golden-status-dot-0 { background: #c6a56c; }
.layout-ufficio .golden-status-dot-1 { background: #6d91b2; }
.layout-ufficio .golden-status-dot-2 { background: #c98658; }
.layout-ufficio .golden-status-dot-3 { background: #79a58a; }

@media (max-width: 1250px) {
  .layout-ufficio .golden-status-dashboard {
    flex-direction: column;
    gap: 16px;
  }

  .layout-ufficio .golden-status-dashboard .golden-status-list {
    width: 100%;
  }
}





/* GOLDEN ACTIVITY TIMELINE */

.layout-ufficio .golden-activity-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.layout-ufficio .golden-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(198, 165, 108, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.layout-ufficio .golden-activity-item:hover,
.layout-ufficio .golden-activity-item:focus-visible {
  background: rgba(198, 165, 108, 0.08);
  border-color: rgba(198, 165, 108, 0.4);
}

.layout-ufficio .golden-activity-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: rgba(198, 165, 108, 0.12);
  color: #c6a56c;
  font-size: 17px;
  font-weight: 700;
}

.layout-ufficio .golden-activity-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.layout-ufficio .golden-activity-content strong {
  color: #e8d5b2;
  font-size: 12px;
  font-weight: 650;
}

.layout-ufficio .golden-activity-content > span {
  color: #c0bcb5;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.layout-ufficio .golden-activity-content small {
  color: #89847c;
  font-size: 10px;
}


/* GOLDEN REMINDERS PANEL v1 */

.layout-ufficio .golden-reminder-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.layout-ufficio .golden-reminder-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(198, 165, 108, 0.14);
  border-radius: 10px;
  min-width: 0;
}

.layout-ufficio .golden-reminder-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.layout-ufficio .golden-reminder-main strong {
  color: #e8d5b2;
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.layout-ufficio .golden-reminder-main > span {
  color: #aaa49a;
  font-size: 11px;
}

.layout-ufficio .golden-reminder-main a {
  color: #c6a56c;
  font-size: 11px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.layout-ufficio .golden-reminder-main a:hover,
.layout-ufficio .golden-reminder-main a:focus-visible {
  text-decoration: underline;
}

.layout-ufficio .golden-reminder-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.layout-ufficio .golden-reminder-meta span {
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid rgba(198, 165, 108, 0.25);
  color: #c6a56c;
  background: rgba(198, 165, 108, 0.08);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.layout-ufficio .golden-reminder-meta span:first-child {
  color: #e8d5b2;
}

@media (max-width: 480px) {
  .layout-ufficio .golden-reminder-item {
    flex-direction: column;
  }

  .layout-ufficio .golden-reminder-meta {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
}


/* GOLDEN REMINDER FORM v1 */

.layout-ufficio .golden-reminder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout-ufficio .golden-reminder-add {
  padding: 8px 12px;
  border: 1px solid rgba(198, 165, 108, 0.5);
  border-radius: 7px;
  background: rgba(198, 165, 108, 0.12);
  color: #e8d5b2;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.layout-ufficio .golden-reminder-add:hover,
.layout-ufficio .golden-reminder-add:focus-visible {
  background: rgba(198, 165, 108, 0.22);
  border-color: #c6a56c;
}

.layout-ufficio .golden-reminder-editor {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  background: #202124;
  border: 1px solid #514938;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.layout-ufficio .golden-reminder-editor[hidden] {
  display: none !important;
}

.layout-ufficio .golden-panel-heading {
  position: relative;
}

.layout-ufficio .golden-reminder-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.layout-ufficio .golden-reminder-form label {
  color: #c9bca5;
  font-size: 11px;
  font-weight: 600;
}

.layout-ufficio .golden-reminder-form input,
.layout-ufficio .golden-reminder-form textarea,
.layout-ufficio .golden-reminder-form select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #514938;
  border-radius: 7px;
  background: #151619;
  color: #eee9dd;
  font: inherit;
  font-size: 12px;
}

.layout-ufficio .golden-reminder-form input:focus,
.layout-ufficio .golden-reminder-form textarea:focus,
.layout-ufficio .golden-reminder-form select:focus {
  outline: 2px solid #c6a56c;
  outline-offset: 1px;
}

.layout-ufficio .golden-reminder-submit {
  margin-top: 8px;
  padding: 11px;
  border: 1px solid #c6a56c;
  border-radius: 7px;
  background: #b99754;
  color: #101114;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.layout-ufficio .golden-reminder-submit:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (max-width: 600px) {
  .layout-ufficio .golden-reminder-editor {
    right: 0;
    width: min(320px, calc(100vw - 32px));
  }

  .layout-ufficio .golden-reminder-add {
    padding: 7px 9px;
    font-size: 10px;
  }
}


/* GOLDEN REMINDER MOBILE FIX v1 */

.layout-ufficio .golden-panel-heading:has(.golden-reminder-actions) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.layout-ufficio .golden-reminder-actions {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.layout-ufficio .golden-reminder-add {
  align-self: flex-start;
}

.layout-ufficio .golden-reminder-editor {
  position: static;
  z-index: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  box-shadow: none;
}

.layout-ufficio .golden-reminder-editor[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .layout-ufficio .golden-reminder-form input,
  .layout-ufficio .golden-reminder-form textarea,
  .layout-ufficio .golden-reminder-form select {
    font-size: 16px;
  }

  .layout-ufficio .golden-reminder-editor {
    padding: 14px;
  }
}


/* GOLDEN REMINDER STATE BUTTONS v1 */

.layout-ufficio .golden-reminder-state-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.layout-ufficio .golden-reminder-complete,
.layout-ufficio .golden-reminder-cancel {
  appearance: none;
  border: 1px solid rgba(207, 166, 88, 0.55);
  border-radius: 8px;
  background: rgba(207, 166, 88, 0.08);
  color: #e8d2a3;
  padding: 8px 12px;
  min-height: 36px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.layout-ufficio .golden-reminder-complete:hover,
.layout-ufficio .golden-reminder-complete:focus-visible {
  background: rgba(207, 166, 88, 0.18);
  border-color: #cfa658;
}

.layout-ufficio .golden-reminder-cancel {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: #b9b9b9;
}

.layout-ufficio .golden-reminder-cancel:hover,
.layout-ufficio .golden-reminder-cancel:focus-visible {
  border-color: rgba(235, 105, 105, 0.65);
  background: rgba(235, 105, 105, 0.10);
  color: #f0aaaa;
}

.layout-ufficio .golden-reminder-complete:disabled,
.layout-ufficio .golden-reminder-cancel:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.layout-ufficio .golden-reminder-state-error {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: #f0aaaa;
  font-size: 12px;
}

.layout-ufficio .golden-reminder-state-error:empty {
  display: none;
}

@media (max-width: 600px) {
  .layout-ufficio .golden-reminder-state-actions {
    gap: 6px;
  }

  .layout-ufficio .golden-reminder-complete,
  .layout-ufficio .golden-reminder-cancel {
    flex: 1 1 auto;
    min-width: 110px;
    min-height: 40px;
  }
}

/* GOLDEN REMINDER CARD LAYOUT v2 */

.layout-ufficio .golden-reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.layout-ufficio .golden-reminder-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
}

.layout-ufficio .golden-reminder-main strong {
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}

.layout-ufficio .golden-reminder-main a {
  overflow-wrap: break-word;
  word-break: normal;
}

.layout-ufficio .golden-reminder-meta {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.layout-ufficio .golden-reminder-state-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
}

@media (max-width: 700px) {
  .layout-ufficio .golden-reminder-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .layout-ufficio .golden-reminder-main {
    grid-column: 1;
    grid-row: 1;
  }

  .layout-ufficio .golden-reminder-meta {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .layout-ufficio .golden-reminder-state-actions {
    grid-column: 1;
    grid-row: 3;
  }

  .layout-ufficio .golden-reminder-complete,
  .layout-ufficio .golden-reminder-cancel {
    flex: 1 1 110px;
  }
}


/* GOLDEN FIELD CARDS V1 */

.layout-tecnico .golden-field-home {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}

.layout-tecnico .golden-field-home > section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layout-tecnico .golden-field-home h3 {
  margin: 0;
  color: #e8d3a6;
  font-size: 17px;
}

.layout-tecnico .golden-field-home .lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layout-tecnico .golden-field-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  min-height: 130px;
  background: #1b1c20;
  border: 1px solid #39342c;
  border-radius: 14px;
  color: #eee9dd;
  text-decoration: none;
}

.layout-tecnico .golden-field-card:hover,
.layout-tecnico .golden-field-card:focus-visible {
  border-color: #c6a56c;
}

.layout-tecnico .golden-field-card-top,
.layout-tecnico .golden-field-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.layout-tecnico .golden-field-code {
  color: #b69b6b;
  font-size: 12px;
  font-weight: 700;
}

.layout-tecnico .golden-field-status {
  padding: 5px 10px;
  border-radius: 999px;
  background: #343025;
  color: #e9c98a;
  font-size: 12px;
}

.layout-tecnico .golden-field-title {
  font-size: 19px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.layout-tecnico .golden-field-card-bottom {
  color: #bcb5a9;
  font-size: 13px;
}

.layout-tecnico .golden-field-open {
  color: #e9c98a;
  font-weight: 700;
}

@media (max-width: 600px) {
  .workspace.layout-tecnico > main {
    padding: 12px;
  }

  .layout-tecnico .golden-field-card {
    padding: 18px;
    min-height: 140px;
  }
}

/* M7 preview: messaggi del pannello Ufficio (stesso linguaggio grafite/nero/oro) */
.golden-msg { border-left: 2px solid #c9a24a; padding: 4px 10px; margin: 6px 0; text-align: left; }
.golden-msg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.golden-chat-area select { margin: 6px 0; max-width: 100%; }

/* M8-A: aggiunte locali al pannello Ufficio (solo selettori .golden-*; nessuna modifica alla struttura desktop) */
.golden-msg-owner { border-left-color: #c9a24a; }
.golden-msg-agente { border-left-color: #8a8f98; background: rgba(255,255,255,.04); }
.golden-msg-altro { border-left-color: #555; }
.golden-mini { font-size: 12px; padding: 2px 8px; margin-top: 4px; }
.golden-agent-tecnica, .golden-agent-memoria { text-align: left; margin: 8px 0; max-height: 360px; overflow: auto; overflow-wrap: anywhere; }
.golden-fase { border-top: 1px solid #3a3a3a; padding: 4px 0; }
.golden-fase ul, .golden-ins-storico ul { margin: 2px 0 2px 16px; padding: 0; }
.golden-ins, .golden-ins-storico, .golden-teach-form, .golden-risultato { border: 1px solid #3a3a3a; padding: 6px 8px; margin: 6px 0; overflow-wrap: anywhere; }
.golden-ins-storico.revocato { opacity: .65; border-style: dashed; }
.golden-teach-form select, .golden-teach-form input, .golden-teach-form textarea, .golden-domanda select, .golden-domanda input, .golden-domanda textarea { display: block; width: 100%; max-width: 100%; box-sizing: border-box; margin: 4px 0; }
@media (max-width: 900px) { .golden-agent-tecnica, .golden-agent-memoria { max-height: none; } }

.golden-technical-view canvas { display:block; max-width:100%; height:auto; border:1px solid #554b31; background:#17191c; }
.golden-technical-links { display:flex; gap:1rem; flex-wrap:wrap; margin-bottom:1rem; }
.golden-technical-links a { color:#c5ab68; }

/* Ufficio: contesto fisso, una sola sezione e scorrimento interno. */
.golden-office-panel.golden-office-panel.golden-office-panel {
  min-height: 0;
  height: var(--golden-office-height, calc(100dvh - 180px));
  max-height: var(--golden-office-height, calc(100dvh - 180px));
  position: sticky;
  top: 0;
  align-self: start;
  gap: 10px;
  overflow: hidden;
}
.golden-office-context { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.golden-office-context label { min-width: 0; font-size: 11px; color: #c9b88f; }
.golden-office-context select { width: 100%; min-width: 0; margin: 4px 0 0; }
.golden-office-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.golden-section-button { padding: 8px 3px; min-width: 0; min-height: 36px; font-size: 11px; background: #232428; color: #b9b2a6; border: 1px solid #454038; border-radius: 6px; }
.golden-section-button.selezionato { background: #463c29; color: #f0d6a3; border-color: #b59a67; }
.golden-question-count { display: inline-block; margin-left: 4px; font-size: 10px; }
.golden-office-panel button:focus-visible, .golden-office-panel summary:focus-visible, .golden-office-panel select:focus-visible, .golden-office-panel textarea:focus-visible, .golden-office-panel input:focus-visible { outline: 2px solid #e0bd78; outline-offset: 2px; }
.golden-office-content { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.golden-office-section { height: 100%; min-height: 0; overflow: auto; padding: 2px; overflow-wrap: anywhere; }
.golden-office-panel [hidden] { display: none !important; }
.golden-office-chat { display: flex; flex-direction: column; gap: 9px; }
.golden-office-panel .golden-agent-tabs { display: flex; flex-wrap: wrap; gap: 4px; flex: 0 0 auto; }
.golden-office-panel .golden-agent-tab { flex: 1 1 auto; min-height: 30px; padding: 5px; font-size: 10px; }
.golden-office-panel .golden-chat-area { flex: 1 1 auto; min-height: 70px; overflow: auto; padding: 10px; gap: 6px; }
.golden-office-panel .golden-chat-area h3 { margin: 0; }
.golden-office-panel .golden-chat-area .golden-muted { margin: 0; }
.golden-office-panel .golden-chat-empty { margin-top: 0; padding: 5px 0; text-align: left; }
.golden-office-panel .golden-chat-composer { flex: 0 0 auto; padding: 8px; }
.golden-office-panel .golden-chat-footer { flex: 0 0 auto; padding-top: 2px; }
.golden-office-panel .golden-agent-header { flex: 0 0 auto; padding-bottom: 8px; }
.golden-office-panel .golden-agent-header .etichetta { white-space: normal; }
.golden-office-section h3 { margin: 4px 0 10px; font-size: 15px; }
.golden-office-section h4 { margin: 16px 0 8px; font-size: 12px; color: #ddc08c; }
.golden-office-section .golden-muted { font-size: 11px; line-height: 1.5; }
.golden-question-details summary { cursor: pointer; padding: 8px 0; font-size: 12px; color: #ddc08c; }
.golden-question-meta { display: block; padding-top: 4px; color: #b9b2a6; font-size: 10px; font-weight: normal; }
.golden-question-details[open] summary { margin-bottom: 8px; border-bottom: 1px solid #433b2e; }
@media (max-width: 900px) {
  .golden-office-panel.golden-office-panel.golden-office-panel { position: static; height: var(--golden-office-height, 85dvh); max-height: var(--golden-office-height, 85dvh); }
}
@media (max-height: 700px) {
  .golden-office-panel.golden-office-panel.golden-office-panel { padding-top: 10px; padding-bottom: 10px; gap: 6px; }
  .golden-office-panel .golden-agent-header .golden-eyebrow, .golden-office-panel .golden-chat-footer { display: none; }
}
