/* app/assets/stylesheets/posturacorretta.css */

/* ----------------------------------------------------
   1. Academy Curriculum Styles
   ---------------------------------------------------- */
@scope (#academy-curriculum) {
  :scope {
    --ink: #14213d;
    --muted: #667085;
    --line: #dce4ee;
    --paper: #ffffff;
    --wash: #f4f7fb;
    --navy: #16325c;
    --blue: #2f6fed;
    --sky: #eaf2ff;
    --green: #15856d;
    --green-wash: #e6f6f1;
    --orange: #b85f18;
    --orange-wash: #fff0df;
    --violet: #7047b8;
    --violet-wash: #f1ebfb;
    --shadow: 0 12px 32px rgba(28, 50, 84, .08);
    --radius: 22px;
  }

#progetti-section * { box-sizing: border-box; }
  :scope {
    margin: 0;
    background: var(--wash);
    color: var(--ink);
    font: 15px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  button, input { font: inherit; }
  button { color: inherit; }
  a { color: inherit; text-decoration: none; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

  .top-actions { display: flex; gap: 9px; }
  .button {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 15px;
    background: white;
    font-weight: 750;
    cursor: pointer;
    transition: .2s ease;
  }
  .button:hover { transform: translateY(-1px); }
  .button.secondary { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.18); }
  .button.primary { color: var(--navy); }

  .hero {
    padding: 56px 5vw 76px;
    color: white;
    background:
      radial-gradient(circle at 87% 10%, rgba(94,160,255,.28), transparent 25%),
      linear-gradient(145deg, #16325c 0%, #1d4072 62%, #27508b 100%);
  }
  .hero-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr .8fr; align-items: end; gap: 50px; }
  .eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 13px; color: #bcd5fa; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
  .eyebrow::before { content: ""; width: 26px; height: 2px; background: #6ea8ff; }
  h1 { max-width: 760px; margin: 0; font-size: clamp(38px, 5vw, 67px); line-height: 1.02; letter-spacing: -.055em; }
  .hero-copy { max-width: 690px; margin: 20px 0 0; color: #d8e5f7; font-size: clamp(16px, 1.7vw, 20px); }
  .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
  .summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 18px;
    background: rgba(255,255,255,.12);
    box-shadow: var(--shadow);
  }
  .summary div { min-height: 92px; padding: 20px; background: rgba(18,43,79,.72); }
  .summary strong { display: block; font-size: 28px; line-height: 1; }
  .summary span { display: block; margin-top: 8px; color: #bcd0eb; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }

  .workspace { max-width: 1280px; margin: -36px auto 0; padding: 0 24px 90px; position: relative; z-index: 3; }
  .toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
  }
  .search { position: relative; }
  .search input {
    width: 100%;
    padding: 12px 15px 12px 42px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: #f8fafc;
  }
  .search input:focus { border-color: #8bb3f3; box-shadow: 0 0 0 4px #eaf2ff; }
  .search::before { content: "⌕"; position: absolute; left: 15px; top: 8px; z-index: 1; color: #718096; font-size: 23px; }
  .area-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid #d7e3f3;
    border-radius: 999px;
    background: var(--sky);
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }
  .area-count { color: #64748b; font-size: 10px; }

  .content-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; margin-top: 30px; }
  .side { position: sticky; top: 98px; align-self: start; }
  .side-label { margin: 0 0 11px; padding-left: 12px; color: #98a2b3; font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
  .side a {
    display: grid;
    grid-template-columns: 29px 1fr auto;
    gap: 9px;
    align-items: center;
    margin: 4px 0;
    padding: 11px 12px;
    border-radius: 12px;
    color: #536179;
    font-size: 13px;
    font-weight: 700;
    transition: .2s ease;
  }
  .side a:hover, .side a.active { color: var(--navy); background: white; box-shadow: 0 5px 18px rgba(23,45,78,.06); }
  .side-num { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #e9eef5; color: #64748b; font-size: 11px; }
  .side a.active .side-num { color: white; background: var(--blue); }
  .side-count { color: #a1aab8; font-size: 11px; }

  .section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 17px; }
  .section-head h2 { margin: 0 0 4px; font-size: 28px; letter-spacing: -.035em; }
  .section-head p { margin: 0; color: var(--muted); }
  .legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 11px; white-space: nowrap; }
  .legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--green); }

  .module-list { display: grid; gap: 15px; }
  .module {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 5px 20px rgba(28,50,84,.035);
    transition: border-color .2s, box-shadow .2s;
  }
  .module:hover { border-color: #c5d3e5; box-shadow: 0 10px 28px rgba(28,50,84,.07); }
  .module[hidden] { display: none; }
  .module-top { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 30px; gap: 18px; align-items: center; width: 100%; padding: 23px; border: 0; text-align: left; background: transparent; cursor: pointer; }
  .module-index { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: var(--blue); background: var(--sky); font-size: 12px; font-weight: 850; }
  .module-title h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
  .module-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
  .modes { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; max-width: none; }
  .module-stats { gap: 6px; }
  .stat-pill {
    display: grid;
    min-width: 68px;
    padding: 7px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    color: #475569;
    text-align: center;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  }
  .stat-pill:hover { transform: translateY(-1px); border-color: #b8c7da; box-shadow: 0 7px 18px rgba(28,50,84,.08); }
  .stat-pill:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 2px; }
  .stat-pill strong { display: block; color: var(--navy); font-size: 13px; line-height: 1; letter-spacing: -.02em; }
  .stat-pill span { display: block; margin-top: 3px; font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
  .stat-pill.participants { background: var(--sky); border-color: #d7e7ff; }
  .stat-pill.teachers-count { background: var(--violet-wash); border-color: #e3d7f6; }
  .stat-pill.centers-count { background: var(--green-wash); border-color: #ccece3; }
  .stat-pill.methodology-count { background: var(--orange-wash); border-color: #fed7aa; }
  .mode { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 9px; background: #f3f6fa; color: #56657a; font-size: 10px; font-weight: 800; white-space: nowrap; }
  .mode::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #91a0b3; }
  .mode.info { color: var(--blue); background: var(--sky); }
  .mode.info::before { background: var(--blue); }
  .mode.practice { color: var(--green); background: var(--green-wash); }
  .mode.practice::before { background: #31a68a; }
  .mode.teach { color: var(--violet); background: var(--violet-wash); }
  .mode.teach::before { background: var(--violet); }
  .participant-count { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; color: #64748b; font-size: 11px; font-weight: 750; }
  .participant-count::before { content: "●"; color: #8aa3c4; font-size: 7px; }
  .teachers { display: flex; align-items: center; justify-content: flex-end; min-width: 128px; }
  .avatars { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
  .avatar {
    position: relative;
    width: 38px;
    height: 38px;
    margin-left: -10px;
    padding: 0;
    overflow: hidden;
    border: 3px solid white;
    border-radius: 50%;
    background: #dce7f4;
    box-shadow: 0 1px 4px rgba(21,38,67,.14);
    cursor: pointer;
  }
  .avatar:first-child { margin-left: 0; }
  .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
  .avatar.teacher-red { border-color: #ef6a6a; }
  .avatar.teacher-green { border-color: #38a982; }
  .avatar.teacher-blue { border-color: #4c8de8; }
  .avatar.more { display: grid; place-items: center; background: var(--navy); color: white; font-size: 10px; font-weight: 850; }
  .chevron { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; color: #7b8799; background: transparent; cursor: pointer; transition: transform .25s, background .2s; }
  .chevron:hover { background: #eef3f9; }
  .module.open .chevron { transform: rotate(180deg); }

  .module-body { display: none; border-top: 1px solid #edf1f6; background: #fbfcfe; }
  .module.open .module-body { display: block; }
  .module-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 12px 22px 0 94px; background: white; scrollbar-width: thin; }
  .module-tab { flex: 0 0 auto; padding: 10px 13px; border: 0; border-bottom: 2px solid transparent; color: #718096; background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
  .module-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
  .tab-panel { display: none; padding: 22px 24px 25px 94px; }
  .tab-panel.active { display: block; }
  .lessons { padding: 0; }
  .body-title { display: flex; justify-content: space-between; margin-bottom: 10px; color: #8a95a5; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
  .lesson { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; gap: 13px; align-items: center; width: 100%; padding: 12px 9px; border: 0; border-bottom: 1px solid #edf1f6; border-radius: 10px; text-align: left; background: transparent; cursor: pointer; }
  .lesson:last-child { border-bottom: 0; }
  .lesson:hover { background: white; }
  .lesson-num { color: #9aa5b4; font-size: 10px; font-weight: 800; }
  .lesson strong { font-size: 13px; }
  .lesson small { display: block; margin-top: 2px; color: var(--muted); }
  .lesson-status { color: var(--green); font-size: 11px; font-weight: 800; }
  .lesson-status.locked { color: #9aa5b4; }
  .roster { padding: 22px 24px; border-left: 1px solid #edf1f6; background: white; }
  .roster-list { display: grid; gap: 11px; }
  .person { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; }
  .person .avatar { margin: 0; cursor: pointer; }
  .person strong { display: block; font-size: 12px; }
  .person span { color: var(--muted); font-size: 10px; }
  .view-all { width: 100%; margin-top: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--blue); background: white; font-size: 11px; font-weight: 800; cursor: pointer; }
  .panel-intro { max-width: 720px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }
  .option-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
  .option-card { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; }
  .option-card strong { display: block; margin-bottom: 5px; font-size: 13px; }
  .option-card p { margin: 0; color: var(--muted); font-size: 11px; }
  .option-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 11px; color: var(--blue); background: var(--sky); font-size: 15px; }
  .location-list, .participant-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .location-card { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-align: left; background: white; cursor: pointer; }
  .location-card:hover { border-color: #9dbbe8; }
  .location-pin { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--green); background: var(--green-wash); }
  .location-card strong { display: block; font-size: 12px; }
  .location-card small { color: var(--muted); }
  .location-card em { color: var(--blue); font-size: 11px; font-style: normal; font-weight: 800; }
  .teacher-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
  .teacher-grid .person { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
  .participant-stat { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; }
  .participant-stat strong { display: block; font-size: 26px; letter-spacing: -.03em; }
  .participant-stat span { color: var(--muted); font-size: 11px; }
  .participant-bar { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 99px; background: #e8edf4; }
  .participant-bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
  .empty { display: none; padding: 55px; border: 1px dashed #bdc9d8; border-radius: 18px; color: var(--muted); text-align: center; background: white; }

  .modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 20px; background: rgba(11,26,49,.56); backdrop-filter: blur(8px); }
  .modal.open { display: grid; }
  .modal-card { width: min(520px, 100%); max-height: 82vh; overflow: auto; border-radius: 24px; background: white; box-shadow: 0 26px 80px rgba(0,0,0,.24); }
  .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 23px 24px; border-bottom: 1px solid var(--line); }
  .modal-head h3 { margin: 0; font-size: 20px; }
  .close { width: 36px; height: 36px; border: 0; border-radius: 10px; color: #667085; background: #f2f4f7; cursor: pointer; }
  .modal-content { padding: 24px; }
  .profile { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; }
  .profile .avatar { width: 72px; height: 72px; margin: 0; border-width: 4px; }
  .profile h4 { margin: 0; font-size: 21px; }
  .profile p { margin: 4px 0; color: var(--muted); }
  .profile-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }

  @media (max-width: 980px) {
    .hero-inner { grid-template-columns: 1fr; }
    .summary { max-width: 560px; }
    .content-grid { grid-template-columns: 1fr; }
    .side { display: none; }
    .module-top { grid-template-columns: 48px minmax(0, 1fr) auto 26px; }
    .modes { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; max-width: none; }
    .module-stats { grid-column: 2 / -1; grid-row: 2; }
    .teachers { grid-column: 3; grid-row: 1; }
    .chevron { grid-column: 4; grid-row: 1; }
  }
  @media (max-width: 720px) {
    .button.secondary { display: none; }
    .button { padding: 8px 11px; font-size: 12px; }
    .hero { padding: 42px 20px 62px; }
    .hero-copy { font-size: 16px; }
    .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary div { min-height: 78px; padding: 16px 12px; }
    .summary strong { font-size: 22px; }
    .summary span { font-size: 9px; }
    .workspace { margin-top: -26px; padding: 0 12px 60px; }
    .toolbar { grid-template-columns: 1fr; padding: 12px; }
    .area-badge { justify-content: center; width: 100%; }
    .section-head { align-items: start; }
    .legend { display: none; }
    .module-top { grid-template-columns: 43px minmax(0,1fr) 26px; gap: 12px; padding: 17px 14px; }
    .module-index { width: 43px; height: 43px; border-radius: 13px; }
    .module-title h3 { font-size: 16px; }
    .module-title p { display: none; }
    .teachers { grid-column: 2; grid-row: 2; justify-content: flex-start; }
    .chevron { grid-column: 3; }
    .modes { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; justify-content: flex-start; }
    .module-tabs { padding: 10px 14px 0; }
    .tab-panel { padding: 17px 14px; }
    .lesson { grid-template-columns: 32px 1fr; }
    .lesson-status { display: none; }
    .option-grid, .location-list, .participant-grid, .teacher-grid { grid-template-columns: 1fr; }
  }
}

/* ----------------------------------------------------
   2. Progetti (ex-Collabora) Page Styles
   ---------------------------------------------------- */

#progetti-section {
    --ink: #0f172a;
    --muted: #64748b;
    --paper: #f8fafc;
    --card: #ffffff;
    --line: #e2e8f0;
    --green: #0f766e;
    --lime: #14b8a6;
    --orange: #f59e0b;
    --red: #e11d48;
    --blue: #4f46e5;
    --shadow: 0 10px 28px rgba(15, 23, 42, .07);
    background: #f8fafc;
    color: #0f172a;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  * { box-sizing: border-box; }

#progetti-section .shell {
    display: block;
    min-height: 100vh;
  }
#progetti-section .brand {
    display: flex;
    gap: 11px;
    align-items: center;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.01em;
    padding: 0 8px;
  }
#progetti-section .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #14b8a6;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 20px;
    box-shadow: 0 6px 14px rgba(20, 184, 166, .25);
  }
#progetti-section .side-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #64748b;
    margin: 32px 10px 10px;
  }
#progetti-section .company {
    border: 0;
    background: transparent;
    color: #cbd5e1;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0;
    font-size: 14px;
  }
#progetti-section .company:hover {
    background: #1e293b;
    color: #fff;
  }
#progetti-section .company.active {
    background: #1e293b;
    color: #fff;
    box-shadow: inset 3px 0 #2dd4bf;
  }
#progetti-section .company span:last-child {
    background: #334155;
    color: #cbd5e1;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
  }
#progetti-section .add-company {
    margin-top: 8px;
    border: 1px dashed #334155;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    padding: 11px;
    font-size: 13px;
    width: 100%;
    text-align: left;
    cursor: pointer;
  }
#progetti-section .add-company:hover {
    background: #1e293b;
    color: #fff;
  }
#progetti-section .side-footer {
    margin-top: auto;
    padding: 14px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #1e293b;
    font-size: 12px;
    line-height: 1.55;
    color: #94a3b8;
  }
#progetti-section .side-footer strong {
    color: #e2e8f0;
  }
#progetti-section .main {
    padding: 28px 32px 56px;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
  }
#progetti-section .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
  }
#progetti-section .eyebrow {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: .14em;
    text-transform: uppercase;
  }
#progetti-section .topbar h1 {
    font-family: inherit;
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -.035em;
    margin: 4px 0 0;
  }
#progetti-section .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }
#progetti-section .hero {
    background: linear-gradient(135deg, #0f766e, #115e59);
    color: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 118, 110, .16);
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 24px;
    overflow: hidden;
    position: relative;
  }
#progetti-section .hero:after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    border: 55px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
    right: -90px;
    top: -110px;
  }
#progetti-section .hero h2 {
    font-family: inherit;
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.025em;
    margin: 5px 0 10px;
  }
#progetti-section .hero p {
    color: #ccfbf1;
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
    max-width: 670px;
  }
#progetti-section .hero-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    z-index: 1;
  }
#progetti-section .btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    cursor: pointer;
  }
#progetti-section .btn:hover {
    background: #f8fafc;
  }
