/* OXFirm — shared brand styles
   Palette: navy #152F82, navy-dark #030A17, accent #FF9100, info #31A6EA
   Font: Poppins + JetBrains Mono                              */

:root {
  /* OXFirm media-kit palette */
  --brand:        #152F82;
  --brand-dark:   #030A17;
  --brand-soft:   #E4E8F4;
  --brand-ink:    #0A1845;

  --accent:       #FF9100;
  --accent-2:     #FF9801;
  --accent-soft:  #FFE9CC;
  --accent-ink:   #8A4F00;

  --info:         #31A6EA;
  --info-soft:    #DCEEFA;

  --bg:           #F6F7FB;
  --surface:      #FFFFFF;
  --surface-2:    #FAFBFD;
  --ink:          #0F1729;
  --ink-2:        #1F2940;
  --muted:        #5C6B89;
  --muted-2:      #94A0B7;
  --line:         #E2E6F0;
  --line-2:       #ECEFF6;
  --line-3:       #F2F4FA;

  --ok:           #1B7A4A;
  --ok-soft:      #D7EBDD;
  --warn:         #C2410C;
  --warn-soft:    #FCE7D8;
  --danger:       #C0322B;
  --danger-soft:  #F8DBD8;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow-xs:    0 1px 0 rgba(15,23,41,.04);
  --shadow-sm:    0 1px 2px rgba(15,23,41,.05), 0 1px 0 rgba(15,23,41,.04);
  --shadow-md:    0 4px 16px -8px rgba(15,23,41,.14), 0 1px 0 rgba(15,23,41,.04);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 13px; line-height: 1.5;
  letter-spacing: -0.005em;
}
::selection { background: var(--brand); color: #fff; }
.mono { font-family: 'JetBrains Mono', monospace; }
a { color: var(--brand); }

/* ─── App shell ─── */
.ox-shell { display: block; min-height: 100vh; }

/* ─── Sidebar ─── */
.ox-sidebar {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  position: fixed;
  top: 0; left: 0;
  width: 244px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 500;
}
.ox-side-top { padding: 4px 6px 0; }
.ox-logo { display: flex; align-items: center; gap: 9px; }
.ox-logo-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--brand-dark);
  display: grid; place-items: center;
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(21,47,130,.15), inset 0 -1px 0 rgba(255,255,255,.08);
}
.ox-logo-word {
  font-size: 17px; font-weight: 700; letter-spacing: -.018em;
  color: var(--brand); line-height: 1;
  display: flex; align-items: baseline;
}
.ox-logo-word em {
  font-style: normal; color: var(--accent);
  font-weight: 800; font-size: 21px; letter-spacing: -.04em;
  margin: 0 -1px; line-height: .8; transform: translateY(1px);
}
.ox-logo-org {
  margin-left: auto;
  font-size: 9px; color: var(--brand);
  padding: 3px 7px; border-radius: 4px;
  background: var(--brand-soft); border: 1px solid transparent;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600;
}

.ox-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.ox-search input { flex: 1; border: 0; background: transparent; outline: 0; font-family: inherit; font-size: 13px; color: var(--ink); }
.ox-search input::placeholder { color: var(--muted-2); }
.ox-search kbd { font-family: 'JetBrains Mono', monospace; font-size: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; color: var(--muted); }

.ox-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; min-height: 0; }
.oxnav-section {
  padding: 14px 10px 4px;
  font-size: 10.5px; letter-spacing: .04em;
  color: var(--muted-2); font-weight: 500; text-transform: uppercase;
}
.oxnav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  text-decoration: none; color: var(--ink-2);
  font-size: 13px; font-weight: 450;
  transition: background .12s, color .12s; cursor: pointer;
}
.oxnav-item:hover { background: var(--line-3); }
.oxnav-item[data-active] {
  background: var(--brand-soft); color: var(--brand);
  font-weight: 500;
}
.oxnav-item[data-active] .oxnav-ico { color: var(--accent); }
.oxnav-ico { display: grid; place-items: center; width: 16px; color: var(--muted); }
.oxnav-item:hover .oxnav-ico { color: var(--ink); }
.oxnav-label { flex: 1; }
.oxnav-chev { color: var(--muted-2); transition: transform .15s; }
.oxnav-item[data-open] .oxnav-chev { transform: rotate(90deg); color: var(--brand); }
.oxnav-badge {
  font-size: 10.5px;
  background: var(--bg); color: var(--muted);
  padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.oxnav-item[data-active] .oxnav-badge {
  background: var(--accent-soft); color: var(--accent-ink); border-color: transparent;
}
.oxnav-sub {
  display: flex; flex-direction: column; gap: 1px;
  margin: 2px 0 4px 26px;
  padding-left: 8px;
  border-left: 1px dashed var(--line);
}
.oxnav-sub .oxnav-item {
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.oxnav-sub .oxnav-item:hover { color: var(--ink); }
.oxnav-sub .oxnav-item[data-active] {
  background: transparent;
  color: var(--brand);
  font-weight: 600;
}

.ox-side-foot { display: flex; flex-direction: column; gap: 8px; }
.ox-side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
}
.ox-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  background: var(--bg); color: var(--ink);
  flex-shrink: 0;
}
.ox-side-user-meta { flex: 1; min-width: 0; }
.ox-side-user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ox-side-user-role { font-size: 10.5px; color: var(--muted); }
.ox-icon-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  flex-shrink: 0;
}
.ox-icon-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft); }
.ox-icon-btn-lg { width: 36px; height: 36px; border-radius: 50%; }

