:root {
  --studio-night: #07111f;
  --studio-night-2: #10233a;
  --studio-panel: rgba(10, 25, 41, 0.96);
  --studio-line: rgba(117, 191, 255, 0.25);
  --studio-text: #eff8ff;
  --studio-muted: #99aec0;
  --studio-green: #45dc92;
  --studio-gold: #f0c65a;
}

html,
body,
#root,
.studio-exec-root {
  background:
    linear-gradient(180deg, rgba(4, 12, 25, 0.36), rgba(4, 10, 18, 0.88)),
    radial-gradient(circle at 65% 0%, #1b3857 0, #0d2035 38%, #07111f 74%) !important;
}

.studio-exec-root {
  grid-template-columns: minmax(0, 1fr) 0 0 !important;
  grid-template-rows: minmax(0, 1fr) 44px 72px !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  height: 100vh !important;
  padding: 86px 322px 10px 238px !important;
}

.studio-exec-root::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 56px 0 0 224px;
  pointer-events: none;
  opacity: 0.72;
  background:
    linear-gradient(90deg, rgba(3, 10, 18, .92), transparent 12%, transparent 88%, rgba(3, 10, 18, .92)),
    linear-gradient(rgba(6, 17, 29, .22), rgba(6, 17, 29, .68)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(100, 142, 167, .16) 32px 34px),
    repeating-linear-gradient(90deg, #14293a 0 62px, #1a3346 62px 122px, #102434 122px 126px);
  background-size: auto, auto, auto, 252px 68px;
}

.studio-exec-office {
  grid-column: 1 / 2 !important;
  grid-row: 1 / 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 2px solid rgba(126, 194, 255, 0.28) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #151523, #111321) !important;
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.42),
    0 0 0 8px rgba(8, 20, 31, .76),
    0 0 0 10px rgba(77, 119, 145, .24),
    inset 0 0 0 1px rgba(255,255,255,.04) !important;
}

.studio-exec-office::after {
  content: "LIVE OPERATIONS FLOOR";
  position: absolute;
  z-index: 8;
  top: 10px;
  left: 12px;
  padding: 6px 8px;
  pointer-events: none;
  color: #a9c9db;
  background: rgba(6, 19, 31, .82);
  border: 1px solid rgba(111, 184, 230, .24);
  border-radius: 7px;
  font-family: var(--studio-font-content);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.studio-exec-office canvas {
  width: 100% !important;
  height: 100% !important;
}

.studio-left-system-panel {
  display: none !important;
}

.studio-unified-sidebar {
  position: fixed;
  z-index: 2147482100;
  top: 86px;
  bottom: 10px;
  left: 14px;
  width: 204px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  padding: 10px;
  color: var(--studio-text);
  background: linear-gradient(180deg, rgba(13, 32, 50, 0.98), rgba(6, 18, 31, 0.98));
  border: 1px solid var(--studio-line);
  border-radius: 15px;
  box-shadow: 0 20px 48px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.06);
}

.studio-sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
}

.studio-sidebar-title strong {
  font-family: var(--studio-font-title) !important;
  font-size: 9px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
}