#progetti-section .btn.primary {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
  }
#progetti-section .btn.primary:hover {
    background: #115e59;
  }
#progetti-section .btn.dark {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
    box-shadow: none;
  }
#progetti-section .btn.dark:hover {
    background: rgba(255, 255, 255, .16);
  }
#progetti-section .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0 26px;
  }
#progetti-section .stat {
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  }
#progetti-section .stat small {
    font-size: 11px;
    color: #64748b;
  }
#progetti-section .stat strong {
    display: block;
    font-family: inherit;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.025em;
    margin-top: 8px;
  }
#progetti-section .stat-sub {
    color: #0f766e;
  }
#progetti-section .section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 15px;
    margin: 28px 0 13px;
  }
#progetti-section .section-head h3 {
    font-size: 18px;
    letter-spacing: -.015em;
    margin: 0;
  }
#progetti-section .filters {
    display: flex;
    gap: 8px;
    padding: 3px;
    background: #f1f5f9;
    border-radius: 9px;
  }
#progetti-section .filter {
    padding: 7px 11px;
    border-radius: 7px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
  }
#progetti-section .filter.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
  }
#progetti-section .projects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
#progetti-section .project {
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 19px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    transition: .2s;
  }
#progetti-section .project:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    border-color: #cbd5e1;
  }
