/* =========================================================
   App stylesheet entry point. Loaded by Layouts::ApplicationLayout
   via stylesheet_link_tag "app".

   Imports the design system (ls/tokens + ls/components).

   Use url() syntax so Propshaft rewrites these to fingerprinted
   paths — bare `@import "x.css"` is NOT rewritten and 404s.
   ========================================================= */

@import url("/assets/ls/tokens-f39e0ad8.css");
@import url("/assets/ls/components-7fc09d3b.css");

/* Page-level scaffolding. */
html, body { margin: 0; padding: 0; background: var(--paper); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  color: var(--ink);
}
main { padding-bottom: 8px; }

/* Display utilities. */
.d-contents { display: contents; }
.d-none { display: none; }
.hidden { display: none; }

/* Force [hidden] to win against component-level display:flex rules.
   Without this, .sheet-scrim's display:flex (and inline styles) keep
   "hidden" elements visible. */
[hidden] { display: none !important; }

/* Element resets inside the app shell. */
.ls-app h1 { text-transform: none; font-size: inherit; }
.ls-app p { margin: 0; }

/* List items: stack of rows in a rounded card. */
.ls-show__items {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* .ls-item is the sortable wrapper around each row — keep it as a real
   box (not display:contents) so stimulus-sortable can drag it. */
.ls-item { display: block; }
.ls-item .row form { margin: 0; }
.ls-row__form { flex: 1; margin: 0; }
.ls-row__form .input--inline { padding: 0; height: auto; min-height: 0; background: transparent; border: none; }
.ls-show__items img { max-width: 100%; height: auto; display: block; }

/* Quick-add bar — standalone pill above the items card. */
.ls-item:has(.ls-quickadd) { display: block; }
.ls-quickadd {
  display: block;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.ls-quickadd__pill {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
}
.ls-quickadd__plus { color: var(--accent); display: inline-flex; }
.ls-quickadd__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  color: var(--ink);
}
.ls-quickadd__input::placeholder { color: var(--ink-faint); }
.ls-quickadd .iconbtn--accent {
  background: var(--accent);
  color: white;
}
.ls-quickadd .iconbtn--accent:hover { background: var(--accent); opacity: 0.92; }

/* ---- Bulk-select mode ----
   While the wrapper has .is-selecting, the items grid behaves like a
   selection surface: child controls are inert and rows accept taps as
   selection toggles. The floating bar sticks to the bottom with the
   selected count and a destructive action. */
.is-selecting .ls-show__items .ls-item > * { pointer-events: none; }
.is-selecting .ls-item { cursor: pointer; transition: background 120ms ease; }
.is-selecting .ls-item.is-selected { background: var(--status-danger-soft); }
.is-selecting .ls-item.is-selected .row__title,
.is-selecting .ls-item.is-selected .row__sub {
  color: var(--status-danger);
}
.is-selecting .row__handle { opacity: 0.25; }

.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md, 0 6px 24px rgba(0,0,0,0.15));
  min-width: 280px;
  max-width: calc(100vw - 32px);
}
.bulk-bar__count {
  flex: 1;
  font-weight: 600;
  color: var(--ink);
  font-size: var(--text-md);
}
.bulk-bar__btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  color: var(--ink-muted);
}
.bulk-bar__btn--danger { color: var(--status-danger); font-weight: 600; }
.bulk-bar__btn:disabled { opacity: 0.4; cursor: not-allowed; }