/* ─── Main ─── */
.ox-main {
  padding: 20px 24px 24px;
  min-width: 0;
  display: flex; flex-direction: column;
  min-height: 100vh;
  margin-left: 244px;
  box-sizing: border-box;
  width: calc(100vw - 244px);
  max-width: calc(100vw - 244px);
  overflow-x: hidden;
}

/* ─── Topbar (compact, brand-color-bar replaced with sticky header) ─── */
.ox-topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.ox-greet { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ox-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
.ox-breadcrumb a { color: var(--muted); text-decoration: none; cursor: pointer; }
.ox-breadcrumb a:hover { color: var(--brand); }
.ox-breadcrumb b { color: var(--ink); font-weight: 500; }
.ox-h1 {
  font-weight: 600; font-size: 19px;
  letter-spacing: -.012em; margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.ox-h1 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.ox-h1 .ox-plan {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  letter-spacing: .04em; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.ox-top-actions { display: flex; align-items: center; gap: 8px; }
.ox-bell { position: relative; }
.ox-bell-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}

.ox-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: #fff;
  border: 0; border-radius: 8px;
  padding: 8px 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .12s, transform .08s;
}
.ox-cta:hover { background: var(--brand-ink); }
.ox-cta:active { transform: translateY(1px); }
.ox-cta-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.ox-cta-ghost:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }
.ox-cta-accent { background: var(--accent); color: #fff; }
.ox-cta-accent:hover { background: var(--accent-2); }
.ox-cta-danger { background: var(--danger); color: #fff; }
.ox-cta-danger:hover { background: #9C281F; }
.ox-cta-ok     { background: var(--ok); color: #fff; }
.ox-cta-info   { background: var(--info); color: #fff; }
.ox-cta-info:hover { background: #2693D2; }
.ox-cta-sm { padding: 6px 10px; font-size: 12px; }

/* ─── Page header (back arrow + title + breadcrumb) ─── */
.ox-pageheader {
  display: flex; align-items: center; gap: 12px;
  margin: 6px 0 20px;
  min-height: 36px;
}
.ox-back {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  color: var(--brand); flex-shrink: 0;
  transition: background .12s, transform .08s;
}
.ox-back:hover { background: var(--brand-soft); }
.ox-back:active { transform: translateX(-2px); }
.ox-pageheader h2 {
  font-size: 18px; font-weight: 700; letter-spacing: -.015em;
  margin: 0; color: var(--ink);
}

/* ─── Footer ─── */
.ox-footer {
  margin-top: auto;
  padding-top: 18px;
  padding-right: 90px; /* keep clear of the AI floating FAB */
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--muted);
}
.ox-footer a { color: var(--brand); text-decoration: none; font-weight: 500; }
.ox-footer a:hover { color: var(--brand-ink); }

/* ─── Card ─── */
.ox-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  position: relative;
}
.ox-card-h {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 12px;
}
.ox-card-h > div:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ox-card-ico {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; flex-shrink: 0;
}
.ox-card-titles { min-width: 0; }
.ox-card-title { font-size: 14px; font-weight: 600; letter-spacing: -.005em; margin: 0; color: var(--ink); }
.ox-card-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.ox-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ox-card-f {
  margin-top: 4px; padding-top: 10px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; align-items: center;
}

/* ─── Form fields ─── */
.ox-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ox-field-label {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand);
}
.ox-field-help {
  font-size: 11px; color: var(--muted);
  margin-top: 2px;
}
.ox-field-value {
  font-size: 14px; font-weight: 500; color: var(--ink);
  padding: 6px 0;
}
.ox-input,
.ox-select-input,
.ox-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit; font-size: 13px; color: var(--ink);
  outline: 0;
  transition: border-color .12s, box-shadow .12s;
}
.ox-input::placeholder, .ox-textarea::placeholder { color: var(--muted-2); }
.ox-input:focus,
.ox-select-input:focus,
.ox-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ox-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.ox-select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235C6B89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Form grid */
.ox-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 20px;
}
.ox-form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ox-form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ox-form-grid-6 { grid-template-columns: repeat(6, 1fr); }
.ox-form-grid > .col-span-2 { grid-column: span 2; }
.ox-form-grid > .col-span-3 { grid-column: span 3; }
.ox-form-grid > .col-span-full { grid-column: 1 / -1; }

/* Group panel (form section with heading) */
.ox-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.ox-fieldset-h {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-2);
}
.ox-fieldset-h-ico {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.ox-fieldset-h-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.ox-fieldset-h-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ─── Tabs (e.g. Sicurezza tabs, Commessa tabs) ─── */
.ox-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}
.ox-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 0; border-bottom: 2px solid transparent;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
  position: relative; top: 1px;
}
.ox-tab:hover { color: var(--ink); }
.ox-tab[data-active] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.ox-tab[data-active] .ox-tab-ico { color: var(--accent); }
.ox-tab-ico { color: currentColor; }

