@font-face{font-family:Cairo;src:url(assets/cairo.ttf)}*{box-sizing:border-box}body{margin:0;color:#10213e;background:#f5f7fb;font:15px Cairo,Arial}header{height:100px;background:#fff;border-bottom:1px solid #e1e7ef;display:flex;align-items:center;justify-content:space-between;padding:18px 42px}header img{width:250px;height:68px;object-fit:contain}.header-tools,.page-head,.actions,.toolbar{display:flex;align-items:center;gap:14px}.page-head{justify-content:space-between;margin:0 0 24px}.eyebrow{color:#6c7a90;font-size:13px}h1{font-size:28px;line-height:1.5;margin:4px 0}h2{font-size:19px;margin:0 0 22px}button,input,select,textarea{font:inherit;border:1px solid #dce4ef;border-radius:9px;padding:10px 15px;background:#fff;color:inherit}button{cursor:pointer;min-height:44px}button:disabled{cursor:default;opacity:.5}.primary{background:#db2937;color:white;border-color:#db2937}.pill{display:inline-flex;background:#fff0f1;color:#b3212e;border-radius:24px;padding:7px 16px;font-size:13px;white-space:nowrap}.neutral{background:#eef2f7;color:#5f6f84}nav{display:flex;gap:10px;background:white;padding:13px 42px;border-bottom:1px solid #e1e7ef}nav button{border:0;background:transparent}nav .active{background:#fff0f1;color:#c52433;font-weight:bold}main{max-width:1320px;margin:auto;padding:32px 42px 70px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:28px}.stats>div,.panel{background:white;border:1px solid #e1e7ef;border-radius:14px;padding:24px}.stats>div{display:flex;align-items:center;justify-content:space-between}.stats span{color:#607087}.stats strong{font-size:29px}.toolbar{margin-bottom:18px}.toolbar input{flex:1}.table-head,.item{display:grid;grid-template-columns:2.4fr 1.4fr 1fr 1.2fr 80px;gap:16px;align-items:center;padding:16px 20px}.table-head{font-size:13px;color:#697990}.item{background:white;border-bottom:1px solid #e1e7ef;min-height:91px}.item:first-child{border-radius:12px 12px 0 0}.item:last-child{border-radius:0 0 12px 12px}.item small{display:block;direction:ltr;text-align:right;color:#78859a;font-size:12px}.tag{font-size:12px;color:#476451;background:#eef6f1;padding:5px 10px;border-radius:7px;width:max-content}.tag.warn{color:#8c5a1e;background:#fff3dc}.item button{color:#c52433;background:#fff4f5;border-color:#f3d9dc}.edit-grid,.release-grid{display:grid;grid-template-columns:2fr 1fr;gap:24px}.security-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}label{display:block;margin-bottom:8px;font-weight:bold;font-size:14px}input,textarea{display:block;width:100%;margin-bottom:20px}textarea{min-height:110px;resize:vertical}input[readonly]{background:#f5f7fa;color:#68758a}.two{display:grid;grid-template-columns:1fr 1fr;gap:16px}dl{margin:0}dt{font-size:13px;color:#697990;margin:14px 0 5px}dd{margin:0 0 15px}.photo-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:190px;background:#f5f7fa;border:1px dashed #d8e0ec;border-radius:12px;margin:24px 0;color:#718198}.photo-empty span{font-size:40px}.field-status{font-size:13px;color:#697990;margin:4px 0 20px}.change{padding:18px 0;border-bottom:1px solid #e1e7ef}.change b{display:block;margin-bottom:8px}.change .old{color:#718198}.actions{margin-top:24px}.history-row{padding:18px 0;border-bottom:1px solid #e1e7ef}#snapshot{display:block;margin:24px 0}.full{width:100%}#status{color:#456d54;margin-top:22px}.login{min-height:calc(100vh - 100px);display:flex;align-items:center;justify-content:center;padding:32px}.login-card{background:white;border:1px solid #e1e7ef;border-radius:18px;padding:36px;width:410px;max-width:100%}.login-card h1{margin:6px 0 28px}.login-card .pill{margin-top:24px}.fake-password{padding:12px;border:1px solid #dce4ef;border-radius:9px;margin-bottom:24px;color:#68758a;direction:ltr}.dark{background:#0b1426;color:#eef2fa}.dark header,.dark nav,.dark .panel,.dark .item,.dark .stats>div,.dark .login-card{background:#132039;border-color:#263650}.dark input,.dark select,.dark textarea,.dark button{background:#1a2b46;color:#eef2fa;border-color:#30405c}.dark .primary{background:#db2937}.dark header img{background:white;border-radius:8px;padding:4px}[hidden]{display:none!important}@media(max-width:720px){header{height:80px;padding:12px 16px;gap:10px}header img{width:165px;height:52px}.header-tools{gap:7px}.header-tools .pill{padding:5px 9px;font-size:11px}nav{padding:10px 12px;gap:4px;display:grid;grid-template-columns:1fr 1fr}nav button{padding:8px;font-size:13px}main{padding:24px 16px 60px}h1{font-size:24px}.page-head{align-items:flex-start;gap:10px}.stats{gap:8px}.stats>div{padding:12px;display:block}.stats span{font-size:11px;display:block}.stats strong{font-size:24px}.toolbar{gap:8px}.toolbar input{min-width:0}.toolbar select{max-width:120px;padding:10px}.table-head{display:none}.item{grid-template-columns:1fr auto;gap:10px;padding:18px 14px}.item .pn{grid-column:1;direction:ltr;text-align:right}.item .category{display:none}.item .tag{grid-column:1}.item button{grid-column:2;grid-row:1/4;align-self:center}.edit-grid,.release-grid,.security-grid{grid-template-columns:1fr}.panel{padding:20px}.two{grid-template-columns:1fr;gap:0}.login{min-height:calc(100vh - 80px);padding:20px}.login-card{padding:26px}}
body{background:#fff}main{padding-top:22px}nav{position:fixed;bottom:0;left:0;right:0;z-index:10;justify-content:center;border-top:1px solid #e1e7ef;border-bottom:0;padding:7px 24px;direction:rtl}nav button{width:150px;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:12px}nav i{font-style:normal;font-family:Arial;font-size:26px;line-height:30px}main{padding-bottom:110px}.toolbar input{background:#f2f5fa;border-radius:18px;margin:0;height:52px}.toolbar button{height:52px;min-width:52px}.section-label{display:flex;justify-content:space-between;align-items:center;margin:28px 0 14px}.section-label h2{margin:0}.section-label span{color:#75849c;font-size:12px}.chips{display:flex;gap:10px;overflow:auto;padding-bottom:10px;margin:0 0 12px}.chips button{white-space:nowrap;background:#f2f5fa;border:0;min-width:80px;color:#6b7e99;border-radius:15px}.chips button.selected{background:#10213e;color:white}#enginefilter{background:#f2f5fa;border-radius:18px;border:0}.engine-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}.engine{display:flex;align-items:center;text-align:right;gap:20px;border-radius:22px;padding:24px;border-color:#e0e7f2;min-height:130px}.engine-mark{border-radius:23px;background:#1e2c40;color:white;display:grid;place-items:center;width:70px;height:70px;font-weight:bold;font-size:16px}.engine b{display:block;font-size:23px;direction:ltr}.engine small{display:block;color:#dc2937;margin-top:9px}.arrow{margin-right:auto;color:#a0abba;font-size:24px}.settings-grid{max-width:750px}.settings-list{padding:4px 22px}.settings-list button{display:flex;width:100%;justify-content:space-between;border:0;border-radius:0;border-bottom:1px solid #e7ecf4;padding:20px 0}.settings-list button:last-child{border-bottom:0}.result{display:flex;gap:24px;align-items:center;width:100%;margin-bottom:12px;padding:24px;border-radius:18px;text-align:right}.result .edit-link{margin-right:auto;color:#db2937}.stock-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.stock-grid .pn{color:#6b7e99;margin-top:8px}.stock-controls{display:flex;align-items:center;justify-content:space-between;margin:22px 0}.stock-controls strong{font-size:25px}.stock-grid input{margin:0}.barcode-panel{max-width:480px;margin:0 auto 24px;text-align:center}.scanbox{font-size:100px;line-height:200px;border:2px dashed #dfe5ef;margin-bottom:24px;border-radius:18px}.photo-button{display:block;border:1px solid #dfe5ef;padding:12px;text-align:center;border-radius:10px;cursor:pointer;color:#cf2534}.photo-empty img{width:100%;height:100%;object-fit:contain}.dark .engine,.dark .settings-list button,.dark .result{background:#132039}.dark .chips .selected{background:#c82932}.dark .toolbar input,.dark #enginefilter{background:#1a2b46}.item .tag{display:none}.item{grid-template-columns:2.4fr 1.4fr 1fr 80px}.table-head{grid-template-columns:2.4fr 1.4fr 1fr 80px}.table-head span:nth-child(4){display:none}
@media(max-width:720px){header{height:86px;padding:12px 18px}header img{width:205px;height:58px}.header-tools .pill{display:none}#logout{display:none!important}nav{display:flex;gap:0;padding:5px 5px 9px}nav button{padding:6px 0;width:20%;font-size:10px;min-width:0}nav i{font-size:25px}main{padding:20px 16px 100px}.engine-grid{grid-template-columns:1fr;gap:12px}.engine{padding:20px;min-height:115px;gap:16px}.engine-mark{width:62px;height:62px;border-radius:21px}.engine b{font-size:21px}.section-label{margin-top:24px}.section-label h2{font-size:18px}.chips{gap:8px}.chips button{min-width:73px;padding:11px 10px;font-size:13px}.page-head h1{font-size:22px}.stock-grid{grid-template-columns:1fr}.result{display:grid;grid-template-columns:1fr auto;gap:8px;padding:18px}.result .pn{grid-column:1}.result .edit-link{grid-row:1/3;grid-column:2}.item{grid-template-columns:1fr auto}.section-label span{font-size:10px}.header-tools button{padding:8px 12px}}
nav i.nav-icon{width:28px;height:28px;background:currentColor;mask-size:contain;mask-position:center;mask-repeat:no-repeat}nav i.nav-search{mask-image:url(assets/nav-search.png)}nav i.nav-stock{mask-image:url(assets/nav-stock.png)}nav i.nav-settings{mask-image:url(assets/nav-settings.png)}nav i.nav-barcode{mask-image:url(assets/nav-barcode.png)}nav i.nav-book{height:28px;display:block}

.engine-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.engine,.engine>div{min-width:0}.engine-mark{flex-shrink:0}.engine b{overflow-wrap:anywhere}dd{overflow-wrap:anywhere}#photogallery{flex-wrap:wrap;margin:12px 0}nav button{width:25%}@media(max-width:720px){.engine-grid{grid-template-columns:minmax(0,1fr)}#logout{display:block!important;font-size:11px}.header-tools button{padding:6px 8px}header img{width:180px}.header-tools{flex-shrink:0}}

.arabic-only label[for=english],.arabic-only #english{display:none}.dark .photo-empty{background:#1a2b46}.dark input[readonly]{background:#1a2b46}#references dl{border-bottom:1px solid #e1e7ef;padding:12px 0}

.allfilters{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin:0 0 16px}.allfilters select{min-width:0;width:100%;font-size:13px}.all-list{border:1px solid #e1e7ef;border-radius:13px;overflow:hidden;background:white}.all-part{display:flex;align-items:center;gap:11px;text-align:right;width:100%;border:0;border-bottom:1px solid #edf0f5;border-radius:0;padding:12px 16px;min-height:79px}.all-part:last-child{border:0}.part-thumb{flex:0 0 44px;width:44px;height:44px;border:1px solid #e5eaf2;border-radius:8px;background:#f6f8fb;display:grid;place-items:center;color:#a5afbd;overflow:hidden;font-size:24px}.part-thumb img{width:100%;height:100%;object-fit:contain;background:white}.part-body{flex:1;min-width:0}.part-top,.part-meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.part-top b{font-size:14px;overflow-wrap:anywhere}.part-edit{color:#d32939;font-size:22px}.part-meta{margin-top:5px;color:#8290a4;direction:rtl}.part-meta strong{font-size:12px;font-weight:500;direction:ltr}.part-meta small{font-size:11px;direction:ltr}.part-english{display:block;font-size:11px;color:#8290a4}.dark .all-list,.dark .all-part{background:#132039;border-color:#263650}.dark .part-thumb{background:#1a2b46;border-color:#30405c}#allmore{margin-top:16px}@media(max-width:720px){.allfilters{grid-template-columns:1fr 1fr;gap:9px}.allfilters select{font-size:12px;padding:8px}.allfilters #allsort{grid-column:1/3;width:180px;justify-self:start;border:0;background:transparent;padding:2px}.all-part{padding:10px 12px}.part-top b{font-size:13px}.part-meta strong{font-size:10px}.part-meta small{font-size:9px}.page-head #allpartsopen{font-size:12px;padding:8px 10px;white-space:nowrap}}

.part-thumb svg{width:25px;height:25px}

#parts .table-head{grid-template-columns:44px 2.4fr 1.4fr 1fr 80px}#parts .table-head:before{content:''}#parts .item{grid-template-columns:44px 2.4fr 1.4fr 1fr 80px}#parts .item .part-thumb{grid-row:1;grid-column:1}#parts .item .part-name{grid-column:2;min-width:0;overflow-wrap:anywhere}@media(max-width:720px){#parts .item{grid-template-columns:44px minmax(0,1fr) auto;column-gap:11px;row-gap:4px;min-height:89px;padding:12px}#parts .item .part-thumb{grid-column:1;grid-row:1/3}#parts .item .part-name{grid-column:2;grid-row:1;font-size:13px}#parts .item .pn{grid-column:2;grid-row:2;font-size:11px}#parts .item button{grid-column:3;grid-row:1/3;font-size:12px;padding:7px 10px}#parts .item .category{display:none}}

#saveprogress{display:block;width:100%;height:8px;margin:16px 0 8px;accent-color:#db2937}#savestate{font-size:12px;color:#62758b;margin-top:8px}

.edit-grid{grid-template-columns:3fr 2fr;gap:22px}.edit-grid textarea{min-height:58px;height:58px}.edit-grid input,.edit-grid textarea{margin-bottom:11px}.edit-grid .panel{padding:22px}.edit-grid .photo-empty{margin:0 0 14px;height:255px}.photo-empty{position:relative;overflow:hidden}.photo-empty img{cursor:zoom-in}.photo-counter{position:absolute;bottom:10px;left:10px;direction:ltr;background:#10213ecc;color:white;border-radius:20px;padding:1px 12px;font:12px Cairo}.gallery-strip{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}.gallery-item{position:relative}.gallery-thumb{display:block;width:78px;height:75px;padding:3px;overflow:hidden}.gallery-thumb img{width:100%;height:100%;object-fit:contain;background:white}.gallery-thumb.selected{border:2px solid #db2937}.gallery-remove{position:absolute;left:-6px;top:-7px;padding:0;min-height:22px;width:22px;border-radius:50%;color:#db2937;background:white!important;line-height:20px}.part-view-grid{display:grid;grid-template-columns:3fr 2fr;gap:22px}.part-view-grid .photo-empty{height:360px;margin:0}.part-view-grid dt{margin-top:12px}.part-view-grid dd{border-bottom:1px solid #dce4ef;padding-bottom:12px}.page-head .actions{margin:0}#zoom{padding:30px 15px 15px;border:0;border-radius:14px;background:#101827;max-width:96vw;max-height:96vh}#zoom::backdrop{background:#000c}#zoomimage{display:block;max-height:85vh;max-width:90vw;object-fit:contain}#zoomclose{position:absolute;top:0;left:0;min-height:30px;padding:0;width:32px;background:#fff;color:#111}.dark .gallery-thumb{background:#1a2b46}@media(max-width:720px){.edit-grid,.part-view-grid{grid-template-columns:1fr}.edit-grid aside{grid-row:1}.part-view-grid .photo-empty{height:280px}.gallery-thumb{width:65px;height:65px}}
@media(min-width:721px){header{height:82px;padding:10px 36px}header img{height:60px;width:230px}main{padding:20px 36px 100px}.page-head{margin-bottom:16px}h1{font-size:26px}.edit-grid .panel{padding:20px}.edit-grid label{margin-bottom:5px}.edit-grid input{padding:7px 12px;margin-bottom:9px}.edit-grid textarea{height:54px;min-height:54px;margin-bottom:9px}.part-view-grid .photo-empty{height:320px}}
.dark .gallery-remove{color:#db2937;border-color:#dce4ef}.dark .gallery-thumb.selected{border-color:#ff4155}

/* archive + stock (test batch) */
.danger{background:#b3261e;color:#fff;border-radius:9px;padding:10px 15px}
.dark .danger{background:#cf3b32;color:#fff}
.history-row button{margin-inline-start:10px;min-height:40px;padding:8px 14px}
.panel h2{font-size:1.05rem;margin:18px 0 6px}
.panel h2:first-child{margin-top:0}
#stockform label{display:block;margin-top:14px}
#stockform input,#stockform textarea{width:100%;box-sizing:border-box}
