/* ============================================================
   components3.css — UI kit batch 3 (gestionale-specific).
   ============================================================ */

/* Accordion */
.ui-acc { display: flex; flex-direction: column; gap: 8px; }
.ui-acc-item { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.ui-acc-head { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--ink); }
.ui-acc-ic { color: var(--accent); font-size: 14px; }
.ui-acc-title { flex: 1; }
.ui-acc-meta { font-size: 12px; color: var(--meta); font-weight: 600; }
.ui-acc-caret { color: var(--meta); font-size: 12px; transition: transform .2s; }
.ui-acc-item.open .ui-acc-caret { transform: rotate(180deg); }
.ui-acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s var(--ease); }
.ui-acc-item.open .ui-acc-body { grid-template-rows: 1fr; }
.ui-acc-inner { overflow: hidden; }
.ui-acc-item.open .ui-acc-inner { padding: 0 16px 16px; }
.ui-acc-inner { font-size: 13.5px; color: var(--body); line-height: 1.6; }

/* FilterChips */
.ui-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.ui-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-deep); font-size: 12.5px; font-weight: 700; }
.ui-chip-k { opacity: .65; font-weight: 600; }
.ui-chip-x { width: 18px; height: 18px; border: 0; background: rgba(0,0,0,.08); color: inherit; border-radius: 50%; cursor: pointer; font-size: 9px; display: grid; place-items: center; }
.ui-chip-x:hover { background: rgba(0,0,0,.2); }
.ui-chip-clear { height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--meta); font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ui-chip-clear:hover { color: var(--danger); }

/* Timeline */
.ui-timeline { display: flex; flex-direction: column; }
.ui-tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.ui-tl-item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--divider); }
.ui-tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; z-index: 1; }
.ui-tl-dot.ok { background: var(--success-bg); color: var(--success); }
.ui-tl-dot.info { background: var(--accent-soft); color: var(--accent-deep); }
.ui-tl-dot.warn { background: var(--warning-bg); color: var(--warning); }
.ui-tl-dot.danger { background: var(--danger-bg); color: var(--danger); }
.ui-tl-body { padding-top: 5px; }
.ui-tl-text { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.ui-tl-time { font-size: 12px; color: var(--meta); margin-top: 2px; }

/* StatCard */
.ui-statcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--sh-sm); }
.ui-statcard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ui-statcard-ic { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 16px; }
.ui-statcard-delta { font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--r-pill); }
.ui-statcard-delta.up { color: #15803d; background: var(--success-bg); }
.ui-statcard-delta.down { color: #b91c1c; background: var(--danger-bg); }
.ui-statcard-val { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.ui-statcard-lbl { font-size: 13px; color: var(--meta); font-weight: 600; margin-top: 6px; }
.ui-statcard-spark { margin-top: 10px; margin-left: -2px; }

/* WeekCalendar */
.ui-week { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.ui-week-head { display: grid; grid-template-columns: 54px repeat(7, 1fr); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ui-week-gutter { border-right: 1px solid var(--line); }
.ui-week-dow { text-align: center; padding: 9px 0; font-size: 12px; font-weight: 700; color: var(--body); border-right: 1px solid var(--divider); }
.ui-week-dow:last-child { border-right: 0; }
.ui-week-grid { display: grid; grid-template-columns: 54px repeat(7, 1fr); max-height: 360px; overflow-y: auto; position: relative; }
.ui-week-hours { border-right: 1px solid var(--line); }
.ui-week-hour { height: 48px; font-size: 10.5px; color: var(--label); font-weight: 600; text-align: right; padding: 2px 6px 0 0; }
.ui-week-col { position: relative; border-right: 1px solid var(--divider); }
.ui-week-col:last-child { border-right: 0; }
.ui-week-slot { height: 48px; border-bottom: 1px solid var(--divider); cursor: pointer; transition: background .1s; }
.ui-week-slot:hover { background: var(--accent-tint); }
.ui-week-ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 4px 7px; color: #fff; overflow: hidden; box-shadow: var(--sh-xs); }
.ui-week-ev b { font-size: 11px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-week-ev span { font-size: 10px; opacity: .9; }

/* Tree */
.ui-tree { display: flex; flex-direction: column; gap: 1px; }
.ui-tree-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600; color: var(--body); }
.ui-tree-row:hover { background: var(--surface-sunken); }
.ui-tree-row.sel { background: var(--accent-tint); color: var(--accent-deep); }
.ui-tree-caret { font-size: 10px; color: var(--meta); width: 12px; transition: transform .15s; }
.ui-tree-row.open .ui-tree-caret { transform: rotate(90deg); }
.ui-tree-caret-sp { width: 12px; }
.ui-tree-ic { color: var(--accent); font-size: 13px; width: 16px; }
.ui-tree-label { flex: 1; }
.ui-tree-count { font-size: 11px; font-weight: 700; color: var(--meta); background: var(--surface-sunken); border-radius: var(--r-pill); padding: 1px 8px; }
.ui-tree-children { display: none; }
.ui-tree-children.open { display: block; }

/* CommandPalette */
.ui-cmd-scrim { position: fixed; inset: 0; z-index: 300; background: rgba(15,23,42,.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; justify-content: center; padding-top: 12vh; animation: fadeIn .14s; }
.ui-cmd { width: min(560px, 92vw); height: max-content; max-height: 60vh; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-pop); overflow: hidden; display: flex; flex-direction: column; }
.ui-cmd-search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ui-cmd-search > i { color: var(--meta); font-size: 16px; }
.ui-cmd-search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink); }
.ui-cmd-search kbd { font-size: 11px; font-weight: 700; color: var(--meta); background: var(--surface-sunken); border-radius: 5px; padding: 3px 7px; border: 1px solid var(--line); }
.ui-cmd-list { overflow-y: auto; padding: 8px; }
.ui-cmd-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 11px 13px; border-radius: var(--r-sm); font-size: 14px; color: var(--body); font-weight: 600; }
.ui-cmd-item i { width: 18px; color: var(--meta); }
.ui-cmd-item.active { background: var(--accent-soft); color: var(--accent-deep); }
.ui-cmd-item.active i { color: var(--accent-deep); }
.ui-cmd-label { flex: 1; }
.ui-cmd-group { font-size: 11px; font-weight: 700; color: var(--label); text-transform: uppercase; letter-spacing: .05em; }
.ui-cmd-empty { padding: 24px; text-align: center; color: var(--meta); font-size: 14px; }

/* CopyField */
.ui-copy { display: flex; align-items: center; gap: 10px; background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 8px 8px 12px; }
.ui-copy-lbl { font-size: 11px; font-weight: 700; color: var(--label); text-transform: uppercase; letter-spacing: .05em; }
.ui-copy-val { flex: 1; font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-x: auto; white-space: nowrap; }
.ui-copy-val.nomono { font-family: inherit; font-weight: 600; }
.ui-copy-btn { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); cursor: pointer; color: var(--body); flex-shrink: 0; transition: color .12s; }
.ui-copy-btn:hover { color: var(--accent); }
.ui-copy-btn.ok { color: var(--success); border-color: #bbf7d0; background: var(--success-bg); }

/* RangeSlider */
.ui-rslider { position: relative; height: 54px; padding-top: 8px; }
.ui-rslider-track { position: absolute; top: 14px; left: 0; right: 0; height: 6px; border-radius: 4px; background: var(--surface-sunken); }
.ui-rslider-fill { position: absolute; height: 100%; border-radius: 4px; background: var(--accent); }
.ui-rslider input[type=range] { position: absolute; top: 6px; left: 0; width: 100%; height: 20px; -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none; margin: 0; }
.ui-rslider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: pointer; box-shadow: var(--sh-sm); }
.ui-rslider input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: pointer; }
.ui-rslider-out { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 800; color: var(--ink); }