.studio-sidebar-live {
  color: var(--studio-green);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.studio-compact-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.studio-compact-kpi {
  min-width: 0;
  padding: 8px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(140, 199, 255, .14);
  border-radius: 9px;
}

.studio-compact-kpi span {
  display: block;
  color: var(--studio-muted);
  font-size: 9px;
  line-height: 1.2;
}

.studio-compact-kpi b {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-unified-sidebar .studio-agent-command-panel {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  min-height: 0 !important;
  flex: 1 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.studio-unified-sidebar .studio-agent-command-head {
  padding: 4px 2px 7px !important;
  color: var(--studio-text) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--studio-line) !important;
}

.studio-unified-sidebar .studio-agent-command-kicker,
.studio-unified-sidebar .studio-agent-command-foot {
  display: none !important;
}

.studio-unified-sidebar .studio-agent-command-head h2 {
  margin: 0 !important;
  color: #fff !important;
  font-family: var(--studio-font-title) !important;
  font-size: 9px !important;
}

.studio-unified-sidebar .studio-agent-command-summary {
  margin-top: 8px !important;
}

.studio-unified-sidebar .studio-agent-command-summary span {
  padding: 4px 6px !important;
  color: #cce8ff !important;
  background: rgba(94, 166, 225, .12) !important;
  font-size: 9px !important;
}

.studio-unified-sidebar .studio-agent-command-list {
  grid-template-columns: 1fr !important;
  gap: 5px !important;
  padding: 6px 0 0 !important;
  scrollbar-width: thin;
}

.studio-unified-sidebar .studio-command-agent {
  grid-template-columns: 29px minmax(0, 1fr) auto !important;
  gap: 7px !important;
  min-height: 43px !important;
  padding: 5px !important;
  color: var(--studio-text) !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(139, 197, 250, .14) !important;
  border-left: 3px solid var(--agent-color) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}

.studio-unified-sidebar .studio-command-agent:hover {
  transform: translateX(2px) !important;
  background: rgba(255,255,255,.09) !important;
}

.studio-unified-sidebar .studio-command-avatar {
  width: 29px !important;
  height: 29px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}

.studio-unified-sidebar .studio-command-agent-name {
  color: #fff !important;
  font-size: 11px !important;
}

.studio-unified-sidebar .studio-command-agent-role {
  color: #9fb3c4 !important;
  font-size: 9px !important;
}

.studio-unified-sidebar .studio-command-agent-status {
  color: var(--studio-green) !important;
  font-size: 9px !important;
  max-width: 118px !important;
}

.studio-chat-bar {
  grid-column: 1 / 2 !important;
  grid-row: 3 / 4 !important;
  height: 72px !important;
  min-height: 72px !important;
  gap: 8px !important;
  padding: 9px !important;
  background: rgba(8, 24, 39, .97) !important;
  border: 1px solid var(--studio-line) !important;
  border-radius: 13px !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.27) !important;
}

.studio-mia-desk {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  color: #dcebf4;
  background: rgba(8, 24, 39, .97);
  border: 1px solid var(--studio-line);
  border-radius: 11px;
  box-shadow: 0 10px 25px rgba(0,0,0,.22);
}

.studio-mia-desk-label {
  margin-right: auto;
  padding: 0 8px;
  color: #bfd3df !important;
  font-size: 9px;
  white-space: nowrap;
}

.studio-mia-desk-label b {
  color: #b6a8ff !important;
}

.studio-mia-desk button {
  min-height: 32px;
  padding: 0 10px;
  color: #e8f4fa !important;
  background: #17354a !important;
  border: 1px solid #3d6680 !important;
  border-radius: 7px;
  font-family: var(--studio-font-content);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.studio-mia-desk button:first-of-type {
  color: #fff !important;
  background: #644db7 !important;
  border-color: #a08cff !important;
}

.studio-city-strip {
  display: none !important;
}

.studio-city-buildings {
  position: absolute;
  inset: 0 0 20px;
  opacity: .88;
  background:
    url("/assets/metrocity-building.png") 18px bottom / 58px auto repeat-x;
  filter: brightness(.55) saturate(.8) hue-rotate(168deg);
}

.studio-city-road {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 24px;
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, #e8ca65 38px 62px, transparent 62px 105px) center 11px / auto 3px no-repeat,
    linear-gradient(180deg, #17202a, #080d13);
  border-top: 2px solid #40505d;
}

.studio-city-car {
  position: absolute;
  z-index: 3;
  bottom: 7px;
  left: -60px;
  width: 42px;
  height: 13px;
  border-radius: 7px 9px 4px 4px;
  background: #e04f48;
  box-shadow: 0 0 8px rgba(255, 93, 77, .42);
  animation: studio-city-drive 11s linear infinite;
}

.studio-city-car::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 10px;
  width: 22px;
  height: 8px;
  border-radius: 7px 7px 0 0;
  background: #9dd7ef;
}

.studio-city-car::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #080b10;
  box-shadow: -28px 0 #080b10;
}

.studio-city-car.car-two {
  bottom: 30px;
  width: 34px;
  background: #e8bf47;
  animation-duration: 15s;
  animation-delay: -6s;
}

.studio-city-smoke {
  position: absolute;
  z-index: 2;
  left: 18%;
  bottom: 44px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(211, 226, 237, .25);
  animation: studio-city-smoke 4.8s ease-out infinite;
}

.studio-city-smoke.smoke-two {
  left: 72%;
  animation-delay: -2.1s;
}

@keyframes studio-city-drive {
  from { transform: translateX(-70px); }
  to { transform: translateX(calc(100vw + 120px)); }
}

@keyframes studio-city-smoke {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  20% { opacity: .55; }
  100% { transform: translate(24px, -55px) scale(2.5); opacity: 0; }
}

.studio-selected-agent-panel,
.studio-agents-grid,
.studio-bottom-grid,
.agent-panel,
.agents-bar,
[class*="selected-agent-panel"],
[class*="agents-grid"] {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
}

.studio-attention-mini {
  top: 86px !important;
  right: 14px !important;
  width: 292px !important;
  max-height: calc(100vh - 96px) !important;
  overflow-y: auto !important;
  gap: 8px !important;
}

.studio-attention-mini::before {
  content: "RICHIESTE DEGLI AGENTI";
  display: block;
  padding: 8px 10px;
  color: #a9c5d6;
  background: rgba(8, 23, 36, .96);
  border: 1px solid rgba(117, 191, 255, .22);
  border-radius: 9px;
  font-family: var(--studio-font-title);
  font-size: 8px;
  line-height: 1.4;
}

.studio-attention-pill {
  padding: 10px 11px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.studio-attention-pill b {
  font-size: 13px !important;
}

.studio-attention-pill small {
  font-size: 11px !important;
}

.studio-attention-pill .hint {
  font-size: 9px !important;
}

.studio-attention-pill:nth-child(n+3) {
  display: none !important;
}

.studio-real-topbar {
  height: 54px !important;
  padding: 7px 10px !important;
  gap: 8px !important;
  background: linear-gradient(180deg, rgba(14, 26, 39, .99), rgba(7, 17, 28, .99)) !important;
  border: 1px solid rgba(116, 184, 236, .30) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.05) !important;
}

.studio-real-topbar::before {
  content: "" !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  margin: 0 2px 0 0 !important;
  background: #111 url("/assets/manzuoli-m-logo.jpg") center / cover no-repeat !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 10px !important;
  box-shadow: 0 5px 14px rgba(0,0,0,.28) !important;
}

.studio-real-topbar b {
  min-width: 218px !important;
  max-width: 218px !important;
  margin-right: auto !important;
  color: #f6fbff !important;
  font-family: var(--studio-font-content) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .04em !important;
  text-shadow: none !important;
}

.studio-real-topbar .studio-topbar-btn,
.studio-real-topbar button {
  height: 38px !important;
  min-width: 92px !important;
  padding: 0 13px !important;
  color: #dceaf4 !important;
  background: #182a39 !important;
  border: 1px solid #30495c !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  font-family: var(--studio-font-content) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.studio-real-topbar .studio-topbar-btn:hover,
.studio-real-topbar button:hover {
  color: #fff !important;
  background: #213b50 !important;
  border-color: #5a84a2 !important;
}

.studio-real-topbar [data-v3-tech-control-room="1"] {
  color: #122333 !important;
  background: linear-gradient(180deg, #f0ca69, #d9a83d) !important;
  border-color: #ffe49a !important;
}

.studio-chat-bar input,
.studio-chat-bar textarea {
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 15px !important;
  color: #f7fbff !important;
  background: #102a43 !important;
  border: 1px solid #315878 !important;
  border-radius: 10px !important;
  font-size: 16px !important;
}

.studio-chat-bar input::placeholder,
.studio-chat-bar textarea::placeholder {
  color: #c4d7e3 !important;
  opacity: 1 !important;
}

.studio-chat-bar button {
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  color: #071522 !important;
  background: linear-gradient(180deg, #f5d879, #d8a93e) !important;
  border: 1px solid #ffe9a5 !important;
  border-radius: 10px !important;
}

/* CFO: pannello finanziario chiaro, ad alto contrasto. */
.cfo-panel-backdrop {
  background: rgba(2, 8, 16, .78) !important;
  backdrop-filter: blur(5px) !important;
}

.cfo-panel-window,
.cfo-panel,
.cfo-shell,
.cfo-hard-panel {
  color: #152437 !important;
  background: #edf4f8 !important;
  border: 1px solid #91abc0 !important;
  box-shadow: 0 28px 80px rgba(0,0,0,.38) !important;
}

.cfo-panel-window {
  width: min(1320px, 96vw) !important;
  max-height: 92vh !important;
  overflow: auto !important;
  border-radius: 16px !important;
}

.cfo-brand,
.cfo-toolbar,
.cfo-nav {
  color: #f4f9ff !important;
  background: linear-gradient(135deg, #0d2942, #164c68) !important;
  border-color: rgba(255,255,255,.15) !important;
}

.cfo-brand-title,
.cfo-title,
.cfo-current-section,
.cfo-card-title,
.cfo-kpi-title,
.cfo-stat-title {
  color: #102b43 !important;
  font-family: var(--studio-font-title) !important;
  font-size: 10px !important;
  line-height: 1.55 !important;
}

.cfo-brand-title,
.cfo-brand-sub,
.cfo-brand .cfo-title {
  color: #fff !important;
}

.cfo-kpis {
  gap: 12px !important;
}

.cfo-kpi,
.cfo-card,
.cfo-form,
.cfo-filters {
  color: #182b3c !important;
  background: #fff !important;
  border: 1px solid #c5d5e0 !important;
  border-radius: 13px !important;
  box-shadow: 0 8px 22px rgba(30, 67, 92, .09) !important;
}

.cfo-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.cfo-nav,
.cfo-tabs {
  overflow-x: auto !important;
  white-space: nowrap !important;
}

.cfo-kpi-value,
.cfo-stat-value,
.cfo-money,
.cfo-amount {
  color: #0c3853 !important;
  font-size: clamp(20px, 2vw, 30px) !important;
  font-weight: 800 !important;
}

.cfo-desc,
.cfo-description,
.cfo-muted,
.cfo-row-desc,
.cfo-updated {
  color: #4d6577 !important;
  font-size: 13px !important;
}

.cfo-table-wrap {
  background: #fff !important;
  border: 1px solid #c5d5e0 !important;
  border-radius: 12px !important;
}

.cfo-table {
  min-width: 880px !important;
  color: #16293a !important;
  background: #fff !important;
  font-size: 14px !important;
}

.cfo-table th {
  color: #143b56 !important;
  background: #dceaf2 !important;
  font-size: 11px !important;
}

.cfo-table td {
  color: #20384a !important;
  border-color: #dfebf2 !important;
}

.cfo-table tbody tr:hover {
  background: #eef7fc !important;
}

.cfo-input,
.cfo-select,
.cfo-form input,
.cfo-form textarea,
.cfo-form select {
  color: #142b3d !important;
  background: #fff !important;
  border: 1px solid #9fb7c8 !important;
  font-size: 15px !important;
}

.cfo-btn,
.cfo-tab,
.cfo-close {
  min-height: 40px !important;
  border-radius: 9px !important;
  font-size: 9px !important;
}

@media (max-width: 900px) {
  html,
  body,
  #root {
    overflow: hidden !important;
  }

  .studio-real-topbar {
    top: 6px !important;
    left: 6px !important;
    right: 6px !important;
    height: 52px !important;
    gap: 6px !important;
    padding: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  .studio-real-topbar::before,
  .studio-real-topbar b {
    display: none !important;
  }

  .studio-real-topbar button,
  .studio-real-topbar .studio-topbar-btn {
    flex: 0 0 auto !important;
    min-width: 86px !important;
    height: 38px !important;
    padding: 0 9px !important;
  }

  .studio-attention-mini {
    top: 64px !important;
    right: 7px !important;
    left: 7px !important;
    width: auto !important;
    max-width: none !important;
    height: 74px !important;
    max-height: 74px !important;
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 7px !important;
    padding: 0 !important;
    scroll-snap-type: x proximity;
  }

  .studio-attention-mini::before {
    display: none !important;
  }

  .studio-attention-pill {
    flex: 0 0 min(280px, calc(100vw - 42px)) !important;
    height: 72px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    scroll-snap-align: start;
  }

  .studio-attention-pill small {
    display: block !important;
    max-height: 31px !important;
    overflow: hidden !important;
  }

  .studio-attention-pill .hint {
    display: none !important;
  }

  #studio-sofia-main-bubble-v120h-area {
    display: none !important;
  }

  .studio-exec-root {
    min-height: 100dvh !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(340px, 1fr) 0 0 !important;
    padding: 145px 7px 220px !important;
  }

  .studio-exec-root::before {
    display: none;
  }

  .studio-exec-office {
    min-height: 0 !important;
    border-radius: 10px !important;
  }

  .studio-exec-office::after {
    top: 7px;
    left: 7px;
    padding: 5px 7px;
    font-size: 8px;
  }

  .studio-unified-sidebar {
    top: auto;
    right: 7px;
    bottom: 86px;
    left: 7px;
    width: auto;
    height: 88px;
    padding: 7px;
    border-radius: 12px;
  }

  .studio-sidebar-title,
  .studio-compact-kpis,
  .studio-unified-sidebar .studio-agent-command-head {
    display: none !important;
  }

  .studio-unified-sidebar .studio-agent-command-list {
    display: flex !important;
    gap: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 !important;
    scroll-snap-type: x proximity;
  }

  .studio-unified-sidebar .studio-command-agent {
    flex: 0 0 165px !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    scroll-snap-align: start;
  }

  .studio-unified-sidebar .studio-command-dot {
    display: none !important;
  }

  .studio-chat-bar {
    position: fixed !important;
    z-index: 2147482200 !important;
    right: 7px !important;
    bottom: 7px !important;
    left: 7px !important;
    width: auto !important;
    height: 74px !important;
  }

  .studio-mia-desk {
    position: fixed !important;
    z-index: 2147482150 !important;
    right: 7px !important;
    bottom: 178px !important;
    left: 7px !important;
    height: 42px !important;
    padding: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  .studio-mia-desk-label {
    display: none;
  }

  .studio-mia-desk button {
    flex: 1 0 auto;
    min-height: 32px;
    padding: 0 8px;
    font-size: 8px;
  }

  .studio-chat-bar input,
  .studio-chat-bar textarea {
    font-size: 16px !important;
  }

  .cfo-panel-window,
  .cfo-panel,
  .cfo-shell {
    inset: 5px !important;
    border-radius: 12px !important;
  }

  .cfo-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .cfo-table-wrap {
    overflow-x: auto !important;
  }
}

@media (min-width: 901px) {
  .studio-exec-root {
    padding-left: 238px !important;
    padding-right: 322px !important;
  }
}

@media (max-width: 520px) {
  .studio-unified-sidebar .studio-command-agent {
    flex-basis: 148px !important;
  }

  .cfo-kpis {
    grid-template-columns: 1fr !important;
  }
}