#progetti-section .project-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
#progetti-section .badge {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #ccfbf1;
    display: inline-block;
  }
#progetti-section .badge.orange {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
  }
#progetti-section .badge.blue {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
  }
#progetti-section .status {
    font-size: 11px;
    color: #64748b;
  }
#progetti-section .project h4 {
    font-family: inherit;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.02em;
    margin: 12px 0 6px;
  }
#progetti-section .project-desc {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    min-height: 40px;
  }
#progetti-section .numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    margin: 17px 0;
  }
#progetti-section .number small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
  }
#progetti-section .number strong {
    font-size: 14px;
  }
#progetti-section .funding-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 7px;
  }
#progetti-section .progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
  }
#progetti-section .progress span {
    display: block;
    height: 100%;
    background: #14b8a6;
    border-radius: inherit;
  }
#progetti-section .project-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
  }
#progetti-section .people {
    display: flex;
  }
#progetti-section .person {
    width: 29px;
    height: 29px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e2e8f0;
    border: 2px solid var(--card);
    font-size: 10px;
    font-weight: 800;
    margin-left: -6px;
    color: #475569;
  }
#progetti-section .person:first-child {
    margin-left: 0;
  }
#progetti-section .open {
    border: 0;
    background: transparent;
    font-weight: 800;
    color: #0f766e;
    font-size: 12px;
    cursor: pointer;
  }
