@font-face {
  font-family: Vazir;
  src: url("./Vazir.ttf") format("truetype");
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f3f6f9;
  --surface: #fff;
  --surface-alt: #f7f9fc;
  --ink: #172b42;
  --muted: #60758a;
  --border: #dfe7ee;
  --brand: #0f5283;
  --brand-deep: #173653;
  --accent: #c9215a;
  --accent-soft: #fff0f5;
  --side: #152d46;
  --side-ink: #e8f0f7;
  --side-muted: #b6c8d7;
  --good: #146c50;
  --good-bg: #e3f5eb;
  --warn: #895a13;
  --warn-bg: #fff2d6;
  --bad: #ae3347;
  --bad-bg: #ffebee;
  --focus: #2681ba;
  --shadow: 0 2px 14px rgba(16, 41, 65, 0.055);
  --radius: 12px;
  --font: Vazir, Tahoma, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101a28;
  --surface: #19293b;
  --surface-alt: #21354b;
  --ink: #eef5fa;
  --muted: #a9bfd0;
  --border: #344b60;
  --brand: #70b9eb;
  --brand-deep: #edf4fa;
  --accent: #f487aa;
  --accent-soft: #3b293d;
  --side: #0b1625;
  --side-ink: #f1f6fa;
  --side-muted: #a8bfd2;
  --good: #86dcb5;
  --good-bg: #164035;
  --warn: #f8c577;
  --warn-bg: #4d391c;
  --bad: #ffa3ae;
  --bad-bg: #4d2630;
  --focus: #7ac8f4;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101a28;
    --surface: #19293b;
    --surface-alt: #21354b;
    --ink: #eef5fa;
    --muted: #a9bfd0;
    --border: #344b60;
    --brand: #70b9eb;
    --brand-deep: #edf4fa;
    --accent: #f487aa;
    --accent-soft: #3b293d;
    --side: #0b1625;
    --side-ink: #f1f6fa;
    --side-muted: #a8bfd2;
    --good: #86dcb5;
    --good-bg: #164035;
    --warn: #f8c577;
    --warn-bg: #4d391c;
    --bad: #ffa3ae;
    --bad-bg: #4d2630;
    --focus: #7ac8f4;
    --shadow: none;
  }
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--font);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--brand);
}
img {
  max-width: 100%;
}
bdi,
.mono {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.app-frame {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100dvh;
}
.side {
  background: var(--side);
  color: var(--side-ink);
  padding: 20px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  z-index: 40;
}
.brand {
  color: var(--side-ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px 16px;
  font: 800 21px/1.15 var(--font);
  direction: ltr;
  justify-content: flex-end;
  letter-spacing: -0.03em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.brand strong {
  color: #f1a5bf;
}
.side-nav {
  display: grid;
  gap: 3px;
}
.nav-group {
  color: var(--side-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 14px 12px 4px;
  letter-spacing: 0.01em;
}
.side-nav a,
.side-logout {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 39px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--side-muted);
  padding: 6px 11px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
}
.side-nav a:hover,
.side-nav a[aria-current="page"],
.side-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.side-nav a[aria-current="page"] {
  border-inline-start: 3px solid #f48eae;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.13);
}
.nav-icon {
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
  font: 700 14px/1 var(--font);
  opacity: 0.9;
}
.side-foot {
  margin: auto 12px 0;
  color: var(--side-muted);
  font-size: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}
.side-close,
.side-collapse {
  background: transparent;
  color: var(--side-muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  min-width: 34px;
  min-height: 34px;
}
.side-close {
  display: none;
}
.side-collapse {
  width: calc(100% - 24px);
  margin: 0 12px;
}
.sidebar-backdrop {
  display: none;
}
.main-col {
  min-width: 0;
}
.topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px clamp(16px, 2.2vw, 34px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.page-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
}
.topbar-spacer {
  flex: 1;
}
.quick-search {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 210px;
  max-width: 330px;
  flex: 1;
}

.quick-search input {
  height: 35px;
  min-width: 0;
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--ink);
}
.quick-search button {
  height: 35px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--brand);
  border-radius: 8px;
  padding: 0 12px;
}
.role-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.icon-button {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}
.mobile-menu {
  display: none;
}
.content {
  max-width: 1620px;
  margin: 0 auto;
  padding: 20px clamp(16px, 2.2vw, 34px) 40px;
  width: 100%;
}
.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 15px;
}
.page-intro h2 {
  font-size: 20px;
  margin: 0;
}
.page-intro p {
  margin: 4px 0 0;
}
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 5px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card {
  margin-top: 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 8px 13px;
  min-height: 36px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.ghost {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--border);
}
.btn.danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.link-danger {
  border: 0;
  background: none;
  color: var(--bad);
  padding: 5px 8px;
}
.empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}
.price {
  font-size: 19px;
  font-weight: 800;
  color: var(--brand);
}
.status-chip,
.stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  padding: 3px 9px;
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 11px;
  font-weight: 700;
}
.status-chip.ok,
.stock.ok {
  background: var(--good-bg);
  color: var(--good);
}
.status-chip.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.workspace-head h2 {
  font-size: 16px;
  margin: 0;
}
.toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
}
.toolbar label,
.filters label,
.form-stack label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.toolbar input,
.toolbar select,
.filters input,
.filters select,
.form-stack input,
.form-stack select,
.form-stack textarea,
.qty {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 6px 9px;
  min-height: 36px;
  width: 100%;
}
.toolbar .wide {
  min-width: 250px;
  flex: 1 1 250px;
}
.toolbar .field {
  flex: 0 1 165px;
  min-width: 130px;
}
.toolbar .small-field {
  flex: 0 1 125px;
  min-width: 105px;
}
.toolbar .check {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 3px;
  color: var(--ink);
  white-space: nowrap;
}
.toolbar .check input {
  width: auto;
  min-height: auto;
}
.toolbar .btn {
  min-height: 36px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.data-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  text-align: right;
}
.data-table th {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-alt);
  padding: 9px 11px;
  font-weight: 800;
  white-space: nowrap;
}
.data-table td {
  border-top: 1px solid var(--border);
  padding: 9px 11px;
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: var(--surface-alt);
}
.data-table .row-title {
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
}
.data-table .row-title:hover {
  color: var(--brand);
}
.data-table .row-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.table-image {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 7px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.data-table .cell-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-start;
}
.cell-actions .btn {
  font-size: 11px;
  padding: 5px 8px;
  min-height: 30px;
}
.cell-actions form {
  display: inline;
}
.data-table .num {
  text-align: left;
  direction: ltr;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  padding: 15px 0 2px;
}
.pagination a {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  text-decoration: none;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.pagination a.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.list-summary {
  color: var(--muted);
  font-size: 12px;
}
.product-grid {
  display: none;
}
.auth-grid,
.hero {
  display: grid;
  grid-template-columns: 1fr minmax(290px, 380px);
  align-items: center;
  gap: 30px;
  min-height: 340px;
}
.auth-grid h2,
.hero h2 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.3;
  margin: 0 0 10px;
}
.form-stack {
  display: grid;
  gap: 12px;
}
.form-stack label {
  font-size: 12px;
  color: var(--ink);
}
.form-stack input {
  min-height: 40px;
}
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hero-art {
  font-size: 90px;
  color: var(--accent);
  text-align: center;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(200px, 28%) 1fr;
  gap: 26px;
}
.detail-image {
  background: var(--surface-alt);
  border-radius: 9px;
  display: grid;
  place-items: center;
  min-height: 250px;
  color: var(--brand);
  font-size: 4rem;
}
.detail-image img {
  max-height: 330px;
  object-fit: contain;
}
.product-description {
  white-space: normal;
  overflow-wrap: anywhere;
}
.detail-layout h2 {
  margin-top: 13px;
}
.detail-layout form {
  margin: 14px 0;
}
.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.welcome h2 {
  font-size: 24px;
  margin: 0 0 8px;
}
.welcome-symbol {
  font-size: 70px;
  color: var(--accent);
  opacity: 0.4;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi {
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  min-height: 96px;
}
.kpi .kpi-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.kpi .kpi-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  display: block;
  margin: 6px 0 2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi .kpi-note {
  font-size: 10px;
  color: var(--muted);
}
.kpi.accent {
  border-top: 3px solid var(--accent);
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cart-row,
.order-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
}
.cart-row > div,
.order-card > *:first-child {
  flex: 1;
}
.cart-row h2 {
  margin: 0 0 3px;
  font-size: 14px;
}
.cart-row p {
  margin: 2px 0;
}
.cart-row form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qty {
  width: 75px;
}
.cart-total,
.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding-top: 15px;
}
.order-card {
  text-decoration: none;
  color: var(--ink);
}
.order-card small {
  color: var(--muted);
}
.plain-list {
  padding: 0;
  list-style: none;
}
.plain-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.order-timeline {
  list-style: none;
  display: flex;
  gap: 0;
  padding: 0;
  margin: 18px 0;
  flex-wrap: wrap;
}
.order-timeline li {
  flex: 1;
  min-width: 100px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  border-top: 3px solid var(--border);
  padding-top: 8px;
}
.order-timeline li.done {
  color: var(--good);
  border-top-color: var(--good);
  font-weight: 700;
}
.cancel-form {
  margin-top: 17px;
}
.flash-stack {
  position: fixed;
  top: 72px;
  left: 16px;
  z-index: 60;
  display: grid;
  gap: 6px;
}
.flash {
  padding: 9px 13px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.flash.success {
  border-color: var(--good);
}
.flash.error {
  border-color: var(--bad);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 15px;
}
.field-help {
  font-size: 11px;
  color: var(--muted);
}
.upload-preview {
  max-width: 190px;
  max-height: 150px;
  object-fit: contain;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.receipt-list {
  display: grid;
  gap: 9px;
}
.receipt-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.receipt-item img {
  max-width: 160px;
  max-height: 110px;
  object-fit: contain;
}
.side-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.65fr);
  gap: 15px;
}
.side-panel > * {
  min-width: 0;
}
body[data-nav-collapsed="true"] .app-frame {
  grid-template-columns: 68px minmax(0, 1fr);
}
body[data-nav-collapsed="true"] .side {
  padding-inline: 7px;
}
body[data-nav-collapsed="true"] .brand {
  font-size: 0;
  justify-content: center;
  padding-inline: 0;
}
body[data-nav-collapsed="true"] .brand strong {
  display: none;
}
body[data-nav-collapsed="true"] .side-nav a,
body[data-nav-collapsed="true"] .side-logout {
  justify-content: center;
  padding: 6px;
}
body[data-nav-collapsed="true"] .nav-text,
body[data-nav-collapsed="true"] .nav-group,
body[data-nav-collapsed="true"] .side-foot {
  display: none;
}
body[data-nav-collapsed="true"] .side-collapse {
  font-size: 0;
  width: 42px;
  margin: auto auto 0;
}
body[data-nav-collapsed="true"] .side-collapse:after {
  content: "⇤";
  font-size: 16px;
}
@media (max-width: 1050px) {
  .app-frame {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .content {
    padding: 18px;
  }
  .quick-search {
    max-width: 220px;
  }
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .side-panel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .app-frame,
  body[data-nav-collapsed="true"] .app-frame {
    display: block;
  }
  .side {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(285px, 84vw);
    height: 100dvh;
    transform: translateX(105%);
    transition: transform 0.2s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  }
  .side.open {
    transform: translateX(0);
  }
  .side-close {
    display: block;
    position: absolute;
    left: 12px;
    top: 15px;
  }
  .side-collapse {
    display: none;
  }
  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 18, 32, 0.52);
    z-index: 30;
    border: 0;
    width: 100%;
    height: 100%;
  }
  .mobile-menu {
    display: grid;
  }
  .topbar {
    gap: 9px;
    min-height: 54px;
  }
  .page-title {
    font-size: 14px;
  }
  .quick-search {
    display: none;
  }
  .content {
    padding: 14px 12px 40px;
  }
  .toolbar .wide {
    flex: 1 1 100%;
  }
  .toolbar .field,
  .toolbar .small-field {
    flex: 1 1 calc(50% - 10px);
    min-width: 135px;
  }
  .table-wrap {
    border: 0;
    overflow: visible;
  }
  .data-table {
    display: block;
    min-width: 0;
  }
  .data-table thead {
    display: none;
  }
  .data-table tbody {
    display: grid;
    gap: 9px;
  }
  .data-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px;
  }
  .data-table td {
    border: 0;
    padding: 1px 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .data-table td:first-child {
    grid-column: 1/-1;
  }
  .data-table td[data-label]:not(:first-child):before {
    content: attr(data-label);
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
  }
  .data-table td.row-main {
    grid-column: 1/-1;
  }
  .data-table .cell-actions {
    grid-column: 1/-1;
    flex-wrap: wrap;
  }
  .data-table td.cell-actions {
    grid-column: 1/-1;
  }
  .data-table .num {
    text-align: right;
    direction: ltr;
  }
  .data-table .table-image {
    width: 38px;
    height: 38px;
  }
  .role-badge {
    display: none;
  }
  .auth-grid,
  .hero,
  .detail-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero-art {
    display: none;
  }
  .cart-row {
    flex-wrap: wrap;
  }
  .cart-row > div {
    flex-basis: 100%;
  }
  .cart-total {
    align-items: stretch;
    flex-direction: column;
  }
  .order-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .side-panel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .toolbar .field,
  .toolbar .small-field {
    flex-basis: 100%;
  }
  .form-grid,
  .kpi-row {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 13px;
  }
  .order-summary {
    flex-wrap: wrap;
  }
  .order-timeline li {
    min-width: 70px;
  }
  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .quick-links .btn {
    flex: 1;
  }
  .form-actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
