/* =====================================================================
   سیستم مدیریت تجارت زعفران — استایل
   رنگ‌ها از خود گل زعفران: بنفش گلبرگ، سرخ/نارنجی رشته، طلایی گرده
   ===================================================================== */

@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Sahel'; src: url('../fonts/Sahel.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sahel'; src: url('../fonts/Sahel-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Shabnam'; src: url('../fonts/Shabnam.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Shabnam'; src: url('../fonts/Shabnam-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
/* B Mitra / B Nazanin: اگر روی ویندوز نصب باشد استفاده می‌شود؛ یا فایل را در assets/fonts بگذارید */
@font-face { font-family: 'BMitraX'; src: local('B Mitra'), local('BMitra'), url('../fonts/BMitra.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'BMitraX'; src: local('B Mitra Bold'), local('BMitraBold'), url('../fonts/BMitraBold.ttf') format('truetype'); font-weight: 700; }
@font-face { font-family: 'BNazaninX'; src: local('B Nazanin'), local('BNazanin'), url('../fonts/BNazanin.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'BNazaninX'; src: local('B Nazanin Bold'), local('BNazaninBold'), url('../fonts/BNazaninBold.ttf') format('truetype'); font-weight: 700; }

:root {
  --brand-950: #1d0f2e;
  --brand-900: #2b1644;
  --brand-800: #3c1f5e;
  --brand-700: #52297d;
  --brand-500: #7c46b0;
  --brand-100: #efe6f8;
  --brand-50:  #f7f2fc;
  --saffron:   #d9480f;
  --saffron-2: #c92a2a;
  --saffron-50:#fff4ec;
  --gold:      #f0a202;
  --gold-50:   #fff8e6;
  --bg:        #f6f2ec;
  --card:      #ffffff;
  --text:      #22192d;
  --muted:     #7b7086;
  --border:    #ece4da;
  --line:      #f2ece5;
  --green:     #2b8a3e;
  --green-50:  #ebfbee;
  --red:       #c92a2a;
  --red-50:    #fff0f0;
  --amber:     #b76e00;
  --amber-50:  #fff6e0;
  --blue:      #1c64c2;
  --blue-50:   #eaf3ff;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(43,22,68,.05), 0 6px 24px -8px rgba(43,22,68,.12);
  --font:      'Vazirmatn', Tahoma, sans-serif;
  --fs:        14.5px;
}
body.font-bmitra   { --font: 'BMitraX', 'B Mitra', 'Vazirmatn', Tahoma, sans-serif; --fs: 17.5px; }
body.font-bnazanin { --font: 'BNazaninX', 'B Nazanin', 'Vazirmatn', Tahoma, sans-serif; --fs: 17px; }
body.font-sahel    { --font: 'Sahel', 'Vazirmatn', Tahoma, sans-serif; --fs: 15px; }
body.font-shabnam  { --font: 'Shabnam', 'Vazirmatn', Tahoma, sans-serif; --fs: 14.5px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs); line-height: 1.75;
  direction: rtl;
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--saffron); }
h1, h2, h3, h4 { margin: 0; line-height: 1.5; }
input, select, textarea, button { font: inherit; color: inherit; }
.ic { flex: none; vertical-align: middle; }
.num, .ltr { direction: ltr; unicode-bidi: plaintext; }

/* ---------- ساختار کلی ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-950) 100%);
  color: #e9def5; padding: 18px 14px 24px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 30%, #9b5fd0, var(--brand-700));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 6px 16px -4px rgba(0,0,0,.4);
}
.brand-logo .ic { color: var(--gold); }
.brand-name { font-weight: 800; font-size: 1.05em; color: #fff; line-height: 1.4; }
.brand-sub { font-size: .78em; color: #b9a7cf; }
.nav-title { font-size: .72em; color: #9d88b8; padding: 14px 12px 4px; letter-spacing: .02em; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; margin: 2px 0;
  color: #ddd0ec; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(240,162,2,.0), rgba(240,162,2,.16)); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.nav a.active .ic { color: var(--gold); }
.nav .ic { color: #b69bd6; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.topbar .title { font-weight: 700; font-size: 1.15em; }
.topbar .spacer { flex: 1; }
.today-chip { display: flex; align-items: center; gap: 8px; background: var(--brand-50); color: var(--brand-800); border-radius: 99px; padding: 4px 14px; font-size: .9em; font-weight: 500; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9em; }
.user-chip b { color: var(--text); font-weight: 600; }
.menu-btn { display: none; background: none; border: 0; padding: 4px; cursor: pointer; color: var(--brand-800); }
.content { padding: 24px 28px 60px; max-width: 1400px; width: 100%; }

/* ---------- کارت‌ها ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 1.02em; font-weight: 700; }
.card-h .spacer { flex: 1; }
.card-b { padding: 18px 20px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 18px; }
.grid > .card, .grid > form.card { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.35em; font-weight: 800; }
.page-head .sub { color: var(--muted); font-size: .9em; }
.page-head .spacer { flex: 1; }

/* ---------- کارت آمار ---------- */
.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat .s-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .s-label { color: var(--muted); font-size: .85em; }
.stat .s-val { font-size: 1.35em; font-weight: 800; line-height: 1.35; }
.stat .s-sub { font-size: .78em; color: var(--muted); }
.t-saffron { background: var(--saffron-50); color: var(--saffron); }
.t-brand { background: var(--brand-50); color: var(--brand-700); }
.t-green { background: var(--green-50); color: var(--green); }
.t-red { background: var(--red-50); color: var(--red); }
.t-gold { background: var(--gold-50); color: var(--amber); }
.t-blue { background: var(--blue-50); color: var(--blue); }

/* ---------- دکمه‌های بزرگ دسترسی سریع ---------- */
.quick { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 8px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-weight: 700; color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; text-align: center;
}
.quick a:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 10px 28px -10px rgba(217,72,15,.35); }
.quick .q-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.quick small { color: var(--muted); font-weight: 400; font-size: .78em; }

/* ---------- دکمه ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; cursor: pointer;
  padding: 8px 18px; border-radius: 10px; font-weight: 600; line-height: 1.6; white-space: nowrap; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: linear-gradient(135deg, #e8590c, var(--saffron-2)); color: #fff; box-shadow: 0 6px 16px -6px rgba(201,42,42,.55); }
.btn-primary:hover { color: #fff; }
.btn-brand { background: linear-gradient(135deg, var(--brand-500), var(--brand-800)); color: #fff; }
.btn-brand:hover { color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { color: #fff; }
.btn-light { background: #fff; border-color: var(--border); color: var(--text); }
.btn-light:hover { background: var(--brand-50); color: var(--brand-800); }
.btn-danger { background: #fff; border-color: #f3c7c7; color: var(--red); }
.btn-danger:hover { background: var(--red-50); color: var(--red); }
.btn-sm { padding: 4px 12px; font-size: .88em; border-radius: 8px; }
.btn-lg { padding: 12px 28px; font-size: 1.05em; border-radius: 12px; }
.btn-icon { padding: 5px 8px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- فرم ---------- */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px 16px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: span 3; }
.form-grid .span4 { grid-column: 1 / -1; }
.field label { display: block; font-size: .86em; font-weight: 600; color: #4b3f58; margin-bottom: 5px; }
.field label .req { color: var(--saffron); }
.field .hint { font-size: .78em; color: var(--muted); margin-top: 3px; }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd3c8; border-radius: 10px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
textarea.input { min-height: 70px; resize: vertical; }
.input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(124,70,176,.15); }
.input[readonly] { background: #faf8f5; color: #4b3f58; }
.input.num-in { direction: ltr; text-align: left; }
.input.big { font-size: 1.15em; font-weight: 700; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group > :first-child.input { border-radius: 0 10px 10px 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: #f6f1eb; border: 1px solid #ddd3c8; border-left: 0; border-radius: 0 10px 10px 0; color: var(--muted); font-size: .88em; white-space: nowrap; }
.input-group .addon + .input { border-radius: 10px 0 0 10px; }
.input-group .input + .addon { border-left: 1px solid #ddd3c8; border-right: 0; border-radius: 10px 0 0 10px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: .92em; }
.check input { width: 17px; height: 17px; accent-color: var(--saffron); }

/* انتخاب نوع (دکمه‌های رادیویی زیبا) */
.seg { display: inline-flex; background: #f3ede6; border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 9px; font-weight: 600; color: #5b4d69; font-size: .93em; }
.seg input:checked + span { background: #fff; color: var(--saffron); box-shadow: 0 2px 8px -2px rgba(43,22,68,.18); }

/* تب بخش‌ها */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 7px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--border); color: #4b3f58; font-weight: 600; font-size: .92em; display: inline-flex; align-items: center; gap: 7px; }
.tabs a .dot { width: 9px; height: 9px; border-radius: 50%; }
.tabs a.active { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.tabs a:hover:not(.active) { border-color: var(--gold); }

/* ---------- جدول ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { background: #faf6f1; color: #5b4d69; font-weight: 700; font-size: .84em; text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fdfbf8; }
table.t td.n, table.t th.n { text-align: left; direction: ltr; white-space: nowrap; }
table.t tfoot td { background: #faf6f1; font-weight: 800; border-top: 2px solid var(--border); }
table.t .muted { color: var(--muted); font-size: .88em; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { color: #d6c9e3; margin-bottom: 6px; }

/* سطرهای فاکتور */
.items-table td { padding: 8px 6px; vertical-align: top; }
.items-table .input { min-height: 40px; padding: 6px 9px; }
.items-table .tare-box { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin-top: 6px; padding: 8px; border-radius: 10px; background: var(--gold-50); border: 1px dashed #f1cf85; }
.items-table .tare-box label { font-size: .74em; color: var(--amber); font-weight: 600; }
.items-table .lot-row { margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.line-total { font-weight: 800; padding-top: 8px; white-space: nowrap; }
.row-del { color: #c2b5cf; background: none; border: 0; cursor: pointer; padding: 8px 4px; }
.row-del:hover { color: var(--red); }

.summary-box { background: linear-gradient(135deg, var(--brand-50), #fff); border: 1px solid var(--brand-100); border-radius: var(--radius); padding: 16px 20px; }
.summary-box .line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.summary-box .line + .line { border-top: 1px dashed #e0d3ee; }
.summary-box .total { font-size: 1.3em; font-weight: 800; color: var(--brand-800); }
.summary-box .remain { font-size: 1.1em; font-weight: 800; color: var(--saffron); }

/* ---------- برچسب ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 99px; font-size: .8em; font-weight: 700; white-space: nowrap; }
.b-green { background: var(--green-50); color: var(--green); }
.b-red { background: var(--red-50); color: var(--red); }
.b-amber { background: var(--amber-50); color: var(--amber); }
.b-gray { background: #f1eef4; color: #6f6479; }
.b-brand { background: var(--brand-50); color: var(--brand-700); }
.b-blue { background: var(--blue-50); color: var(--blue); }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }

/* ---------- پیام‌ها ---------- */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.alert-success { background: var(--green-50); color: #1f6b30; border: 1px solid #c3ebcb; }
.alert-error { background: var(--red-50); color: #9b1c1c; border: 1px solid #f6caca; }
.alert-info { background: var(--blue-50); color: #174e96; border: 1px solid #cfe2fb; }
.alert-warn { background: var(--amber-50); color: #7a4a00; border: 1px solid #f7dba3; }

/* ---------- فیلتر ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }
.filters .field .input { min-height: 38px; padding: 5px 10px; }

.pager { display: flex; gap: 8px; justify-content: center; padding: 14px; }

/* ---------- جستجوی شخص ---------- */
.ac { position: relative; }
.ac-list { position: absolute; top: 100%; right: 0; left: 0; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(43,22,68,.3); margin-top: 4px; max-height: 300px; overflow-y: auto; display: none; }
.ac-list.open { display: block; }
.ac-item { padding: 9px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.hl { background: var(--brand-50); }
.ac-item small { color: var(--muted); }
.ac-new { color: var(--saffron); font-weight: 700; }
.ac-selected { margin-top: 6px; font-size: .86em; }

/* ---------- مودال ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(29,15,46,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); max-height: 92vh; overflow-y: auto; }
.modal .card-h { padding: 16px 22px; }
.modal .card-b { padding: 20px 22px; }

/* ---------- تقویم شمسی ---------- */
.dp { position: relative; }
.dp-pop { position: absolute; top: 100%; right: 0; z-index: 60; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px -12px rgba(43,22,68,.3); padding: 10px; width: 280px; display: none; }
.dp-pop.open { display: block; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-weight: 700; color: var(--brand-800); }
.dp-head button { background: var(--brand-50); border: 0; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; color: var(--brand-700); font-size: 1.1em; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dp-grid .wd { font-size: .75em; color: var(--muted); padding: 2px 0; }
.dp-grid button { border: 0; background: none; padding: 6px 0; border-radius: 8px; cursor: pointer; font-size: .9em; }
.dp-grid button:hover { background: var(--brand-50); }
.dp-grid button.sel { background: var(--saffron); color: #fff; }
.dp-grid button.today { box-shadow: inset 0 0 0 1.5px var(--gold); }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.dp-foot button { background: none; border: 0; color: var(--saffron); cursor: pointer; font-weight: 600; font-size: .88em; }

/* ---------- نمودار میله‌ای ساده ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 10px 4px 0; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .bar { width: 42%; max-width: 26px; border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bars .bar.b1 { background: linear-gradient(180deg, #f08c3a, var(--saffron)); }
.bars .bar.b2 { background: linear-gradient(180deg, #a67bd1, var(--brand-700)); }
.bars .lbl { font-size: .74em; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: .84em; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; vertical-align: middle; }

/* ---------- لیست ساده ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t1 { font-weight: 600; }
.list-row .t2 { font-size: .82em; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; background: var(--brand-50); color: var(--brand-700); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; }
.kv dt { color: var(--muted); font-size: .88em; }
.kv dd { margin: 0; font-weight: 600; }

.stock-pill { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: #fcfaf7; border: 1px solid var(--line); }
.stock-pill + .stock-pill { margin-top: 8px; }
.stock-pill b { font-size: 1.05em; }

/* ---------- ورود ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 80% -10%, #6d3b9c 0%, transparent 60%), radial-gradient(900px 500px at 0% 110%, #d9480f55 0%, transparent 60%), var(--brand-950); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 34px 30px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); }
.login-card .brand-logo { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 12px; }
.login-card h1 { text-align: center; font-size: 1.35em; font-weight: 800; }
.login-card p.sub { text-align: center; color: var(--muted); margin: 2px 0 22px; }

/* ---------- چاپ ---------- */
.print-only { display: none; }
.invoice-print { max-width: 820px; margin: 0 auto; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 16px; border-bottom: 3px solid var(--saffron); margin-bottom: 16px; }
.inv-head .shop { font-size: 1.4em; font-weight: 800; color: var(--brand-800); }
.inv-title { font-size: 1.2em; font-weight: 800; color: var(--saffron); }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 13px; }
  .sidebar, .topbar, .no-print, .btn, .alert, .filters, .pager { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ddd; }
  .print-only { display: block; }
  table.t th { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1200px) {
  .quick { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; right: -270px; transition: right .2s; box-shadow: -20px 0 60px rgba(0,0,0,.3); }
  body.nav-open .sidebar { right: 0; }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .g2, .g3, .g-2-1 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .user-chip span { display: none; }
}
@media (max-width: 560px) {
  .quick { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2, .form-grid .span3 { grid-column: auto; }
  .today-chip { display: none; }
}
