* {
  box-sizing: border-box;
}
:root {
  font:
    15px/1.5 system-ui,
    sans-serif;
  color: #182b36;
  background: #f2f6f7;
  --muted: #506571;
  --line: #d7e1e5;
  --brand: #07695e;
}
body {
  margin: 0;
  min-height: 100vh;
}
h1,
h2,
h3,
p {
  margin: 0 0 0.75rem;
}
h1 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  letter-spacing: -0.05em;
}
h2 {
  font-size: 1.17rem;
}
a {
  color: var(--brand);
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--line);
  padding: 0.58rem 0.85rem;
  border-radius: 0.55rem;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
button:hover:not(:disabled),
.button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
:focus-visible {
  outline: 3px solid #148c79;
  outline-offset: 3px;
}
label {
  display: grid;
  gap: 0.28rem;
  font-weight: 600;
}
input:not([type='checkbox']),
select {
  display: block;
  min-width: 0;
  width: 100%;
  padding: 0.55rem 0.65rem;
  color: inherit;
  background: #fff;
  border: 1px solid #aebfc7;
  border-radius: 0.45rem;
}
form {
  display: grid;
  gap: 0.9rem;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: #b7ece0;
  color: #08483f;
}
.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(ellipse at 10% 12%, #c5e9e3, transparent 55%), #edf4f5;
}
.signin .panel {
  width: min(100%, 28rem);
  padding: clamp(1.4rem, 5vw, 2.5rem);
  box-shadow: 0 20px 70px #19374016;
}
.signin .brand {
  margin-bottom: 1.6rem;
}
.signin h1 {
  font-size: 2rem;
}
.muted,
small {
  color: var(--muted);
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}
.shell > aside {
  position: sticky;
  inset-block-start: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}
aside {
  background: #102c37;
  color: #edf7f8;
  padding: 1.35rem 1rem;
}
aside nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 2rem;
}
aside a {
  padding: 0.62rem 0.72rem;
  color: #e2eff1;
  border-radius: 0.5rem;
  text-decoration: none;
}
aside a:hover,
aside a[aria-current='page'] {
  background: #24515c;
}
.workspace {
  min-width: 0;
}
header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
}
.content {
  max-width: 1440px;
  margin: auto;
  padding: 1.7rem clamp(1rem, 4vw, 2.5rem) 2rem;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1rem;
}
.heading,
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}
.heading h1 {
  margin: 0;
}
.bar form {
  width: min(100%, 32rem);
  display: flex;
  flex: 1 1 18rem;
  gap: 0.45rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.75rem;
}
.scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th,
td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
td small {
  display: block;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tag {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 2rem;
  background: #e5f1ee;
  white-space: nowrap;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.8rem;
}
.error {
  color: #9c2635;
  margin-top: 0.5rem;
}
.notice {
  color: #07574a;
  margin-bottom: 0.8rem;
}
dialog {
  width: min(calc(100% - 2rem), 44rem);
  max-height: 90vh;
  overflow: auto;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  color: inherit;
}
dialog::backdrop {
  background: #0e2537a8;
}
dialog .heading h2 {
  margin: 0;
}
dialog img {
  display: block;
  max-width: 100%;
  margin: 0.5rem auto;
}
.category-tree,
.category-branches {
  list-style: none;
  margin: 0;
  padding: 0;
}
.category-tree {
  overflow: auto;
}
.category-branches {
  border-inline-start: 1px solid var(--line);
  margin-inline-start: 1rem;
  padding-inline-start: 0.7rem;
}
.branch-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 17rem;
  padding: 0.5rem 0.3rem;
  border-bottom: 1px solid var(--line);
}
.branch-toggle,
.branch-leaf {
  display: grid;
  place-items: center;
  flex: 0 0 1.65rem;
  padding: 0;
  min-height: 1.7rem;
}
.branch-toggle span {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
}
.branch-toggle[aria-expanded='true'] span {
  transform: rotate(90deg);
}
.branch-leaf::before {
  content: '';
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #8498a2;
}
.branch-names {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.65rem;
  overflow-wrap: anywhere;
}
.branch-names [lang='ar'] {
  color: var(--muted);
}
@media (max-width: 600px) {
  .branch-row {
    flex-wrap: wrap;
  }
  .branch-row .actions {
    flex-basis: 100%;
    padding-inline-start: 2rem;
  }
}
.barcode-camera {
  display: grid;
  gap: 0.55rem;
}
.barcode-camera video {
  width: 100%;
  max-height: 48vh;
  object-fit: contain;
  border-radius: 0.65rem;
  background: #102c37;
}
.barcode-camera p {
  margin: 0;
}
.barcode-camera p:empty {
  display: none;
}
.category-picker {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
.category-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
}
.category-picker p {
  margin: 0;
}
.secret {
  user-select: all;
}
pre {
  overflow: auto;
  background: #eef4f5;
  padding: 0.85rem;
  border-radius: 0.5rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .shell > aside {
    position: static;
    height: auto;
    max-height: 45vh;
    max-height: 45dvh;
  }
  aside {
    padding: 0.65rem;
  }
  aside nav {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0.45rem;
  }
  header {
    justify-content: space-between;
  }
}