#progetti-section .open:hover {
    color: #115e59;
  }

#progetti-section dialog {
    border: 0;
    border-radius: 16px;
    padding: 0;
    width: min(760px, calc(100vw - 30px));
    background: var(--card);
    box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
    border: 1px solid #e2e8f0;
  }
#progetti-section dialog::backdrop {
    background: rgba(15, 23, 42, .52);
  }
#progetti-section .modal-head {
    padding: 19px 22px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
#progetti-section .modal-head h3 {
    margin: 0;
    font-family: inherit;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.025em;
  }
#progetti-section .close {
    border: 0;
    background: transparent;
    font-size: 23px;
    color: #64748b;
    cursor: pointer;
  }
#progetti-section .modal-body {
    padding: 20px 22px;
  }
#progetti-section .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
#progetti-section .field {
    display: grid;
    gap: 7px;
  }
#progetti-section .field.full {
    grid-column: 1 / -1;
  }
#progetti-section .field label {
    font-size: 11px;
    color: #475569;
    font-weight: 800;
  }
#progetti-section .field input, #progetti-section .field select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    padding: 9px 11px;
    width: 100%;
    font-size: 13px;
    outline: none;
  }
#progetti-section .field input:focus, #progetti-section .field select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, .12);
  }
#progetti-section .modal-foot {
    padding: 14px 22px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    background: #f8fafc;
  }
