/* فاکتورساز آنلاین کیان v3.3.8-lite - استایل اصلی */
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-Thin.woff2') format('woff2');font-weight:100;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-ExtraLight.woff2') format('woff2');font-weight:200;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-Light.woff2') format('woff2');font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-Medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-SemiBold.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-Bold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-ExtraBold.woff2') format('woff2');font-weight:800;font-style:normal;font-display:swap}
@font-face{font-family:'Estedad-FD';src:url('fonts/Estedad-FD-Black.woff2') format('woff2');font-weight:900;font-style:normal;font-display:swap}
:root{--font-main:'Estedad-FD',Vazirmatn,YekanBakhFaNum,IRANSans,Tahoma,Arial,sans-serif;--bg:#f5f7fb;--card:#fff;--text:#172033;--muted:#667085;--line:#e6e9f0;--primary:#2563eb;--primary2:#1d4ed8;--green:#16a34a;--red:#dc2626;--orange:#ea580c;--dark:#0f172a;--shadow:0 18px 45px rgba(15,23,42,.075)}

/* Theme system v3.3.7 */
:root{color-scheme:light;--surface:#fff;--input:#fff;--soft:#f8fafc;--sidebar:#ffffff;--sidebar-text:#344054;--sidebar-active:#eff6ff;--sidebar-border:#e6e9f0;--auth-card:rgba(255,255,255,.92);--auth-shadow:0 26px 70px rgba(15,23,42,.13)}
html[data-theme="dark"]{color-scheme:dark;--bg:#0b1120;--card:#111827;--surface:#111827;--input:#0f172a;--text:#eef2ff;--muted:#94a3b8;--line:#263449;--primary:#3b82f6;--primary2:#60a5fa;--green:#22c55e;--red:#f87171;--orange:#fb923c;--dark:#020617;--sidebar:#020617;--sidebar-text:#cbd5e1;--shadow:0 20px 55px rgba(0,0,0,.28);--auth-card:rgba(15,23,42,.88);--auth-shadow:0 28px 80px rgba(0,0,0,.45)}
.fs-theme-toggle{direction:ltr;display:inline-flex;align-items:center;gap:2px;width:74px;height:38px;padding:4px;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--card) 86%,transparent);box-shadow:0 10px 28px rgba(15,23,42,.08);backdrop-filter:blur(10px);position:relative;vertical-align:middle}
.fs-theme-toggle button{width:30px;height:30px;border:0;border-radius:999px;background:transparent;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:.2s ease}
.fs-theme-toggle button svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fs-theme-toggle button.active{background:#fff;color:#2563eb;box-shadow:0 5px 14px rgba(37,99,235,.20)}
html[data-theme="dark"] .fs-theme-toggle button.active{background:#1e293b;color:#facc15;box-shadow:0 5px 18px rgba(250,204,21,.16)}
.global-theme-wrap{position:fixed;top:18px;left:18px;z-index:80}.topbar .fs-theme-toggle{flex:0 0 auto}.mobilebar .fs-theme-toggle{margin-right:auto}
.kian-logo-img{width:58px;height:58px;object-fit:contain}.brand .kian-logo-img{width:48px;height:48px}.auth-brand-logo{display:flex;align-items:center;justify-content:center;margin-bottom:10px}.auth-card .logo-title{text-align:center}.auth-card .sub{text-align:center}.auth-card .btn-primary{background:linear-gradient(135deg,#2563eb,#1d4ed8);box-shadow:0 14px 30px rgba(37,99,235,.22)}
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] .card,html[data-theme="dark"] .auth-card,html[data-theme="dark"] .install-card,html[data-theme="dark"] .paper,html[data-theme="dark"] .template-card,html[data-theme="dark"] .bank-list-card{background:var(--card);border-color:var(--line);color:var(--text)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea,html[data-theme="dark"] table,html[data-theme="dark"] .suggest,html[data-theme="dark"] .jalali-picker{background:var(--input);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] th{background:#182235;color:#cbd5e1}html[data-theme="dark"] td,html[data-theme="dark"] th{border-color:var(--line)}html[data-theme="dark"] .btn{background:#1e293b;color:#e2e8f0}html[data-theme="dark"] .btn-primary{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff}html[data-theme="dark"] .sidebar{background:var(--sidebar);color:#fff}html[data-theme="dark"] .nav a{color:var(--sidebar-text)}html[data-theme="dark"] .total-box,html[data-theme="dark"] .info-box,html[data-theme="dark"] .invoice-bank-account,html[data-theme="dark"] .settings-tabs a{background:#0f172a;border-color:var(--line);color:var(--text)}html[data-theme="dark"] .paper{background:#fff;color:#172033}html[data-theme="dark"] .paper input,html[data-theme="dark"] .paper select,html[data-theme="dark"] .paper textarea{background:#fff;color:#172033}

*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);direction:rtl;font-family:var(--font-main);font-size:14px;line-height:1.75}a{text-decoration:none;color:inherit}button,input,select,textarea,table{font:inherit}.auth{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:28px;position:relative;overflow:hidden;background:linear-gradient(135deg,#f8fafc,#eef2ff)}.auth:before{content:'';position:absolute;inset:-18px;background:url('../img/login-bg.jpg') center/cover no-repeat;filter:blur(1.4px);opacity:.86;transform:scale(1.01);z-index:0}.auth:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,rgba(248,250,252,.30),rgba(255,255,255,.66),rgba(239,246,255,.30));z-index:1}.auth-card,.install-card{width:100%;max-width:480px;background:#fff;border:1px solid var(--line);border-radius:26px;box-shadow:var(--shadow);padding:30px}.auth-card{position:relative;z-index:2;background:var(--auth-card);box-shadow:var(--auth-shadow);backdrop-filter:blur(14px);border-color:rgba(226,232,240,.78)}.install-card{max-width:940px;margin:34px auto}.logo-title{font-size:27px;font-weight:900;margin:0 0 8px}.sub{color:var(--muted);margin:0 0 18px}.layout{min-height:100vh}.sidebar{position:fixed;top:0;bottom:0;right:0;width:278px;background:var(--sidebar);color:var(--text);padding:22px;overflow:auto;z-index:20;border-left:1px solid var(--sidebar-border);box-shadow:0 18px 45px rgba(15,23,42,.055)}.brand{display:flex;gap:12px;align-items:center;margin-bottom:20px}.mark{width:48px;height:48px;border-radius:18px;background:linear-gradient(135deg,#2563eb,#14b8a6);display:flex;align-items:center;justify-content:center;font-weight:900;font-size:21px}.brand strong{display:block;font-size:18px}.brand small{display:block;color:var(--muted)}.nav a{display:flex;justify-content:space-between;align-items:center;padding:13px 14px;border-radius:15px;margin:6px 0;color:var(--sidebar-text);font-weight:800}.nav a:hover,.nav a.active{background:var(--sidebar-active);color:var(--primary)}.content{margin-right:278px;padding:28px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.topbar h1{margin:0;font-size:24px}.topbar p{margin:4px 0 0;color:var(--muted)}.mobilebar{display:none}.card{background:var(--card);border:1px solid var(--line);border-radius:23px;box-shadow:var(--shadow);padding:21px;margin-bottom:18px}.grid{display:grid;gap:16px}.g4{grid-template-columns:repeat(4,1fr)}.g3{grid-template-columns:repeat(3,1fr)}.g2{grid-template-columns:repeat(2,1fr)}.stat h3{margin:0;color:var(--muted);font-size:13px}.stat strong{display:block;margin-top:9px;font-size:24px}.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.btn{border:0;border-radius:14px;padding:10px 15px;background:#eef2f7;color:#111827;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:800;white-space:nowrap}.btn:hover{filter:brightness(.98)}.btn-primary{background:var(--primary);color:#fff}.btn-green{background:var(--green);color:#fff}.btn-red{background:var(--red);color:#fff}.btn-orange{background:var(--orange);color:#fff}.btn-sm{padding:7px 10px;border-radius:11px;font-size:12px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.form-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.field label{display:block;margin:0 0 6px;font-weight:850;color:var(--text)}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:16px;padding:12px 13px;background:var(--input);color:var(--text);outline:none;box-shadow:0 1px 0 rgba(15,23,42,.02)}textarea{min-height:92px;resize:vertical}input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(37,99,235,.08)}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:18px}table{width:100%;border-collapse:separate;border-spacing:0;background:#fff}th,td{padding:12px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle}th{background:#f8fafc;color:#475467;font-size:13px}tr:last-child td{border-bottom:0}.badge{padding:5px 10px;border-radius:999px;font-size:12px;font-weight:900;display:inline-flex}.paid{background:#dcfce7;color:#166534}.pending{background:#ffedd5;color:#9a3412}.unpaid{background:#fee2e2;color:#991b1b}.overdue{background:#ffe4e6;color:#9f1239}.partial{background:#e0f2fe;color:#075985}.draft{background:#e0e7ff;color:#3730a3}.notice{padding:12px 14px;border-radius:15px;margin-bottom:16px;background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}.notice.err{background:#fef2f2;color:#991b1b;border-color:#fecaca}.notice.ok{background:#ecfdf5;color:#166534;border-color:#bbf7d0}.total-box{max-width:440px;margin-right:auto;background:#f8fafc;border:1px solid var(--line);border-radius:19px;padding:16px}.total-row{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px dashed #d0d5dd}.total-row:last-child{border:0;font-size:18px;font-weight:900}.invoice-lines input{min-width:96px}.wide{min-width:220px}.searchbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.searchbar input,.searchbar select{max-width:320px}.pager{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px;color:var(--muted)}.template-card{border:1px solid var(--line);border-radius:20px;padding:16px;background:linear-gradient(180deg,#fff,#f8fafc)}.preview{height:105px;border-radius:17px;margin-bottom:10px;background:linear-gradient(90deg,rgba(37,99,235,.15),transparent),repeating-linear-gradient(180deg,#e5e7eb 0 8px,transparent 8px 19px)}.preview.modern{background:linear-gradient(135deg,#0f172a,#2563eb)}.preview.minimal{background:linear-gradient(135deg,#fafafa,#e5e7eb)}.footer{color:var(--muted);font-size:12px;margin:24px 0 0}.paper-wrap{max-width:990px;margin:24px auto;padding:0 16px}.paper{background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);padding:34px}.invoice-head{display:flex;justify-content:space-between;gap:20px;border-bottom:2px solid #111827;padding-bottom:20px;margin-bottom:22px}.invoice-title{font-family:var(--font-main);font-size:30px;margin:0 0 10px;font-weight:900}.invoice-logo{max-width:160px;max-height:75px;object-fit:contain}.info-box{border:1px solid var(--line);border-radius:17px;background:#f8fafc;padding:14px}.invoice-modern .invoice-head{background:linear-gradient(135deg,#0f172a,#2563eb);color:#fff;border:0;border-radius:22px;padding:24px}.invoice-minimal{box-shadow:none;border:1px solid #111;border-radius:0}.invoice-minimal .invoice-head{border-bottom:1px solid #111}.print-actions{max-width:990px;margin:18px auto;display:flex;gap:8px;justify-content:flex-end;padding:0 16px}.autocomplete{position:relative}.suggest{position:absolute;top:100%;right:0;left:0;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);z-index:10;display:none;max-height:220px;overflow:auto}.suggest div{padding:9px 12px;cursor:pointer}.suggest div:hover{background:#eff6ff}.danger{border:1px solid #fecaca;background:#fff7f7}.muted{color:var(--muted)}.template-card{position:relative}.template-card.active{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.08),var(--shadow)}.template-card.active:after{content:'قالب پیش‌فرض';position:absolute;top:12px;left:12px;background:#dcfce7;color:#166534;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:900}.template-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.money-input{text-align:left;direction:ltr;font-variant-numeric:tabular-nums}.money-input::placeholder{text-align:right;direction:rtl}.current-logo-box{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.logo-broken-hint{color:#991b1b;background:#fef2f2;border:1px solid #fecaca;border-radius:12px;padding:8px 10px;font-size:12px}
.jalali-picker{position:absolute;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 18px 45px rgba(15,23,42,.14);padding:12px;z-index:9999;width:292px;direction:rtl}.jalali-picker-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.jalali-picker-title{font-weight:900;color:#172033}.jalali-picker button{border:0;background:#eff6ff;color:#1d4ed8;border-radius:10px;padding:7px 10px;cursor:pointer;font-weight:900}.jalali-picker-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.jalali-picker-dayname{font-size:11px;color:#64748b;text-align:center;font-weight:900;padding:3px}.jalali-picker-day{border:1px solid #eef2f7!important;background:#fff!important;color:#172033!important;border-radius:10px!important;min-height:33px;padding:4px!important;font-weight:800}.jalali-picker-day:hover{background:#eff6ff!important;border-color:#bfdbfe!important}.jalali-picker-day.today{background:#f97316!important;border-color:#ea580c!important;color:#fff!important;box-shadow:0 8px 18px rgba(249,115,22,.25)}.jalali-picker-day.selected{background:#2563eb!important;border-color:#2563eb!important;color:#fff!important}.jalali-picker-empty{min-height:33px}.field{position:relative}.field small{display:block;margin-top:5px;color:#667085;font-size:12px}
@media(max-width:1000px){.mobilebar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}.hamb{width:42px;height:42px;border-radius:13px;background:#eff6ff;border:1px solid #dbeafe;color:#1d4ed8;font-weight:900}.sidebar{transform:translateX(105%);transition:.25s;width:82%;max-width:310px}.sidebar.open{transform:translateX(0)}.content{margin:0;padding:18px}.topbar{display:block}.g4,.g3,.g2,.form-grid,.form-grid-3{grid-template-columns:1fr}.actions{margin-top:10px}.pager{display:block}.table-wrap{border-radius:15px}.paper{padding:20px}.invoice-head{display:block}.print-actions{justify-content:center}}@media print{body{background:#fff}.print-actions,.sidebar,.mobilebar,.no-print{display:none!important}.paper-wrap{max-width:none;margin:0;padding:0}.paper{box-shadow:none;border:0;border-radius:0;padding:0}.content{margin:0;padding:0}a[href]:after{content:''}}

/* Invoice premium print/view v2.5 */
.invoice-shell{--inv-accent:#2563eb;--inv-ink:#111827;--inv-soft:#f8fafc;--inv-line:#e5e7eb;background:#fff;color:var(--inv-ink);border-radius:28px;overflow:hidden;position:relative}
.invoice-shell:before{content:"";position:absolute;inset:0 0 auto 0;height:9px;background:linear-gradient(90deg,#0f172a,#2563eb,#14b8a6)}
.invoice-hero{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:stretch;padding:36px 36px 22px;border-bottom:1px solid var(--inv-line);background:linear-gradient(180deg,#fff,#fbfdff)}
.invoice-brand-card{display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center;text-align:center;min-height:158px;border:1px solid var(--inv-line);border-radius:24px;background:#fff;padding:18px 20px}.invoice-brand-logo{width:190px;height:82px;border:0;border-radius:0;display:flex;align-items:center;justify-content:center;background:transparent;overflow:visible;flex:0 0 auto;margin:0 0 0}.invoice-brand-logo img{max-width:185px;max-height:78px;object-fit:contain}.invoice-brand-fallback{width:92px;height:92px;border-radius:22px;background:linear-gradient(135deg,#0f172a,#2563eb);color:#fff;display:flex;align-items:center;justify-content:center;font-size:34px;font-weight:900}.invoice-brand-name{font-size:24px;font-weight:950;margin:0}.invoice-brand-sub{margin:0;color:#64748b;font-weight:700;font-size:13px;line-height:1.45}.invoice-contact{display:flex;flex-wrap:wrap;gap:8px;margin-top:13px}.invoice-chip{border:1px solid var(--inv-line);background:#fff;border-radius:999px;padding:5px 10px;color:#475569;font-size:12px}
.invoice-title-card{background:#0f172a;color:#fff;border-radius:24px;padding:23px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;min-height:158px}.invoice-title-card h1{font-family:var(--font-main);margin:0 0 12px;font-size:32px;font-weight:950;letter-spacing:-.6px}.invoice-title-card h1:after{content:"";display:block;width:44px;height:3px;background:#fff;border-radius:999px;margin:10px auto 0;opacity:.55}.invoice-no{display:inline-flex;border:1px solid rgba(255,255,255,.22);border-radius:999px;padding:4px 9px;margin:5px 3px 0;color:#e2e8f0;font-size:12px;line-height:1.5}.invoice-status-line{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:14px}.invoice-status-line .badge{background:#fff;color:#0f172a}.invoice-meta-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:0 36px 24px}.invoice-meta{background:var(--inv-soft);border:1px solid var(--inv-line);border-radius:18px;padding:13px}.invoice-meta span{display:block;color:#64748b;font-size:12px;font-weight:800;margin-bottom:4px}.invoice-meta strong{font-size:15px}.invoice-parties{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:0 36px 24px}.party-card{border:1px solid var(--inv-line);border-radius:22px;padding:18px;background:#fff}.party-card h3{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:16px}.party-card h3:before{content:"";width:9px;height:9px;border-radius:50%;background:var(--inv-accent)}.party-card p{margin:6px 0;color:#334155}.party-card .party-name{font-size:18px;color:#0f172a;font-weight:950;margin-bottom:8px}.invoice-items{padding:0 36px 24px}.invoice-items .table-wrap{border-radius:22px;overflow:hidden;border-color:#d9e0ea}.inv-table{min-width:830px}.inv-table th{background:#eef4ff;color:#1e3a8a;font-weight:950;border-bottom:1px solid #dbeafe}.inv-table td{font-size:13px}.inv-table tbody tr:nth-child(even) td{background:#fbfdff}.inv-table .item-title{font-weight:900;color:#0f172a}.inv-table .item-desc{display:block;color:#64748b;font-size:12px;margin-top:2px}.invoice-bottom{display:grid;grid-template-columns:1fr 390px;gap:20px;align-items:start;padding:0 36px 28px}.invoice-note-card{border:1px dashed #cbd5e1;border-radius:20px;background:#f8fafc;padding:16px;color:#334155;min-height:auto}.invoice-note-card h3{margin:0 0 8px;font-size:15px}.invoice-bank-info{margin-top:10px;padding-top:10px;border-top:1px dashed #cbd5e1;color:#0f172a;font-weight:700}.invoice-summary-card{border:1px solid var(--inv-line);border-radius:22px;background:#fff;box-shadow:0 18px 36px rgba(15,23,42,.07);overflow:hidden}.summary-row{display:flex;justify-content:space-between;gap:14px;padding:11px 16px;border-bottom:1px solid #eef2f7}.summary-row span{color:#64748b}.summary-row strong{color:#0f172a}.summary-row.total-grand{background:linear-gradient(135deg,#0f172a,#2563eb);color:#fff;padding:16px}.summary-row.total-grand span,.summary-row.total-grand strong{color:#fff;font-size:18px}.summary-row.remaining strong{color:#dc2626}.invoice-signatures{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:0 36px 20px}.sign-box{border:1px solid var(--inv-line);border-radius:20px;min-height:62px;padding:12px;background:linear-gradient(180deg,#fff,#f9fafb);display:flex;align-items:center;justify-content:center;color:#64748b;font-weight:800}.invoice-footer-note{border-top:1px solid var(--inv-line);padding:14px 36px;color:#64748b;font-size:12px;background:#fbfdff;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.invoice-minimal.invoice-shell:before{background:#111}.invoice-minimal .invoice-title-card{background:#fff;color:#111;border:1px solid #111;border-radius:0}.invoice-minimal .invoice-title-card h1:after{background:#111}.invoice-minimal .invoice-no{color:#111;border-color:#111}.invoice-minimal .invoice-status-line .badge{border:1px solid #111}.invoice-minimal .invoice-hero,.invoice-minimal .invoice-footer-note{background:#fff}.invoice-classic.invoice-shell:before{background:#64748b}.invoice-classic .invoice-title-card{background:#f8fafc;color:#0f172a;border:1px solid var(--inv-line)}.invoice-classic .invoice-title-card h1:after{background:#64748b}.invoice-classic .invoice-no{color:#475569;border-color:#cbd5e1}.invoice-classic .invoice-status-line .badge{background:#e2e8f0;color:#0f172a}

.invoice-classic.invoice-shell{--inv-accent:#64748b;border-radius:12px;background:#fff;border:1px solid #cbd5e1;box-shadow:0 10px 30px rgba(15,23,42,.06)}
.invoice-classic.invoice-shell:before{background:#64748b;height:6px}
.invoice-classic .invoice-hero{background:#fff;border-bottom:2px solid #334155}
.invoice-classic .invoice-brand-logo{border-radius:8px;border-color:#94a3b8;background:#f8fafc}
.invoice-classic .invoice-title-card{background:#f8fafc;color:#0f172a;border:1px solid #cbd5e1;border-radius:10px;box-shadow:none}
.invoice-classic .invoice-no{color:#475569;border-color:#cbd5e1}
.invoice-classic .invoice-status-line .badge{background:#e2e8f0;color:#0f172a}
.invoice-classic .party-card,.invoice-classic .invoice-note-card,.invoice-classic .invoice-summary-card,.invoice-classic .sign-box{border-radius:10px;box-shadow:none}
.invoice-classic .inv-table th{background:#f1f5f9;color:#334155}
.invoice-classic .summary-row.total-grand{background:#334155;color:#fff}
.invoice-minimal.invoice-shell{--inv-accent:#111;box-shadow:none;border:1px solid #111;border-radius:0;background:#fff}
.invoice-minimal.invoice-shell:before{background:#111;height:3px}
.invoice-minimal .invoice-hero{background:#fff;border-bottom:1px solid #111;padding-top:28px}
.invoice-minimal .invoice-brand-logo{border-radius:0;border-color:#111;background:#fff}
.invoice-minimal .invoice-title-card{background:#fff;color:#111;border:1px solid #111;border-radius:0;box-shadow:none}
.invoice-minimal .invoice-no{color:#111;border-color:#111;border-radius:0}
.invoice-minimal .invoice-status-line .badge{border:1px solid #111;border-radius:0;background:#fff;color:#111}
.invoice-minimal .invoice-meta,.invoice-minimal .party-card,.invoice-minimal .invoice-note-card,.invoice-minimal .invoice-summary-card,.invoice-minimal .sign-box{border-radius:0;box-shadow:none;background:#fff;border-color:#111}
.invoice-minimal .invoice-chip{border-radius:0;border-color:#111;color:#111}
.invoice-minimal .inv-table th{background:#fff;color:#111;border-top:1px solid #111;border-bottom:1px solid #111}
.invoice-minimal .inv-table tbody tr:nth-child(even) td{background:#fff}
.invoice-minimal .summary-row.total-grand{background:#111;color:#fff}
.invoice-minimal .invoice-footer-note{background:#fff;border-color:#111}
.logo-broken-hint{display:inline-block;margin-top:8px;color:#991b1b;background:#fef2f2;border:1px solid #fecaca;border-radius:10px;padding:6px 9px;font-size:12px}
@media(max-width:760px){.invoice-hero,.invoice-parties,.invoice-bottom,.invoice-signatures{grid-template-columns:1fr}.invoice-hero{padding:26px 18px 18px}.invoice-meta-grid{grid-template-columns:1fr;padding:0 18px 18px}.invoice-parties,.invoice-items,.invoice-bottom,.invoice-signatures{padding-left:18px;padding-right:18px}.invoice-title-card h1{font-size:25px}.invoice-brand-card{display:block}.invoice-brand-logo,.invoice-brand-fallback{margin-bottom:12px}.invoice-footer-note{padding:14px 18px}}
@media print{@page{size:A4;margin:10mm}body{background:#fff!important;font-size:11.5px}.invoice-shell{border-radius:0!important;box-shadow:none!important;border:0!important}.invoice-shell:before{height:5px}.invoice-hero{padding:18px 0 12px}.invoice-meta-grid,.invoice-parties,.invoice-items,.invoice-bottom,.invoice-signatures{padding-left:0!important;padding-right:0!important}.invoice-meta-grid{gap:8px}.invoice-parties{gap:10px}.invoice-bottom{grid-template-columns:1fr 330px;gap:14px}.invoice-title-card{border-radius:14px!important;min-height:auto;padding:15px}.invoice-title-card h1{font-size:25px}.invoice-brand-logo{width:120px!important;height:68px!important;flex-basis:auto!important;border:0!important;background:transparent!important}.invoice-brand-logo img{max-width:116px!important;max-height:60px!important}.invoice-brand-fallback{width:70px;height:70px;flex-basis:70px}.invoice-brand-name{font-size:20px}.party-card,.invoice-note-card,.invoice-summary-card,.sign-box{box-shadow:none!important;break-inside:avoid}.table-wrap{overflow:visible!important}.inv-table{min-width:0!important}.inv-table th,.inv-table td{padding:7px 6px}.invoice-footer-note{padding:8px 0}.summary-row{padding:7px 10px}.summary-row.total-grand{padding:10px}.sign-box{min-height:72px}tr{break-inside:avoid}}


/* Print polish v2.5.7: keep invoice visual style, fit better on A4 and hide product footer */
@media print{
  @page{size:A4 portrait;margin:6mm}
  html,body{width:210mm;margin:0!important;background:#fff!important;color:#0f172a!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body{font-size:10.8px!important;line-height:1.45!important}
  .print-actions,.sidebar,.mobilebar,.no-print,.invoice-footer-note,.footer{display:none!important}
  .paper-wrap{max-width:none!important;width:100%!important;margin:0!important;padding:0!important}
  .paper,.paper.invoice-shell{width:100%!important;box-shadow:none!important;border:0!important;border-radius:0!important;padding:0!important;margin:0!important;overflow:visible!important}
  .invoice-shell:before{height:4px!important;display:block!important}
  .invoice-hero{display:grid!important;grid-template-columns:1.08fr .92fr!important;gap:8px!important;align-items:stretch!important;padding:8px 0 7px!important;border-bottom:1px solid #e2e8f0!important;page-break-inside:avoid!important;break-inside:avoid!important;background:#fff!important}
  .invoice-brand-card{display:flex!important;flex-direction:column!important;gap:4px!important;align-items:center!important;justify-content:center!important;text-align:center!important;padding:8px!important;border:1px solid #e2e8f0!important;border-radius:14px!important;background:#fff!important;min-height:auto!important}
  .invoice-brand-logo,.invoice-brand-fallback{width:82px!important;height:48px!important;flex:0 0 auto!important;border-radius:12px!important}
  .invoice-brand-logo img{max-width:100%!important;max-height:100%!important;object-fit:contain!important}
  .invoice-brand-name{display:block!important;font-size:12px!important;line-height:1.25!important;margin:2px 0 0!important}.invoice-brand-sub{display:block!important;font-size:9px!important;line-height:1.25!important;margin:0!important;color:#64748b!important}.invoice-contact{display:none!important}
  .invoice-chip{font-size:9.5px!important;padding:3px 6px!important;border-radius:999px!important}
  .invoice-title-card{min-height:auto!important;padding:10px!important;border-radius:14px!important;background:linear-gradient(135deg,#0f172a,#2563eb)!important;color:#fff!important;text-align:center!important;align-items:center!important;justify-content:center!important;page-break-inside:avoid!important;break-inside:avoid!important}
  .invoice-title-card h1{font-size:21px!important;margin:0 0 5px!important;color:inherit!important}
  .invoice-no{font-size:8.8px!important;padding:2px 5px!important;margin-top:3px!important;color:#e2e8f0!important}
  .invoice-status-line{margin-top:7px!important;gap:4px!important}
  .invoice-status-line .badge,.badge{font-size:9.5px!important;padding:3px 7px!important}
  .invoice-meta-grid{grid-template-columns:repeat(3,1fr)!important;gap:7px!important;padding:7px 0!important;page-break-inside:avoid!important;break-inside:avoid!important}
  .invoice-meta{padding:8px!important;border-radius:12px!important;background:#f8fafc!important}
  .invoice-meta span{font-size:9.5px!important;margin-bottom:2px!important}
  .invoice-meta strong{font-size:11.5px!important}
  .invoice-parties{grid-template-columns:1fr 1fr!important;gap:8px!important;padding:0 0 8px!important;page-break-inside:avoid!important;break-inside:avoid!important}
  .party-card{padding:9px!important;border-radius:14px!important;background:#fff!important;min-height:auto!important}
  .party-card h3{font-size:12px!important;margin:0 0 5px!important}
  .party-card .party-name{font-size:13.5px!important;margin-bottom:3px!important}
  .party-card p{font-size:10px!important;margin:2px 0!important}
  .invoice-items{padding:0 0 8px!important}
  .invoice-items .table-wrap{overflow:visible!important;border-radius:0!important;border:0!important}
  .inv-table{width:100%!important;min-width:0!important;table-layout:fixed!important;border-collapse:collapse!important}
  .inv-table th,.inv-table td{padding:5px 4px!important;font-size:9.4px!important;line-height:1.35!important;border-bottom:1px solid #e2e8f0!important;word-break:break-word!important}
  .inv-table th{background:#eef4ff!important;color:#1e3a8a!important;font-weight:900!important}
  .inv-table .item-title{font-size:9.8px!important}
  .inv-table .item-desc{font-size:8.7px!important;margin-top:1px!important;color:#64748b!important}
  .invoice-bottom{display:grid!important;grid-template-columns:1fr 300px!important;gap:8px!important;padding:0 0 9px!important;align-items:start!important;page-break-inside:avoid!important;break-inside:avoid!important}
  .invoice-note-card{min-height:74px!important;padding:9px!important;border-radius:14px!important;background:#f8fafc!important;font-size:10px!important}
  .invoice-note-card h3{font-size:12px!important;margin:0 0 4px!important}
  .invoice-note-card small{font-size:8.8px!important}
  .invoice-summary-card{border-radius:14px!important;box-shadow:none!important;page-break-inside:avoid!important;break-inside:avoid!important}
  .summary-row{padding:5px 8px!important;font-size:9.6px!important}
  .summary-row.total-grand{padding:8px!important;background:linear-gradient(135deg,#0f172a,#2563eb)!important;color:#fff!important}
  .summary-row.total-grand span,.summary-row.total-grand strong{font-size:13px!important;color:#fff!important}
  .invoice-signatures{grid-template-columns:1fr 1fr!important;gap:8px!important;padding:0!important;page-break-inside:avoid!important;break-inside:avoid!important}
  .sign-box{min-height:48px!important;padding:8px!important;border-radius:14px!important;background:#fff!important;font-size:10px!important;align-items:center!important}
  tr,.party-card,.invoice-meta,.invoice-note-card,.invoice-summary-card,.sign-box{page-break-inside:avoid!important;break-inside:avoid!important}
  a[href]:after{content:''!important}
}


/* Print size selector v2.5.8: optimized A4/A5 invoice print layouts */
.print-size-control{display:inline-flex;gap:6px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:14px;padding:5px}
.print-size-control span{font-size:12px;color:#64748b;font-weight:800;padding:0 4px}
@page invoiceA4{size:A4 portrait;margin:7mm}
@page invoiceA5{size:A5 portrait;margin:5mm}
@media print{
  html,body{width:auto!important;max-width:none!important;min-width:0!important;overflow:visible!important}
  body.print-a4 .paper-wrap{page:invoiceA4;width:196mm!important;max-width:196mm!important;margin:0 auto!important;padding:0!important}
  body.print-a5 .paper-wrap{page:invoiceA5;width:138mm!important;max-width:138mm!important;margin:0 auto!important;padding:0!important}
  body.print-a4 .paper,body.print-a4 .invoice-shell,
  body.print-a5 .paper,body.print-a5 .invoice-shell{max-width:100%!important;min-width:0!important;overflow:visible!important}
  body.print-a4 .invoice-hero{grid-template-columns:1fr 1fr!important}
  body.print-a4 .invoice-bottom{grid-template-columns:1fr 74mm!important}
  body.print-a4 .inv-table th,body.print-a4 .inv-table td{font-size:9.2px!important;padding:4.8px 3.5px!important}
  body.print-a4 .invoice-title-card h1{font-size:20px!important}
  body.print-a4 .invoice-brand-name{font-size:15.5px!important}

  body.print-a5{font-size:8.4px!important;line-height:1.32!important}
  body.print-a5 .invoice-shell:before{height:3px!important}
  body.print-a5 .invoice-hero{grid-template-columns:1fr 1fr!important;gap:5px!important;padding:5px 0!important}
  body.print-a5 .invoice-brand-card{gap:5px!important;padding:5px!important;border-radius:9px!important}
  body.print-a5 .invoice-brand-logo{width:95px!important;height:52px!important;border:0!important;background:transparent!important}
  body.print-a5 .invoice-brand-logo img{max-width:90px!important;max-height:48px!important}
  body.print-a5 .invoice-brand-logo,body.print-a5 .invoice-brand-fallback{width:58px!important;height:34px!important;flex-basis:auto!important;border-radius:8px!important}
  body.print-a5 .invoice-contact{display:none!important}
  body.print-a5 .invoice-chip{font-size:6.8px!important;padding:1px 4px!important}
  body.print-a5 .invoice-title-card{padding:6px!important;border-radius:9px!important}
  body.print-a5 .invoice-title-card h1{font-size:15px!important;margin:0 0 3px!important}
  body.print-a5 .invoice-no{font-size:6.4px!important;padding:1px 3px!important;margin-top:2px!important}
  body.print-a5 .invoice-status-line{margin-top:4px!important;gap:2px!important}
  body.print-a5 .invoice-status-line .badge,body.print-a5 .badge{font-size:6.8px!important;padding:1px 4px!important}
  body.print-a5 .invoice-meta-grid{grid-template-columns:repeat(3,1fr)!important;gap:4px!important;padding:4px 0!important}
  body.print-a5 .invoice-meta{padding:5px!important;border-radius:8px!important}
  body.print-a5 .invoice-meta span{font-size:6.8px!important;margin-bottom:1px!important}
  body.print-a5 .invoice-meta strong{font-size:8.1px!important}
  body.print-a5 .invoice-parties{grid-template-columns:1fr 1fr!important;gap:5px!important;padding:0 0 5px!important}
  body.print-a5 .party-card{padding:5px!important;border-radius:9px!important}
  body.print-a5 .party-card h3{font-size:8.2px!important;margin:0 0 2px!important;gap:3px!important}
  body.print-a5 .party-card h3:before{width:5px!important;height:5px!important}
  body.print-a5 .party-card .party-name{font-size:9.2px!important;margin-bottom:1px!important}
  body.print-a5 .party-card p{font-size:6.9px!important;margin:0!important;line-height:1.35!important}
  body.print-a5 .invoice-items{padding:0 0 4px!important}
  body.print-a5 .inv-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
  body.print-a5 .inv-table th,body.print-a5 .inv-table td{font-size:6.4px!important;line-height:1.22!important;padding:2.7px 1.7px!important;word-break:break-word!important;overflow-wrap:anywhere!important}
  body.print-a5 .inv-table .item-title{font-size:6.8px!important}
  body.print-a5 .inv-table .item-desc{font-size:5.9px!important;margin-top:0!important}
  body.print-a5 .invoice-bottom{grid-template-columns:1fr 48mm!important;gap:5px!important;padding:0 0 5px!important}
  body.print-a5 .invoice-note-card{min-height:46px!important;padding:5px!important;border-radius:9px!important;font-size:6.8px!important}
  body.print-a5 .invoice-note-card h3{font-size:8px!important;margin:0 0 2px!important}
  body.print-a5 .invoice-note-card small{font-size:5.9px!important}
  body.print-a5 .invoice-summary-card{border-radius:9px!important}
  body.print-a5 .summary-row{padding:2.9px 5px!important;font-size:6.8px!important}
  body.print-a5 .summary-row.total-grand{padding:5px!important}
  body.print-a5 .summary-row.total-grand span,body.print-a5 .summary-row.total-grand strong{font-size:8.8px!important}
  body.print-a5 .invoice-signatures{grid-template-columns:1fr 1fr!important;gap:5px!important;padding:0!important}
  body.print-a5 .sign-box{min-height:32px!important;padding:5px!important;border-radius:9px!important;font-size:7px!important}
}

/* Invoice cleanup v2.5.9 */
.invoice-brand-card .invoice-contact{display:none!important}
.invoice-meta-grid{display:none!important}
.invoice-bottom{padding-bottom:14px}
.invoice-signatures{margin-top:0}
@media print{.invoice-meta-grid,.invoice-status-line{display:none!important}.invoice-bottom{padding-bottom:4px!important}.invoice-signatures{padding-top:0!important;margin-top:0!important}.sign-box{min-height:34px!important;align-items:center!important}.invoice-brand-card .invoice-contact{display:none!important}}

.invoice-brand-card .invoice-brand-name,.invoice-brand-card .invoice-brand-sub{display:block!important}.invoice-brand-card .invoice-contact{display:none!important}
.inv-table{table-layout:fixed;width:100%}.inv-table th:nth-child(1),.inv-table td:nth-child(1){width:42px;text-align:center}.inv-table th:nth-child(2),.inv-table td:nth-child(2){width:42%}.inv-table th:nth-child(3),.inv-table td:nth-child(3){width:9%}.inv-table th:nth-child(4),.inv-table td:nth-child(4){width:8%}.inv-table th:nth-child(5),.inv-table td:nth-child(5){width:14%}.inv-table th:nth-child(6),.inv-table td:nth-child(6){width:11%}.inv-table th:nth-child(7),.inv-table td:nth-child(7){width:16%}.inv-table .item-title{white-space:normal;line-height:1.7}.invoice-customer-debt{border:1px solid #fecaca;background:#fff7f7;color:#991b1b;border-radius:16px;padding:10px 12px;margin:0 0 12px;font-weight:900;display:flex;justify-content:space-between;gap:12px}.invoice-bank-account{margin-top:8px;padding:8px 10px;border:1px dashed #cbd5e1;border-radius:12px;background:#fff}.settings-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.settings-tabs a{padding:10px 14px;border-radius:14px;background:#f1f5f9;border:1px solid #e2e8f0;font-weight:800}.settings-tabs a.active{background:#2563eb;color:#fff}.bank-list-card{border:1px solid var(--border);border-radius:18px;padding:14px;background:#fff;margin-top:14px}
@media print{.invoice-brand-card{min-height:auto!important;justify-content:flex-start!important}.invoice-brand-card .invoice-brand-name{font-size:16px!important}.invoice-brand-card .invoice-brand-sub{font-size:11px!important}.invoice-brand-card .invoice-contact{display:none!important}.invoice-customer-debt{padding:7px 10px!important;margin-bottom:8px!important}.inv-table .item-title{line-height:1.45!important}.invoice-bank-account{padding:5px 7px!important;margin-top:5px!important}}

/* v2.6.4 invoice refinements */
.invoice-signatures{margin-top:50px!important}
.invoice-brand-logo{border:0!important;background:transparent!important;box-shadow:none!important}
.invoice-brand-logo img{transform:scale(1.04)}
@media print{.invoice-signatures{margin-top:50px!important}.invoice-brand-logo{border:0!important;background:transparent!important}}
/* v3.1.0 stamp and access polish */
.stamp-preview,.invoice-stamp{
  filter: brightness(0) saturate(100%) invert(24%) sepia(72%) saturate(2177%) hue-rotate(189deg) brightness(91%) contrast(90%);
  opacity:.68;
  mix-blend-mode:multiply;
}
.seller-sign{position:relative;overflow:hidden;min-height:118px!important}
.seller-sign span{position:relative;z-index:2}
.invoice-stamp{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-8deg);max-width:165px;max-height:105px;object-fit:contain;z-index:1;pointer-events:none}
@media print{.seller-sign{min-height:95px!important}.invoice-stamp{max-width:145px;max-height:88px}}

/* v3.3.2: نمایش درست پیشنهاد کالا/خدمات داخل جدول فاکتور */
.table-wrap.invoice-lines{overflow:visible}
.table-wrap.invoice-lines .suggest{z-index:9999;min-width:260px}.suggest strong{display:block;font-weight:900}.suggest small{display:block;color:var(--muted);font-size:12px;margin-top:2px}


html[data-theme="dark"] .auth{background:#020617}html[data-theme="dark"] .auth:before{opacity:.24;filter:blur(5px) saturate(.75)}html[data-theme="dark"] .auth:after{background:linear-gradient(90deg,rgba(2,6,23,.72),rgba(15,23,42,.86),rgba(2,6,23,.72))}html[data-theme="dark"] .auth-card{border-color:rgba(51,65,85,.9)}
@media(max-width:760px){.global-theme-wrap{top:10px;left:10px}.auth{padding:74px 14px 22px}.auth:before{opacity:.58}.auth-card{padding:22px;border-radius:22px}.topbar{align-items:flex-start}.topbar .fs-theme-toggle{margin-top:2px}}

/* Light/Dark polish v3.3.7 */
html[data-theme="light"] .sidebar{background:#fff;color:#172033}
html[data-theme="light"] .nav a{color:#344054}
html[data-theme="light"] .nav a:hover,html[data-theme="light"] .nav a.active{background:#eff6ff;color:#2563eb}
html[data-theme="light"] .mobilebar{background:rgba(255,255,255,.92);backdrop-filter:blur(14px)}
html[data-theme="light"] .card,html[data-theme="light"] .topbar,html[data-theme="light"] .auth-card,html[data-theme="light"] .install-card{background:#fff}
html[data-theme="dark"]{--sidebar-border:#1e293b;--sidebar-active:#111c2f}
html[data-theme="dark"] .sidebar{background:var(--sidebar);color:#fff;border-left-color:var(--sidebar-border);box-shadow:0 18px 45px rgba(0,0,0,.22)}
html[data-theme="dark"] .brand small{color:#94a3b8}
html[data-theme="dark"] .nav a:hover,html[data-theme="dark"] .nav a.active{background:#111c2f;color:#93c5fd}
html[data-theme="dark"] .field label{color:#e2e8f0}
html[data-theme="dark"] .auth:before{opacity:.38;filter:blur(1.8px)}
html[data-theme="dark"] .auth:after{background:linear-gradient(90deg,rgba(2,6,23,.62),rgba(15,23,42,.78),rgba(2,6,23,.62))}
