/* ============================================================
   ls_style.css — Stile CRUD generico, Access-like
   ============================================================ */

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --toolbar-bg:   #2c3e50;
    --toolbar-fg:   #ecf0f1;
    --btn-primary:  #2980b9;
    --btn-hover:    #1a6496;
    --btn-danger:   #c0392b;
    --btn-secondary:#5d6d7e;
    --sidebar-bg:   #f4f6f8;
    --sidebar-w:    240px;
    --border:       #ccd0d4;
    --row-even:     #ffffff;
    --row-odd:      #f0f4f8;
    --row-hover:    #dce8f5;
    --header-bg:    #dde3ea;
    --header-fg:    #2c3e50;
    --font:         'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size:    12px;
    --filter-bg:    #eaf0f6;
    --success-bg:   #d4edda;
    --success-fg:   #155724;
    --error-bg:     #f8d7da;
    --error-fg:     #721c24;
}

html, body {
    font-family: var(--font);
    font-size: var(--font-size);
    background: #e8ecef;
    color: #222;
    height: 100%;
}

/* ---- TOOLBAR ---- */
#toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--toolbar-bg);
    color: var(--toolbar-fg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    flex-wrap: wrap;
}

.app-title {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    margin-right: 12px;
    color: #a8d4f0;
}

.toolbar-actions {
    display: flex;
    gap: 6px;
    flex: 1;
}

.record-counter {
    font-size: 11px;
    color: #bdc3c7;
    margin-left: auto;
    white-space: nowrap;
}

/* ---- BOTTONI ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.btn-primary   { background: var(--btn-primary); color: #fff; }
.btn-primary:hover { background: var(--btn-hover); }
.btn-secondary { background: var(--btn-secondary); color: #fff; }
.btn-secondary:hover { background: #4a5568; }
.btn-danger    { background: var(--btn-danger); color: #fff; }
.btn-danger:hover { background: #a93226; }





.btn-page {
    display: inline-block;
    padding: 3px 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    color: var(--btn-primary);
    font-size: 11px;
}
.btn-page:hover { background: #e8f4fd; }
.btn-page.disabled { color: #aaa; pointer-events: none; background: #f5f5f5; }

.btn-icon {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    padding: 1px 5px;
    line-height: 1;
    transition: background 0.1s;
}
.btn-edit  { color: #2980b9; }
.btn-edit:hover  { background: #eaf4fb; border-color: #aed6f1; }
.btn-delete { color: #c0392b; }
.btn-delete:hover { background: #fdf2f2; border-color: #f1948a; }

/* ---- FLASH MESSAGE ---- */
.flash {
    padding: 8px 16px;
    margin: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    animation: fadeout 3s forwards;
}
.flash-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid #c3e6cb; }
.flash-error   { background: var(--error-bg);   color: var(--error-fg);   border: 1px solid #f5c6cb; }
@keyframes fadeout {
    0%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* ---- LAYOUT ---- */
#layout {
    display: flex;
    height: calc(100vh - 40px);
    overflow: hidden;
}

/* ---- SIDEBAR ---- */
#sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 8px;
    /* Pronta per Layer 3 */
}

/* ---- AREA PRINCIPALE ---- */
#main-area {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* ---- TABELLA ---- */
#table-wrapper {
    overflow: auto;
    flex: 1;
}

#data-table {
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 100%;
    font-size: 12px;
}

#data-table thead th {
    background: var(--header-bg);
    color: var(--header-fg);
    font-weight: 700;
    border: 1px solid var(--border);
    padding: 4px 6px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    user-select: none;
    overflow: hidden;
}

.th-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

/* Handle resize colonne */
.col-resize-handle {
    width: 5px;
    min-width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    border-right: 2px solid #b0bec5;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
}
#data-table thead th { position: relative; }
.col-resize-handle:hover { border-right-color: var(--btn-primary); }

#data-table tbody td {
    border: 1px solid #dde3ea;
    padding: 3px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    cursor: default;
}

