/* ===================== Nutrition App — نظام التصميم الموحّد =====================
   ملف واحد لكل الأقسام: الخط، الألوان، البنر، التبويبات، البطاقات، الأزرار، الجداول، النوافذ.
   أي قسم جديد: يكفي <link href="/fonts.css"> + <link href="/ui.css"> قبل /nav.js، وبنر <header> عادي. */
:root{
  --na-f:'Tajawal',system-ui,'Segoe UI',Tahoma,sans-serif;
  --na-teal:#0f9d8a;--na-teal-d:#0b6e66;--na-teal-l:#e6f4f1;
  --na-ink:#17302c;--na-muted:#5d7a74;--na-line:#dbe9e5;
  --na-bg:#eef5f3;--na-card:#fff;--na-red:#dc2626;
  --na-r:14px;--na-r-s:10px;
  --na-shadow:0 1px 3px rgba(0,0,0,.08);
  --na-hd-h:72px;
}

/* ---------- الخط والخلفية ---------- */
html body{font-family:var(--na-f);background:var(--na-bg);color:var(--na-ink)}
body button,body input,body select,body textarea,body table{font-family:var(--na-f)!important}

/* ---------- البنر (رأس كل قسم) ---------- */
body>header{
  background:linear-gradient(135deg,var(--na-teal),var(--na-teal-d))!important;color:#fff;
  min-height:var(--na-hd-h);padding:10px 16px;box-sizing:border-box;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-radius:0;margin:0;box-shadow:none}
