/* locto-ui v1.1.2 components. Load after locto-tokens.css. */
/* locto-ui.css: shared components for every Locto internal app.
   Loads after tokens.css. Class prefix: lt-. No values here that tokens.json owns. */

.lt, .lt * { box-sizing: border-box; }
.lt { font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.lt :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* zero specificity, so component classes (nav, bar, switcher) always win */
:where(.lt a) { color: var(--brand-strong); text-decoration: none; }
:where(.lt a:hover) { text-decoration: underline; }
.lt-icon { width: 16px; height: 16px; stroke-width: 2; flex: none; }

/* ---------- Global bar (identical in every app) ---------- */
.lt-bar { height: var(--bar-height); background: var(--bar); color: var(--on-bar); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); position: sticky; top: 0; z-index: 30; }
.lt-bar :focus-visible { outline-color: var(--on-bar); }
.lt-bar-brand { display: flex; align-items: center; gap: var(--space-3); color: var(--on-bar); text-decoration: none; }
.lt-bar-brand img { height: 26px; width: auto; display: block; }
.lt-bar-app { font-size: 15px; font-weight: 600; padding-left: var(--space-3); border-left: 1px solid rgba(255,255,255,0.35); line-height: 22px; }
.lt-bar-search { margin: 0 auto; flex: 0 1 440px; height: 32px; display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); border-radius: var(--radius-pill); background: rgba(255,255,255,0.16); color: var(--on-bar); border: 0; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.lt-bar-search:hover { background: rgba(255,255,255,0.24); }
.lt-bar-search kbd { margin-left: auto; font: 500 11px var(--font-sans); padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,0.2); }
.lt-bar-actions { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.lt-bar-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm); background: transparent; border: 0; color: var(--on-bar); cursor: pointer; position: relative; }
.lt-bar-btn:hover { background: rgba(255,255,255,0.16); }
.lt-bar-btn .lt-count { position: absolute; top: 2px; right: 0; }
.lt-avatar { width: 30px; height: 30px; border-radius: var(--radius-pill); display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface); color: var(--brand-strong); flex: none; }

/* ---------- App switcher ---------- */
.lt-switcher { width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: var(--space-3); color: var(--ink); }
.lt-switcher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1); }
.lt-switcher-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--space-3) var(--space-2); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.lt-switcher-app:hover { background: var(--surface-2); text-decoration: none; }
.lt-switcher-app[aria-current="true"] { background: var(--brand-soft); color: var(--brand-strong); }
.lt-switcher-tile { width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.lt-switcher-app[aria-current="true"] .lt-switcher-tile { background: var(--brand); color: var(--on-brand); }
.lt-switcher-foot { border-top: 1px solid var(--line); margin-top: var(--space-2); padding-top: var(--space-2); font-size: 13px; color: var(--ink-3); display: flex; justify-content: space-between; }

/* ---------- Shell: sidebar + main ---------- */
.lt-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: calc(100vh - var(--bar-height)); }
.lt-side { background: var(--surface); border-right: 1px solid var(--line); padding: var(--space-3) var(--space-2); display: flex; flex-direction: column; gap: 2px; }
.lt-side-group { font: 600 12px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: var(--space-4) var(--space-3) var(--space-1); }
.lt-nav { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; position: relative; }
.lt-nav:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.lt-nav[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.lt-nav[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--hl); }
.lt-nav .lt-count { margin-left: auto; }
.lt-main { min-width: 0; padding: var(--space-5); }
.lt-main-inner { max-width: var(--content-max); }
@media (min-width: 1800px) { .lt-main-inner { max-width: 1760px; } }

/* Page header */
.lt-page-head { display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.lt-page-head h1 { font-size: 22px; line-height: 28px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
.lt-crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 2px; }
.lt-page-meta { font-size: 13px; color: var(--ink-3); }
.lt-page-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }

/* ---------- Buttons ---------- */
.lt-btn { height: var(--control-height); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 14px/1 var(--font-sans); cursor: pointer; white-space: nowrap; }
.lt-btn:hover { border-color: var(--brand); color: var(--brand-strong); }
.lt-btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.lt-btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.lt-btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.lt-btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.lt-btn-danger { color: var(--bad); border-color: var(--line-strong); }
.lt-btn-danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.lt-btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #ffffff; font-weight: 600; }
.lt-btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.lt-btn-icon { width: var(--control-height); padding: 0; }
.lt-btn[disabled], .lt-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.lt-btn[aria-busy="true"] { pointer-events: none; }
.lt-btn[aria-busy="true"] .lt-spin { display: inline-block; }