#progetti-section .empty {
    grid-column: 1 / -1;
    padding: 50px;
    text-align: center;
    color: var(--muted);
  }

#progetti-section .form-section {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
  }
#progetti-section .form-section summary {
    list-style: none;
    padding: 13px 15px;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
  }
#progetti-section .form-section summary::-webkit-details-marker {
    display: none;
  }
#progetti-section .form-section summary span {
    font-size: 11px;
    color: var(--muted);
  }
#progetti-section .form-section[open] summary {
    border-bottom: 1px solid var(--line);
  }
#progetti-section .inner-grid {
    padding: 15px;
    background: #fff;
  }

#progetti-section .detail-dialog {
    width: min(920px, calc(100vw - 24px));
  }
#progetti-section .detail-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
  }
#progetti-section .detail-kpi {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  }
#progetti-section .detail-kpi small {
    display: block;
    color: var(--muted);
    font-size: 11px;
  }
#progetti-section .detail-kpi strong {
    display: block;
    margin-top: 6px;
    font-size: 17px;
  }
#progetti-section .tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
    overflow: auto;
  }
#progetti-section .tab {
    border: 0;
    background: transparent;
    padding: 9px 12px;
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
    font-size: 12px;
    cursor: pointer;
  }
#progetti-section .tab.active {
    color: #0f766e;
    border-bottom: 3px solid #14b8a6;
  }
