.login-brand-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-brand-card__logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 88px;
  object-fit: contain;
}

.login-partner-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-partner-card__logo {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
  margin: 0 0 14px 0;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-card input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
}

.primary-btn {
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent-600);
  color: var(--accent-contrast);
  cursor: pointer;
}

.page-shell {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.lists-page {
  display: grid;
  gap: 12px;
}

.lists-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lists-page__header h1 {
  margin: 0;
}

.lists-page__filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 10px;
}

.lists-page__search-input,
.lists-page__filter-select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
  font: inherit;
  color: #111827;
  background: #fff;
}

.lists-page__search-input:focus,
.lists-page__filter-select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.lists-items {
  --lists-masonry-gap: 10px;
  column-gap: var(--lists-masonry-gap);
  column-count: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.lists-infinite-status {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 0.85rem;
}

.lists-infinite-sentinel {
  height: 1px;
  width: 100%;
}

.list-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  min-height: 44px;
  display: grid;
  align-items: start;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 var(--lists-masonry-gap);
  overflow: hidden;
}

.list-card > * {
  min-width: 0;
}

.list-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.list-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.list-card--protected {
  border-color: color-mix(in srgb, var(--accent-600) 26%, #d1d5db);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent-600) 8%, #ffffff) 0%,
      color-mix(in srgb, var(--accent-700) 5%, #ffffff) 100%
    );
}

.list-card--protected:hover {
  border-color: color-mix(in srgb, var(--accent-600) 38%, #94a3b8);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent-600) 12%, #ffffff) 0%,
      color-mix(in srgb, var(--accent-700) 8%, #ffffff) 100%
    );
}

.list-card__title {
  font-weight: 600;
  color: #334155;
  text-align: left;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card__title .search-hit {
  font-weight: 600;
}

.list-card__protected-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent-700) 74%, #334155);
  background: color-mix(in srgb, var(--accent-600) 14%, transparent);
}

.list-card__protected-info i {
  font-size: 0.78rem;
  line-height: 1;
}

/* List protected-row help — mirrors tile preview tooltip popovers */
.list-info-popover {
  position: fixed;
  z-index: 2300;
  max-width: var(--popover-max-width);
  pointer-events: none;
}

.list-info-popover__panel {
  position: relative;
  min-width: var(--popover-min-width);
  padding: var(--popover-padding);
  border-radius: var(--popover-radius);
  background: var(--popover-bg);
  color: var(--popover-text);
  font-size: var(--popover-font-size);
  line-height: var(--popover-line-height);
  white-space: pre-wrap;
  font-weight: var(--popover-font-weight);
  box-shadow: var(--popover-shadow);
}

.list-info-popover__panel::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  top: -6px;
  left: var(--list-info-arrow-x, 50%);
  transform: translateX(-50%) rotate(45deg);
  background: var(--popover-bg);
}

.list-info-popover--place-above .list-info-popover__panel::before {
  top: auto;
  bottom: -6px;
}

.list-card__match-preview {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.8rem;
  line-height: 1.35;
  min-width: 0;
  padding: 2px 0 0;
}

.list-card__match-preview-label {
  flex-shrink: 0;
  font-weight: 700;
  color: #64748b;
}

.list-card__match-preview-text {
  min-width: 0;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card__usage-chip mark.search-hit {
  font-weight: 600;
}

.list-card__meta {
  color: #64748b;
  font-size: 0.85rem;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card__usage {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  color: #64748b;
  font-size: 0.82rem;
  text-align: left;
  min-width: 0;
  max-width: 100%;
}

.list-card__usage-label {
  font-weight: 700;
  color: #475569;
}

.list-card__usage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.list-card__usage-chip,
.list-card__usage-more {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 100%;
  box-sizing: border-box;
}

.list-card__usage-chip {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shared app modals (Lists, stock, dossiers, etc.) — tile_creator.html also relies on these via base layout */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.app-modal[hidden] {
  display: none;
}

.app-modal__backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: rgba(7, 12, 28, 0.16);
  background-image:
    radial-gradient(circle at 14% 18%, color-mix(in srgb, var(--accent-600) 26%, transparent) 0%, transparent 34%),
    radial-gradient(circle at 84% 20%, color-mix(in srgb, var(--accent-700) 20%, transparent) 0%, transparent 32%),
    radial-gradient(circle at 76% 84%, color-mix(in srgb, var(--accent-600) 16%, transparent) 0%, transparent 34%),
    radial-gradient(circle at 22% 82%, color-mix(in srgb, var(--accent-700) 16%, transparent) 0%, transparent 32%);
  backdrop-filter: blur(12px) saturate(1.13);
  -webkit-backdrop-filter: blur(12px) saturate(1.13);
  opacity: 0;
  animation: app-modal-fade-in 180ms ease forwards;
}

.app-modal__backdrop::before,
.app-modal__backdrop::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.42;
  pointer-events: none;
}

.app-modal__backdrop::before {
  width: min(38vw, 500px);
  height: min(38vw, 500px);
  left: -7%;
  top: -12%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--accent-600) 70%, transparent) 0%, transparent 72%);
  box-shadow:
    420px 70px 0 0 color-mix(in srgb, var(--accent-700) 28%, transparent),
    620px 260px 0 6px color-mix(in srgb, var(--accent-600) 20%, transparent),
    300px 420px 0 0 color-mix(in srgb, var(--accent-700) 22%, transparent);
  animation: modal-orb-float-a 11s ease-in-out infinite alternate;
}