/* ---------- Fields ---------- */
.lt-field { display: grid; gap: 6px; }
.lt-field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.lt-field-label .lt-req { color: var(--ink-3); font-weight: 400; }
.lt-input, .lt-select, .lt-textarea { width: 100%; height: var(--control-height); padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 14px var(--font-sans); }
.lt-textarea { height: auto; min-height: 84px; padding: 8px 10px; line-height: 20px; resize: vertical; }
.lt-input::placeholder, .lt-textarea::placeholder { color: var(--ink-3); }
.lt-input:focus, .lt-select:focus, .lt-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lt-input[aria-invalid="true"], .lt-select[aria-invalid="true"], .lt-textarea[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.lt-field-hint { font-size: 13px; color: var(--ink-3); }
.lt-field-error { font-size: 13px; color: var(--bad); display: flex; gap: var(--space-1); align-items: center; }
.lt-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.lt-search { position: relative; }
.lt-search .lt-icon { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.lt-search .lt-input { padding-left: 32px; }

/* Segmented + tabs */
.lt-seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.lt-seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); font: 500 13px var(--font-sans); cursor: pointer; }
.lt-seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.lt-tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--line); }
.lt-tab { padding: 10px 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font: 500 14px var(--font-sans); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.lt-tab:hover { color: var(--ink); }
.lt-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--hl); }
.lt-tab .lt-n { font-size: 12px; color: var(--ink-3); background: var(--surface-2); border-radius: var(--radius-pill); padding: 0 7px; }

/* ---------- Pills, counts, chips ---------- */
.lt-pill { --c: var(--slate); --g: var(--slate-soft); display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--radius-pill); background: var(--g); color: var(--c); font: 500 12px/16px var(--font-sans); white-space: nowrap; }
.lt-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lt-pill.no-dot::before { display: none; }
.lt-pill-brand { --c: var(--brand-strong); --g: var(--brand-soft); }
.lt-pill-hl { --c: var(--hl-strong); --g: var(--hl-soft); }
.lt-pill-ok { --c: var(--ok); --g: var(--ok-soft); }
.lt-pill-warn { --c: var(--warn); --g: var(--warn-soft); }
.lt-pill-bad { --c: var(--bad); --g: var(--bad-soft); }
.lt-pill-violet { --c: var(--violet); --g: var(--violet-soft); }
.lt-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--hl); color: #ffffff; font: 700 11px/18px var(--font-sans); text-align: center; }
.lt-count.muted { background: var(--slate-soft); color: var(--ink-2); font-weight: 600; }
.lt-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 12px; }

/* ---------- Cards, KPI tiles ---------- */
.lt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.lt-card-head { display: flex; align-items: center; gap: var(--space-2); padding: 14px var(--space-4); border-bottom: 1px solid var(--line); }
.lt-card-head h2 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0; }
.lt-card-head .lt-page-actions { margin-left: auto; }
.lt-card-body { padding: var(--space-4); }
.lt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }
.lt-tile { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px var(--space-4); display: grid; gap: 4px; font: inherit; color: var(--ink); cursor: pointer; }
.lt-tile:hover { border-color: var(--line-strong); }
.lt-tile[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lt-tile-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.lt-tile-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--slate)); }
.lt-tile-value { font-size: 28px; line-height: 32px; font-weight: 650; letter-spacing: -0.01em; }
.lt-tile-value.attn { color: var(--hl-strong); }
.lt-tile-delta { font-size: 13px; color: var(--ink-3); }
.lt-tile[data-zero="true"] .lt-tile-value { color: var(--ink-3); }