#progetti-section .tab-panel {
    display: none;
  }
#progetti-section .tab-panel.active {
    display: block;
  }
#progetti-section .table-wrap {
    overflow: auto;
  }
#progetti-section .ledger {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
#progetti-section .ledger th, #progetti-section .ledger td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
  }
#progetti-section .ledger th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    background: #f8fafc;
  }
#progetti-section .positive {
    color: #0f766e;
    font-weight: 850;
  }
#progetti-section .stage-current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 15px;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 9px;
    margin-bottom: 14px;
  }
#progetti-section .stage-current small {
    color: var(--muted);
  }
#progetti-section .stage-current strong {
    color: #0f766e;
  }
#progetti-section .panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
#progetti-section .panel-head h4 {
    margin: 0;
  }
#progetti-section .note {
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    margin-top: 14px;
  }
#progetti-section .stat-sub {
    font: 700 13px Inter, sans-serif;
    color: #0f766e;
    margin-left: 6px;
  }
#progetti-section .simple-funding {
    padding: 16px 0;
    border-top: 1px solid var(--line);
    margin-top: 17px;
  }
#progetti-section .simple-funding small {
    display: block;
    color: var(--muted);
    margin-top: 7px;
    font-size: 10px;
  }
#progetti-section .next-action {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 11px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    font-size: 12px;
  }
#progetti-section .next-action span {
    color: var(--muted);
  }
#progetti-section .next-action strong {
    text-align: right;
    color: #334155;
  }
#progetti-section .project-foot {
    border-top: 0;
  }
#progetti-section .project-desc {
    min-height: 44px;
  }
#progetti-section .tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 7px 11px;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }
#progetti-section .tool-badge span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #0f766e;
    color: #fff;
  }
#progetti-section .company-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0 24px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  }
#progetti-section .company-bar-head {
    min-width: 150px;
  }
#progetti-section .company-bar-head strong {
    display: block;
    font-size: 13px;
  }
#progetti-section .company-bar-head span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
  }
#progetti-section .company-list {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 8px;
  }
#progetti-section .company-bar .company {
    width: auto;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    margin: 0;
  }
#progetti-section .company-bar .company:hover {
    border-color: #14b8a6;
    color: #0f766e;
    background: #f0fdfa;
  }