/* ─── Segment control ─── */
.ox-segment {
  display: inline-flex;
  background: var(--bg); border-radius: 7px;
  padding: 2px; border: 1px solid var(--line);
}
.ox-segment button {
  border: 0; background: transparent;
  font-family: inherit; font-size: 12px; color: var(--muted);
  padding: 4px 11px; border-radius: 5px; cursor: pointer; font-weight: 500;
}
.ox-segment button[data-active] {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* ─── Pills / badges ─── */
.ox-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ox-pill-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.ox-pill-warn   { background: var(--warn-soft);   color: var(--warn);   border-color: transparent; }
.ox-pill-ok     { background: var(--ok-soft);     color: var(--ok);     border-color: transparent; }
.ox-pill-info   { background: var(--info-soft);   color: var(--info);   border-color: transparent; }
.ox-pill-brand  { background: var(--brand-soft);  color: var(--brand);  border-color: transparent; }
.ox-pill-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.ox-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ox-pill-status {
  padding: 4px 10px; font-weight: 600; text-transform: lowercase;
  font-size: 11px; letter-spacing: 0;
}

/* ─── Tables (the main data presentation) ─── */
.ox-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ox-table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.ox-table-toolbar-l { display: flex; align-items: center; gap: 10px; }
.ox-table-toolbar-r { display: flex; align-items: center; gap: 10px; }
.ox-show-entries { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ox-show-entries select {
  appearance: none; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface);
  padding: 4px 22px 4px 10px; font-family: inherit; font-size: 12px;
  color: var(--ink); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235C6B89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.ox-search-mini {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 10px; min-width: 220px;
}
.ox-search-mini input {
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 12.5px; color: var(--ink);
  flex: 1;
}
.ox-search-mini svg { color: var(--muted); }

.ox-table { width: 100%; border-collapse: collapse; }
.ox-table thead th {
  background: var(--brand-soft);
  color: var(--brand);
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ox-table thead th.sortable { cursor: pointer; }
.ox-table thead th.sortable svg { opacity: .5; margin-left: 4px; vertical-align: middle; }
.ox-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink-2);
  vertical-align: middle;
}
.ox-table tbody tr:hover td { background: var(--surface-2); }
.ox-table tbody tr:last-child td { border-bottom: 0; }
.ox-table .ox-cell-num {
  font-family: 'JetBrains Mono', monospace;
  color: var(--brand); font-weight: 600;
  cursor: pointer;
}
.ox-table .ox-cell-num:hover { text-decoration: underline; }
.ox-table .ox-cell-mono { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }
.ox-table .ox-cell-amount { font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.ox-table-actions { display: inline-flex; gap: 4px; }
.ox-row-btn {
  width: 28px; height: 28px;
  border: 0; border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer; color: #fff;
  transition: filter .12s;
}
.ox-row-btn:hover { filter: brightness(.92); }
.ox-row-btn-view   { background: var(--info); }
.ox-row-btn-edit   { background: var(--brand); }
.ox-row-btn-del    { background: var(--danger); }
.ox-row-btn-down   { background: var(--ok); }
.ox-row-btn-doc    { background: var(--info); }
.ox-row-btn-sync   { background: var(--info); }

.ox-table-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px; color: var(--muted);
}
.ox-pagination {
  display: inline-flex; gap: 4px;
}
.ox-pagination button {
  min-width: 30px; height: 30px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  border-radius: 6px; cursor: pointer;
  padding: 0 10px;
}
.ox-pagination button:hover { color: var(--ink); border-color: var(--brand); }
.ox-pagination button[data-active] {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.ox-pagination button[disabled] { opacity: .4; cursor: not-allowed; }

/* ─── Filter strip ─── */
.ox-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

/* ─── Status pills/links inside table ─── */
.ox-status-soft {
  padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.ox-status-soft.aperto    { background: var(--ok-soft);     color: var(--ok); }
.ox-status-soft.chiuso    { background: var(--line-3);      color: var(--muted); }
.ox-status-soft.sospeso   { background: var(--warn-soft);   color: var(--warn); }

.ox-tag-soft {
  padding: 4px 11px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 5px;
}
.ox-tag-update {
  background: var(--accent-soft); color: var(--accent-ink);
}
.ox-tag-updated {
  background: var(--ok-soft); color: var(--ok);
}

/* ─── Modal ─── */
.ox-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(3,10,23,.48);
  display: grid; place-items: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
  animation: oxFade .12s ease;
}
@keyframes oxFade { from { opacity: 0 } to { opacity: 1 } }
.ox-modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%; max-width: 480px;
  box-shadow: 0 18px 60px rgba(3,10,23,.28);
  overflow: hidden;
  animation: oxRise .16s ease;
}
@keyframes oxRise { from { transform: translateY(6px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.ox-modal-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
}
.ox-modal-h h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.ox-modal-close {
  width: 28px; height: 28px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.ox-modal-close:hover { color: var(--danger); border-color: var(--danger); }
.ox-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ox-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}

/* ─── Chat ─── */
.ox-chat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  height: 560px; overflow: hidden;
}
.ox-chat-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.ox-chat-h-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ox-chat-h-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.ox-chat-h-sub { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.ox-chat-h-sub .ox-pill-dot { background: var(--ok); }

.ox-chat-body {
  flex: 1; padding: 18px 20px;
  overflow-y: auto;
  background:
    radial-gradient(180% 100% at 50% 0%, rgba(21,47,130,.02), transparent 50%),
    var(--surface);
  display: flex; flex-direction: column; gap: 10px;
}
.ox-chat-date {
  align-self: center;
  font-size: 10.5px; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 10px;
  background: var(--line-3);
  border-radius: 999px;
  margin: 4px 0;
}
.ox-bubble {
  max-width: 70%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px; line-height: 1.45;
  position: relative;
  word-wrap: break-word;
}
.ox-bubble-meta {
  font-size: 10px; opacity: .7;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
  display: block;
}
.ox-bubble-me {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-ink) 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ox-bubble-them {
  align-self: flex-start;
  background: var(--brand-soft);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.ox-chat-input {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.ox-chat-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit; font-size: 13px;
  outline: 0; background: var(--surface-2);
  transition: border-color .12s, box-shadow .12s;
}
.ox-chat-input input:focus {
  border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ox-chat-send {
  width: 38px; height: 38px;
  background: var(--brand); color: #fff;
  border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: background .12s, transform .08s;
}
.ox-chat-send:hover { background: var(--brand-ink); }
.ox-chat-send:active { transform: scale(.94); }

/* ─── Message list (Messaggi diretti page) ─── */
.ox-msglist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ox-msglist-row {
  display: grid; grid-template-columns: 44px 1fr auto;
  gap: 12px; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer; transition: background .12s;
}
.ox-msglist-row:last-child { border-bottom: 0; }
.ox-msglist-row:hover { background: var(--surface-2); }
.ox-msglist-row .ox-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 600;
}
.ox-msglist-from { font-size: 14px; font-weight: 600; color: var(--ink); }
.ox-msglist-preview { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ox-msglist-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ox-msglist-when { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted-2); }
.ox-unread-badge {
  background: var(--accent); color: #fff;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  padding: 1px 6px; border-radius: 999px; font-weight: 600;
}

/* ─── Section block (e.g. Dettagli Commessa header) ─── */
.ox-section-h {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.ox-section-h-bar {
  width: 8px; height: 28px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--accent) 100%);
  border-radius: 3px; flex-shrink: 0;
}
.ox-section-h-title {
  font-size: 16px; font-weight: 600; color: var(--ink);
  letter-spacing: -.01em;
}
.ox-section-h-sub { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ─── Commessa Fasi: progress cards + accordion ─── */
.ox-progress-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 16px;
}
.ox-progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.ox-progress-eye {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.ox-progress-v {
  display: flex; align-items: baseline; gap: 12px;
  font-weight: 700;
}
.ox-progress-num { font-size: 36px; letter-spacing: -.02em; color: var(--ink); }
.ox-progress-pct { font-size: 16px; color: var(--accent); font-weight: 600; }
.ox-progress-bar {
  height: 6px; border-radius: 999px;
  background: var(--line-3);
  overflow: hidden;
}
.ox-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
}

.ox-fase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.ox-fase-h {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: background .12s;
}
.ox-fase-h:hover { background: var(--surface-2); }
.ox-fase[data-open] .ox-fase-h { border-bottom-color: var(--line-2); background: var(--surface-2); }
.ox-fase-ico {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
}
.ox-fase-title { font-size: 15px; font-weight: 600; color: var(--brand); flex: 1; }
.ox-fase-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.ox-fase-body { padding: 4px 0; }
.ox-fase-progress {
  padding: 8px 16px 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--muted);
  border-bottom: 1px dashed var(--line-2);
}
.ox-fase-progress .ox-progress-bar { flex: 1; height: 4px; }

/* ─── Organigramma ─── */
.ox-org {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.ox-org-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 28px;
  position: relative;
}
.ox-org-row:last-child { margin-bottom: 0; }

/* Vertical line going DOWN from each box in the top row */
.ox-org-row:not(:last-child) .ox-org-box::after {
  content: '';
  position: absolute; left: 50%; bottom: -14px;
  width: 1px; height: 14px;
  background: var(--ink-2);
}
/* Vertical line going UP from each box in the bottom row */
.ox-org-row + .ox-org-row .ox-org-box::before {
  content: '';
  position: absolute; left: 50%; top: -14px;
  width: 1px; height: 14px;
  background: var(--ink-2);
}
/* Horizontal connector spanning from the center of the first column
   to the center of the last column. With a 3-col grid + 28px gap,
   each column center is at (100% - 56px) / 6 from its respective side. */
.ox-org-row + .ox-org-row::before {
  content: '';
  position: absolute;
  left:  calc((100% - 56px) / 6);
  right: calc((100% - 56px) / 6);
  top: -14px;
  height: 1px;
  background: var(--ink-2);
}
.ox-org-box {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center;
}
.ox-org-box-actions {
  position: absolute; left: 10px; right: 10px; top: 8px;
  display: flex; justify-content: space-between;
}
.ox-org-action {
  width: 22px; height: 22px; border-radius: 5px;
  display: grid; place-items: center;
  cursor: pointer; border: 0; color: #fff;
}
.ox-org-action-down { background: var(--danger); }
.ox-org-action-info { background: var(--danger); border-radius: 50%; }
.ox-org-ico {
  width: 36px; height: 36px;
  margin-top: 12px;
  color: var(--ink);
}
.ox-org-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ox-org-role  { font-size: 11px; color: var(--muted); line-height: 1.3; }
.ox-org-name  { font-size: 12.5px; font-weight: 600; color: var(--brand); margin-top: 4px; }
.ox-org-empty { font-size: 12px; color: var(--muted); font-style: italic; }

/* ─── Risorse Incluse - Regolamenti detail (download rows) ─── */
.ox-rcat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.ox-rcat-h {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
}
.ox-rcat-ico-btn {
  width: 30px; height: 30px;
  background: var(--brand); color: #fff;
  border: 0; border-radius: 7px;
  display: grid; place-items: center; cursor: pointer;
}
.ox-rcat-title { font-size: 15px; font-weight: 700; color: var(--brand); flex: 1; }
.ox-rcat-body { padding: 4px 0; }
.ox-rcat-row {
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 16px; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-2);
}
.ox-rcat-row:last-child { border-bottom: 0; }
.ox-rcat-row:hover { background: var(--surface-2); }
.ox-rcat-name { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.ox-rcat-file {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--brand);
}
.ox-rcat-file::before {
  content: '•'; color: var(--ok); font-size: 16px; line-height: 0; margin-right: 4px;
}
.ox-rcat-actions { display: flex; gap: 6px; }

/* ─── Video tutorial layout ─── */
.ox-tut-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
.ox-tut-cats {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ox-tut-cat-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.ox-tut-cat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  transition: background .12s;
}
.ox-tut-cat-row:last-child { border-bottom: 0; }
.ox-tut-cat-row:hover { background: var(--surface-2); }
.ox-tut-cat-row[data-active] {
  background: var(--brand); color: #fff;
}
.ox-tut-cat-row[data-active] .ox-tut-cat-num { background: rgba(255,255,255,.18); color: #fff; }
.ox-tut-cat-num {
  background: var(--brand-soft); color: var(--brand);
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  padding: 2px 8px; border-radius: 999px;
}
.ox-tut-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ox-tut-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.ox-tut-card-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
}
.ox-tut-card-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.ox-tut-card-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.ox-tut-thumb {
  aspect-ratio: 16/9;
  background:
    radial-gradient(circle at 30% 40%, rgba(255,145,0,.25), transparent 55%),
    linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  display: grid; place-items: center;
  position: relative; cursor: pointer;
}
.ox-tut-thumb-logo {
  font-family: 'Poppins', sans-serif; color: #fff;
  font-size: 38px; font-weight: 700; letter-spacing: -.02em;
  display: flex; align-items: baseline;
}
.ox-tut-thumb-logo em {
  font-style: normal; color: var(--accent); font-size: 52px; font-weight: 800;
  letter-spacing: -.04em; margin: 0 -2px; line-height: .85;
}
.ox-tut-play-btn {
  position: absolute; bottom: 12px; left: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: var(--brand);
  display: grid; place-items: center; cursor: pointer;
  border: 0;
}
.ox-tut-fav {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(15,23,41,.85); color: #fff;
  display: grid; place-items: center; cursor: pointer; border: 0;
}
.ox-tut-progress {
  height: 4px; background: rgba(255,255,255,.18);
  position: absolute; left: 0; right: 0; bottom: 0;
}
.ox-tut-progress span {
  display: block; height: 100%;
  background: var(--accent);
  width: 30%;
}
.ox-tut-dur {
  position: absolute; top: 10px; left: 12px;
  background: rgba(15,23,41,.7); color: #fff;
  padding: 2px 8px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
}

/* ─── Documents list (Sicurezza · Documenti) ─── */
.ox-doc-table th, .ox-doc-table td { padding: 14px 18px; }

/* ─── AI floating widget ─── */
.ox-ai-fab {
  position: fixed;
  bottom: 22px; right: 22px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff; border: 0;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 28px -6px rgba(21,47,130,.45), 0 0 0 4px rgba(21,47,130,.08);
  z-index: 900;
  transition: background .12s, transform .15s;
}
.ox-ai-fab:hover { background: var(--brand-ink); transform: scale(1.05); }
.ox-ai-fab svg { width: 22px; height: 22px; }

.ox-ai-widget {
  position: fixed;
  bottom: 92px; right: 22px;
  width: 380px; max-width: calc(100vw - 44px);
  height: 540px; max-height: calc(100vh - 130px);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 80px -16px rgba(3,10,23,.36), 0 0 0 1px var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 900;
  animation: oxAiPop .18s ease;
}
@keyframes oxAiPop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.ox-ai-widget-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
  color: #fff;
}
.ox-ai-widget-h-l { display: flex; align-items: center; gap: 10px; }
.ox-ai-widget-close {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.14); color: #fff;
  border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: background .12s;
}
.ox-ai-widget-close:hover { background: rgba(255,255,255,.24); }
.ox-ai-widget-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 10px;
}
.ox-ai-bubble {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px; line-height: 1.45;
  border: 1px solid var(--line);
}
.ox-ai-bubble-bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.ox-ai-bubble-me {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  border-bottom-right-radius: 4px;
}
.ox-typing { display: inline-flex; gap: 4px; }
.ox-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted-2);
  animation: oxTyp .9s ease-in-out infinite;
}
.ox-typing span:nth-child(2) { animation-delay: .15s; }
.ox-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes oxTyp {
  0%,60%,100% { transform: translateY(0); opacity: .4; }
  30%         { transform: translateY(-3px); opacity: 1; }
}
.ox-ai-widget-input {
  display: flex; align-items: center; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.ox-ai-widget-input input {
  flex: 1;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px;
  font-family: inherit; font-size: 13px;
  outline: 0; background: var(--surface-2);
}
.ox-ai-widget-input input:focus {
  border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ox-ai-widget-input button {
  width: 36px; height: 36px;
  background: var(--brand); color: #fff;
  border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, transform .08s;
}
.ox-ai-widget-input button:hover { background: var(--brand-ink); }
.ox-ai-widget-input button:active { transform: scale(.94); }
.ox-ai-widget-input button:disabled { opacity: .5; cursor: wait; }

/* ─── User menu (in topbar) ─── */
.ox-usermenu { position: relative; }
.ox-usermenu-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer;
  font-family: inherit; font-size: 13px;
  transition: background .12s, border-color .12s;
}
.ox-usermenu-trigger:hover { background: var(--surface-2); border-color: var(--brand); }
.ox-usermenu-trigger svg { color: var(--muted); }
.ox-usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 200px;
  padding: 6px;
  box-shadow: 0 12px 36px -8px rgba(3,10,23,.18);
  z-index: 100;
  animation: oxRise .15s ease;
}
.ox-usermenu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: transparent;
  border: 0; border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit; font-size: 13px;
  color: var(--ink-2); cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.ox-usermenu-item:hover { background: var(--brand-soft); color: var(--brand); }