/* ---------- Table ---------- */
.lt-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: auto; }
.lt-toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; padding: var(--space-3); border-bottom: 1px solid var(--line); }
.lt-toolbar .lt-search { flex: 1 1 240px; max-width: 360px; }
.lt-toolbar-meta { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.lt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lt-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font: 600 12px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px var(--space-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.lt-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.lt-table th[aria-sort="ascending"], .lt-table th[aria-sort="descending"] { color: var(--ink); }
.lt-table td { padding: 10px var(--space-3); border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.lt-table td.key { color: var(--ink); font-weight: 500; }
.lt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.lt-table tbody tr:last-child td { border-bottom: 0; }
.lt-table tbody tr[data-href], .lt-table tbody tr.click { cursor: pointer; }
.lt-table tbody tr:hover td { background: var(--surface-2); }
.lt-table tbody tr[aria-selected="true"] td { background: var(--brand-soft); }
.lt-table tr.attn td:first-child { box-shadow: inset 3px 0 0 var(--hl); }
.lt-table-foot { display: flex; align-items: center; gap: var(--space-2); padding: 10px var(--space-3); border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.lt-table-foot .lt-page-actions { margin-left: auto; }
@media (max-width: 700px) {
  .lt-table.cards thead { display: none; }
  .lt-table.cards, .lt-table.cards tbody, .lt-table.cards tr, .lt-table.cards td { display: block; }
  .lt-table.cards tr { padding: var(--space-3); border-bottom: 1px solid var(--line); }
  .lt-table.cards td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: var(--space-3); }
  .lt-table.cards td::before { content: attr(data-label); font: 600 12px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .lt-table.cards td.key::before { display: none; }
}

/* ---------- Overlays ---------- */
.lt-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
.lt-dialog { width: min(var(--dialog-width), calc(100vw - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); padding: 0; overflow: hidden; }
.lt-dialog::backdrop { background: var(--scrim); }
.lt-dialog-wide { width: min(880px, calc(100vw - 32px)); }
.lt-dialog-head { padding: 18px var(--space-5) 0; display: flex; gap: var(--space-3); align-items: flex-start; }
.lt-dialog-head h2 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0; }
.lt-dialog-body { padding: var(--space-3) var(--space-5) var(--space-5); color: var(--ink-2); display: grid; gap: var(--space-3); }
.lt-dialog-foot { padding: var(--space-3) var(--space-5); background: var(--surface-2); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--space-2); }
.lt-dialog-icon { width: 36px; height: 36px; border-radius: var(--radius-pill); display: grid; place-items: center; flex: none; background: var(--bad-soft); color: var(--bad); }
.lt-consequences { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.lt-drawer { width: min(var(--drawer-width), 100vw); height: 100%; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-overlay); display: grid; grid-template-rows: auto auto 1fr auto; color: var(--ink); }
.lt-drawer-head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); display: flex; gap: var(--space-3); align-items: flex-start; }
.lt-drawer-head h2 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0 0 4px; }
.lt-drawer-head .lt-btn-icon { margin-left: auto; }
.lt-drawer-tabs { padding: 0 var(--space-5); }
.lt-drawer-body { padding: var(--space-5); overflow: auto; display: grid; gap: var(--space-4); align-content: start; }
.lt-drawer-foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: var(--space-2); align-items: center; }
.lt-drawer-foot .lt-save-state { margin-right: auto; font-size: 13px; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.lt-kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px var(--space-4); margin: 0; font-size: 14px; }
.lt-kv dt { color: var(--ink-3); }
.lt-kv dd { margin: 0; color: var(--ink); }
@media (max-width: 700px) { .lt-dialog, .lt-dialog-wide, .lt-drawer { width: 100vw; border-radius: 0; } }

/* Toasts */
.lt-toasts { display: grid; gap: var(--space-2); justify-items: center; }
.lt-toast { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; max-width: 520px; padding: 8px 8px 8px 14px; border-radius: var(--radius-md); background: var(--toast-bg); color: var(--toast-fg); box-shadow: var(--shadow-overlay); font-size: 13px; }
.lt-toast .lt-icon { color: var(--toast-ok); }
.lt-toast.error .lt-icon { color: var(--toast-bad); }
.lt-toast-undo { margin-left: var(--space-2); background: transparent; border: 0; color: inherit; font: 600 13px var(--font-sans); text-decoration: underline; cursor: pointer; padding: 4px 6px; }

/* Alerts / banners */
.lt-alert { --c: var(--brand-strong); --g: var(--brand-soft); display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--g); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); }
.lt-alert > .lt-icon { color: var(--c); margin-top: 2px; }
.lt-alert strong { display: block; font-weight: 600; }
.lt-alert .lt-alert-action { margin-left: auto; }
.lt-alert-warn { --c: var(--warn); --g: var(--warn-soft); }
.lt-alert-bad { --c: var(--bad); --g: var(--bad-soft); }
.lt-alert-ok { --c: var(--ok); --g: var(--ok-soft); }

/* States */
.lt-empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-7) var(--space-4); text-align: center; color: var(--ink-2); }
.lt-empty-icon { width: 44px; height: 44px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); }
.lt-empty h3 { margin: 0; font-size: 16px; color: var(--ink); font-weight: 600; }
.lt-empty p { margin: 0; max-width: 46ch; }
.lt-skel { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: lt-shimmer 1.4s ease-in-out infinite; }
.lt-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: lt-rot .7s linear infinite; }
.lt-sync { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.lt-sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.lt-sync.stale::before { background: var(--warn); }
.lt-sync.failed::before { background: var(--bad); }
@keyframes lt-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes lt-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lt-skel, .lt-spin { animation: none; } }