#progetti-section .company-bar .company.active {
    background: #0f766e;
    color: #fff;
    border-color: #0f766e;
    box-shadow: none;
  }
#progetti-section .company-bar .company span:last-child {
    margin-left: 8px;
    background: rgba(15, 23, 42, .08);
    color: inherit;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
  }
#progetti-section .company-bar .add-company {
    margin: 0;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    width: auto;
    cursor: pointer;
  }
#progetti-section .company-bar .add-company:hover {
    border-color: #14b8a6;
    background: #f0fdfa;
    color: #0f766e;
  }

  @media (max-width: 1000px) {
    #progetti-section .shell {
      grid-template-columns: 1fr;
    }
    #progetti-section .sidebar {
      display: none;
    }
    #progetti-section .main {
      padding: 22px 20px 48px;
    }
    #progetti-section .stats {
      grid-template-columns: repeat(3, 1fr) !important;
    }
  }
  @media (max-width: 720px) {
    #progetti-section .main {
      padding: 18px 14px 40px;
    }
    #progetti-section .hero {
      grid-template-columns: 1fr;
      padding: 20px;
      border-radius: 13px;
    }
    #progetti-section .hero-actions {
      justify-content: flex-start;
    }
    #progetti-section .projects {
      grid-template-columns: 1fr;
      gap: 11px;
    }
    #progetti-section .project {
      padding: 16px;
    }
    #progetti-section .stats {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 8px;
    }
    #progetti-section .stat {
      padding: 13px;
    }
    #progetti-section .stat strong {
      font-size: 18px;
    }
    #progetti-section .topbar h1 {
      font-size: 28px;
    }
    #progetti-section .form-grid {
      grid-template-columns: 1fr;
    }
    #progetti-section .field.full {
      grid-column: auto;
    }
    #progetti-section .filters {
      max-width: 100%;
      overflow: auto;
    }
    #progetti-section .section-head {
      align-items: start;
      flex-direction: column;
    }
    #progetti-section .modal-body {
      padding: 17px;
    }
    #progetti-section .detail-summary {
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    #progetti-section .detail-kpi:last-child {
      grid-column: 1 / -1;
    }
    #progetti-section .company-bar {
      align-items: stretch;
      flex-direction: column;
    }
    #progetti-section .company-list {
      width: 100%;
    }
    #progetti-section .company-bar .company, #progetti-section .company-bar .add-company {
      justify-content: center;
      width: 100%;
    }
    #progetti-section .next-action {
      align-items: flex-start;
    }
    #progetti-section .panel-head {
      align-items: flex-start;
      flex-direction: column;
    }
  }
/* Contenuti Markdown caricati dal builder */
.markdown-content {
  color: #374151;
  font-size: 1rem;
  line-height: 1.75;
}

.markdown-content > * + * { margin-top: 1rem; }
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  color: #111827;
  font-weight: 700;
  line-height: 1.25;
}
.markdown-content h1 { font-size: 2.25rem; }
.markdown-content h2 { font-size: 1.75rem; margin-top: 2rem; }
.markdown-content h3 { font-size: 1.25rem; margin-top: 1.5rem; }
.markdown-content ul { list-style: disc; padding-left: 1.5rem; }
.markdown-content ol { list-style: decimal; padding-left: 1.5rem; }
.markdown-content a { color: #4f46e5; text-decoration: underline; }
.markdown-content blockquote {
  border-left: 4px solid #a5b4fc;
  color: #4b5563;
  font-style: italic;
  padding-left: 1rem;
}
.markdown-content img { border-radius: .5rem; }

.accordion-cta {
  align-items: center;
  background: #4f46e5;
  border-radius: .5rem;
  color: #fff;
  display: inline-flex;
  font-size: .875rem;
  font-weight: 600;
  gap: .5rem;
  margin-top: 1rem;
  padding: .625rem 1rem;
  text-decoration: none;
  transition: background-color .2s ease, transform .2s ease;
}

.accordion-cta:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.accordion-cta:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}