.app-modal__backdrop::after {
  width: min(34vw, 420px);
  height: min(34vw, 420px);
  right: -6%;
  bottom: -10%;
  background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--accent-700) 62%, transparent) 0%, transparent 74%);
  box-shadow:
    -340px -70px 0 0 color-mix(in srgb, var(--accent-600) 26%, transparent),
    -500px -240px 0 0 color-mix(in srgb, var(--accent-700) 22%, transparent),
    -240px -360px 0 8px color-mix(in srgb, var(--accent-600) 18%, transparent);
  animation: modal-orb-float-b 13s ease-in-out infinite alternate;
}

.app-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 360px);
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: app-modal-pop-in 220ms ease forwards;
}

.app-modal__dialog h3 {
  margin: 0;
}

.app-modal__field {
  font-size: 0.9rem;
  font-weight: 600;
}

.app-modal__dialog input,
.app-modal__dialog select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
}

.app-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app-modal__btn {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.app-modal__btn-primary {
  background: var(--accent-600);
  color: var(--accent-contrast);
}

.app-modal__btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.app-modal__btn-danger {
  background: #dc2626;
  color: #fff;
}

@keyframes app-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes app-modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-orb-float-a {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(34px, 22px, 0) scale(1.08);
  }
}

@keyframes modal-orb-float-b {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-28px, -20px, 0) scale(1.1);
  }
}

/* Shared slate action button (stock pages, list options modal, tile creator) */
.tile-border-reset-btn {
  border: none;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: #64748b;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}

.tile-border-reset-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.app-modal__dialog.list-options-modal__dialog {
  width: min(94vw, 900px);
  max-height: 90dvh;
  height: auto;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  overflow: hidden;
}

.list-options-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-options-modal__header h3 {
  margin: 0;
}

.list-options-rows {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  align-content: start;
  grid-auto-rows: auto;
  padding: 2px 2px 4px;
}

.list-options-modal__footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.list-options-modal__footer .tile-border-reset-btn {
  align-self: flex-start;
}

.list-options-modal__footer .app-modal__actions {
  align-self: flex-end;
}

.list-options-modal__footer .app-modal__btn {
  min-height: 40px;
  height: 40px;
  min-width: 89px;
  padding: 0 12px;
  line-height: 1;
}

@media (max-width: 760px) {
  .list-options-modal__footer {
    align-items: stretch;
  }

  .list-options-modal__footer .tile-border-reset-btn {
    width: 100%;
    align-self: stretch;
  }

  .list-options-modal__footer .app-modal__actions {
    width: 100%;
    align-self: stretch;
  }

  .list-options-modal__footer .app-modal__btn {
    flex: 1;
  }
}

.list-option-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px auto auto auto;
  gap: 8px;
  align-items: center;
}

.list-option-row--with-color {
  grid-template-columns: minmax(180px, 1fr) 180px 92px auto auto auto;
}

.list-option-row--header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
}

.list-option-header-cell {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.list-option-row--header .list-option-header-cell:nth-child(n + 3) {
  text-align: center;
}

.list-option-color-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  cursor: pointer;
}

.list-option-move-btn,
.list-option-remove-btn {
  border: none;
  border-radius: 8px;
  min-height: 40px;
  width: 40px;
  padding: 0;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.list-option-move-btn {
  background: #e2e8f0;
  color: #334155;
}

.list-option-move-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.list-empty {
  color: #64748b;
  font-size: 0.92rem;
}


@media (max-width: 700px) {
  .lists-page__filters {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .lists-items {
    column-count: 2;
  }
}

@media (min-width: 1100px) {
  .lists-items {
    column-count: 3;
  }
}

@media (min-width: 1500px) {
  .lists-items {
    column-count: 4;
  }
}

body.has-open-modal {
  overflow: hidden;
}