.row-even { background: var(--row-even); }
.row-odd  { background: var(--row-odd); }
#data-table tbody tr:hover { background: var(--row-hover); }

.col-actions {
    width: 58px !important;
    min-width: 58px;
    text-align: center;
    white-space: nowrap;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #888;
    font-style: italic;
}

#data-table td a {
    color: var(--btn-primary);
    text-decoration: none;
}
#data-table td a:hover { text-decoration: underline; }

/* ---- PAGINAZIONE ---- */
#pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.page-info {
    font-size: 11px;
    color: #555;
    margin: 0 4px;
}

.goto-form {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    margin-left: auto;
}
.goto-form input[type=number] {
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 11px;
}

/* ---- MODALI ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    /* non usiamo flex centrato: le finestre sono posizionate in modo assoluto */
}

.modal {
    position: absolute;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    width: 540px;
    height: 560px;
    min-width: 280px;
    min-height: 200px;
    max-width: 98vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    resize: both;
    /* auto permette scrollbar interna E resize */
    overflow: auto;
}
.modal-wide  { width: 780px; height: 640px; }
.modal-small { width: 400px; height: 230px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    border-radius: 5px 5px 0 0;
    font-weight: 700;
    font-size: 13px;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}
.modal-header-danger { background: #fadbd8; }

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #555;
    line-height: 1;
    padding: 0 4px;
}
.modal-close:hover { color: var(--btn-danger); }

.modal-body {
    padding: 12px 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b0bec5 #f4f6f8;
}
.modal-body::-webkit-scrollbar { width: 7px; }
.modal-body::-webkit-scrollbar-track { background: #f4f6f8; }
.modal-body::-webkit-scrollbar-thumb { background: #b0bec5; border-radius: 4px; }

.modal-footer {
    padding: 9px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: #f8fafc;
    border-radius: 0 0 5px 5px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

/* ---- FORM ROWS ---- */
.form-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 7px;
}
.form-row label {
    min-width: 130px;
    text-align: right;
    font-size: 11px;
    color: #555;
    padding-top: 4px;
    flex-shrink: 0;
}
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=url],
.form-row input[type=number],
.form-row input[type=date],
.form-row textarea,
.form-row select {
    flex: 1;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 12px;
    font-family: var(--font);
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--btn-primary);
}
.form-row textarea { resize: vertical; min-height: 50px; }

.form-row-inline {
    align-items: center;
    margin-bottom: 6px;
}
.form-row-inline label { padding-top: 0; }
.form-row-inline select { flex: none; min-width: 140px; }

.readonly-val {
    flex: 1;
    font-size: 12px;
    color: #555;
    padding: 4px 6px;
    background: #f4f6f8;
    border: 1px solid #dde3ea;
    border-radius: 3px;
}

