/* V7.6.1 usability: spreadsheet legacy import, stacked customer file, keyboard spatial navigation, storage visibility */
:where(button,a[href],input,select,textarea,[tabindex]:not([tabindex="-1"])):focus{
  outline:3px solid color-mix(in srgb,var(--primary-2,#2d8174) 72%,#fff)!important;
  outline-offset:2px!important;
}
.main-nav button:focus{background:rgba(255,255,255,.2)!important;color:#fff!important;box-shadow:inset 0 0 0 2px rgba(255,255,255,.5)}

.v20-legacy-help{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;margin:0 0 12px;padding:11px 13px;border:1px solid var(--line);border-radius:13px;background:var(--surface-3)}
.v20-legacy-help p{margin:0;line-height:1.8;color:var(--muted)}
.v20-sheet-panel{padding:0;overflow:hidden}
.v20-sheet-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:13px 14px;border-bottom:1px solid var(--line);background:var(--surface)}
.v20-sheet-toolbar .row-actions{margin-inline-start:auto}
.v20-sheet-scroll{overflow:auto;max-width:100%;max-height:min(68vh,720px);direction:rtl;overscroll-behavior:contain;background:var(--surface)}
.v20-sheet-grid{min-width:2280px;direction:rtl}
.v20-sheet-head,.v20-sheet-row{display:grid;grid-template-columns:54px 190px 176px 135px 145px 130px 130px 170px 145px 135px 135px 125px 116px 215px 52px;align-items:stretch}
.v20-sheet-head{position:sticky;top:0;z-index:8;background:#eef5f3;border-bottom:2px solid var(--line);font-weight:900;font-size:12px}
.v20-sheet-head>*{padding:9px 7px;border-inline-start:1px solid var(--line);display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.5}
.v20-sheet-row{border-bottom:1px solid var(--line);background:var(--surface)}
.v20-sheet-row:nth-child(even){background:color-mix(in srgb,var(--surface) 94%,var(--primary-soft,#e6f4f1))}
.v20-sheet-row>div{position:relative;padding:4px;border-inline-start:1px solid var(--line);min-width:0;display:flex;align-items:center}
.v20-sheet-row>input,.v20-sheet-row>select{width:calc(100% - 8px);margin:4px;align-self:center}
.v20-sheet-row input,.v20-sheet-row select,.v20-sheet-row textarea{border-radius:7px;padding:8px 7px;min-height:38px;font-size:12px;background:#fff}
.v20-sheet-row textarea{height:38px;min-height:38px;resize:vertical}
.v20-row-no{justify-content:center!important;font-weight:900;color:var(--muted);background:color-mix(in srgb,var(--surface-2) 84%,transparent)}
.v20-sheet-row>[data-f="phone"]{border-color:#86b89c!important;background:#f2fbf5!important;box-shadow:inset 0 0 0 1px #b9ddc7}
.v20-sheet-row .icon-btn{width:36px;height:36px;border-radius:8px;margin:auto}
.v20-find-cell{position:relative!important;display:block!important}
.v20-person-results{position:absolute;z-index:30;top:44px;right:4px;width:300px;max-height:260px;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);display:none}
.v20-person-results:not(:empty){display:block}
.v20-person-option{width:100%;border:0;border-bottom:1px solid var(--line);background:#fff;padding:8px 10px;text-align:right;display:grid;gap:2px}
.v20-person-option:hover,.v20-person-option:focus{background:var(--primary-soft)}
.v20-person-option small{color:var(--muted)}
.v20-sheet-footer{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:13px;border-top:1px solid var(--line);background:var(--surface-3)}

.v20-anchor-tabs{position:sticky;top:88px;z-index:20;background:color-mix(in srgb,var(--surface,#fff) 96%,transparent);backdrop-filter:blur(10px);padding-block:8px;border-bottom:1px solid var(--line);margin-bottom:14px}
.v20-profile-stack{display:grid;gap:14px}
.v20-profile-section{scroll-margin-top:160px}
.v20-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.v20-section-title h3{margin:0}
.v20-section-title p{margin:3px 0 0;color:var(--muted);font-size:12px}
.v20-history-note,.v20-contract-purpose,.v20-ops-help{margin:0 0 14px;padding:11px 13px;border:1px solid var(--line);border-radius:13px;background:var(--surface-3);line-height:1.8;color:var(--muted)}
.v20-contract-purpose strong,.v20-ops-help strong{color:var(--text)}

.v20-storage-panel{margin-top:14px}
.v20-storage-intro{margin:0 0 13px;color:var(--muted);line-height:1.8}
.v20-path-grid{display:grid;gap:9px}
.v20-path-grid>div{display:grid;grid-template-columns:150px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 10px;border:1px solid var(--line);border-radius:11px;background:var(--surface-3)}
.v20-path-grid>div>span{font-size:12px;font-weight:900}
.v20-path-grid>div code{direction:ltr;text-align:left;white-space:normal;overflow-wrap:anywhere;background:#fff;border:1px solid var(--line);border-radius:8px;padding:7px 9px;font-size:11px}
.v20-storage-stats{display:flex;gap:8px;flex-wrap:wrap;margin-top:11px}
.v20-storage-stats span{padding:6px 9px;border-radius:999px;background:var(--primary-soft);font-size:11px;font-weight:800}

@media(max-width:900px){
  .v20-anchor-tabs{top:70px}
  .v20-path-grid>div{grid-template-columns:1fr}
  .v20-path-grid>div code{text-align:right;direction:ltr}
}
@media(max-width:680px){
  .v20-sheet-scroll{max-height:62vh}
  .v20-sheet-toolbar{align-items:stretch}
  .v20-sheet-toolbar>.row-actions{width:100%}
  .v20-sheet-toolbar .btn{flex:1}
  .v20-anchor-tabs{position:relative;top:auto}
  .v20-profile-section{scroll-margin-top:88px}
}

/* V7.6.2 legacy ledger autocomplete + inline validation */
.v20-sheet-grid{min-width:2100px}
.v20-sheet-head,.v20-sheet-row{grid-template-columns:54px 190px 138px 148px 132px 132px 176px 148px 136px 136px 126px 116px 215px 52px}
.v21-auto-cell{position:relative!important;padding:4px!important;display:flex!important;align-items:center;min-width:0}
.v21-auto-cell>input{width:100%;margin:0!important}
.v21-auto-results{top:46px!important;right:4px!important;left:auto;width:min(360px,78vw)!important;z-index:80!important}
.v21-auto-option em{font-style:normal;font-size:10px;color:var(--muted);justify-self:start}
.v21-invalid{border-color:#c62828!important;background:#fff4f4!important;box-shadow:0 0 0 2px rgba(198,40,40,.08)!important}
.v21-field-error{position:absolute;z-index:5;bottom:-17px;right:5px;color:#b3261e;background:#fff;padding:0 3px;border-radius:3px;font-size:9px;white-space:nowrap}
.v21-field-error:empty{display:none}
.v20-sheet-row:has(.v21-field-error:not(:empty)){margin-bottom:18px}
.v21-add-row-under{display:flex;justify-content:center;position:sticky;right:0;width:100%;min-width:2100px;padding:12px;border-top:1px dashed var(--line);background:var(--surface-3)}
.v21-add-row-under .btn{min-width:220px}
@media(max-width:760px){.v21-auto-results{width:min(330px,86vw)!important}.v21-add-row-under{justify-content:flex-start;padding-inline:16px}}
.v21-auto-cell>[data-f="phone"]{border-color:#86b89c!important;background:#f2fbf5!important;box-shadow:inset 0 0 0 1px #b9ddc7}
