/* CST Comune – stili complementari a Bootstrap Italia (tema Design Comuni Italia). */

.cst-main { padding-bottom: 2rem; }
.cst-eyebrow { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #5d7083; margin-bottom: .4rem; }

/* Navigazione tra le 5 fasi */
.cst-phases ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; counter-reset: none; }
.cst-phases li a { display: flex; align-items: center; gap: .6rem; height: 100%; padding: .7rem .8rem; border: 1px solid #d1d9e0; border-radius: 6px; text-decoration: none; color: #17324d; background: #fff; transition: border-color .15s, box-shadow .15s; font-size: .88rem; line-height: 1.2; }
.cst-phases li a:hover { border-color: var(--bs-primary, #0066cc); box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb, 0,102,204), .15); }
.cst-phases li.active a { background: var(--bs-primary, #0066cc); border-color: var(--bs-primary, #0066cc); color: #fff; }
.cst-phases .cst-num { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: rgba(var(--bs-primary-rgb, 0,102,204), .1); color: var(--bs-primary, #0066cc); }
.cst-phases li.active .cst-num { background: #fff; }
@media (max-width: 991px) { .cst-phases ol { grid-template-columns: 1fr; } }

/* Hub */
.cst-hub-card { transition: transform .15s, box-shadow .15s; }
.cst-hub-card:hover { transform: translateY(-2px); }
.cst-hub-card .card-title a::after { content: none; }
.cst-num-big { font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--bs-primary, #0066cc); opacity: .35; font-family: "Titillium Web", Geneva, Tahoma, sans-serif; }
.cst-kpis .cst-kpi-val { font-size: 1.35rem; font-weight: 700; color: #17324d; margin-top: .25rem; }

/* Schede */
.cst-tabs .nav-link { white-space: nowrap; }
.cst-badge { font-weight: 600; font-size: .72rem; letter-spacing: .02em; vertical-align: middle; }

/* Tabelle */
.cst-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #5d7083; font-weight: 600; white-space: nowrap; }
.cst-table td { vertical-align: top; }
.cst-edit-table td { padding: .25rem .3rem; vertical-align: middle; }
.cst-edit-table .form-control, .cst-edit-table .form-select { min-height: 2rem; font-size: .9rem; border: 1px solid #c5cfd8; border-radius: 4px; padding: .2rem .45rem; box-shadow: none; }
.cst-code { display: inline-block; font-family: "Roboto Mono", monospace; font-size: .8rem; font-weight: 700; color: var(--bs-primary, #0066cc); background: rgba(var(--bs-primary-rgb, 0,102,204), .1); border-radius: 4px; padding: 0 .35rem; }

/* Form in colonne strette */
.cst-stack .col-md-6 { flex: 0 0 100%; max-width: 100%; }
.cst-filters .select-wrapper label, .cst-filters .form-label { font-size: .8rem; }

/* Cartelle documentali e fascicolo */
.cst-folders li a, .cst-tree a { color: #17324d; display: inline-block; padding: .15rem 0; }
.cst-tree a { padding: .2rem .35rem; border-radius: 4px; }
.cst-tree a:hover { background: rgba(var(--bs-primary-rgb, 0,102,204), .05); }
.cst-tree .cst-tree-active { background: rgba(var(--bs-primary-rgb, 0,102,204), .1); font-weight: 700; }
.cst-tree { max-height: 70vh; overflow: auto; }

/* Bandi */
.cst-bando h3 { line-height: 1.3; }

/* Wizard */
.cst-wizard .steppers-header ul { flex-wrap: wrap; }
.cst-wizard .steppers-header li button { color: inherit; font-weight: inherit; }
.cst-wizard .steppers-number { display: inline-flex; width: 1.6rem; height: 1.6rem; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid currentColor; font-size: .8rem; margin-right: .3rem; }
.cst-wp { border-left: 4px solid var(--bs-primary, #0066cc); }
.cst-dl { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; }
.cst-dl dd { margin: 0; text-align: right; white-space: nowrap; }
.cst-gantt-wrap { overflow-x: auto; border: 1px solid #e3e8ed; border-radius: 4px; }
.cst-gantt { border-collapse: collapse; font-size: .75rem; width: 100%; }
.cst-gantt th, .cst-gantt td { border: 1px solid #eef1f4; padding: 0; height: 1.5rem; min-width: 1.4rem; text-align: center; }
.cst-gantt th:first-child, .cst-gantt td:first-child { text-align: left; padding: 0 .5rem; min-width: 16rem; max-width: 22rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: #fff; }
.cst-gantt tr.wp td:first-child { font-weight: 700; }
.cst-gantt tr.task td:first-child { padding-left: 1.4rem; color: #455b71; }
.cst-gantt td.on { background: var(--bs-primary, #0066cc); }
.cst-gantt tr.task td.on { background: rgba(var(--bs-primary-rgb, 0,102,204), .45); }

/* Chat agente appalti */
.cst-chat-log { height: 460px; overflow-y: auto; padding: 1rem; background: #f6f8fa; border-radius: 6px; }
.cst-msg { display: flex; margin-bottom: .9rem; }
.cst-msg-user { justify-content: flex-end; }
.cst-bubble { max-width: 88%; padding: .75rem 1rem; border-radius: 12px; font-size: .95rem; line-height: 1.5; }
.cst-msg-bot .cst-bubble { background: #fff; border: 1px solid #e3e8ed; border-top-left-radius: 2px; }
.cst-msg-user .cst-bubble { background: var(--bs-primary, #0066cc); color: #fff; border-top-right-radius: 2px; }
.cst-bubble ul, .cst-bubble ol { padding-left: 1.2rem; margin: .4rem 0; }
.cst-bubble p:last-child { margin-bottom: 0; }
.cst-sources { margin-top: .75rem; border-top: 1px solid #e3e8ed; padding-top: .5rem; }
.cst-source summary { cursor: pointer; font-size: .85rem; color: var(--bs-primary, #0066cc); padding: .15rem 0; }
.cst-art-index { max-height: 420px; overflow-y: auto; }
.cst-suggest .chip { height: auto; min-height: 1.75rem; padding: .25rem .75rem; cursor: pointer; background: #fff; }
.cst-suggest .chip-label { white-space: normal; line-height: 1.25; text-align: left; }
.cst-typing span { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 50%; background: #9aa9b8; animation: cst-b 1.2s infinite ease-in-out; }
.cst-typing span:nth-child(2) { animation-delay: .2s; }
.cst-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes cst-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Login */
.cst-login form p { margin-bottom: 1rem; }
.cst-login input[type=text], .cst-login input[type=password] { width: 100%; border: 1px solid #c5cfd8; border-radius: 4px; padding: .5rem .75rem; }
.cst-login input[type=submit] { background: var(--bs-primary, #0066cc); color: #fff; border: 0; border-radius: 4px; padding: .55rem 1.5rem; font-weight: 600; }

.cst-empty { background: #fafbfc; }

/* Stampa riepilogo proposta */
@media print {
	body.cst-page header, body.cst-page footer, body.cst-page .cst-phases, body.cst-page .cst-tabs, body.cst-page .steppers, body.cst-page .steppers-nav,
	body.cst-page .cmp-breadcrumbs, body.cst-page .cmp-hero, body.cst-page .alert, body.cst-page [data-act], body.cst-page a.btn, body.cst-page .it-header-wrapper,
	body.cst-page .cst-wz-body > .d-flex:first-child { display: none !important; }
	.cst-gantt td.on { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.cst-content .callout p, .cst-content .callout li { font-family: inherit; }

/* Allineamento al tema AGID */
.cst-badge-attivo { background: rgba(var(--bs-primary-rgb, 0,102,204), .1); color: var(--bs-primary, #0066cc); border: 1px solid var(--bs-primary, #0066cc); font-weight: 600; }
.cst-hub-card .green-title-big a { color: inherit; }
.cst-kpis .border { background: #fff; }
.cst-main .cst-content > .alert:first-child { margin-top: 0; }