.ox-usermenu-item svg { color: var(--muted); }
.ox-usermenu-item:hover svg { color: var(--brand); }
.ox-usermenu-divider {
  height: 1px; background: var(--line-2);
  margin: 6px 0;
}
.ox-usermenu-danger,
.ox-usermenu-danger:hover { color: var(--danger); background: transparent; }
.ox-usermenu-danger:hover { background: var(--danger-soft); }
.ox-usermenu-danger svg,
.ox-usermenu-danger:hover svg { color: var(--danger); }

/* ─── Misc ─── */
.ox-spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: oxspin .8s linear infinite;
}
@keyframes oxspin { to { transform: rotate(360deg); } }
.ox-empty {
  text-align: center; padding: 48px 20px;
  color: var(--muted); font-size: 13px;
}

/* ─── Responsive ─── */
@media (max-width: 1180px) {
  .ox-form-grid-3, .ox-form-grid-4, .ox-form-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .ox-org-row { grid-template-columns: 1fr; }
  .ox-org-row + .ox-org-row::before { display: none; }
  .ox-tut-page { grid-template-columns: 1fr; }
  .ox-tut-cards { grid-template-columns: 1fr; }
  .ox-progress-cards { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .ox-shell { grid-template-columns: 1fr; }
  .ox-sidebar { position: relative; height: auto; }
  .ox-filters { grid-template-columns: 1fr; }
  .ox-form-grid, .ox-form-grid-3, .ox-form-grid-4, .ox-form-grid-6 { grid-template-columns: 1fr; }
}

/* ═══ OxDocs Extra Components ═══════════════════════════════════ */

/* ── Section header ── */
.ox-section-h {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.ox-section-h-bar {
  width: 8px; height: 28px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--accent) 100%);
  border-radius: 3px; flex-shrink: 0;
}
.ox-section-h-title { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.ox-section-h-sub   { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ── CTA extra sizes ── */
.ox-cta-sm  { padding: 6px 10px; font-size: 12px; }
.ox-cta-ok   { background: var(--ok); color: #fff; }
.ox-cta-ok:hover { background: #155e3b; }
.ox-cta-info { background: var(--info); color: #fff; }
.ox-cta-info:hover { background: #2693D2; }
.ox-cta-accent { background: var(--accent); color: #fff; }
.ox-cta-accent:hover { background: var(--accent-2); }

/* ── Tag soft ── */
.ox-tag-soft { padding: 4px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 5px; }
.ox-tag-update  { background: var(--accent-soft); color: var(--accent-ink); }
.ox-tag-updated { background: var(--ok-soft); color: var(--ok); }

/* ── Progress (Commessa fasi) ── */
.ox-progress-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.ox-progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.ox-progress-eye  { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ox-progress-v    { display: flex; align-items: baseline; gap: 12px; font-weight: 700; }
.ox-progress-num  { font-size: 36px; letter-spacing: -.02em; color: var(--ink); }
.ox-progress-pct  { font-size: 16px; color: var(--accent); font-weight: 600; }
.ox-progress-bar  { height: 6px; border-radius: 999px; background: var(--line-3); overflow: hidden; }
.ox-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%); }

/* ── Fase accordion ── */
.ox-fase { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.ox-fase-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid transparent; transition: background .12s; }
.ox-fase-h:hover { background: var(--surface-2); }
.ox-fase[data-open] .ox-fase-h { border-bottom-color: var(--line-2); background: var(--surface-2); }
.ox-fase-ico   { width: 30px; height: 30px; border-radius: 7px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.ox-fase-title { font-size: 15px; font-weight: 600; color: var(--brand); flex: 1; }
.ox-fase-meta  { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.ox-fase-body  { padding: 4px 0; }
.ox-fase-progress { padding: 8px 16px 12px; display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); border-bottom: 1px dashed var(--line-2); }
.ox-fase-progress .ox-progress-bar { flex: 1; height: 4px; }

/* ── Risorse Incluse detail (rcat) ── */
.ox-rcat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.ox-rcat-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.ox-rcat-ico-btn { width: 30px; height: 30px; background: var(--brand); color: #fff; border: 0; border-radius: 7px; display: grid; place-items: center; cursor: pointer; }
.ox-rcat-title { font-size: 15px; font-weight: 700; color: var(--brand); flex: 1; }
.ox-rcat-body  { padding: 4px 0; }
.ox-rcat-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.ox-rcat-row:last-child { border-bottom: 0; }
.ox-rcat-row:hover { background: var(--surface-2); }
.ox-rcat-name { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.ox-rcat-file { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--brand); }
.ox-rcat-actions { display: flex; gap: 6px; }

/* ── Tutorial grid ── */
.ox-tut-page  { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.ox-tut-cats  { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ox-tut-cat-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink); }
.ox-tut-cat-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: background .12s; }
.ox-tut-cat-row:last-child { border-bottom: 0; }
.ox-tut-cat-row:hover { background: var(--surface-2); }
.ox-tut-cat-row[data-active] { background: var(--brand); color: #fff; }
.ox-tut-cat-num { background: var(--brand-soft); color: var(--brand); font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 2px 8px; border-radius: 999px; }
.ox-tut-cat-row[data-active] .ox-tut-cat-num { background: rgba(255,255,255,.18); color: #fff; }
.ox-tut-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ox-tut-card  { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ox-tut-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%); display: grid; place-items: center; position: relative; cursor: pointer; }
.ox-tut-thumb-logo { font-family: 'Poppins', sans-serif; color: #fff; font-size: 38px; font-weight: 700; opacity: .15; }

/* ── AI widget (embedded) ── */
.ox-ai-widget-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%); color: #fff; }
.ox-ai-widget-h-l { display: flex; align-items: center; gap: 10px; }
.ox-ai-bubble { max-width: 84%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; border: 1px solid var(--line); }
.ox-ai-bubble-bot { align-self: flex-start; background: var(--surface); color: var(--ink); border-bottom-left-radius: 4px; }
.ox-ai-bubble-me  { align-self: flex-end; background: var(--brand); color: #fff; border-color: var(--brand); border-bottom-right-radius: 4px; }
.ox-ai-widget-input { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.ox-ai-widget-input input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-family: inherit; font-size: 13px; outline: 0; background: var(--surface-2); }
.ox-ai-widget-input input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ox-ai-widget-input button { width: 36px; height: 36px; background: var(--brand); color: #fff; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.ox-ai-widget-input button:hover { background: var(--brand-ink); }

/* ── Deadline items (dashboard) ── */
.ox-deadline-shared { background: var(--accent-soft); border-radius: 8px; padding: 8px; margin: 0 -8px; }

/* ── DataTables overrides ── */
.ox-table thead .sorting::after, .ox-table thead .sorting_asc::after,
.ox-table thead .sorting_desc::after, .ox-table thead .sorting::before,
.ox-table thead .sorting_asc::before, .ox-table thead .sorting_desc::before {
  color: rgba(21,47,130,.4) !important;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--line) !important; border-radius: 8px !important;
  padding: 5px 10px !important; font-size: 13px !important;
  background: var(--surface) !important; color: var(--ink) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--brand) !important; border-color: var(--brand) !important;
  color: #fff !important; border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--brand-soft) !important; border-color: var(--brand-soft) !important;
  color: var(--brand) !important; border-radius: 6px !important;
}

/* ── Select2 overrides ── */
.select2-container--default .select2-selection--single {
  border: 1px solid var(--line) !important; border-radius: 8px !important; height: 40px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 40px !important; font-size: 13px !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px !important; }
.select2-dropdown { border: 1px solid var(--line) !important; border-radius: 8px !important; box-shadow: var(--shadow-md) !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--brand) !important; }
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-soft) !important;
}

/* ── Layout enforcement (override Bootstrap) ── */
html { overflow-x: hidden; }
body { overflow-x: hidden; min-height: 100vh; }





/* Chatbot widget: parte nascosto */
#ox-ai-widget { display: none; }
#ox-ai-widget.ox-ai-open { display: flex !important; flex-direction: column !important; }
