/* SK Inventory — custom layer on top of Tailwind */

:root { color-scheme: light; }
html.dark { color-scheme: dark; }

/* Smooth theme switch (but not on transform-heavy elements) */
body, aside, header, .card, button, a, input, select, textarea {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

/* Slim scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(120,120,135,.35) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(120,120,135,.30); border-radius: 9999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(120,120,135,.55); background-clip: content-box; }

/* Visible keyboard focus everywhere */
:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; border-radius: 6px; }

/* Card base used across pages */
.card {
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  background: #fff;
}
html.dark .card { border-color: #2e2e34; background: #1a1a1a; }

/* Form controls — pill / rounded, no harsh borders */
.field {
  width: 100%;
  border-radius: .75rem;
  border: 1px solid rgb(226 232 240);
  background: #fff;
  padding: .625rem .875rem;
  font-size: .875rem;
  color: rgb(15 23 42);
}
.field::placeholder { color: rgb(148 163 184); }
.field:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
html.dark .field { background: #202024; border-color: #2e2e34; color: rgb(226 232 240); }
html.dark .field::placeholder { color: rgb(100 116 139); }

select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.25rem; }

/* Buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; border-radius:9999px; font-weight:600; font-size:.875rem; padding:.625rem 1.1rem; transition: background-color .15s ease, color .15s ease, opacity .15s; cursor:pointer; }
.btn-primary { background:#4f46e5; color:#fff; }
.btn-primary:hover { background:#4338ca; }
.btn-ghost { background:transparent; color:rgb(71 85 105); }
.btn-ghost:hover { background:rgb(241 245 249); }
html.dark .btn-ghost { color:rgb(148 163 184); }
html.dark .btn-ghost:hover { background:#26262b; }
.btn-danger { background:rgba(244,63,94,.12); color:#f43f5e; }
.btn-danger:hover { background:rgba(244,63,94,.2); }
.btn:disabled { opacity:.5; cursor:not-allowed; }

/* Hide number input spinners */
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

/* Modal */
.modal-enter { animation: fadeUp .25s ease-out both; }
@keyframes fadeUp { from { opacity:0; transform: translateY(10px) scale(.98); } to { opacity:1; transform:none; } }

/* Scanner viewport tweaks */
#scanner-region video { border-radius: 1rem; object-fit: cover; }
#scanner-region img { display:none; }

[x-cloak] { display:none !important; }

/* Form label */
.lbl { display:block; font-size:.8rem; font-weight:600; color:rgb(71 85 105); margin-bottom:.4rem; }
html.dark .lbl { color:rgb(148 163 184); }

/* Square icon button (table row actions, modal close) */
.btn-icon { display:inline-grid; place-items:center; width:2.25rem; height:2.25rem; border-radius:9999px; color:rgb(100 116 139); transition: background-color .15s, color .15s; cursor:pointer; }
.btn-icon:hover { background:rgb(241 245 249); color:rgb(51 65 85); }
html.dark .btn-icon { color:rgb(148 163 184); }
html.dark .btn-icon:hover { background:#26262b; color:rgb(226 232 240); }

/* ---- Scanner viewport (responsive, cross-platform) ---- */
.scanner-viewport {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 60vh;
  min-height: 240px;
  position: relative;
}
.scanner-viewport video,
.scanner-viewport canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}
#reader { border: 0; }
#reader img { margin: 0 auto; }        /* html5-qrcode shutter/scan-region icons */
#reader__dashboard_section_csr button { border-radius: 9999px !important; }

/* ---- pagination + tab-navigation helpers ---- */
.f-hide, .p-hide { display: none !important; }

.sk-sh {
  background: linear-gradient(100deg, rgba(148,163,184,.12) 40%, rgba(148,163,184,.24) 50%, rgba(148,163,184,.12) 60%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.1s linear infinite;
}
.dark .sk-sh {
  background: linear-gradient(100deg, rgba(51,65,85,.45) 40%, rgba(71,85,105,.55) 50%, rgba(51,65,85,.45) 60%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.1s linear infinite;
}
@keyframes sk-shimmer { to { background-position: -200% 0; } }

/* keep search inputs clean (no native ✕) */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