/* QtyUnit */
.ui-qtyunit { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-sunken); border-radius: var(--r-pill); padding: 4px; }
.ui-qtyunit-btn { width: 32px; height: 32px; border: 0; background: var(--surface); border-radius: 50%; cursor: pointer; color: var(--body); font-size: 11px; box-shadow: var(--sh-xs); }
.ui-qtyunit-btn:hover { color: var(--accent); }
.ui-qtyunit-input { width: 52px; border: 0; background: transparent; text-align: center; font-weight: 800; font-size: 15px; color: var(--ink); outline: none; }
.ui-qtyunit-unit { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; background: var(--surface); border-radius: var(--r-pill); cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent); box-shadow: var(--sh-xs); }
.ui-qtyunit-unit > i { font-size: 9px; color: var(--meta); }
.ui-qtyunit-pop { min-width: 70px; }

/* NotificationCenter */
.ui-notif { position: relative; display: inline-block; }
.ui-notif-bell { position: relative; }
.ui-notif-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.ui-notif-pop { left: auto; right: 0; width: 320px; padding: 0; }
.ui-notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ui-notif-head b { font-size: 14px; color: var(--ink); }
.ui-notif-read { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.ui-notif-list { max-height: 320px; overflow-y: auto; }
.ui-notif-item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--divider); }
.ui-notif-item.unread { background: var(--accent-tint); }
.ui-notif-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.ui-notif-ic.info { background: var(--accent-soft); color: var(--accent-deep); }
.ui-notif-ic.ok { background: var(--success-bg); color: var(--success); }
.ui-notif-ic.warn { background: var(--warning-bg); color: var(--warning); }
.ui-notif-ic.danger { background: var(--danger-bg); color: var(--danger); }
.ui-notif-text { font-size: 13px; color: var(--ink); font-weight: 600; line-height: 1.4; }
.ui-notif-time { font-size: 11.5px; color: var(--meta); margin-top: 2px; }

/* Gauge */
.ui-gauge { position: relative; text-align: center; }
.ui-gauge-val { font-size: 26px; font-weight: 800; color: var(--ink); margin-top: -16px; }
.ui-gauge-lbl { font-size: 12.5px; color: var(--meta); font-weight: 600; margin-top: 2px; }
