/* ============================================================================
 * Around the House — Responsive PWA Stylesheet + Thermal QR Print Layout
 * ============================================================================ */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --indigo-950: #1e1b4b;
  --indigo-900: #312e81;
  --indigo-800: #3730a3;
  --indigo-700: #4338ca;
  --indigo-600: #4f46e5;
  --indigo-100: #e0e7ff;
  --accent: #facc15;
  --accent-text: #1e1b4b;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #15803d;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.container {
  width: 100%;
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--indigo-900);
  color: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
  padding: 12px 0 10px;
}

.header-inner { display: flex; flex-direction: column; gap: 10px; }

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-icon { border-radius: 8px; flex-shrink: 0; }
.brand-title { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.brand-subtitle { margin: 0; font-size: 0.75rem; color: #c7d2fe; }

.view-toggle {
  display: inline-flex;
  background: var(--indigo-800);
  padding: 3px;
  border-radius: 9px;
}

.view-btn {
  border: 0;
  background: transparent;
  color: #c7d2fe;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
}
.view-btn.active { background: #fff; color: var(--indigo-900); box-shadow: var(--shadow-sm); }

.search-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  max-width: 420px;
}

.search-wrap { position: relative; flex: 1; }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #a5b4fc;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid var(--indigo-700);
  background: var(--indigo-800);
  color: #fff;
  font-size: 0.875rem;
}
.search-input::placeholder { color: #a5b4fc; }
.search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.icon-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--indigo-700);
  background: var(--indigo-800);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-pill-btn:hover { background: var(--danger); border-color: var(--danger); }

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.edit-banner-actions { display: flex; align-items: center; gap: 14px; }
.toggle-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.btn-link-light {
  border: 0;
  background: transparent;
  color: #fde68a;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.8rem;
}

/* Filter Pill Bars */
.filter-bars { display: flex; flex-direction: column; gap: 6px; }
.pill-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.pill-bar::-webkit-scrollbar { display: none; }

.pill-btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  background: var(--indigo-800);
  color: #c7d2fe;
  transition: background 0.15s, color 0.15s;
}
.pill-btn:hover { color: #fff; }
.pill-btn.active { background: var(--accent); color: var(--accent-text); }
.pill-btn.loc-pill.active { background: #38bdf8; color: #082f49; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { filter: brightness(0.95); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; min-height: 34px; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; min-height: 28px; }

.btn-primary { background: var(--indigo-600); color: #fff; }
.btn-secondary { background: var(--surface-subtle); color: var(--text); border-color: var(--border); }
.site-header .btn-secondary { background: var(--indigo-800); color: #fff; border-color: var(--indigo-700); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.btn-danger { background: var(--danger); color: #fff; }

/* --- Main Inventory Grid / List --- */
.main-content { padding: 20px 16px 40px; min-height: 65vh; }

.state-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--indigo-600);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (min-width: 768px) {
  .bin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
@media (min-width: 1080px) {
  .bin-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
}

.bin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto;
}

.bin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.bin-card:hover { box-shadow: var(--shadow-md); }

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e2e8f0;
  overflow: hidden;
  cursor: zoom-in;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
}
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
@media (hover: hover) {
  .carousel-btn { opacity: 0; transition: opacity 0.15s; }
  .bin-card:hover .carousel-btn, .bin-card:focus-within .carousel-btn { opacity: 1; }
}

.counter-pill {
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.card-media .counter-pill { position: absolute; left: 8px; bottom: 8px; }

.loc-chip-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { font-weight: 800; font-size: 0.92rem; color: var(--text); line-height: 1.25; }
.slug-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.loc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 999px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-btn {
  border: 0;
  background: var(--indigo-100);
  color: var(--indigo-700);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.tag-btn:hover { background: #c7d2fe; }

.card-notes {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-edit-row {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--surface-subtle);
  display: flex;
  gap: 6px;
}

/* List View Item */
.bin-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.bin-list-thumb {
  width: 84px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
  position: relative;
}
.bin-list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bin-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Native <dialog> Modals + Modern Overscroll Containment --- */
dialog.modal {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(96vw, 540px);
  width: 100%;
  max-height: 92dvh;
  overflow: visible;
}
dialog.wide-modal { max-width: min(96vw, 720px); }
dialog.xwide-modal { max-width: min(96vw, 1040px); }

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(3px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 1.15rem; }
.modal-sub { margin: 3px 0 0; font-size: 0.8rem; color: var(--text-muted); }

.modal-close-btn {
  border: 0;
  background: var(--surface-subtle);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-close-btn:hover { background: var(--border); }

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer, .bin-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}
.spacer { flex: 1; }

/* --- Lightbox Dialog --- */
dialog.lightbox-modal {
  max-width: 100vw;
  max-height: 100dvh;
  width: 100vw;
  height: 100dvh;
  margin: 0;
}
dialog.lightbox-modal::backdrop { background: rgba(2, 6, 23, 0.94); }

.lightbox-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.85);
}
.lightbox-title { margin: 0; font-size: 1.05rem; }
.lightbox-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.lightbox-header-actions { display: flex; align-items: center; gap: 8px; }
.lightbox-header .modal-close-btn { background: rgba(255, 255, 255, 0.14); color: #fff; }

.lightbox-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 54px;
}
.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 68dvh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-empty { padding: 40px; color: #94a3b8; font-size: 0.95rem; }
.lightbox-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  max-width: 680px;
}
.lightbox-notes { margin: 0; font-size: 0.85rem; color: #cbd5e1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }

/* --- Forms + Modern After-Interaction Validation --- */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  gap: 6px;
}
.tab-btn {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.tab-btn.active { color: var(--indigo-600); border-bottom-color: var(--indigo-600); }

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.hint { font-size: 0.76rem; color: var(--text-muted); }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.field :is(input, select, textarea):focus {
  outline: 2px solid var(--indigo-600);
  outline-offset: 1px;
}

.error-msg {
  display: none;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Validate only after user interaction (:user-invalid + JS fallback class) */
:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}
:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) + .error-msg,
.password-wrap:has(:is(input):is(:user-invalid, .user-invalid-fallback)) + .error-msg,
.slug-row:has(:is(input):is(:user-invalid, .user-invalid-fallback)) + .error-msg {
  display: block;
}
:is(input, select, textarea):is(:user-valid, .user-valid-fallback) {
  border-color: var(--success);
}

.form-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.84rem;
  font-weight: 600;
}

.password-wrap, .slug-row, .location-row, .new-loc-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.new-loc-wrap { margin-top: 6px; }

.toggle-pw-btn {
  border: 1px solid #cbd5e1;
  background: var(--surface-subtle);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.chip-suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.chip-suggest-btn {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  cursor: pointer;
}
.chip-suggest-btn:hover { background: var(--indigo-100); color: var(--indigo-700); }

/* --- Photo Manager --- */
.photo-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.photo-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.photo-section-head h3 { margin: 0; font-size: 0.95rem; }
.upload-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.upload-progress { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-muted); }
.progress-track { flex: 1; height: 8px; background: var(--surface-subtle); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--indigo-600); transition: width 0.15s; }

.photo-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}
.photo-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
}
.photo-tile.is-cover { border-color: var(--indigo-600); box-shadow: 0 0 0 2px var(--indigo-100); }
.photo-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-tile-actions {
  display: flex;
  justify-content: space-between;
  padding: 6px;
  gap: 4px;
  background: #fff;
}
.tile-btn {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.tile-btn.cover-active { background: var(--accent); border-color: #eab308; color: var(--accent-text); }
.tile-btn.del-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* --- Bulk QR Label Printer --- */
.qr-printer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 820px) {
  .qr-printer-layout { grid-template-columns: 330px 1fr; }
}
.qr-controls-col { display: flex; flex-direction: column; gap: 16px; }
.qr-section { display: flex; flex-direction: column; gap: 8px; }
.qr-section h3, .qr-preview-head h3 { margin: 0; font-size: 0.92rem; }
.qr-section-head, .qr-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.qr-select-btns { display: flex; gap: 4px; }

.qr-checklist {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qr-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
}
.qr-check-row:hover { background: var(--surface-subtle); }

.custom-size-row { display: grid; grid-template-columns: 1fr 1fr 78px; gap: 8px; }
.qr-tip {
  margin: 4px 0 0;
  font-size: 0.76rem;
  color: var(--indigo-900);
  background: var(--indigo-100);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.qr-preview-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qr-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 240px;
  align-content: flex-start;
}

/* Sticker Card (Shared by Preview & Print) */
.qr-sticker {
  background: #fff;
  border: 1px dashed #94a3b8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #000;
  overflow: hidden;
  box-sizing: border-box;
}
.qr-sticker.layout-stacked { flex-direction: column; text-align: center; gap: 3px; }
.qr-sticker.layout-side { flex-direction: row; text-align: left; gap: 6px; padding: 4px 6px; }
.qr-sticker-code { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-sticker-code svg { display: block; width: 100%; height: 100%; }
.qr-sticker-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.12; overflow: hidden; }
.qr-sticker-slug { font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; font-size: 11px; }
.qr-sticker-title { font-weight: 600; font-size: 9px; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Users Admin List --- */
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.user-row-controls { display: flex; align-items: center; gap: 8px; }
.create-user-box {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.create-user-box h3 { margin: 0; font-size: 0.92rem; }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--indigo-950);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

/* --- Print Styles (Thermal Roll & Letter Sticker Sheet) --- */
#print-area { display: none; }

@media print {
  #app-shell, dialog, .toast { display: none !important; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  #print-area { display: block !important; }
  .qr-sticker {
    border: 0 !important;
    border-radius: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .print-mode-thermal .qr-sticker {
    page-break-after: always;
    break-after: page;
  }
  .print-mode-thermal .qr-sticker:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .print-mode-sheet {
    display: grid !important;
    grid-template-columns: repeat(3, 2.625in);
    column-gap: 0.125in;
    row-gap: 0;
    padding: 0.5in 0.1875in;
  }
  .print-mode-sheet .qr-sticker {
    width: 2.625in;
    height: 1in;
  }
}
