/* CHANGE LOG
 * -----------------------------------------------------------------------------
 * SEQ | AUTHOR | DESCRIPTION
 * -----------------------------------------------------------------------------
 * 1 | maintainer@emeraldcoastsystemsgroup.com | Styles for the native `/cockpit/?screen=lists` Lists view: opaque
 *   theme-token cards, two-pane desktop layout (`>= 900px`), single-pane phone layout (`< 900px`) with `‹ Lists` back
 *   navigation, `>= 44px` touch targets, zero horizontal overflow, and staged Amazon cart link receipt styling.
 */

.lists-workbench {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto;
}

.lists-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.lists-sidebar-header,
.lists-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lists-heading {
  font-size: 20px;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.lists-subheading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 8px 0 4px;
}

.lists-muted {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.lists-back-btn {
  display: none;
}

.lists-create-form,
.lists-add-form,
.lists-rename-form,
.lists-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.lists-input {
  flex: 1 1 160px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.lists-input-narrow {
  flex: 0 1 120px;
}

.lists-input:focus-visible,
.lists-btn:focus-visible,
.lists-nav-item:focus-visible,
.lists-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.lists-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.lists-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.lists-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lists-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
  font-weight: 600;
}

.lists-btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.lists-btn-danger {
  color: var(--status-error);
}

.lists-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.lists-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.lists-nav-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.lists-nav-item.is-active {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  font-weight: 600;
}

.lists-nav-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lists-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.lists-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lists-banner,
.lists-dialog,
.lists-staged-cart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.lists-banner-error {
  border-color: var(--status-error);
  color: var(--status-error);
}

.lists-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lists-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.lists-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 200px;
  min-width: 0;
}

.lists-check-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 18px;
  flex-shrink: 0;
}

.lists-item-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lists-item-title {
  font-size: 15px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.lists-item-row.is-done .lists-item-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.lists-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.lists-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.lists-cart-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lists-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.lists-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.lists-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

@media (max-width: 899px) {
  .lists-workbench {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    gap: 10px;
  }

  .lists-workbench[data-mobile-pane="detail"] .lists-sidebar {
    display: none;
  }

  .lists-workbench[data-mobile-pane="master"] .lists-detail {
    display: none;
  }

  .lists-back-btn {
    display: inline-flex;
  }
}
