.cs-wrap { --cs-ink: #203449; --cs-line: #c7cfd8; --cs-soft: #edf1f5; max-width: 1500px; }
.cs-wrap h1, .cs-wrap h2 { color: var(--cs-ink); }
.cs-card { background: #fff; border: 1px solid var(--cs-line); border-left: 4px solid var(--cs-ink); padding: 14px 18px; margin: 16px 0; }
.cs-card h2 { margin-top: 0; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 20px; }
.cs-form th { width: 190px; padding: 8px 10px 8px 0; }
.cs-form td { padding: 6px 0; }
.cs-data summary { cursor: pointer; font-weight: 600; color: var(--cs-ink); }
.cs-delete { margin-top: 14px; }

.cs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.cs-bar select { margin: 0 4px; }
.cs-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.cs-tabs .is-on { background: var(--cs-ink); border-color: var(--cs-ink); color: #fff; }
.cs-defco { margin-left: auto; }
.cs-search { display: flex; gap: 8px; margin-bottom: 8px; }
.cs-search input { flex: 1; max-width: 480px; }
.cs-results { max-height: 300px; overflow: auto; border: 1px solid var(--cs-line); background: #fafbfd; }
.cs-res { display: grid; grid-template-columns: 110px 1fr 56px auto; gap: 10px; align-items: start; padding: 6px 10px; border-bottom: 1px solid var(--cs-soft); }
.cs-res b { color: var(--cs-ink); }
.cs-res i { font-style: normal; color: #536579; }
.cs-results .description { padding: 8px 10px; margin: 0; }
.cs-custom { display: grid; grid-template-columns: 1fr 120px; gap: 8px; max-width: 760px; }
.cs-custom textarea { grid-column: 1 / -1; }
.cs-custom button { justify-self: start; }

.cs-scroll { overflow-x: auto; }
.cs-lines th { white-space: nowrap; }
.cs-lines td { vertical-align: top; }
.cs-lines textarea { width: 100%; min-width: 280px; margin-bottom: 4px; }
.cs-lines input { width: 100%; }
.cs-lines .cs-s { width: 56px; }
.cs-lines .cs-n { width: 74px; text-align: right; }
.cs-lines .cs-co { min-width: 130px; }
.cs-lines .cs-notes { font-size: 12px; color: #536579; }
.cs-ro { color: #536579; font-size: 12px; max-width: 150px; }
.cs-amt { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs-empty { padding: 24px; text-align: center; color: #536579; }

.cs-tot { margin: 14px 0 0 auto; border-collapse: collapse; min-width: 320px; }
.cs-tot th { text-align: left; padding: 4px 16px 4px 0; font-weight: 500; }
.cs-tot td { text-align: right; padding: 4px 0; font-variant-numeric: tabular-nums; }
.cs-tot .cs-grand th, .cs-tot .cs-grand td { border-top: 2px solid var(--cs-ink); font-weight: 700; font-size: 15px; color: var(--cs-ink); }

#cs-msg { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 0; z-index: 9999; }
#cs-msg.is-ok, #cs-msg.is-error { padding: 10px 16px; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
#cs-msg.is-ok { background: var(--cs-ink); }
#cs-msg.is-error { background: #b32d2e; }

/* ---- Pagina sul sito (fuori dalla bacheca): stili propri per i controlli di WordPress ---- */
.cs-front { font-size: 15px; line-height: 1.5; max-width: 1400px; margin: 0 auto; }
.cs-front .button, .cs-front .page-title-action { display: inline-block; padding: 6px 14px; border: 1px solid var(--cs-ink); border-radius: 3px; background: #fff; color: var(--cs-ink); font: inherit; font-size: 14px; line-height: 1.4; text-decoration: none; cursor: pointer; }
.cs-front .button-primary, .cs-front .button.is-on { background: var(--cs-ink); color: #fff; }
.cs-front .button-small { padding: 2px 10px; font-size: 13px; }
.cs-front .button.disabled, .cs-front .button:disabled { opacity: .45; pointer-events: none; }
.cs-front .button-link { border: 0; background: none; padding: 0; color: var(--cs-ink); cursor: pointer; text-decoration: underline; font: inherit; }
.cs-front .button-link-delete { color: #b32d2e; }
.cs-front input[type=text], .cs-front input[type=password], .cs-front input[type=search], .cs-front input[type=date], .cs-front input:not([type]), .cs-front select, .cs-front textarea { border: 1px solid var(--cs-line); border-radius: 3px; padding: 5px 8px; font: inherit; font-size: 14px; background: #fff; color: #1f2933; box-sizing: border-box; max-width: 100%; }
.cs-front .large-text { width: 100%; }
.cs-front .regular-text { width: min(100%, 25em); }
.cs-front .widefat { width: 100%; border-collapse: collapse; }
.cs-front .widefat th, .cs-front .widefat td { padding: 8px 10px; border-bottom: 1px solid var(--cs-soft); text-align: left; }
.cs-front .widefat thead th { background: var(--cs-soft); color: var(--cs-ink); font-size: 13px; }
.cs-front .widefat.striped tbody tr:nth-child(even) { background: #fafbfd; }
.cs-front .form-table { width: 100%; border-collapse: collapse; }
.cs-front .form-table th { text-align: left; font-weight: 600; vertical-align: top; }
.cs-front .description { color: #536579; font-size: 13px; }
.cs-front .notice { padding: 10px 14px; margin: 12px 0; border-left: 4px solid var(--cs-ink); background: var(--cs-soft); }
.cs-front .notice-error { border-color: #b32d2e; }
.cs-front .wp-header-end { display: none; }
.cs-front h1.wp-heading-inline { display: inline-block; margin-right: 12px; }
.cs-front .cs-lines td, .cs-front .cs-lines th { padding: 6px 6px; }
.cs-login { max-width: 380px; }
.cs-login input[type=text], .cs-login input[type=password] { width: 100%; }
.cs-login p { margin: 0 0 12px; }
.cs-login label { display: block; margin-bottom: 4px; }

/* ---- Pagina a tutta larghezza (template del plugin, senza stili del tema) ---- */
body.cs-standalone { margin: 0; background: #f2f4f7; color: #1f2933; font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.cs-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; background: #203449; color: #fff; }
.cs-top a { color: #fff; }
.cs-brand { text-decoration: none; font-size: 18px; }
.cs-brand span { margin-left: 10px; font-size: 14px; opacity: .7; }
.cs-user { font-size: 14px; }
.cs-main { padding: 4px 24px 56px; }
.cs-standalone .cs-front { max-width: none; margin: 0; }
.cs-front h1 { font-size: 24px; line-height: 1.25; margin: 20px 0 8px; font-weight: 700; }
.cs-front h2 { font-size: 17px; line-height: 1.3; margin: 0 0 10px; font-weight: 600; }
.cs-front .form-table th, .cs-front .form-table td { border: 0; padding: 6px 12px 6px 0; }
.cs-front .form-table th { width: 220px; }
.cs-front .cs-card { box-shadow: 0 1px 2px rgba(32, 52, 73, .06); }
.cs-front table { margin: 0; }
.cs-front .cs-grid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
@media (max-width: 700px) {
  .cs-main { padding: 4px 12px 40px; }
  .cs-front .form-table th, .cs-front .form-table td { display: block; width: 100%; }
  .cs-front .cs-grid { grid-template-columns: 1fr; }
}

/* ---- Voci dell'archivio già selezionate ---- */
.cs-res.is-sel { background: #e9f3ec; box-shadow: inset 4px 0 0 #2f7d4f; }
.cs-res.is-sel b { color: #2f7d4f; }
.cs-res .button.is-picked { background: #2f7d4f; border-color: #2f7d4f; color: #fff; white-space: nowrap; }
.cs-lines textarea { resize: vertical; overflow: hidden; min-height: 44px; min-width: 360px; }

/* ---- Barra di esportazione, cronologia, archivio ---- */
.cs-bar { gap: 10px 28px; }
.cs-bar-g { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cs-bar-g b { color: var(--cs-ink); margin-right: 2px; }
.cs-pct { color: #536579; font-size: 12px; white-space: nowrap; text-align: right; }
.cs-tot .cs-exec th, .cs-tot .cs-exec td { color: #2f7d4f; font-weight: 600; border-top: 1px dashed var(--cs-line); }
.cs-logtab td, .cs-logtab th { vertical-align: top; }
.cs-logtab td:nth-child(1) { white-space: nowrap; }
.cs-newarch { display: grid; grid-template-columns: 1.4fr 150px 90px 150px; gap: 8px; max-width: 920px; }
.cs-newarch textarea { grid-column: 1 / -1; }
.cs-newarch button { justify-self: start; }
.cs-lines .cs-cat { min-width: 170px; }
.cs-lines .cs-code { width: 90px; }
.cs-res { grid-template-columns: 110px 1fr 120px auto; }