.req { color: #c0392b; font-size: 11px; }

/* ---- TABELLA IMPOSTAZIONI COLONNE ---- */
.col-settings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.col-settings-table th {
    background: var(--header-bg);
    padding: 5px 8px;
    text-align: left;
    border: 1px solid var(--border);
    font-weight: 700;
}
.col-settings-table td {
    padding: 3px 8px;
    border: 1px solid #eee;
    vertical-align: middle;
}
.col-settings-table tr:nth-child(even) td { background: #f8fafc; }
.col-settings-table small { color: #888; }

hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
h4 { font-size: 12px; color: #444; margin-bottom: 8px; }

/* ============================================================
   LAYER 2 — Lookup + Toolbar avanzata
   ============================================================ */

/* ---- LOOKUP FIELD ---- */
.lookup-field-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.lookup-input {
    flex: 1;
    background: #f4f6f8;
    font-family: var(--font);
    font-size: 12px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    padding: 4px 6px;
    color: #333;
}
.btn-lookup {
    background: #f0f4f8;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    cursor: pointer;
    padding: 3px 7px;
    font-size: 13px;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
}
.btn-lookup:hover { background: #dce8f5; border-color: #2980b9; }

.btn-lookup-clear {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1;
}
.btn-lookup-clear:hover { color: #c0392b; background: #fdf2f2; }

/* ---- TOOLBAR MODALITÀ LOOKUP ---- */
.toolbar-lookup {
    background: #1a5276;
}

/* ---- BOTTONE SELEZIONA (in modalità lookup) ---- */
.btn-select-lookup {
    font-size: 11px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* Larghezza colonna azioni più ampia se ci sono ROW_BUTTONS custom */
.col-actions { min-width: 58px; }

/* ============================================================
   LAYER 3 — Sidebar Filtri
   ============================================================ */

#sidebar {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ---- Header sidebar ---- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 6px;
    font-weight: 700;
    font-size: 12px;
    color: #2c3e50;
    border-bottom: 1px solid var(--border);
    background: #e8edf2;
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
}
.sidebar-clear-all {
    font-size: 10px;
    color: #c0392b;
    text-decoration: none;
    font-weight: 600;
}
.sidebar-clear-all:hover { text-decoration: underline; }

/* ---- Gruppi filtro ---- */
.sidebar-group {
    border-bottom: 1px solid #e0e5ea;
    padding: 7px 10px;
    transition: background 0.1s;
}
.sidebar-group:hover { background: #edf0f4; }
.sidebar-group-active { background: #eaf4fb; }
.sidebar-group-active:hover { background: #daeaf7; }

.sidebar-group-label {
    font-weight: 700;
    font-size: 11px;
    color: #34495e;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.filter-active-dot { color: #2980b9; font-size: 9px; line-height: 1; }

/* ---- Checkbox ---- */
.sidebar-checkboxes {
    display: flex;
    flex-direction: column;
    /* 5 voci da ~22px ciascuna */
    max-height: 110px;
    overflow-y: scroll; /* sempre visibile */
    border: 1px solid #dde3ea;
    border-radius: 3px;
    background: #fff;
}
.sidebar-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 0;
    flex-shrink: 0;
}
.sidebar-checkbox-label:hover { background: #eaf4fb; }
.sidebar-checkbox-label input[type=checkbox] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--btn-primary);
    flex-shrink: 0;
}
.sidebar-checkbox-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Testo ILIKE ---- */
.sidebar-text-input {
    width: 100%;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 11px;
    font-family: var(--font);
    background: #fff;
    box-sizing: border-box;
}
.sidebar-text-input:focus { outline: none; border-color: var(--btn-primary); }

/* ---- Slider range doppio ---- */
.sidebar-slider-wrap { padding-top: 2px; }

.slider-values {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 11px;
}
.slider-num-input {
    width: 52px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 11px;
    font-family: var(--font);
    text-align: center;
}
.slider-num-input:focus { outline: none; border-color: var(--btn-primary); }

.slider-track-wrap {
    position: relative;
    height: 22px;
    display: flex;
    align-items: center;
    margin: 0 6px;
}
.slider-track {
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    background: #ccd0d4;
    border-radius: 2px;
    z-index: 1;
}
.slider-range {
    position: absolute;
    height: 100%;
    background: var(--btn-primary);
    border-radius: 2px;
}
.slider-thumb {
    position: absolute;
    left: 0; right: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    z-index: 2;
}
.slider-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--btn-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    cursor: pointer;
    pointer-events: all;
}
.slider-thumb::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--btn-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    cursor: pointer;
    pointer-events: all;
    border: none;
}
.slider-thumb-max { z-index: 3; }

/* ---- Date range ---- */
.sidebar-daterange {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.daterange-label {
    font-size: 10px;
    color: #777;
    margin-bottom: -1px;
}
.sidebar-date-input {
    width: 100%;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    padding: 3px 5px;
    font-size: 11px;
    font-family: var(--font);
    box-sizing: border-box;
}
.sidebar-date-input:focus { outline: none; border-color: var(--btn-primary); }

/* ---- Footer sidebar ---- */
.sidebar-footer {
    padding: 10px;
    position: sticky;
    bottom: 0;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-btn-apply {
    width: 100%;
    justify-content: center;
    padding: 6px;
    font-size: 12px;
}

/* ---- TAG MULTI-SELECT ---- */
.tag-select-wrap {
    flex: 1;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    background: #fff;
    max-height: 140px;
    overflow-y: auto;
    padding: 3px 0;
}
.tag-select-wrap label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    min-width: unset;
    text-align: left;
    color: #333;
}
.tag-select-wrap label:hover { background: #eaf4fb; }
.tag-select-wrap input[type=checkbox] {
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--btn-primary);
}
.tag-count {
    margin-left: auto;
    font-size: 10px;
    color: #888;
    background: #e8ecef;
    border-radius: 8px;
    padding: 0 5px;
    min-width: 18px;
    text-align: center;
}
.tag-hidden-input { display: none; }

/* ---- Checkbox disabilitate (conteggio zero nei filtri attivi) ---- */
.cb-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.cb-disabled input[type=checkbox] { cursor: not-allowed; }
.tag-count-zero {
    background: #e8ecef;
    color: #aaa;
}

/* ---- Logic Toggle OR/AND ---- */
.logic-toggle {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}
.logic-btn {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    background: #f4f6f8;
    color: #666;
    cursor: pointer;
    line-height: 1.4;
    font-family: var(--font);
    transition: background 0.12s, color 0.12s;
}
.logic-btn:hover { background: #dce8f5; border-color: #2980b9; color: #2980b9; }
.logic-active {
    background: #2980b9;
    color: #fff;
    border-color: #2980b9;
}
.logic-active:hover { background: #1a6496; }

/* ============================================================
   STANDARD HEADER — 2 BARRE (Proposta A, vedi standard_header_logistar.md)
   Aggiunto per uniformare tutti i programmi. Non tocca nulla sopra:
   #toolbar (vecchio, singola barra) resta per compatibilità nei file
   non ancora convertiti, ma i nuovi programmi usano .bar1-a/.bar2-a.
   ============================================================ */

.icon { width:15px; height:15px; stroke:currentColor; stroke-width:1.8; fill:none; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; vertical-align:middle; }

/* ---- BARRA 1 — identità/sistema ---- */
.bar1-a{
    display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:10px; padding:0 12px; height:38px;
    background:var(--toolbar-bg); color:var(--toolbar-fg); flex-shrink:0;
    position:sticky; top:0; z-index:110;
}
.bar1-a .zone-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.bar1-a .zone-right{ display:flex; align-items:center; gap:14px; justify-self:end; }
.bar1-a .brand{ font-weight:800; font-size:13.5px; letter-spacing:1.6px; color:#a8d4f0; justify-self:center; user-select:none; }
.bar1-a .ic-btn{ background:none; border:none; color:#bcc9d4; cursor:pointer; padding:6px; border-radius:4px; display:flex; text-decoration:none; }
.bar1-a .ic-btn:hover{ background:rgba(255,255,255,.08); color:#fff; }
.bar1-a .divider{ width:1px; align-self:stretch; margin:8px 0; background:rgba(255,255,255,.15); }
.bar1-a .title{ font-weight:700; font-size:13px; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar1-a .pkg-badge{
    font-size:10px; font-weight:700; letter-spacing:.3px; padding:2px 7px; border-radius:3px; color:#fff;
    background:var(--pkg-color, var(--btn-primary)); flex-shrink:0;
}
.bar1-a .meta{ display:flex; align-items:center; gap:5px; color:#aebac4; font-size:11.5px; white-space:nowrap; }
.bar1-a .meta strong{ color:var(--toolbar-fg); font-weight:600; }

/* ---- BARRA 2 — altri programmi/procedure da chiamare ---- */
.bar2-a{
    display:flex; align-items:center; gap:6px; padding:6px 12px; min-height:36px;
    background:var(--header-bg); color:var(--header-fg); border-bottom:1px solid var(--border); flex-shrink:0; flex-wrap:wrap;
    position:sticky; top:38px; z-index:105;
}
.bar2-a .grp{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.bar2-a .gdiv{ width:1px; height:20px; background:#c3cbd3; margin:0 4px; }
.bar2-a .spacer{ flex:1; }
.bar2-a .record-counter{ font-size:11px; color:#5d6d7e; white-space:nowrap; }

.btn-a{
    display:inline-flex; align-items:center; gap:5px; font-family:var(--font); font-size:11.5px; font-weight:600;
    padding:5px 10px; border-radius:3px; border:1px solid transparent; cursor:pointer; white-space:nowrap;
    text-decoration:none;
}
.btn-a.primary{ background:var(--btn-primary); color:#fff; }
.btn-a.primary:hover{ background:var(--btn-primary-hover, var(--btn-hover)); }
.btn-a.ghost{ background:#fff; border-color:var(--border); color:#34495e; }
.btn-a.ghost:hover{ background:#eaf4fb; border-color:var(--btn-primary); }
.btn-a.danger{ background:#fff; border-color:#eecfcb; color:var(--btn-danger); }
.btn-a.danger:hover{ background:#fdf2f2; }

/* Se una pagina con bar1-a/bar2-a ha anche #layout sotto, va tolto
   lo spazio già riservato da #layout a un'unica toolbar da 40px */
.has-double-bar #layout{ height: calc(100vh - 74px); }

/* ---- Menu ad hamburger (side-menu scorrevole) ---- */
.overlay{
    position: fixed; inset: 0; background: rgba(0,0,0,.35);
    z-index: 250; display: none;
}
.overlay.open{ display:block; }
.side-menu{
    position: fixed; top:0; left:-260px; width:250px; height:100%;
    background: var(--toolbar-bg); color: var(--toolbar-fg);
    z-index: 300; transition: left .18s ease; box-shadow: 2px 0 12px rgba(0,0,0,.3);
    padding-top: 38px; overflow-y:auto;
}
.side-menu.open{ left:0; }
.side-menu a{
    display:block; padding:10px 16px; color:var(--toolbar-fg); text-decoration:none;
    font-size:12.5px; border-bottom:1px solid rgba(255,255,255,.08);
}
.side-menu a:hover{ background: rgba(255,255,255,.08); }
.side-menu .grp{
    padding:10px 16px 4px; font-size:10.5px; letter-spacing:.6px;
    color:#a8d4f0; font-weight:700;
}

/* ---- Menu a 3 puntini (dropdown in barra 1) ---- */
.dropdown{ position:relative; }
.dropdown-menu{
    position:absolute; right:0; top:32px; background:#fff; border:1px solid var(--border);
    border-radius:4px; min-width:180px; box-shadow:0 6px 18px rgba(0,0,0,.25);
    display:none; z-index:200;
}
.dropdown-menu.open{ display:block; }
.dropdown-menu a{
    display:block; padding:7px 12px; color:#222; text-decoration:none; font-size:12px;
}
.dropdown-menu a:hover{ background:#eef2f6; }
.dropdown-menu hr{ border:none; border-top:1px solid var(--border); margin:2px 0; }

/* ---- Risultato elaborazione (programmi tipo "Elaborazione") ---- */
.result-panel{
    margin-top:14px; background:#eaf7ef; border:1px solid #bfe3c8; border-radius:5px; padding:12px 14px; font-size:13px; color:#1e6b3a;
}
.result-panel b{ font-size:17px; }
.debug-box{
    margin-top:10px; font-size:11px; font-family:Consolas, monospace; background:var(--toolbar-bg); color:#cfe4f2; border-radius:5px;
    padding:10px 12px; line-height:1.6;
}
.debug-box .k{ color:#7fb3e0; }