body>header h1{font-size:18px;font-weight:800;margin:0;line-height:1.3;color:#fff;display:flex;align-items:center}
body>header small{font-size:12px;font-weight:500;opacity:.92;display:block;line-height:1.4;color:#fff}
body>header p{margin:2px 0 0;font-size:12px;opacity:.92}
body>header .hdic{width:36px;height:36px;border-radius:11px!important;margin-inline-end:10px;box-shadow:0 0 0 2px rgba(255,255,255,.35);background:#fff;flex:none}

/* ---------- الحاوية ---------- */
.wrap{box-sizing:border-box}

/* ---------- التبويبات ---------- */
.tabs{display:flex;gap:6px;margin-bottom:10px;overflow:auto}
.tabs .tab{flex:1;min-width:110px;min-height:40px;padding:8px 10px;border:0;border-radius:var(--na-r-s);background:#fff;font-weight:700;color:var(--na-teal-d);cursor:pointer;font-size:14px;white-space:nowrap;box-shadow:var(--na-shadow)}
.tabs .tab.on{background:var(--na-teal);color:#fff}

/* ---------- البطاقات ---------- */
.card{border-radius:var(--na-r);box-shadow:var(--na-shadow)}

/* ---------- الأزرار ---------- */
button.p{background:var(--na-teal);color:#fff;border:0;border-radius:var(--na-r-s);font-weight:700;cursor:pointer}
button.s{background:#fff;border:1px solid var(--na-teal);color:var(--na-teal-d);border-radius:var(--na-r-s);cursor:pointer}
button.d{background:#fff;border:1px solid var(--na-red);color:var(--na-red);border-radius:var(--na-r-s);cursor:pointer}

/* ---------- الجداول ---------- */
.scr{border-radius:var(--na-r)}

/* ---------- الحقول ---------- */
body input:not([type=checkbox]):not([type=radio]):not([type=range]),body select,body textarea{border-radius:var(--na-r-s)}

@media(max-width:520px){body>header h1{font-size:16px}body>header .hdic{width:32px;height:32px}}
/* زر مخفي بالكود ما يظهره توحيد الأزرار */.xib[style*="display:none"],.xib[style*="display: none"]{display:none!important}
body.tp-on .search{position:relative;top:auto}
/* الأزرار العائمة بشكل واحد بكل الأقسام */
button.fab{min-height:46px;padding:10px 18px!important;border-radius:14px!important;font-weight:700!important;font-size:15px!important;box-shadow:0 4px 14px rgba(11,110,102,.28)!important}
button.fab.s{background:#fff!important;color:var(--na-teal-d,#0b6e66)!important;border:1.5px solid var(--na-teal,#0f9d8a)!important}
/* 📱 بنر الجوال: العنوان سطر كامل · تحته الاسم والنطاق يمين والأزرار يسار */
.hdnm,.hdsc{display:none}
@media(max-width:600px){
 body>header{display:grid;grid-template-columns:1fr auto;grid-template-areas:"t t" "n b" "s b";row-gap:0;column-gap:8px;align-items:center;padding:10px 14px 8px;min-height:0}
 body>header>.hdt{display:contents}
 body>header h1{grid-area:t;font-size:17px;white-space:nowrap;overflow:visible;min-width:0;margin-bottom:4px;padding:3px 3px 0}body>header h1>span{overflow:hidden;text-overflow:ellipsis;min-width:0}
 body>header h1 .hdic{width:30px;height:30px;border-radius:9px!important}
 body>header .hdt>small{display:none}
 body>header>.hdnm{display:block;grid-area:n;align-self:end;font-size:12px;font-weight:500;color:#fff;opacity:.92;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
 body>header>.hdsc{display:block;grid-area:s;align-self:start;font-size:12px;font-weight:500;color:#fff;opacity:.92;line-height:1.35}
 body>header>.nvgrp,body>header>.hl{grid-area:b;justify-self:end;align-self:center}
 body>header .nvgrp>button{width:40px;height:40px}
}
html.nv-d #nvSd>.sh{min-height:73px;box-sizing:border-box;align-items:center}
.tabs a.tab{display:flex;align-items:center;justify-content:center;text-decoration:none}
table.mwt thead th,table.mwt th.gh,table.mwt th:first-child{text-align:center!important}
@media(min-width:601px){body>header>div:first-child:has(h1 .hdic){display:grid!important;grid-template-columns:auto 1fr;grid-template-areas:"i t" "i s";column-gap:10px;row-gap:2px;align-items:center;justify-items:start}body>header>div:first-child>h1:has(.hdic){display:contents}body>header>div:first-child>h1>.hdic{grid-area:i;width:46px;height:46px;border-radius:12px!important;margin:0;align-self:center}body>header>div:first-child>h1>span:not(.hdic){grid-area:t;align-self:end;line-height:1.2}body>header>div:first-child>small{grid-area:s;align-self:start;margin:0}}
@media(max-width:600px){
 body>header:has(h1 .hdic){grid-template-columns:auto 1fr auto!important;grid-template-areas:"i t t" "i n b" "i s b";column-gap:10px}
 body>header h1:has(.hdic){display:contents}
 body>header h1>.hdic{grid-area:i;width:54px;height:54px;border-radius:14px!important;margin:0;align-self:center;box-shadow:0 0 0 2px rgba(255,255,255,.35)}
 body>header h1:has(.hdic)>span:not(.hdic){grid-area:t;align-self:end;font-size:17px;font-weight:800;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;margin-bottom:2px}
}
html:not(.nv-d) .hm-hero .hm-mn{position:absolute;top:16px;left:16px;margin:0}html:not(.nv-d) .hm-hero .hm-net{left:64px;top:20px}
.nsk{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px;opacity:0;animation:nskin .2s ease .45s forwards}.nsk i{display:block;height:150px;border-radius:16px;background:linear-gradient(90deg,#e8f0ee 0%,#f6faf9 50%,#e8f0ee 100%);background-size:200% 100%;animation:nsksh 1.3s ease-in-out infinite}@keyframes nsksh{0%{background-position:100% 0}100%{background-position:-100% 0}}@keyframes nskin{to{opacity:1}}
.hdds{display:none}
@media(min-width:601px){body>header>div:first-child:has(h1 .hdic){grid-template-areas:"i t" "i s" "i d"}body>header .hdds{display:block;grid-area:d;font-size:12.5px;font-weight:500;color:#fff;opacity:.85;line-height:1.5;margin-top:2px;max-width:780px}}
#gsv>#gtabs{margin-top:12px}#gsv .gh{margin-top:0}

/* 📐 قاعدة ثابتة: بطاقات الصف الواحد بنفس الارتفاع، وأزرارها على نفس المستوى تحت */
.deck{align-items:stretch}.deck>.card{display:flex;flex-direction:column;margin-bottom:0;min-width:0}.deck>.card>.row:last-child{margin-top:auto}.gl{align-items:stretch}.gl>.gc>.gac{margin-top:auto}
.deck>.card>.row:last-child:has(>button){flex-wrap:nowrap;gap:6px;align-items:stretch}.deck>.card>.row:last-child>button{flex:1 1 0;min-width:0;padding-inline:6px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;justify-content:center;margin:0}.deck>.card>.row:last-child>button.d{flex:0 0 auto;min-width:38px}

/* ================= 🧩 مكتبة المكونات الموحّدة (30/11/2026) ================= */
/* الأزرار: 3 أنواع (p أساسي / s ثانوي / d حذف) — طول واحد، زوايا 10، خط 14 عريض */
:root{--na-h:40px;--na-ifs:15px}
@media(max-width:899px){:root{--na-h:44px;--na-ifs:16px}}
button.p:not(.fab),button.s:not(.fab),button.d:not(.fab),a.btn,button.btn{min-height:var(--na-h);padding-top:0;padding-bottom:0;padding-inline:14px;border-radius:10px!important;font-size:14px!important;font-weight:700!important;line-height:1.2;display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;vertical-align:middle}
button.s:not(.fab),a.btn.s{border:1px solid #cfe3de!important;background:#fff;color:var(--na-teal-d,#0b6e66)}
button.s:not(.fab):hover{background:#f3faf8}
button.p:not(.fab):hover{filter:brightness(1.06)}
button.d:not(.fab){border:1px solid #f3c4c4!important;background:#fff;color:#dc2626;min-width:var(--na-h);padding-inline:10px}
button.p:disabled,button.s:disabled,button.d:disabled{opacity:.55;cursor:not-allowed}
td button.p,td button.s,td button.d,th button.s{min-height:32px;padding-inline:10px;font-size:13px}
/* الحقول: طول واحد وخط واحد (16 على الموبايل عشان الآيفون ما يكبّر الشاشة) */
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]),body select{min-height:var(--na-h);font-size:var(--na-ifs);border-radius:10px;box-sizing:border-box}
body textarea{font-size:var(--na-ifs);border-radius:10px}
td input:not([type=checkbox]):not([type=radio]),td select{min-height:34px;font-size:14px}
body>header input,body>header select,#nvSd select{min-height:0;font-size:inherit}
.deck>.card>.row:last-child>button{font-size:13px;gap:4px;padding-inline:4px!important}
/* أزرار بطاقات الأنشطة والمواضيع بنفس شكل الأزرار الموحّدة */
.ga{min-height:var(--na-h);border-radius:10px;display:inline-flex;align-items:center;justify-content:center;gap:4px;font-size:13px!important;font-weight:700!important;border-color:#cfe3de;box-sizing:border-box}
.ga.del{border-color:#f3c4c4}
.ics>.ic{width:var(--na-h);height:var(--na-h);border-radius:10px;border-color:#cfe3de}
.ics>.ic.del{color:#dc2626;border-color:#f3c4c4}
/* رسالة التنبيه (Toast): شكل ومكان ومدة واحدة بكل الأقسام */
#ts,body>.toast,#idtoast{position:fixed!important;left:50%!important;right:auto!important;top:auto!important;bottom:calc(88px + env(safe-area-inset-bottom,0px))!important;transform:translateX(-50%)!important;background:#17302c!important;color:#fff!important;padding:11px 18px!important;border-radius:12px!important;font-size:14px!important;font-weight:500!important;line-height:1.5!important;max-width:min(92vw,520px)!important;width:max-content;text-align:center!important;z-index:2147483001!important;box-shadow:0 8px 24px rgba(0,0,0,.22)!important;font-family:var(--na-f,Tajawal),system-ui,sans-serif!important;animation:natst .18s ease-out}
@keyframes natst{from{opacity:0;transform:translate(-50%,8px)}}
/* النوافذ المنبثقة: خلفية وزوايا موحّدة */
.modal{background:rgba(15,31,30,.45)!important}
.modal .box{border-radius:16px!important;padding:16px!important;box-shadow:0 12px 40px rgba(0,0,0,.18)}
.ics>.ic.ed{width:auto!important;padding:0 12px!important;gap:4px;font-size:13px!important;font-weight:700;color:var(--na-teal-d,#0b6e66)}
/* ===== جولة التوحيد الثانية (30/11) ===== */
/* أزرار خاصة بنفس شكل الزر الثانوي */
.nw-add,#gmore.pill,.nt-ed{min-height:var(--na-h);padding:0 14px;border-radius:10px;border:1px solid #cfe3de;background:#fff;color:var(--na-teal-d,#0b6e66);font-size:14px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box}
.cmu{border:1px solid #cfe3de;background:#fff;color:var(--na-teal-d,#0b6e66);border-radius:8px;padding:2px 8px;font:inherit;font-size:12px;font-weight:700;cursor:pointer;margin-inline-start:4px}
/* مربعات البحث بنفس طول الحقول */
input[type=search],input[placeholder*="بحث"],input[placeholder*="ابحث"]{height:var(--na-h)!important;min-height:0!important;padding-top:0!important;padding-bottom:0!important;box-sizing:border-box!important}
/* خط الحقول واحد حتى بالصفحات اللي كانت تفرض خط أصغر */
html body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]),html body select{font-size:var(--na-ifs)!important}
html body td input:not([type=checkbox]):not([type=radio]),html body td select{font-size:14px!important}
html body>header input,html body>header select,html #nvSd select,html body .naf-p input{font-size:inherit!important}
/* بطاقات المواضيع وعناوينها زي باقي البطاقات */
body.tp-on .card,#tpl .card{border:0;padding:12px}
.card h3{font-size:15px!important}

/* 🎨 أيقونات الأزرار المرسومة (مكتوبة مباشرة بالصفحات: <i class=xi-eye></i>) — بتاخذ لون نص الزر */
[class^=xi-]{display:inline-block;width:18px;height:18px;flex:none;vertical-align:middle;background-color:currentColor;-webkit-mask:var(--xi) center/contain no-repeat;mask:var(--xi) center/contain no-repeat}
.xdel .xi-del{width:18px;height:18px}.xib{display:inline-flex;align-items:center;justify-content:center;gap:6px;vertical-align:middle}
.xi-eye{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%2012a2%202%200%201%200%204%200a2%202%200%200%200%20-4%200'/%3E%3Cpath%20d='M21%2012c-2.4%204%20-5.4%206%20-9%206c-3.6%200%20-6.6%20-2%20-9%20-6c2.4%20-4%205.4%20-6%209%20-6c3.6%200%206.6%202%209%206'/%3E%3C/svg%3E")}
.xi-edit{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2020h4l10.5%20-10.5a2.828%202.828%200%201%200%20-4%20-4l-10.5%2010.5v4'/%3E%3Cpath%20d='M13.5%206.5l4%204'/%3E%3C/svg%3E")}
.xi-re{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%2011a8.1%208.1%200%200%200%20-15.5%20-2m-.5%20-4v4h4'/%3E%3Cpath%20d='M4%2013a8.1%208.1%200%200%200%2015.5%202m.5%204v-4h-4'/%3E%3C/svg%3E")}
.xi-clip{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%207l-6.5%206.5a1.5%201.5%200%200%200%203%203l6.5%20-6.5a3%203%200%200%200%20-6%20-6l-6.5%206.5a4.5%204.5%200%200%200%209%209l6.5%20-6.5'/%3E%3C/svg%3E")}
.xi-tel{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%204h4l2%205l-2.5%201.5a11%2011%200%200%200%205%205l1.5%20-2.5l5%202v4a2%202%200%200%201%20-2%202a16%2016%200%200%201%20-15%20-15a2%202%200%200%201%202%20-2'/%3E%3C/svg%3E")}
.xi-plus{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%205v14'/%3E%3Cpath%20d='M5%2012h14'/%3E%3C/svg%3E")}
.xi-ok{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012l5%205l10%20-10'/%3E%3C/svg%3E")}
.xi-bell{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%205a2%202%200%201%201%204%200a7%207%200%200%201%204%206v3a4%204%200%200%200%202%203h-16a4%204%200%200%200%202%20-3v-3a7%207%200%200%201%204%20-6'/%3E%3Cpath%20d='M9%2017v1a3%203%200%200%200%206%200v-1'/%3E%3C/svg%3E")}
.xi-vid{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2010l4.553%20-2.276a1%201%200%200%201%201.447%20.894v6.764a1%201%200%200%201%20-1.447%20.894l-4.553%20-2.276v-4z'/%3E%3Cpath%20d='M5%206h8a2%202%200%200%201%202%202v8a2%202%200%200%201%20-2%202h-8a2%202%200%200%201%20-2%20-2v-8a2%202%200%200%201%202%20-2z'/%3E%3C/svg%3E")}
.xi-link{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%2015l6%20-6'/%3E%3Cpath%20d='M11%206l.463%20-.536a5%205%200%200%201%207.071%207.072l-.534%20.464'/%3E%3Cpath%20d='M13%2018l-.397%20.534a5.068%205.068%200%200%201%20-7.127%200a4.972%204.972%200%200%201%200%20-7.071l.524%20-.463'/%3E%3C/svg%3E")}
.xi-sms{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%209h8'/%3E%3Cpath%20d='M8%2013h6'/%3E%3Cpath%20d='M18%204a3%203%200%200%201%203%203v8a3%203%200%200%201%20-3%203h-5l-5%203v-3h-2a3%203%200%200%201%20-3%20-3v-8a3%203%200%200%201%203%20-3h12z'/%3E%3C/svg%3E")}
.xi-del{--xi:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%207h16'/%3E%3Cpath%20d='M10%2011v6'/%3E%3Cpath%20d='M14%2011v6'/%3E%3Cpath%20d='M5%207l1%2012a2%202%200%200%200%202%202h8a2%202%200%200%200%202-2l1-12'/%3E%3Cpath%20d='M9%207V4a1%201%200%200%201%201-1h4a1%201%200%200%201%201%201v3'/%3E%3C/svg%3E")}

/* 📱 قاعدة ثابتة (30/11/2026): أزرار البطاقات على الموبايل — ارتفاع ثابت، والعرض حسب النص، وبتنزل لصف جديد لما ما يكفي المكان */
@media(max-width:600px){
.row:has(>button,>a.btn),.gac{flex-wrap:wrap!important;gap:6px!important;align-items:center!important}
.row:has(>button,>a.btn)>:is(button,a.btn,.na-ask),.gac>:is(button,a.btn,.na-ask){flex:0 0 auto!important;width:auto!important;max-width:100%;height:var(--na-h)!important;min-height:var(--na-h)!important;margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-inline:14px!important}
.row:has(>button,>a.btn)>button.d.xdel{width:var(--na-h)!important;padding:0!important}
}

/* 📱 البانر ما بيوسع الصفحة أبداً: العنوان الطويل (مثل Supplements Distribution) بيتقصّ بنقاط بدل ما يدفع الأزرار برّا الشاشة ويزق الصفحة يمين ويسار */
@media(max-width:899px){
html,body{overflow-x:clip}
body>header{max-width:100%;min-width:0}
body>header:has(h1 .hdic){grid-template-columns:auto minmax(0,1fr) auto!important}
body>header>*,body>header h1,body>header h1>span,body>header .hdnm{min-width:0}
body>header h1,body>header h1>span:not(.hdic){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body>header h1>span:not(.hdic),body>header h1:not(:has(.hdic)){direction:ltr;text-align:right}
body>header:has(#nvclk) h1>span:not(.hdic),body>header:has(#nvclk) h1:not(:has(.hdic)){margin-left:100px}
}

/* 🕘 الساعة بتبين بشريط الجوال/الكمبيوتر — بالبانر التاريخ بس، عشان عنوان الصفحة ياخد مساحة أوسع */
#nvclk>b{display:none!important}