/* Command palette */
.lt-palette { width: min(620px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); overflow: hidden; color: var(--ink); }
.lt-palette-input { display: flex; gap: 10px; align-items: center; padding: 14px var(--space-4); border-bottom: 1px solid var(--line); }
.lt-palette-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: 16px var(--font-sans); }
.lt-palette-group { font: 600 12px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px var(--space-4) 4px; }
.lt-palette-item { display: flex; gap: 10px; align-items: center; padding: 8px var(--space-4); font-size: 14px; color: var(--ink); }
.lt-palette-item .lt-icon { color: var(--ink-3); }
.lt-palette-item .lt-where { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.lt-palette-item[aria-selected="true"] { background: var(--brand-soft); }
.lt-palette-item[aria-selected="true"] .lt-icon { color: var(--brand-strong); }
.lt-palette-foot { display: flex; gap: var(--space-4); padding: 8px var(--space-4); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: var(--surface-2); }
.lt-kbd { font: 500 11px var(--font-sans); padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--ink-2); background: var(--surface); }

/* Menus */
.lt-menu { min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); padding: 6px; color: var(--ink); }
.lt-menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.lt-menu-head b { display: block; font-weight: 600; }
.lt-menu-head span { font-size: 13px; color: var(--ink-3); }
.lt-menu-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: 14px var(--font-sans); text-align: left; cursor: pointer; }
.lt-menu-item:hover { background: var(--surface-2); }
.lt-menu-item .lt-icon { color: var(--ink-3); }
.lt-menu-item .lt-trail { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.lt-menu-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- Responsive shell ---------- */
@media (max-width: 900px) {
  .lt-shell { grid-template-columns: minmax(0, 1fr); }
  .lt-side { position: fixed; inset: var(--bar-height) auto 0 0; width: min(var(--sidebar-width), 85vw); transform: translateX(-100%); transition: transform .2s; z-index: 35; }
  .lt-side[data-open="true"] { transform: none; box-shadow: var(--shadow-overlay); }
  .lt-bar-search span { display: none; }
  .lt-bar-search { flex: 0 0 34px; padding: 0; justify-content: center; background: transparent; }
  .lt-bar-search kbd { display: none; }
  .lt-main { padding: var(--space-4); }
}
@media (pointer: coarse) { .lt-btn, .lt-input, .lt-select { height: 40px; } .lt-input, .lt-select, .lt-textarea { font-size: 16px; } }

/* lucide icons rendered from <i data-lucide> */
.lt svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex: none; }

/* ---------- Runtime pieces created by locto-ui.js ---------- */
locto-bar { display: block; position: sticky; top: 0; z-index: 30; }
.lt-bar { font-family: var(--font-sans); font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px)); }
.lt-wordmark { height: 24px; width: auto; display: block; color: var(--on-bar); }
.lt-bar-menu { display: none; }
.lt-bar-search span { flex: 1; }
.lt-pop { position: fixed; z-index: 70; background: transparent; }
.lt-pop .lt-switcher, .lt-pop .lt-menu { font-family: var(--font-sans); font-size: 14px; }
.lt-linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-strong); cursor: pointer; }
.lt-linklike:hover { text-decoration: underline; }
.lt-palette-wrap { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; font-family: var(--font-sans); }
.lt-palette-list { max-height: min(60vh, 480px); overflow: auto; padding-bottom: 6px; }
.lt-palette-item { cursor: pointer; }
.lt-palette-text { display: grid; min-width: 0; }
.lt-palette-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-palette-text small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-palette-empty { padding: 16px; color: var(--ink-3); font-size: 14px; }
.lt-toasts.lt-fixed { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(24px, env(safe-area-inset-bottom, 0px)); z-index: 90; background: transparent; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.lt-toast { pointer-events: auto; font-family: var(--font-sans); }
.lt-toast-close { background: transparent; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 4px; border-radius: 4px; display: grid; place-items: center; }
.lt-toast-close:hover { opacity: 1; }
dialog.lt-dialog { margin: auto; font-family: var(--font-sans); font-size: 14px; line-height: 20px; }
dialog.lt-dialog[open] { animation: lt-pop-in .14s ease-out; }
@keyframes lt-pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .lt-bar-menu { display: grid; } }
@media (prefers-reduced-motion: reduce) { dialog.lt-dialog[open] { animation: none; } }
.lt-palette-input input:focus-visible { outline: none; }
/* toast host as a manual popover: undo the UA popover box */
.lt-toasts.lt-fixed[popover] { margin: 0; padding: 0; border: 0; inset: auto; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); overflow: visible; }
.lt-toasts.lt-fixed[popover]:not(:popover-open) { display: none; }
/* Phones: keep the app name on one line; feedback stays in the user menu */
.lt-bar-app { white-space: nowrap; }
@media (max-width: 480px) {
  .lt-bar { gap: var(--space-2); }
  .lt-bar-feedback { display: none; }
}
/* Narrow alerts put their action under the text */
@media (max-width: 600px) {
  .lt-alert { flex-wrap: wrap; }
  .lt-alert > div { flex: 1 1 200px; min-width: 0; }
  .lt-alert .lt-alert-action { margin-left: 0; }
}

