/* Vista "Access originale": riproduzione di una finestra di form Access 2010/2013.
   Colori fissi (è una riproduzione dell'originale): uguali in tema chiaro e scuro.
   Tutto sotto il prefisso .lg- ; .legacy-note e .legacy-wrap usano i token di app.css. */

.legacy-note code { font-family: var(--font-data); font-size: .95em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.legacy-wrap { position: relative; }
.lg-zoom { display: flex; gap: 4px; justify-content: flex-end; margin: -6px -4px 8px 0; }
.lg-zoom button { font-family: var(--font-ui); font-size: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--r-sm); padding: 2px 10px; cursor: pointer; }
.lg-zoom button[aria-pressed="true"] { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); }
.lg-stage { display: flex; justify-content: flex-start; }

/* ---------- finestra (MDI figlia, Access 2010) ---------- */
.lg-win {
  color-scheme: light;
  flex: none; position: relative; background: #ABABAB;
  border: 1px solid #6F86A8; box-shadow: 0 0 0 3px #C5D5EA, 0 0 0 4px #8FA6C6, 0 6px 18px rgba(0,0,0,.25);
  margin: 4px; font-family: Tahoma, "Segoe UI", sans-serif; font-size: 8pt; color: #000; line-height: normal;
  -webkit-font-smoothing: auto; text-rendering: optimizeLegibility;
}
.lg-title {
  height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 0 0 6px;
  background: linear-gradient(#E4ECF7, #D3E0F1 50%, #C7D7EE 51%, #D5E2F3);
  border-bottom: 1px solid #A3B9D8; color: #1E395B; font: 9pt "Segoe UI", Tahoma, sans-serif; user-select: none;
}
.lg-title-ic { width: 16px; height: 16px; border-radius: 2px; background: linear-gradient(135deg, #B33A3A, #8A1F1F); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); position: relative; flex: none; }
.lg-title-ic::after { content: "A"; position: absolute; inset: 0; color: #fff; font: bold 10px/16px Arial, sans-serif; text-align: center; }
.lg-title-t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-title-ctl { display: flex; align-self: stretch; }
.lg-title-ctl span { width: 28px; display: grid; place-items: center; font: 11px "Segoe UI", sans-serif; color: #2B3F5C; }
.lg-title-ctl .lg-x { width: 40px; background: linear-gradient(#E9A79B, #C7432F 50%, #B7301C 51%, #D2735F); color: #fff; border-left: 1px solid #A3B9D8; }
.lg-scroll { overflow: hidden; background: #ABABAB; }
.lg-client { position: relative; }
.lg-form { position: relative; background-color: #fff; background-repeat: no-repeat; background-position: center top; }
.lg-form.lg-has-pic .lg-sec { background: transparent !important; }

/* barra di navigazione record */
.lg-nav { height: 20px; display: flex; align-items: center; gap: 2px; padding: 0 4px; background: linear-gradient(#F6F9FC, #E3EAF3); border-top: 1px solid #A3B9D8; font: 8pt "Segoe UI", Tahoma, sans-serif; color: #2B3F5C; white-space: nowrap; overflow: hidden; }
.lg-nav-l { margin-right: 4px; }
.lg-nav-b { width: 16px; text-align: center; font-size: 7px; color: #3C5A85; }
.lg-nav-n { min-width: 48px; padding: 0 4px; margin: 0 2px; background: #fff; border: 1px solid #A3B9D8; height: 14px; line-height: 13px; }
.lg-nav-f { margin-left: 10px; padding-left: 14px; position: relative; color: #888; }
.lg-nav-f::before { content: ""; position: absolute; left: 2px; top: 3px; border: 4px solid transparent; border-top: 6px solid #999; }
.lg-nav-s { margin-left: 8px; width: 80px; height: 14px; background: #fff; border: 1px solid #A3B9D8; color: #999; padding-left: 3px; line-height: 13px; }

/* ---------- sezioni e controlli ---------- */
.lg-sec { position: relative; overflow: hidden; background: #fff; }
.lg-sec-header, .lg-sec-pageHeader { border-bottom: 1px solid rgba(0,0,0,.08); }
.lg-sec.lg-repeat { border-top: 0; }
.lg-c { position: absolute; box-sizing: border-box; margin: 0; overflow: hidden; }
.lg-label { padding: 1px 2px 0; white-space: pre-wrap; line-height: 1.15; }
.lg-label.lg-one { white-space: pre; overflow: visible; }
.lg-text { padding: 1px 3px 0 3px; white-space: nowrap; line-height: 1.2; }
.lg-val { display: block; overflow: hidden; text-overflow: clip; }
.lg-val.lg-multi { white-space: pre-wrap; }
.lg-val.lg-design { color: #8C8C8C; font-weight: 400; font-style: normal; }
.lg-combo { padding-right: 16px; }
.lg-drop { position: absolute; right: 0; top: 0; bottom: 0; width: 14px; background: linear-gradient(#FCFCFC, #E6E6E6); border-left: 1px solid #C6C6C6; }
.lg-drop::after { content: ""; position: absolute; left: 3px; top: 50%; margin-top: -2px; border: 4px solid transparent; border-top: 4px solid #444; border-bottom: 0; }

.lg-list { background: #fff; padding: 1px; }
.lg-rows { position: relative; }
.lg-row { height: 14px; line-height: 14px; padding: 0 2px; white-space: nowrap; overflow: hidden; }
.lg-row-empty { display: flex; }
.lg-row-empty .lg-cell { flex: none; height: 14px; border-right: 1px dotted #E1E1E1; }
.lg-list-src { position: absolute; left: 3px; right: 3px; top: 2px; color: #8C8C8C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }

.lg-btn {
  display: flex; align-items: center; justify-content: center; padding: 1px 2px; cursor: pointer; text-align: center;
  background: linear-gradient(#F6F6F6, #EBEBEB 48%, #DDDDDD 52%, #CFCFCF); border: 1px solid #707070; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); line-height: 1.1;
}
.lg-btn:hover { background: linear-gradient(#EAF6FD, #D9F0FC 48%, #BEE6FD 52%, #A7D9F5); border-color: #3C7FB1; }
.lg-btn:active { background: linear-gradient(#E5F4FC, #C4E5F6 48%, #98D1EF 52%, #6DB7DF); border-color: #2C628B; }
.lg-btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.lg-btn-cap { white-space: pre-wrap; overflow: hidden; max-height: 100%; }
.lg-btn-img { max-width: calc(100% - 4px); max-height: calc(100% - 4px); object-fit: contain; image-rendering: auto; pointer-events: none; }
.lg-btn-ph { font-size: 7pt; color: #4A4A4A; white-space: pre-wrap; overflow: hidden; max-height: 100%; }
.lg-btn-noimg .lg-btn-ph { border: 1px dashed #A8A8A8; border-radius: 2px; padding: 1px 2px; background: rgba(255,255,255,.5); }

.lg-chkwrap { display: flex; align-items: center; justify-content: flex-start; cursor: pointer; overflow: visible; }
.lg-chk, .lg-opt { display: inline-block; width: 13px; height: 13px; flex: none; background: linear-gradient(135deg, #DCDCDC, #FFFFFF); border: 1px solid #8E8F8F; box-sizing: border-box; position: relative; margin-left: 1px; }
.lg-opt { border-radius: 50%; }
.lg-chk.on::after { content: ""; position: absolute; left: 3px; top: 0; width: 4px; height: 8px; border: solid #1F3D6B; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.lg-opt.on::after { content: ""; position: absolute; left: 3px; top: 3px; width: 5px; height: 5px; border-radius: 50%; background: #1F3D6B; }

.lg-group, .lg-rect { pointer-events: none; }
.lg-line { overflow: visible; pointer-events: none; }
.lg-line svg { display: block; overflow: visible; }
.lg-img { display: flex; align-items: center; justify-content: center; }
.lg-img img { width: 100%; height: 100%; display: block; }
.lg-img-ph { font-size: 7pt; color: #7A7A7A; padding: 2px; text-align: center; word-break: break-all; border: 1px dashed #B5B5B5; background: repeating-linear-gradient(45deg, rgba(0,0,0,.03) 0 6px, transparent 6px 12px); width: 100%; height: 100%; display: grid; place-items: center; }
.lg-obj { border: 1px solid #A0A0A0; background: #F7F7F7; color: #8C8C8C; display: grid; place-items: center; font-size: 7pt; }

/* effetti speciali Access */
.lg-sunken { border: 0; box-shadow: inset 1px 1px 0 #A0A0A0, inset 2px 2px 0 #696969, inset -1px -1px 0 #FFFFFF, inset -2px -2px 0 #E3E3E3; padding-left: 4px; padding-top: 2px; }
.lg-raised { border: 0; box-shadow: inset 1px 1px 0 #FFFFFF, inset -1px -1px 0 #696969, inset -2px -2px 0 #A0A0A0; }
.lg-etched { border: 1px solid #A0A0A0; box-shadow: 1px 1px 0 #FFFFFF, inset 1px 1px 0 #FFFFFF; }
.lg-chiseled { border-bottom: 2px groove #D4D4D4; }

/* sottomaschere */
.lg-sub { background: transparent; overflow: auto; scrollbar-width: thin; }
.lg-sub > .lg-embedded { min-width: 100%; }
.lg-sub-ph { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #F4F4F4 0 8px, #EDEDED 8px 16px); color: #6B6B6B; border: 1px solid #A0A0A0; font-size: 8pt; }
.lg-embedded .lg-form { background-color: #fff; }

/* datasheet */
.lg-ds { background: #fff; font: 8pt Calibri, "Segoe UI", Tahoma, sans-serif; }
.lg-ds-t { border-collapse: collapse; table-layout: fixed; }
.lg-ds-t th, .lg-ds-t td { border: 1px solid #C0C0C0; height: 17px; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; font-weight: 400; }
.lg-ds-t th { background: linear-gradient(#FFFFFF, #E9EEF5); color: #1E395B; border-color: #9EB6CE; }
.lg-ds-t .lg-ds-sel { width: 14px; padding: 0; background: linear-gradient(90deg, #F2F5F9, #E0E7F0); border-color: #9EB6CE; text-align: center; color: #555; }
.lg-ds-t tr:nth-child(even) td:not(.lg-ds-sel) { background: #F7F7F7; }

/* struttura a schede */
.lg-tab { overflow: visible; pointer-events: none; }
.lg-tabstrip { position: absolute; display: flex; z-index: 2; align-items: flex-end; gap: 0; padding-left: 2px; pointer-events: auto; }
.lg-tabbtn {
  font: inherit; color: #1E395B; height: calc(100% - 2px); padding: 0 9px; margin-right: -1px; cursor: pointer; white-space: nowrap;
  background: linear-gradient(#FBFCFE, #E7EDF6); border: 1px solid #A3B9D8; border-bottom: 0; border-radius: 3px 3px 0 0; position: relative;
}
.lg-tabbtn:hover { background: linear-gradient(#FFFFFF, #DDEBFA); }
.lg-tabbtn[aria-selected="true"] { height: 100%; background: #fff; z-index: 1; margin-bottom: -1px; color: #000; }
.lg-tabbody { position: absolute; left: 0; right: 0; bottom: 0; border: 1px solid #A3B9D8; background: transparent; }
.lg-pagelayer { position: absolute; inset: 0; pointer-events: none; }
.lg-pagelayer > * { pointer-events: auto; }
.lg-pagelayer > .lg-group, .lg-pagelayer > .lg-rect, .lg-pagelayer > .lg-line { pointer-events: none; }
.lg-pagelayer[hidden] { display: none; }
