/* Parsichemical brand — matches website-main/frontend/styles/globals.css */
@font-face { font-family: 'IRANSansXFaNum'; src: url('../fonts/IRANSansXFaNum-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IRANSansXFaNum'; src: url('../fonts/IRANSansXFaNum-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IRANSansXFaNum'; src: url('../fonts/IRANSansXFaNum-DemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IRANSansXFaNum'; src: url('../fonts/IRANSansXFaNum-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --primary: #1a73e8; --secondary: #f9ab00; --background: #f8fafd; --text: #202124; --primary-soft: #aecbfa; --primary-dark: #174ea6;
  --surface: #ffffff; --surface-muted: #eef3fa; --surface-muted-hover: #e3ebf7; --border: #dadce0; --muted: #5f6368;
  --success: #16a34a; --warning: #f9ab00; --destructive: #ef4444; --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'IRANSansXFaNum', system-ui, sans-serif; background: var(--background); color: var(--text); font-size: 14px; line-height: 1.7; direction: rtl; }
a { color: var(--primary); text-decoration: none; } a:hover { color: var(--primary-dark); }
.layout { display: flex; min-height: 100vh; }
.side { width: 230px; background: var(--surface); border-left: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; }
.side .logo { display: block; text-align: center; margin-bottom: 12px; } .side .logo img { width: 110px; height: auto; }
.side .brand { text-align: center; font-weight: 700; color: var(--primary-dark); margin-bottom: 14px; font-size: 13px; }
.side h6 { margin: 14px 8px 4px; font-size: 11px; color: var(--muted); font-weight: 600; }
.side a { display: block; padding: 7px 10px; border-radius: var(--radius); color: var(--text); font-weight: 500; }
.side a:hover { background: var(--surface-muted); } .side a.on { background: var(--surface-muted); color: var(--primary); font-weight: 600; }
.main { flex: 1; padding: 20px 28px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.top h1 { font-size: 20px; margin: 0; font-weight: 700; }
.who { color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; border-top: 3px solid var(--primary); }
.stat.y { border-top-color: var(--secondary); } .stat .l { color: var(--muted); font-size: 12px; } .stat .v { font-size: 19px; font-weight: 700; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
th { background: var(--surface-muted); font-weight: 600; font-size: 13px; }
tfoot td { font-weight: 700; background: var(--surface-muted); }
td.n, th.n { text-align: left; direction: ltr; font-feature-settings: "tnum"; white-space: nowrap; }
.tbl { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
form.inline { display: inline; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
input[type=checkbox] { width: auto; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 10px; align-items: end; }
.btn { display: inline-block; font-family: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--primary); background: var(--primary); color: #fff; padding: 7px 16px; border-radius: var(--radius); cursor: pointer; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn.y { background: var(--secondary); border-color: var(--secondary); color: var(--text); } .btn.y:hover { background: #e09800; }
.btn.o { background: #fff; color: var(--primary); } .btn.o:hover { background: var(--surface-muted); }
.btn.d { background: #fff; color: var(--destructive); border-color: var(--destructive); } .btn.d:hover { background: #fef2f2; }
.btn.s { padding: 3px 10px; font-size: 12px; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; } .alert.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface-muted); color: var(--primary-dark); }
.tag.y { background: #fef3c7; color: #92400e; } .tag.r { background: #fee2e2; color: #991b1b; } .tag.g { background: #dcfce7; color: #166534; }
.muted { color: var(--muted); } .ltr { direction: ltr; unicode-bidi: embed; } .mono { font-family: ui-monospace, monospace; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--surface-muted), var(--background)); }
.auth .box { width: 380px; max-width: 94vw; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 28px; }
.auth .box img.logo { display: block; margin: 0 auto 10px; width: 120px; }
.auth h1 { font-size: 17px; text-align: center; margin: 0 0 18px; color: var(--primary-dark); }
.auth .f { margin-bottom: 12px; } .auth .btn { width: 100%; }
.qr { text-align: center; } .qr img { border: 1px solid var(--border); border-radius: 6px; }
.scan { background: #fffbeb; border: 1px dashed var(--secondary); padding: 10px; border-radius: var(--radius); margin-bottom: 10px; }
.lines td input, .lines td select { min-width: 80px; }
.right { text-align: left; } .mt { margin-top: 12px; }
.labels { display: flex; flex-wrap: wrap; gap: 0; }
.label { width: 50mm; height: 30mm; padding: 1.5mm; text-align: center; overflow: hidden; border: 1px dashed #ccc; page-break-inside: avoid; }
.label .nm { font-size: 9px; font-weight: 700; height: 7mm; overflow: hidden; } .label img { max-width: 46mm; height: 15mm; } .label .br { font-size: 7px; color: var(--primary); }
.noprint { } @media print { .side, .top, .noprint { display: none !important; } .main { padding: 0; } .card { border: 0; } .label { border: 0; } body { background: #fff; } }
.navt { display: none; }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 12px; border-left: 0; border-bottom: 1px solid var(--border); max-height: 100vh; }
  .side .logo { margin: 0; } .side .logo img { width: 64px; }
  .side .brand { margin: 0; flex: 1; text-align: right; }
  .navt { display: inline-block; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; min-height: 40px; }
  .side > a:not(.logo), .side > h6 { display: none; width: 100%; }
  .side.open > a:not(.logo), .side.open > h6 { display: block; }
  .side.open { overflow-y: auto; }
  .side > a:not(.logo) { padding: 10px; }
  .main { padding: 12px; min-width: 0; }
  .top h1 { font-size: 17px; } .top .who { font-size: 12px; }
  input, select, textarea, button { font-size: 16px; }
  .tbl table { min-width: 520px; }
  img { max-width: 100%; }
}
.secret { text-align: center; word-break: break-all; }
/* Phase 3A: customers, picker, camera scanner */
fieldset.pf { border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 10px; }
fieldset.pf legend { padding: 0 6px; color: var(--muted); font-size: 12px; }
fieldset[hidden] { display: none; }
details.card > summary { cursor: pointer; padding: 4px 0; min-height: 32px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.pp { position: relative; } .pp-q { margin-bottom: 6px; }
.pp-res { position: absolute; inset-inline: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: 260px; overflow-y: auto; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.pp-item { display: block; width: 100%; text-align: right; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 10px; font: inherit; cursor: pointer; min-height: 44px; }
.pp-item:hover, .pp-item:focus { background: var(--surface-muted); }
.pp-add { margin-top: 8px; }
.camw { display: flex; gap: 6px; align-items: stretch; } .camw > input { flex: 1; min-width: 0; } .camb { min-width: 44px; min-height: 40px; }
.cam { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom); }
.cam video { width: 100%; max-width: 720px; max-height: 70vh; object-fit: cover; border-radius: 8px; }
.cam-frame { position: absolute; width: min(80vw, 520px); height: min(30vh, 200px); border: 2px solid rgba(255,255,255,.85); border-radius: 10px; pointer-events: none; }
.cam-msg { color: #fff; text-align: center; max-width: 520px; line-height: 1.8; } .cam.err .cam-frame, .cam.err video { display: none; }
.cam .btn { min-width: 120px; min-height: 44px; }
@media (max-width: 800px) { .kv { grid-template-columns: 1fr; } .pp-res { max-height: 50vh; } }
.sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
