/* ============================================================
   Tracino — Invoice styles (Modern / Official / Thermal)
   Shared by: admin modal, my-account, print window
   ============================================================ */

/* ===================== MODERN ===================== */
.tracino-invoice.tinv-modern {
    background: #fff; color: #1f2937; direction: rtl; text-align: right;
    border-radius: 14px; border: 1px solid #e5e7eb; overflow: hidden;
    font-size: 13px; max-width: 100%;
}
.tinv-modern * { box-sizing: border-box; }
.tm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 22px; flex-wrap: wrap; }
.tm-brand { display: flex; align-items: center; gap: 12px; }
.tm-logo { width: 48px; height: 48px; border-radius: 13px; background: linear-gradient(135deg, #3b82f6, #22d3ee); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tm-store h1 { font-size: 17px; margin: 0 0 3px; color: #0f172a; }
.tm-meta { color: #6b7280; font-size: 11.5px; line-height: 1.9; }
.tm-id { text-align: left; }
.tm-badge { display: inline-block; background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; font-size: 11px; font-weight: bold; padding: 4px 14px; border-radius: 20px; margin-bottom: 6px; }
.tm-id h2 { margin: 0 0 4px; font-size: 20px; color: #0f172a; letter-spacing: 1px; }
.tm-hr { height: 4px; background: linear-gradient(90deg, #3b82f6, #22d3ee, transparent); margin: 0 22px 18px; border-radius: 4px; }
.tm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 0 22px 16px; }
.tm-card { background: #f9fafb; border: 1px solid #eef1f6; border-radius: 12px; padding: 13px 15px; }
.tm-card h3 { font-size: 12.5px; color: #374151; margin: 0 0 8px; padding-bottom: 7px; border-bottom: 1px dashed #e5e7eb; }
.tm-row { font-size: 12px; color: #4b5563; padding: 3px 0; line-height: 1.9; word-break: break-word; }
.tm-row b { color: #0f172a; }
.tm-code { font-family: 'Courier New', monospace; letter-spacing: .5px; color: #2563eb; }
.tm-code.green { color: #059669; }
.tm-items { width: 100%; border-collapse: collapse; margin: 4px 0 0; font-size: 12.5px; }
.tm-items thead th { background: #f0f6ff; color: #1e40af; text-align: right; padding: 10px 14px; border-top: 1px solid #dbeafe; border-bottom: 2px solid #bfdbfe; font-size: 12px; }
.tm-items tbody td { padding: 10px 14px; border-bottom: 1px solid #eef1f6; color: #1f2937; }
.tm-item-name { font-weight: bold; color: #0f172a; }
.tm-item-meta { color: #6b7280; font-size: 11px; margin-top: 3px; font-weight: normal; }
.tm-total-wrap { display: flex; justify-content: flex-end; padding: 14px 22px 6px; }
.tm-total-box { min-width: 300px; max-width: 100%; background: #f9fafb; border: 1px solid #eef1f6; border-radius: 12px; padding: 6px 14px; }
.tm-trow { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; color: #4b5563; padding: 7px 0; border-bottom: 1px dashed #e5e7eb; }
.tm-trow:last-child { border-bottom: none; }
.tm-trow.tm-grand { color: #1d4ed8; font-weight: bold; font-size: 14px; border-top: 2px solid #bfdbfe; margin-top: 3px; padding-top: 10px; }
.tm-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 22px 17px; background: #f9fafb; border-top: 1px solid #eef1f6; margin-top: 12px; font-size: 11.5px; color: #6b7280; line-height: 1.9; }
.tm-footer strong { color: #2563eb; }
.tm-thanks { text-align: right; }

/* ===================== OFFICIAL ===================== */
.tracino-invoice.tinv-official {
    background: #fff; color: #111827; direction: rtl; text-align: right;
    border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden;
    font-size: 12.5px; max-width: 100%;
}
.tinv-official * { box-sizing: border-box; }
.to-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 22px 14px; border-bottom: 2px solid #111827; flex-wrap: wrap; }
.to-brand { display: flex; align-items: center; gap: 11px; }
.to-logo { width: 42px; height: 42px; border: 1.5px solid #111827; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #111827; flex-shrink: 0; }
.to-kicker { font-size: 10.5px; color: #6b7280; letter-spacing: 1px; }
.to-brand h1 { font-size: 17px; margin: 0; color: #111827; }
.to-title { text-align: center; border: 1.5px solid #111827; padding: 8px 18px; border-radius: 4px; }
.to-title span { display: block; font-size: 10.5px; color: #4b5563; letter-spacing: 2px; }
.to-title strong { font-size: 14px; color: #111827; }
.to-docmeta { display: flex; gap: 16px; flex-wrap: wrap; margin: 0; }
.to-docmeta div { text-align: left; }
.to-docmeta dt { font-size: 10px; color: #6b7280; }
.to-docmeta dd { margin: 0; font-size: 12px; font-weight: bold; color: #111827; }
.to-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-bottom: 1px solid #e5e7eb; }
.to-party { padding: 15px 22px; }
.to-party:first-child { border-left: 1px solid #e5e7eb; }
.to-party h2 { font-size: 13px; color: #111827; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.to-party h2 span { width: 21px; height: 21px; background: #111827; color: #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.to-party-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.to-party-grid .wide { grid-column: 1 / -1; }
.to-party-grid small { display: block; font-size: 10px; color: #6b7280; margin-bottom: 1px; }
.to-party-grid strong { font-size: 12px; color: #111827; word-break: break-word; line-height: 1.8; }
.to-sec-title { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px 9px; }
.to-sec-title h2 { font-size: 13px; color: #111827; margin: 0; display: flex; align-items: center; gap: 8px; }
.to-sec-title h2 span { width: 21px; height: 21px; background: #111827; color: #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.to-sec-title > div { font-size: 11px; color: #6b7280; }
.to-table-wrap { padding: 0 22px; overflow-x: auto; }
.to-items table { width: 100%; border-collapse: collapse; font-size: 12px; }
.to-items thead th { background: #f3f4f6; color: #111827; border: 1px solid #d1d5db; padding: 8px 10px; text-align: right; font-size: 11.5px; }
.to-items tbody td { border: 1px solid #e5e7eb; padding: 8px 10px; color: #1f2937; }
.to-items .to-rownum { width: 44px; text-align: center; color: #6b7280; }
.to-items .to-desc { font-weight: bold; color: #111827; }
.to-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 22px; }
.to-details h2, .to-totals h2 { font-size: 12.5px; color: #111827; margin: 0 0 9px; }
.to-details dl { margin: 0; }
.to-details dl div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #e5e7eb; font-size: 11.5px; flex-wrap: wrap; }
.to-details dt { color: #6b7280; }
.to-details dd { margin: 0; font-weight: bold; color: #111827; }
.to-details .mono { font-family: 'Courier New', monospace; letter-spacing: .5px; }
.to-trow { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #374151; padding: 7px 0; border-bottom: 1px dashed #e5e7eb; }
.to-trow.to-grand { border-top: 2px solid #111827; border-bottom: none; margin-top: 4px; padding-top: 10px; font-weight: bold; font-size: 13.5px; color: #111827; }
.to-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 26px 40px 12px; }
.to-sign div { border-top: 1px dotted #9ca3af; text-align: center; padding-top: 7px; font-size: 11px; color: #6b7280; }
.to-foot { padding: 11px 22px; background: #f9fafb; border-top: 1px solid #e5e7eb; font-size: 10.5px; color: #6b7280; text-align: center; }
.to-foot strong { color: #111827; }

/* ===================== THERMAL ===================== */
.tracino-invoice.tinv-thermal {
    width: 302px; max-width: 100%; margin: 0 auto;
    background: #fff; color: #111827; direction: rtl; text-align: right;
    border: 1px solid #e5e7eb; padding: 14px 13px;
    font-size: 11.5px; line-height: 1.8;
    font-family: 'Kalameh', Tahoma, monospace;
}
.tinv-thermal * { box-sizing: border-box; }
.tt-head { text-align: center; border-bottom: 1px dashed #9ca3af; padding-bottom: 9px; margin-bottom: 9px; }
.tt-shop { font-size: 15px; font-weight: bold; color: #111827; }
.tt-meta { font-size: 10.5px; color: #4b5563; margin-top: 3px; }
.tt-meta b { direction: ltr; display: inline-block; }
.tt-sep { margin: 0 4px; }
.tt-seller { font-size: 10px; color: #6b7280; margin-top: 3px; }
.tt-buyer { border-bottom: 1px dashed #9ca3af; padding-bottom: 8px; margin-bottom: 8px; font-size: 10.5px; color: #374151; }
.tt-buyer div { padding: 1.5px 0; word-break: break-word; }
.tt-buyer strong { color: #111827; }
.tt-items, .tt-summary { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.tt-items thead th { text-align: right; border-bottom: 1px solid #111827; padding: 4px 2px; font-size: 10px; color: #111827; }
.tt-items thead th small { font-weight: normal; color: #6b7280; }
.tt-items tbody td { padding: 5px 2px; border-bottom: 1px dotted #d1d5db; color: #111827; vertical-align: top; }
.tt-col-qty { width: 44px; text-align: center !important; }
.tt-col-total { width: 84px; text-align: left !important; direction: ltr; }
.tt-summary td, .tt-summary th { padding: 4px 2px; font-size: 10.5px; color: #111827; }
.tt-summary th { text-align: right; width: 78px; }
.tt-summary .tt-qty { width: 40px; text-align: center; direction: ltr; }
.tt-summary td { text-align: left; direction: ltr; }
.tt-summary .tt-method { direction: rtl; display: inline-block; color: #6b7280; }
.tt-final th, .tt-final td { border-top: 1px solid #111827; border-bottom: 1px double #111827; font-weight: bold; font-size: 12px; padding: 6px 2px; }
.tt-payrow td { direction: rtl; text-align: right; }
.tt-codes { border: 1px dashed #9ca3af; border-radius: 4px; padding: 6px 8px; margin: 9px 0 0; font-size: 9.5px; color: #4b5563; }
.tt-codes div { padding: 1px 0; word-break: break-all; }
.tt-codes b { direction: ltr; display: inline-block; font-family: 'Courier New', monospace; color: #111827; }
.tt-note { border-top: 1px dashed #9ca3af; margin-top: 9px; padding-top: 7px; font-size: 10px; color: #4b5563; word-break: break-word; }
.tt-foot { text-align: center; border-top: 1px dashed #9ca3af; margin-top: 10px; padding-top: 8px; font-size: 10px; font-weight: bold; color: #111827; }

/* ===================== TRACINO — CLASSIC ===================== */
.tracino-invoice.tinv-tk-classic {
    background: #fff; color: #000; direction: rtl; text-align: right;
    border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden;
    padding: 18px 16px 14px; font-size: 13px; line-height: 1.9; max-width: 100%;
}
.tinv-tk-classic * { box-sizing: border-box; }
.tk1-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid #e5e7eb; margin-bottom: 14px; }
.tk1-shopmeta { text-align: right; line-height: 1.9; min-width: 0; }
.tk1-shopname { font-size: 17px; font-weight: 700; margin: 0 0 4px; color: #111827; }
.tk1-line { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 12px; }
.tk1-t { font-weight: 700; color: #374151; }
.tk1-muted { color: #6b7280; font-size: 12px; word-break: break-word; }
.tk1-logobox { width: 110px; height: 84px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto; overflow: hidden; }
.tk1-logobox img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tk1-logoph { font-size: 26px; font-weight: 800; color: #cbd5e1; letter-spacing: 1px; }
.tk1-ordermeta { text-align: left; line-height: 1.9; min-width: 0; }
.tk1-ordertitle { font-weight: 700; font-size: 15px; color: #111827; margin-bottom: 4px; }
.tk1-badge { display: inline-block; background: #f3f4f6; border: 1px dashed #d1d5db; color: #6b7280; padding: 2px 10px; border-radius: 10px; font-size: 11.5px; font-weight: normal; margin-right: 6px; }
.tk1-badge b { font-weight: 700; }
.tk1-customer { border: 1px solid #111827; padding: 13px 15px; background: #ececec; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.tk1-comp { font-size: 12.5px; }
.tk1-comp .tk1-t { margin-left: 3px; }
.tk1-codes { display: flex; gap: 8px 22px; flex-wrap: wrap; border: 1px dashed #9ca3af; border-radius: 6px; padding: 8px 12px; margin-bottom: 14px; font-size: 12px; color: #374151; background: #fafafa; }
.tk1-codes b { direction: ltr; display: inline-block; font-family: 'Courier New', monospace; font-weight: 700; color: #111827; }
.tk1-codes b.green { color: #047857; }
.tk1-tablewrap { width: 100%; overflow-x: auto; }
table.tk1-products { width: 100%; border-collapse: collapse; margin-bottom: 12px; text-align: center; font-size: 12.5px; }
table.tk1-products th { background: #d9d9d9; padding: 9px 8px; border: 1px solid #000; font-size: 12px; white-space: nowrap; }
table.tk1-products td { border: 1px solid #000; padding: 9px 8px; vertical-align: middle; }
table.tk1-products tr.odd td { background: #fff; }
table.tk1-products tr.even td { background: #f6f6f6; }
.tk1-col-row { width: 44px; }
.tk1-col-id { width: 64px; }
.tk1-col-qty { width: 56px; }
.tk1-itemname { text-align: right; font-weight: 600; }
.tk1-itemmeta { color: #6b7280; font-size: 11px; font-weight: normal; margin-top: 3px; }
.tk1-empty { text-align: center !important; color: #94a3b8; padding: 16px 8px !important; }
.tk1-count { margin: 0 0 12px; font-size: 12.5px; }
table.tk1-totaltable { width: 55%; min-width: 300px; margin: 0 0 14px auto; border: 1px solid #000; border-collapse: collapse; text-align: center; font-size: 12.5px; }
table.tk1-totaltable th, table.tk1-totaltable td { border: 1px solid #000; padding: 8px 10px; }
table.tk1-totaltable th { background: #ececec; text-align: right; white-space: nowrap; }
table.tk1-totaltable th.tk1-th-total, table.tk1-totaltable th.tk1-th-ship, table.tk1-totaltable th.tk1-th-final { background: #cfcfcf; }
table.tk1-totaltable td { text-align: left; }
.tk1-notes { border: 1px solid #111827; background: #f9fafb; padding: 10px 12px; margin: 0 0 14px; line-height: 1.9; font-size: 12.5px; }
.tk1-notes p { margin: 0; }
.tk1-notes p + p { margin-top: 8px; }
.tk1-signature { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 14px 20px 0 50px; font-size: 12.5px; }
.tk1-signature img { max-width: 120px; max-height: 80px; width: auto; height: auto; object-fit: contain; }
.tk1-foot { text-align: center; margin-top: 14px; padding-top: 9px; border-top: 1px dashed #d1d5db; font-size: 11px; color: #6b7280; }
.tk1-foot strong { color: #153677; }

/* ===================== TRACINO — MODERN ===================== */
.tracino-invoice.tinv-tk-modern {
    --tk2-primary: #153677; --tk2-border: #e5e7eb; --tk2-text: #111827; --tk2-muted: #6b7280; --tk2-soft: #f9fafb;
    background: #fff; color: var(--tk2-text); direction: rtl; text-align: right;
    border: 1px solid var(--tk2-border); border-radius: 14px; overflow: hidden;
    padding: 22px; font-size: 13px; max-width: 100%;
}
.tinv-tk-modern * { box-sizing: border-box; }
.tk2-header { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--tk2-border); margin-bottom: 6px; }
.tk2-brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.tk2-logo { width: 68px; height: 68px; object-fit: contain; background: #fff; border: 1px solid var(--tk2-border); border-radius: 12px; padding: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--tk2-primary); }
.tk2-store h1 { font-size: 19px; margin: 0 0 5px; color: var(--tk2-text); }
.tk2-meta { font-size: 11.5px; color: var(--tk2-muted); line-height: 1.9; }
.tk2-invid { text-align: left; }
.tk2-badge { display: inline-block; background: var(--tk2-soft); border: 1px dashed var(--tk2-border); color: var(--tk2-muted); padding: 5px 12px; border-radius: 10px; font-size: 12px; margin-bottom: 7px; }
.tk2-invid h2 { margin: 0 0 4px; font-size: 21px; color: var(--tk2-primary); letter-spacing: .5px; }
.tk2-hr { height: 4px; background: linear-gradient(90deg, var(--tk2-primary), #60a5fa); border-radius: 999px; margin: 12px 0 16px; }
.tk2-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.tk2-card { border: 1px solid var(--tk2-border); border-radius: 12px; padding: 13px 14px; background: #fff; min-width: 0; }
.tk2-card h3 { margin: 0 0 9px; font-size: 13px; color: var(--tk2-muted); padding-bottom: 7px; border-bottom: 1px dashed var(--tk2-border); }
.tk2-row { font-size: 12.5px; line-height: 1.9; color: #374151; word-break: break-word; }
.tk2-row b { color: var(--tk2-text); }
.tk2-code { font-family: 'Courier New', monospace; direction: ltr; display: inline-block; color: #2563eb; letter-spacing: .5px; }
.tk2-code.green { color: #059669; }
.tk2-tablewrap { width: 100%; overflow-x: auto; }
table.tk2-items { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--tk2-border); border-radius: 12px; background: #fff; font-size: 12.5px; }
.tk2-items thead th { background: var(--tk2-soft); font-weight: 600; font-size: 12.5px; text-align: center; padding: 11px 12px; border-bottom: 1px solid var(--tk2-border); white-space: nowrap; }
.tk2-items tbody td { font-size: 12.5px; padding: 11px 12px; border-bottom: 1px solid var(--tk2-border); text-align: center; vertical-align: top; }
.tk2-items tbody tr:last-child td { border-bottom: none; }
.tk2-items .text-right { text-align: right; }
.tk2-itemmeta { color: var(--tk2-muted); font-size: 11px; margin-top: 4px; font-weight: normal; }
.tk2-empty { text-align: center !important; color: #94a3b8; padding: 18px 10px !important; }
.tk2-total { display: grid; grid-template-columns: 1fr minmax(280px, 360px); gap: 16px; margin-top: 16px; align-items: start; }
.tk2-spacer { height: 1px; }
.tk2-box { border: 1px solid var(--tk2-border); border-radius: 12px; padding: 0; overflow: hidden; background: #fff; }
.tk2-trow { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--tk2-border); }
.tk2-trow:last-child { border-bottom: none; }
.tk2-trow.tk2-grand { background: var(--tk2-soft); font-weight: 700; color: var(--tk2-primary); font-size: 14px; }
.tk2-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: center; }
.tk2-note { border: 1px dashed var(--tk2-border); border-radius: 12px; background: var(--tk2-soft); padding: 12px 14px; font-size: 12.5px; color: #374151; }
.tk2-note strong { color: var(--tk2-text); }
.tk2-note:empty { display: none; }
.tk2-thanks { text-align: left; color: var(--tk2-muted); font-size: 12px; line-height: 1.9; }
.tk2-powered { margin-top: 14px; padding-top: 9px; border-top: 1px dashed var(--tk2-border); text-align: center; font-size: 11px; color: var(--tk2-muted); }
.tk2-powered strong { color: var(--tk2-primary); }

/* ===================== TRACINO — OFFICIAL ===================== */
.tracino-invoice.tinv-tk-official {
    --tk3-navy: #153677; --tk3-blue: #2563a7; --tk3-soft: #edf4ff; --tk3-border: #c8d5e6; --tk3-text: #142033; --tk3-muted: #667085;
    background: #fff; color: var(--tk3-text); direction: rtl; text-align: right;
    border-radius: 6px; overflow: hidden; font-size: 13px; line-height: 1.75; max-width: 100%; padding: 0;
}
.tinv-tk-official * { box-sizing: border-box; }
.tk3-sheet { position: relative; padding: 26px 24px 18px; border-top: 5px solid var(--tk3-navy); background: #fff; overflow: hidden; }
.tk3-sheet::before { position: absolute; z-index: 0; top: -90px; left: -80px; width: 210px; height: 210px; border: 46px solid rgba(37, 99, 167, .045); border-radius: 50%; content: ""; }
.tk3-sheet > * { position: relative; z-index: 1; }
.tk3-header { display: grid; grid-template-columns: 1.2fr 1fr 1fr; align-items: center; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--tk3-navy); }
.tk3-brand { display: flex; min-width: 0; align-items: center; gap: 10px; }
.tk3-logo { width: 52px; height: 52px; flex: 0 0 auto; object-fit: contain; }
.tk3-kicker { margin-bottom: 2px; color: var(--tk3-blue); font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.tk3-brand h1 { margin: 0; color: var(--tk3-navy); font-size: 17px; line-height: 1.45; }
.tk3-muted { color: var(--tk3-muted); font-size: 10.5px; }
.tk3-title { text-align: center; }
.tk3-title span, .tk3-title strong { display: block; }
.tk3-title span { color: var(--tk3-navy); font-size: 21px; font-weight: 900; line-height: 1.4; }
.tk3-title strong { margin-top: 3px; color: var(--tk3-muted); font-size: 11px; }
dl.tk3-docmeta { margin: 0; overflow: hidden; border: 1px solid var(--tk3-border); border-radius: 8px; }
.tk3-docmeta > div { display: grid; grid-template-columns: 1fr 1.2fr; }
.tk3-docmeta > div + div { border-top: 1px solid #dbe4ef; }
.tk3-docmeta dt, .tk3-docmeta dd { margin: 0; padding: 4px 8px; font-size: 10px; }
.tk3-docmeta dt { background: #f5f8fc; color: var(--tk3-muted); }
.tk3-docmeta dd { color: var(--tk3-text); font-weight: 700; }
.tk3-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.tk3-party { overflow: hidden; border: 1px solid var(--tk3-border); border-radius: 9px; }
.tk3-party h2, .tk3-sectitle h2 { display: flex; margin: 0; align-items: center; gap: 7px; color: var(--tk3-navy); font-size: 12px; }
.tk3-party h2 { padding: 7px 9px; border-bottom: 1px solid var(--tk3-border); background: var(--tk3-soft); }
.tk3-party h2 span, .tk3-sectitle h2 span { display: inline-grid; width: 21px; height: 21px; border-radius: 50%; background: var(--tk3-navy); color: #fff; font-size: 10px; place-items: center; flex-shrink: 0; }
.tk3-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 3px 9px 7px; }
.tk3-pgrid > div { display: flex; min-width: 0; align-items: baseline; gap: 5px; padding: 5px 4px; border-bottom: 1px dashed #dbe4ef; }
.tk3-pgrid > div.wide, .tk3-pgrid > div.email { grid-column: 1 / -1; }
.tk3-pgrid small { flex: 0 0 auto; margin: 0; color: var(--tk3-muted); font-size: 9px; white-space: nowrap; }
.tk3-pgrid strong { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; font-size: 10.5px; font-weight: 600; text-align: right; }
.tk3-items { margin-top: 16px; }
.tk3-sectitle { display: flex; margin-bottom: 7px; align-items: center; justify-content: space-between; }
.tk3-sectitle > div { color: var(--tk3-muted); font-size: 10px; }
.tk3-tablewrap { overflow: hidden auto; border: 1px solid var(--tk3-border); border-radius: 8px; }
.tk3-items table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tk3-items th, .tk3-items td { padding: 8px 6px; border-left: 1px solid #dbe4ef; border-bottom: 1px solid #dbe4ef; text-align: center; vertical-align: middle; font-size: 10.5px; }
.tk3-items th:last-child, .tk3-items td:last-child { border-left: 0; }
.tk3-items tr:last-child td { border-bottom: 0; }
.tk3-items th { background: var(--tk3-navy); color: #fff; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.tk3-items tbody tr:nth-child(even) { background: #f8fafc; }
.tk3-col-row { width: 5%; }
.tk3-itemmeta { color: var(--tk3-muted); font-size: 9px; font-weight: normal; margin-top: 2px; }
.tk3-empty { text-align: center !important; color: #94a3b8; padding: 16px 8px !important; }
.tk3-summary { display: grid; grid-template-columns: 1fr 1.15fr; align-items: start; gap: 16px; margin-top: 16px; }
.tk3-details { min-height: 100%; padding: 9px 11px; border: 1px solid var(--tk3-border); border-radius: 8px; background: #f8fafc; }
.tk3-details h2 { margin: 0 0 7px; color: var(--tk3-navy); font-size: 11.5px; }
.tk3-details dl { margin: 0; }
.tk3-details dl > div { display: flex; padding: 4px 0; justify-content: space-between; gap: 12px; border-bottom: 1px dashed #d6e0eb; font-size: 10.5px; flex-wrap: wrap; }
.tk3-details dl > div:last-child { border-bottom: 0; }
.tk3-details dt { color: var(--tk3-muted); }
.tk3-details dd { margin: 0; font-weight: 600; }
.tk3-details .mono { font-family: 'Courier New', monospace; letter-spacing: .5px; word-break: break-all; }
table.tk3-totals { overflow: hidden; border: 1px solid var(--tk3-border); border-radius: 8px; border-spacing: 0; border-collapse: separate; width: 100%; }
.tk3-totals th, .tk3-totals td { padding: 7px 10px; border-bottom: 1px solid #dbe4ef; font-size: 10.5px; }
.tk3-totals tr:last-child th, .tk3-totals tr:last-child td { border-bottom: 0; }
.tk3-totals th { background: #f8fafc; color: #475467; text-align: right; font-weight: 600; }
.tk3-totals td { text-align: left; font-weight: 700; }
.tk3-totals .deduction { color: #b42318; }
.tk3-totals .grand-total th, .tk3-totals .grand-total td { padding-top: 9px; padding-bottom: 9px; background: var(--tk3-navy); color: #fff; font-size: 11.5px; }
.tk3-notes { margin-top: 14px; padding: 8px 11px; border: 1px dashed #b5c5d8; border-radius: 8px; background: #fbfcfe; }
.tk3-notes h2 { margin: 0 0 7px; color: var(--tk3-navy); font-size: 11.5px; }
.tk3-notes p { margin: 3px 0; font-size: 10.5px; }
.tk3-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 20px; break-inside: avoid; }
.tk3-signatures > div { position: relative; min-height: 78px; padding-top: 7px; border-top: 1px solid #8291a5; color: #475467; text-align: center; font-size: 10.5px; }
.tk3-signatures img { display: block; max-width: 110px; max-height: 62px; margin: 5px auto 0; object-fit: contain; }
.tk3-legal { margin: 12px 0 0; padding-top: 6px; border-top: 1px dashed #c5d0de; color: var(--tk3-muted); font-size: 9px; text-align: center; }
.tk3-legal strong { color: var(--tk3-navy); }

/* ===================== TRACINO — THERMAL ===================== */
.tracino-invoice.tinv-tk-thermal {
    --tk4-border: #222;
    width: 302px; max-width: 100%; margin: 0 auto;
    background: #fff; color: #000; direction: rtl; text-align: right;
    border: 1px solid #e2e6ee; padding: 14px 12px;
    font-size: 11.5px; line-height: 1.75;
    font-family: 'Kalameh', Tahoma, monospace;
}
.tinv-tk-thermal * { box-sizing: border-box; }
.tk4-receipt { width: 100%; }
.tk4-head { text-align: center; border-bottom: 1px dashed #000; padding-bottom: 6px; margin-bottom: 6px; }
.tk4-shop { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.tk4-meta { font-size: 10.5px; }
.tk4-meta .sep { margin: 0 3px; }
.tk4-seller { font-size: 10px; margin-top: 2px; color: #333; }
.tk4-buyer { border: 1px solid var(--tk4-border); padding: 5px 6px; margin-bottom: 6px; font-size: 10.5px; }
.tk4-buyer div { padding: 1.5px 0; word-break: break-word; }
.tk4-buyer strong { color: #000; }
table.tk4-items, table.tk4-summary { width: 100%; table-layout: fixed; border-collapse: collapse; border-spacing: 0; margin-bottom: 6px; font-size: 10.5px; }
.tk4-items th, .tk4-items td, .tk4-summary th, .tk4-summary td { border: 1px solid var(--tk4-border); padding: 4px 3px; text-align: center; vertical-align: middle; overflow-wrap: anywhere; }
.tk4-items th { font-weight: 700; font-size: 10px; }
.tk4-items .col-name { width: 34%; text-align: right; }
.tk4-items .col-qty { width: 13%; }
.tk4-items .col-price, .tk4-items .col-total { width: 26.5%; }
.tk4-empty { text-align: center !important; color: #94a3b8; }
.tk4-summary th { text-align: right; font-weight: 700; width: 38%; }
.tk4-summary .qty-cell { width: 14%; }
.tk4-summary td { text-align: left; direction: ltr; }
.tk4-summary th { direction: rtl; }
.tk4-summary .shipping-cell .method { font-size: 9.5px; direction: rtl; display: inline-block; color: #444; }
.tk4-summary .payment-row td { direction: rtl; text-align: right; }
.tk4-summary .final-row th, .tk4-summary .final-row td { font-weight: 700; font-size: 12px; }
.tk4-codes { border: 1px dashed #666; border-radius: 4px; padding: 5px 7px; margin: 6px 0 0; font-size: 9.5px; color: #333; }
.tk4-codes div { padding: 1px 0; word-break: break-all; }
.tk4-codes b { direction: ltr; display: inline-block; font-family: 'Courier New', monospace; color: #000; }
.tk4-note { font-size: 10px; margin-top: 4px; word-break: break-word; }
.tk4-foot { text-align: center; border-top: 1px dashed #000; padding-top: 5px; margin-top: 5px; font-weight: 700; font-size: 10px; }

/* ===================== Embedded contexts ===================== */
.tracino-adm-body .tinv-modern,
.tracino-adm-body .tinv-official,
.tracino-adm-body .tinv-thermal,
.tracino-adm-body .tinv-tk-classic,
.tracino-adm-body .tinv-tk-modern,
.tracino-adm-body .tinv-tk-official,
.tracino-adm-body .tinv-tk-thermal { box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
.tracino-adm-body .tinv-thermal,
.tracino-adm-body .tinv-tk-thermal { margin: 0 auto; }

/* ===================== Print ===================== */
@media print {
    .tinv-modern, .tinv-official,
    .tinv-tk-classic, .tinv-tk-modern, .tinv-tk-official { border-radius: 0; box-shadow: none; }
    .tinv-thermal { border: none; }
    .tracino-invoice.tinv-tk-classic { padding: 0; border: none; }
    .tracino-invoice.tinv-tk-modern { border: none; }
}

/* ===================== Responsive (TRACINO styles) ===================== */
@media screen and (max-width: 768px) {
    .tk1-header { grid-template-columns: 1fr; gap: 10px; text-align: center; }
    .tk1-shopmeta, .tk1-ordermeta { text-align: center; }
    .tk1-customer { flex-direction: column; }
    table.tk1-totaltable { width: 100%; min-width: 0; }
    .tk2-header { grid-template-columns: 1fr; align-items: flex-start; }
    .tk2-invid { text-align: right; }
    .tk2-cards, .tk2-total, .tk2-footer { grid-template-columns: 1fr; }
    .tk2-thanks { text-align: right; }
    .tk3-header, .tk3-parties, .tk3-summary { grid-template-columns: 1fr; }
    .tk3-title { text-align: right; }
}
