*,
*::before,
*::after {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.pos-cart {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
}

.pos-catalog {
  padding: 0;
  border: none;
}

.pos-product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: .75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-subtle);
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button--status-success,
.button--status-warning,
.button--status-danger,
.button--status-info {
  border-color: currentColor;
}

.button--status-success { color: var(--status-success); }
.button--status-warning { color: var(--status-warning); }
.button--status-danger { color: var(--status-danger); }
.button--status-info { color: var(--status-info); }

.button--quiet:hover,
.button--quiet:focus-visible {
  background: var(--surface-raised);
}

.field {
  display: grid;
  gap: .35rem;
}

.field__label {
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
}

.field__control {
  width: 100%;
  min-height: 38px;
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-subtle);
}



select.field__control {
  appearance: none;
  padding-right: 2.75rem !important;
  background-image: var(--select-chevron) !important;
  background-position: right .75rem center !important;
  background-size: 16px 16px !important;
  background-repeat: no-repeat !important;
}

textarea.field__control {
  min-height: 88px;
  resize: vertical;
}

.field__control::placeholder {
  color: var(--text-muted);
  opacity: .7;
}

.permission-notice {
  margin: 0 0 .85rem;
  color: var(--status-danger);
  font-weight: 650;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
}

.data-table th {
  /*position: sticky;*/
  top: 0;
  background: var(--surface);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 1;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
 /* background: var(--surface-raised); */
}

.dialog-host[hidden] {
  display: none;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: auto;
  background: rgb(0 0 0 / .35);
  z-index: 100;
}

.dialog {
  width: min(100%, 520px);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-hover);
}

.dialog > footer,
.dialog form > footer {
  position: sticky;
  bottom: -1.25rem;
  margin: 1.25rem  -1.25rem -1.25rem;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: .15rem .5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 10%, transparent);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill--success { color: var(--status-success); }
.status-pill--warning { color: var(--status-warning); }
.status-pill--danger { color: var(--status-danger); }
.status-pill--info { color: var(--status-info); }

.toolbar--filters {
  flex-wrap: nowrap;
}

.toolbar--filters .field__control {
  flex: 0 1 180px;
  min-width: 0;
}

.toolbar--filters input[type="search"] {
  flex: 1 1 280px;
}

@media (max-width: 760px) {
  .toolbar--filters { flex-wrap: wrap; }
}