/* =========================================================================================
   Shell 1.1: no top bar (the old CRM layout, shared).
   Desktop: the sidebar is full height. <locto-side-head> (logo, app, switcher, search) is pinned
   at its top and <locto-side-foot> (you, theme, feedback, sign out) at its bottom.
   Phones (≤900px): <locto-bar> draws a slim white row (menu, logo, search); the sidebar is a drawer.
   ========================================================================================= */
@media (min-width: 901px) { :root { --bar-height: 0px; } locto-bar { display: none; } }
.lt-wordmark { color: var(--bar); } /* Locto Blue #298398 in both themes: blue on white, blue on near-black */
.lt-bar { height: var(--bar-height); background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); gap: var(--space-2); }
.lt-bar :focus-visible { outline-color: var(--focus); }
.lt-bar-btn { color: var(--ink-2); }
.lt-bar-btn:hover { background: var(--surface-2); color: var(--ink); }
.lt-bar-menu { display: grid; }
.lt-bar .lt-wordmark { height: 28px; }
.lt-bar-app { border-left: 0; padding-left: 0; font: 600 11px/1 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); align-self: flex-end; padding-bottom: 5px; }
.lt-bar-brand { align-items: flex-end; gap: 8px; }
.lt-bar-actions { margin-left: auto; }

.lt-shell { min-height: calc(100vh - var(--bar-height)); }
.lt-side { padding-top: 0; padding-bottom: 0; overflow-y: auto; }
@media (min-width: 901px) { .lt-side { position: sticky; top: 0; height: 100vh; } }
locto-side-head { display: block; order: -1; position: sticky; top: 0; z-index: 2; background: var(--surface); margin: 0 calc(-1 * var(--space-2)); padding: var(--space-4) var(--space-3) var(--space-2); }
locto-side-foot { display: block; order: 99; position: sticky; bottom: 0; z-index: 2; background: var(--surface); margin: auto calc(-1 * var(--space-2)) 0; padding: var(--space-2); border-top: 1px solid var(--line); }
.lt-sh-row { display: flex; align-items: center; gap: var(--space-2); padding: 0 2px var(--space-3); }
.lt-sh-brand { display: flex; align-items: flex-end; gap: 8px; min-width: 0; text-decoration: none; }
.lt-sh-brand:hover { text-decoration: none; }
.lt-sh-brand .lt-wordmark { height: 34px; }
.lt-sh-app { font: 600 11px/1 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 6px; white-space: nowrap; }
.lt-sh-icon { width: 32px; height: 32px; flex: none; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.lt-sh-icon:hover, .lt-sh-icon[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.lt-sh-apps { margin-left: auto; }
.lt-sh-search { width: 100%; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); font: 13px var(--font-sans); cursor: pointer; text-align: left; }
.lt-sh-search:hover { border-color: var(--line-strong); color: var(--ink-2); }
.lt-sh-search span { flex: 1; }
.lt-sh-search kbd { font: 500 11px var(--font-sans); padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink-3); }
.lt-sf { display: flex; align-items: center; gap: 4px; }
.lt-sf-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.lt-sf-user:hover, .lt-sf-user[aria-expanded="true"] { background: var(--surface-2); }
.lt-sf-user .lt-avatar { background: var(--brand-soft); color: var(--brand-strong); }
.lt-sf-who { min-width: 0; display: grid; }
.lt-sf-who b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-sf-who small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  locto-side-head { display: none; }
  .lt-side { padding-top: var(--space-3); }
}
