/* ==========================================================
   متابع — مخطوطة إسلامية كروكية على ورق
   ========================================================== */

:root{
  --paper:#FBF7EC;
  --paper-2:#F4EDDB;
  --card:#EDF3F1;
  --card-2:#E3ECE9;
  --ink:#26302F;
  --ink-82:rgba(38,48,47,.82);
  --ink-70:rgba(38,48,47,.70);
  --ink-50:rgba(38,48,47,.50);
  --ink-30:rgba(38,48,47,.30);
  --ink-16:rgba(38,48,47,.16);
  --teal:#1F7A6E;
  --teal-2:#3FA395;
  --clay:#D2823C;
  --gold:#C9A24A;
  --olive:#6F9B4A;
  --slate:#3F6E9E;
  --plum:#8A4E7D;
  --danger:#B0432C;
  --r-card:18px 13px 20px 15px / 15px 20px 13px 18px;
  --r-inner:15px 11px 17px 12px / 12px 17px 11px 15px;
  --r-sm:12px 9px 14px 10px / 10px 14px 9px 12px;
  --shadow:0 1px 0 rgba(42,46,49,.06), 0 8px 22px -18px rgba(42,46,49,.55);
}

*,*::before,*::after{box-sizing:border-box}

html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  background:
    radial-gradient(110% 65% at 50% -12%, rgba(210,130,60,.16), transparent 62%),
    radial-gradient(85% 60% at 100% 0%, rgba(31,122,110,.13), transparent 58%),
    radial-gradient(85% 60% at 0% 100%, rgba(63,110,158,.12), transparent 58%),
    var(--paper);
  color:var(--ink);
  font-family:'Tajawal',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  font-size:15px;
  line-height:1.65;
  min-height:100vh;
  overscroll-behavior-y:contain;
  -webkit-tap-highlight-color:transparent;
  user-select:none;
  -webkit-user-select:none;
}

/* نسيج الورق */
body::before{
  content:'';
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  opacity:.045;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* نقش هندسي إسلامي */
body::after{
  content:'';
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  opacity:.05;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%232A2E31' stroke-width='1.1'%3E%3Cpath d='M60 8 112 60 60 112 8 60Z'/%3E%3Crect x='23' y='23' width='74' height='74'/%3E%3Ccircle cx='60' cy='60' r='26'/%3E%3C/g%3E%3C/svg%3E");
  background-size:120px 120px;
  background-position:center;
}

body.lock{overflow:hidden}

input,select,textarea{
  user-select:text;
  -webkit-user-select:text;
  font-family:inherit;
}

.svg-defs{position:absolute;width:0;height:0;overflow:hidden}

.is-hidden{display:none !important}

.app{
  position:relative;
  z-index:1;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* ---------------- الترويسة ---------------- */

.app-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px 10px;
  max-width:780px;
  width:100%;
  margin-inline:auto;
}

.brand{display:flex;align-items:center;gap:10px;min-width:0}

.star-lg{
  width:28px;height:28px;flex:0 0 auto;
  color:var(--ink);opacity:.85;
}

.brand-txt{min-width:0}

.brand h1{
  font-family:'Noto Naskh Arabic',serif;
  font-size:26px;
  font-weight:700;
  line-height:1.05;
  margin:0;
}

.brand-sub{
  margin:2px 0 0;
  font-size:11.5px;
  color:var(--ink-70);
  line-height:1.3;
}

.header-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}

.icon-btn{
  width:46px;height:46px;
  flex:0 0 auto;
  display:grid;place-items:center;
  background:transparent;
  color:var(--ink);
  border:1.4px solid var(--ink-30);
  border-radius:14px 11px 15px 12px / 12px 15px 11px 14px;
  cursor:pointer;
  transition:transform .12s ease, background .18s ease, border-color .18s ease;
}
.icon-btn svg{width:22px;height:22px}
.icon-btn:active{transform:scale(.94);background:rgba(42,46,49,.07);border-color:var(--ink)}
.icon-btn:focus-visible{outline:2px dashed var(--ink);outline-offset:3px}

.icon-btn--cal{
  background:rgba(126,154,150,.18);
  border-color:var(--ink);
}

/* خط يد كروكي */
.hr-hand{
  height:6px;
  width:100%;
  max-width:780px;
  margin:0 auto;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='6' viewBox='0 0 64 6'%3E%3Cpath d='M0 3 Q 8 1.2 16 3 T 32 3 T 48 3 T 64 3' fill='none' stroke='%232A2E31' stroke-opacity='.34' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:repeat-x;
  background-size:64px 6px;
  background-position:center;
}
.hr-hand--short{max-width:100%;margin:16px 0;opacity:.8}

/* ---------------- شريط التاريخ ---------------- */

.date-row{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 18px 12px;
  max-width:780px;
  width:100%;
  margin-inline:auto;
  position:sticky;
  top:0;
  z-index:15;
  background:linear-gradient(var(--paper) 70%, rgba(246,244,239,.72));
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
}

.date-pill{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  background:rgba(232,237,240,.85);
  color:var(--ink);
  border:1.5px solid var(--ink);
  border-radius:var(--r-sm);
  font-family:inherit;
  cursor:pointer;
  text-align:start;
  transition:transform .12s ease, background .16s ease;
}
.date-pill:active{transform:scale(.985);background:rgba(225,232,235,.95)}
.date-pill:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}

.dp-ic{width:22px;height:22px;flex:0 0 auto;color:var(--ink);opacity:.9}

.dp-txt{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}
.dp-txt b{font-size:14.5px;font-weight:700;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dp-txt em{font-size:11.5px;font-style:normal;color:var(--ink-70);line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.dp-hint{
  flex:0 0 auto;
  font-size:11px;
  font-weight:700;
  color:var(--ink-70);
  border:1.1px dashed var(--ink-30);
  border-radius:8px 6px 9px 7px / 7px 9px 6px 8px;
  padding:3px 8px;
  white-space:nowrap;
}

.today-btn{
  flex:0 0 auto;
  font-family:inherit;
  font-size:12.5px;
  font-weight:700;
  color:var(--paper);
  background:var(--ink);
  border:1.5px solid var(--ink);
  border-radius:var(--r-sm);
  padding:0 13px;
  height:44px;
  cursor:pointer;
}
.today-btn:active{transform:scale(.96)}

/* ---------------- الحاوية ---------------- */

.app-main{
  width:100%;
  max-width:780px;
  margin-inline:auto;
  padding:0 18px 72px;
  flex:1 1 auto;
}

.view{animation:fadeUp .28s ease-out both}

@keyframes fadeUp{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:none}
}

/* ---------------- رأس لوحة اليوم ---------------- */

.today-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.today-head-txt{min-width:0}

.sec-title{
  font-family:'Noto Naskh Arabic',serif;
  font-size:21px;
  font-weight:700;
  margin:0;
  line-height:1.25;
  color:var(--ink);
}

.sec-sub{
  margin:2px 0 0;
  font-size:12px;
  color:var(--ink-70);
  line-height:1.4;
}

/* ---------------- الأزرار ---------------- */

.btn{
  font-family:inherit;
  font-size:14px;
  font-weight:700;
  line-height:1.2;
  color:var(--ink);
  background:transparent;
  border:1.5px solid var(--ink);
  border-radius:14px 11px 16px 12px / 12px 16px 11px 14px;
  padding:10px 16px;
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  cursor:pointer;
  transition:transform .12s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.btn--sm{font-size:13px;padding:9px 13px;min-height:44px;white-space:nowrap}
.btn--primary{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.btn--primary:active{transform:scale(.97);background:#1c1f22;color:var(--paper)}
.btn--ghost{background:transparent;color:var(--ink);border-color:var(--ink-30)}
.btn--ghost:active{background:rgba(42,46,49,.08);color:var(--ink);border-color:var(--ink)}
.btn--danger{background:transparent;color:var(--danger);border-color:rgba(180,103,76,.65)}
.btn--danger:active{background:var(--danger);color:var(--paper);border-color:var(--danger)}
.btn:active{transform:scale(.97)}
.btn:focus-visible{outline:2px dashed var(--ink);outline-offset:3px}
.btn:disabled{opacity:.45;cursor:default}

/* ---------------- بطاقة الشخص ---------------- */

.people-list{display:flex;flex-direction:column;gap:14px}

.pcard{
  position:relative;
  background:linear-gradient(180deg, rgba(255,255,255,.35), rgba(232,237,240,1) 40%), var(--card);
  color:var(--ink);
  border:1.5px solid var(--ink);
  border-radius:var(--r-card);
  box-shadow:var(--shadow);
  padding:13px 14px 12px;
}
.pcard::after{
  content:'';
  position:absolute;
  inset:4px;
  border:1px solid rgba(42,46,49,.13);
  border-radius:var(--r-inner);
  pointer-events:none;
}

.pcard-top{
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
  z-index:1;
}

.pcard-open{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  background:transparent;
  border:0;
  padding:0;
  font-family:inherit;
  color:var(--ink);
  text-align:start;
  cursor:pointer;
}
.pcard-open:active .avatar{transform:scale(.95)}
.pcard-open:focus-visible{outline:2px dashed var(--ink);outline-offset:4px;border-radius:12px}

.avatar{
  width:40px;height:40px;
  flex:0 0 auto;
  display:grid;place-items:center;
  font-family:'Noto Naskh Arabic',serif;
  font-size:19px;
  font-weight:700;
  color:var(--paper);
  background:var(--c,var(--teal));
  border:1.4px solid var(--ink);
  border-radius:50% 46% 52% 48% / 48% 52% 46% 50%;
  box-shadow:inset 0 0 0 2px rgba(246,244,239,.25);
  transition:transform .14s ease;
}
.avatar--lg{width:52px;height:52px;font-size:25px}
.avatar--sm{width:32px;height:32px;font-size:15px;border-width:1.2px}

.pcard-id{min-width:0;flex:1 1 auto;display:flex;flex-direction:column}
.pc-name{
  font-family:'Noto Naskh Arabic',serif;
  font-size:18px;
  font-weight:700;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--ink);
}
.pc-sub{
  font-size:11px;
  color:var(--ink-70);
  line-height:1.4;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pcard-chev{
  width:16px;height:16px;
  flex:0 0 auto;
  opacity:.5;
}

/* العدّاد المصغّر */
.mini-dial{
  flex:0 0 auto;
  width:54px;
  height:54px;
  position:relative;
  color:var(--ink);
}
.mini-dial-svg{width:100%;height:100%;display:block;overflow:visible}
.md-txt{
  font-family:'Tajawal',sans-serif;
  font-size:46px;
  font-weight:700;
  fill:var(--ink);
  font-variant-numeric:tabular-nums;
}

/* مقاييس البطاقة */

.metric{margin-top:11px;position:relative;z-index:1}
.metric-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
}
.metric-head .m-name{
  font-size:13px;
  font-weight:700;
  color:var(--ink);
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.metric-head .m-name::before{
  content:'';
  width:7px;height:7px;
  border-radius:2px;
  background:var(--mc,var(--teal));
  border:1px solid var(--ink);
  transform:rotate(45deg);
}
.metric-val{
  font-size:11.5px;
  color:var(--ink-70);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

/* دوائر الفروض */

.prayer-row{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:5px;
}

.prayer{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  min-height:56px;
  padding:2px 0 0;
  background:transparent;
  border:0;
  color:var(--ink);
  font-family:inherit;
  cursor:pointer;
}

.prayer-dot{
  width:36px;height:36px;
  display:grid;place-items:center;
  border:1.5px dashed rgba(42,46,49,.45);
  border-radius:50% 47% 51% 49% / 49% 51% 47% 50%;
  color:transparent;
  transition:background .18s ease, border-color .18s ease, border-style .1s ease, transform .12s ease;
}
.prayer-dot svg{width:19px;height:19px;opacity:0;transform:scale(.5);transition:opacity .16s ease, transform .2s cubic-bezier(.34,1.56,.64,1)}
.prayer-label{font-size:10px;color:var(--ink-70);line-height:1.2}

.prayer.is-on .prayer-dot{
  background:var(--teal);
  border-style:solid;
  border-color:var(--ink);
  color:var(--paper);
  transform:scale(1.02);
}
.prayer.is-on .prayer-dot svg{opacity:1;transform:scale(1)}
.prayer.is-on .prayer-label{color:var(--ink);font-weight:700}
.prayer:active .prayer-dot{transform:scale(.92)}
.prayer:focus-visible{outline:none}
.prayer:focus-visible .prayer-dot{outline:2px dashed var(--ink);outline-offset:3px}

.prayer-row--lg{gap:8px}
.prayer-row--lg .prayer{min-height:72px}
.prayer-row--lg .prayer-dot{width:46px;height:46px}
.prayer-row--lg .prayer-dot svg{width:24px;height:24px}
.prayer-row--lg .prayer-label{font-size:11.5px}

/* شريط المهام في البطاقة */

.taskbar{
  height:12px;
  border:1.3px solid var(--ink);
  border-radius:8px 6px 9px 7px / 7px 9px 6px 8px;
  background:rgba(246,244,239,.55);
  overflow:hidden;
}
.taskbar i{
  display:block;
  height:100%;
  width:0%;
  background:repeating-linear-gradient(135deg,var(--olive) 0 5px,rgba(154,169,127,.7) 5px 10px);
  border-inline-end:1.5px solid var(--ink);
  transition:width .3s ease;
}

/* معاينة الملاحظة */
.note-preview{
  margin-top:11px;
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:8px 10px;
  background:rgba(246,244,239,.62);
  border:1.2px dashed rgba(42,46,49,.28);
  border-radius:var(--r-sm);
  position:relative;
  z-index:1;
}
.np-ic{
  flex:0 0 auto;
  width:6px;
  align-self:stretch;
  border-radius:3px;
  background:var(--clay);
}
.np-txt{
  flex:1 1 auto;
  min-width:0;
  font-size:11.5px;
  line-height:1.45;
  color:var(--ink-82);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.np-more{
  flex:0 0 auto;
  font-size:10.5px;
  font-weight:700;
  color:var(--clay);
}

/* شريط الأسبوع */

.pcard-foot{
  margin-top:12px;
  padding-top:10px;
  border-top:1.2px dashed rgba(42,46,49,.22);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  position:relative;
  z-index:1;
}
.foot-label{font-size:11px;color:var(--ink-70);white-space:nowrap}

.week-strip{display:flex;gap:4px}
.ws-cell{
  width:24px;height:24px;
  display:grid;place-items:center;
  font-size:9.5px;
  color:var(--ink);
  border:1.1px solid rgba(42,46,49,.28);
  border-radius:6px 4px 6px 5px / 5px 6px 4px 6px;
  background:transparent;
  font-variant-numeric:tabular-nums;
}

/* ---------------- الحالة الفارغة ---------------- */

.empty{
  text-align:center;
  padding:34px 18px 30px;
  border:1.6px dashed rgba(42,46,49,.35);
  border-radius:var(--r-card);
  background:rgba(232,237,240,.5);
  color:var(--ink);
}
.empty-star{width:44px;height:44px;color:var(--ink);opacity:.5;margin-bottom:6px}
.empty h3{
  font-family:'Noto Naskh Arabic',serif;
  font-size:20px;
  margin:0 0 12px;
  font-weight:700;
  color:var(--ink);
}
.steps{
  list-style:none;
  margin:0 0 20px;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:9px;
  text-align:start;
  max-width:350px;
  margin-inline:auto;
}
.steps li{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:13px;
  color:var(--ink-82);
  line-height:1.5;
}
.steps b{
  flex:0 0 auto;
  width:22px;height:22px;
  display:grid;place-items:center;
  font-size:11.5px;
  border:1.3px solid var(--ink);
  border-radius:50% 46% 52% 48% / 48% 52% 46% 50%;
  background:var(--paper);
  color:var(--ink);
  margin-top:1px;
}
.empty-note{font-size:11px;color:var(--ink-50);margin:14px 0 0}

/* ---------------- صفحة الشخص ---------------- */

.person-head{
  display:flex;
  align-items:center;
  gap:11px;
  margin-bottom:14px;
}

.back-btn{
  width:44px;height:44px;
  flex:0 0 auto;
  display:grid;place-items:center;
  background:transparent;
  border:1.4px solid var(--ink-30);
  border-radius:13px 10px 14px 11px / 11px 14px 10px 13px;
  color:var(--ink);
  cursor:pointer;
  transition:transform .12s ease, background .16s ease;
}
.back-btn svg{width:20px;height:20px}
.back-btn:active{transform:scale(.93);background:rgba(42,46,49,.08)}
.back-btn:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}

.ph-info{flex:1 1 auto;min-width:0}
.ph-info h2{
  margin:0;
  font-family:'Noto Naskh Arabic',serif;
  font-size:22px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--ink);
}
.ph-info span{font-size:11.5px;color:var(--ink-70)}

/* شعار اليوم */
.date-banner{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  margin-bottom:12px;
  background:rgba(246,244,239,.85);
  border:1.4px dashed rgba(42,46,49,.35);
  border-radius:var(--r-sm);
  color:var(--ink);
  font-family:inherit;
  text-align:start;
  cursor:pointer;
  transition:background .16s ease, transform .12s ease;
}
.date-banner:active{transform:scale(.99);background:rgba(239,237,227,.95)}
.date-banner:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}
.db-ic{flex:0 0 auto;display:grid;place-items:center;width:26px;height:26px;color:var(--ink)}
.db-ic svg{width:20px;height:20px}
.db-txt{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}
.db-txt b{font-size:13.5px;line-height:1.3}
.db-txt em{font-size:11px;font-style:normal;color:var(--ink-70);line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.db-hint{flex:0 0 auto;font-size:11px;font-weight:700;color:var(--clay)}

/* مبدّل النطاق */

.range-toggle{
  display:flex;
  gap:6px;
  padding:4px;
  border:1.4px solid var(--ink-30);
  border-radius:13px 10px 14px 11px / 11px 14px 10px 13px;
  background:rgba(232,237,240,.6);
  margin-bottom:14px;
}
.range-btn{
  flex:1 1 0;
  min-height:40px;
  font-family:inherit;
  font-size:12.5px;
  font-weight:700;
  color:var(--ink-70);
  background:transparent;
  border:0;
  border-radius:10px 8px 11px 9px / 9px 11px 8px 10px;
  cursor:pointer;
  transition:background .18s ease, color .18s ease;
}
.range-btn.is-on{background:var(--ink);color:var(--paper)}
.range-btn:focus-visible{outline:2px dashed var(--ink);outline-offset:1px}

/* ---------------- عدّاد الطيارة ---------------- */

.gauge-panel{
  position:relative;
  border:1.6px solid var(--ink);
  border-radius:var(--r-card);
  background:
    radial-gradient(115% 110% at 25% 0%, rgba(255,255,255,.62), rgba(232,237,240,.9) 55%),
    var(--card);
  color:var(--ink);
  padding:14px 13px 12px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:6px 12px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.gauge-panel::after{
  content:'';
  position:absolute;
  inset:5px;
  border-radius:var(--r-inner);
  pointer-events:none;
  border:1px solid rgba(42,46,49,.12);
  background:
    radial-gradient(circle at 7px 7px, rgba(42,46,49,.5) 2.1px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 7px) 7px, rgba(42,46,49,.5) 2.1px, transparent 2.6px),
    radial-gradient(circle at 7px calc(100% - 7px), rgba(42,46,49,.5) 2.1px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), rgba(42,46,49,.5) 2.1px, transparent 2.6px);
}

.gauge-dial{
  flex:0 0 auto;
  width:min(56vw, 196px);
  max-width:196px;
  color:var(--ink);
}
.gauge{width:100%;height:auto;display:block;overflow:visible}

.gauge-needle{
  transform-box:view-box;
  transform-origin:100px 100px;
}
.gauge-needle.is-anim{
  transition:transform .95s cubic-bezier(.22,.9,.24,1);
}

.gauge-num{
  font-family:'Tajawal',sans-serif;
  font-size:9.5px;
  fill:var(--ink);
  opacity:.55;
  font-variant-numeric:tabular-nums;
}
.gauge-val{
  font-family:'Tajawal',sans-serif;
  font-size:40px;
  font-weight:700;
  fill:var(--ink);
  font-variant-numeric:tabular-nums;
}
.gauge-unit{font-size:15px;opacity:.55}
.gauge-cap{
  font-family:'Tajawal',sans-serif;
  font-size:10.5px;
  fill:var(--ink);
  opacity:.6;
}

.gauge-meta{
  flex:1 1 132px;
  min-width:132px;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.gm-row{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  color:var(--ink);
  border-bottom:1.1px dashed rgba(42,46,49,.2);
  padding-bottom:6px;
}
.gm-row span{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gm-row b{font-size:13.5px;font-weight:700;font-variant-numeric:tabular-nums}
.gm-dot{
  flex:0 0 auto;
  width:9px;height:9px;
  background:var(--c,var(--teal));
  border:1.2px solid var(--ink);
  border-radius:2px;
  transform:rotate(45deg);
}
.gm-note{
  margin:0;
  font-size:10.5px;
  line-height:1.5;
  color:var(--ink-50);
}

/* فاصل النجمة */

.star-div{
  display:flex;
  align-items:center;
  gap:12px;
  margin:20px 0;
  color:var(--ink-50);
}
.star-div::before,
.star-div::after{
  content:'';
  flex:1 1 auto;
  height:0;
  border-top:1.2px dashed rgba(42,46,49,.28);
}
.star-svg{width:16px;height:16px;flex:0 0 auto}

/* ---------------- لوحات الأقسام ---------------- */

.panel{
  position:relative;
  border:1.5px solid var(--ink);
  border-radius:var(--r-card);
  background:var(--card);
  color:var(--ink);
  padding:13px 14px 15px;
  margin-bottom:14px;
  box-shadow:var(--shadow);
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.panel-head h3{
  margin:0;
  font-family:'Noto Naskh Arabic',serif;
  font-size:17px;
  font-weight:700;
  color:var(--ink);
  line-height:1.3;
}
.panel-tag{
  font-size:11px;
  color:var(--ink-70);
  border:1.1px solid var(--ink-30);
  border-radius:8px 6px 9px 7px / 7px 9px 6px 8px;
  padding:3px 8px;
  white-space:nowrap;
  background:rgba(246,244,239,.6);
}

.panel-hint{
  margin:0 0 10px;
  font-size:11px;
  line-height:1.5;
  color:var(--ink-50);
}

.panel-empty{
  margin:0;
  padding:12px;
  font-size:12px;
  line-height:1.6;
  color:var(--ink-70);
  text-align:center;
  border:1.2px dashed rgba(42,46,49,.3);
  border-radius:var(--r-sm);
  background:rgba(246,244,239,.55);
}

/* المهام */

.task-list{display:flex;flex-direction:column;gap:8px}

.task-item{
  display:flex;
  align-items:stretch;
  gap:6px;
}

.task-row{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
  gap:11px;
  min-height:50px;
  padding:8px 12px;
  font-family:inherit;
  font-size:14px;
  font-weight:500;
  text-align:start;
  color:var(--ink);
  background:rgba(246,244,239,.6);
  border:1.3px solid var(--ink-30);
  border-radius:12px 9px 13px 10px / 10px 13px 9px 12px;
  cursor:pointer;
  transition:background .16s ease, border-color .16s ease, color .16s ease, transform .1s ease;
}
.task-row:active{transform:scale(.99);background:rgba(239,237,227,.9)}
.task-row:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}

.task-box{
  width:28px;height:28px;
  flex:0 0 auto;
  display:grid;place-items:center;
  border:1.5px dashed rgba(42,46,49,.45);
  border-radius:50% 47% 51% 49% / 49% 51% 47% 50%;
  color:transparent;
  transition:background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}
.task-box svg{width:16px;height:16px}

.task-txt{
  flex:1 1 auto;
  min-width:0;
  line-height:1.45;
  word-break:break-word;
}

.task-item.is-done .task-row{
  background:rgba(154,169,127,.28);
  border-color:var(--ink);
}
.task-item.is-done .task-box{
  background:var(--olive);
  border-style:solid;
  border-color:var(--ink);
  color:var(--paper);
  transform:scale(1.03);
}
.task-item.is-done .task-txt{
  color:var(--ink);
  font-weight:700;
}

.task-del,
.note-del{
  flex:0 0 auto;
  width:40px;
  display:grid;place-items:center;
  background:transparent;
  border:1.2px solid rgba(42,46,49,.2);
  border-radius:11px 9px 12px 10px / 10px 12px 9px 11px;
  color:var(--ink-50);
  cursor:pointer;
  transition:background .16s ease, color .16s ease, border-color .16s ease;
}
.task-del svg,
.note-del svg{width:14px;height:14px}
.task-del:active,
.note-del:active{background:rgba(180,103,76,.18);color:var(--danger);border-color:var(--danger)}
.task-del:focus-visible,
.note-del:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}

.task-add{
  display:flex;
  gap:8px;
  margin-top:12px;
  align-items:stretch;
}
.task-add input{
  flex:1 1 auto;
  min-width:0;
  min-height:46px;
  padding:9px 12px;
  font-size:14px;
  color:var(--ink);
  background:var(--paper);
  border:1.4px solid var(--ink);
  border-radius:11px 9px 12px 10px / 10px 12px 9px 11px;
  outline:none;
  transition:box-shadow .15s ease;
}
.task-add input:focus{box-shadow:0 0 0 3px rgba(126,154,150,.32)}
.task-add input::placeholder{color:var(--ink-50)}
.task-add .btn{flex:0 0 auto}

/* الملاحظات */

.note-add{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:12px;
}
.note-add textarea{
  width:100%;
  min-height:66px;
  resize:vertical;
  padding:10px 12px;
  font-size:14px;
  line-height:1.6;
  color:var(--ink);
  background:var(--paper);
  border:1.4px solid var(--ink);
  border-radius:12px 9px 13px 10px / 10px 13px 9px 12px;
  outline:none;
  transition:box-shadow .15s ease;
}
.note-add textarea:focus{box-shadow:0 0 0 3px rgba(200,146,114,.3)}
.note-add textarea::placeholder{color:var(--ink-50)}
.note-add .btn{align-self:flex-end}

.note-list{display:flex;flex-direction:column;gap:8px}

.note-item{
  display:flex;
  align-items:stretch;
  gap:6px;
  padding:0;
}
.note-txt{
  flex:1 1 auto;
  min-width:0;
  padding:9px 12px;
  font-size:13px;
  line-height:1.55;
  color:var(--ink);
  background:rgba(246,244,239,.72);
  border:1.2px dashed rgba(42,46,49,.3);
  border-radius:12px 9px 13px 10px / 10px 13px 9px 12px;
  word-break:break-word;
  white-space:pre-wrap;
}

/* سجل 30 يومًا */

.histo{
  display:flex;
  align-items:flex-end;
  gap:3px;
  height:52px;
  padding-top:4px;
}
.histo-bar{
  flex:1 1 0;
  min-width:0;
  padding:0;
  border:0;
  border-radius:3px 2px 3px 2px;
  background:rgba(42,46,49,.16);
  cursor:pointer;
  transition:opacity .15s ease, transform .12s ease;
}
.histo-bar:active{transform:scaleY(.9);opacity:.75}
.histo-bar:focus-visible{outline:2px dashed var(--ink);outline-offset:1px}

/* منطقة الخطر */

.danger-zone{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:22px;
}

/* ---------------- الأوراق السفلية ---------------- */

.sheet-wrap{
  position:fixed;
  inset:0;
  z-index:120;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.sheet-wrap.is-hidden{display:none !important}

.sheet-bg{
  position:absolute;
  inset:0;
  background:rgba(42,46,49,.38);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  animation:fadeIn .2s ease-out;
}

@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes sheetIn{from{transform:translateY(26px);opacity:.55}to{transform:none;opacity:1}}

.sheet{
  position:relative;
  width:100%;
  max-width:520px;
  max-height:88vh;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  background:var(--paper);
  color:var(--ink);
  border:1.5px solid var(--ink);
  border-bottom:0;
  border-radius:22px 18px 0 0 / 18px 22px 0 0;
  padding:10px 18px 22px;
  animation:sheetIn .26s cubic-bezier(.2,.8,.3,1);
}

.sheet-grip{
  width:44px;height:5px;
  margin:0 auto 12px;
  border-radius:3px;
  background:rgba(42,46,49,.22);
}

.sheet-title{
  font-family:'Noto Naskh Arabic',serif;
  font-size:20px;
  font-weight:700;
  margin:0 0 16px;
  color:var(--ink);
}

.sheet-note{
  font-size:12px;
  color:var(--ink-70);
  line-height:1.6;
  margin:0 0 14px;
}
.sheet-note--stat{
  font-variant-numeric:tabular-nums;
  border:1.2px dashed rgba(42,46,49,.3);
  border-radius:10px 8px 11px 9px / 9px 11px 8px 10px;
  padding:8px 11px;
  background:rgba(232,237,240,.55);
  margin-bottom:16px;
}

.sheet-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}
.sheet-actions .btn{flex:1 1 0}
.sheet-actions--col{flex-direction:column}
.sheet-actions--col .btn{width:100%}

.color-row{display:flex;gap:10px;flex-wrap:wrap;padding-top:2px}

.color-dot{
  width:40px;height:40px;
  border-radius:50% 46% 52% 48% / 48% 52% 46% 50%;
  border:1.5px solid transparent;
  background:var(--c);
  cursor:pointer;
  display:grid;
  place-items:center;
  transition:transform .12s ease, border-color .15s ease;
}
.color-dot::after{
  content:'';
  width:12px;height:12px;
  border-radius:50%;
  background:var(--paper);
  opacity:0;
  transition:opacity .15s ease;
}
.color-dot.is-on{border-color:var(--ink);transform:scale(1.06)}
.color-dot.is-on::after{opacity:1}
.color-dot:active{transform:scale(.92)}

/* ---------------- التقويم ---------------- */

.cal-nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:12px;
}
.cal-nav-btn{
  width:44px;height:44px;
  flex:0 0 auto;
  display:grid;place-items:center;
  background:transparent;
  color:var(--ink);
  border:1.3px solid var(--ink-30);
  border-radius:12px 9px 13px 10px / 10px 13px 9px 12px;
  cursor:pointer;
  transition:transform .12s ease, background .16s ease;
}
.cal-nav-btn svg{width:18px;height:18px}
.cal-nav-btn:active{transform:scale(.93);background:rgba(42,46,49,.08)}
.cal-nav-btn:disabled{opacity:.28;cursor:default}
.cal-nav-btn:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}

.cal-month{
  font-family:'Noto Naskh Arabic',serif;
  font-size:17px;
  font-weight:700;
  color:var(--ink);
  text-align:center;
  flex:1 1 auto;
}

.cal-dow{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:4px;
  margin-bottom:6px;
}
.cal-dow span{
  text-align:center;
  font-size:10.5px;
  color:var(--ink-50);
  padding-bottom:2px;
}

.cal-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:4px;
}
.cal-blank{display:block}

.cal-day{
  position:relative;
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:inherit;
  font-size:13.5px;
  font-weight:500;
  color:var(--ink);
  background:transparent;
  border:1.2px solid rgba(42,46,49,.22);
  border-radius:10px 8px 11px 9px / 9px 11px 8px 10px;
  cursor:pointer;
  transition:background .16s ease, border-color .16s ease, color .16s ease, transform .1s ease;
}
.cal-day:active{transform:scale(.94)}
.cal-day.is-today{border-color:var(--clay);border-width:1.6px}
.cal-day.is-sel{background:var(--ink);color:var(--paper);border-color:var(--ink);font-weight:700}
.cal-day:disabled{opacity:.25;cursor:default}
.cal-day:focus-visible{outline:2px dashed var(--ink);outline-offset:1px}

.cal-dot{
  position:absolute;
  bottom:4px;
  left:50%;
  transform:translateX(-50%);
  width:4px;height:4px;
  border-radius:50%;
  background:var(--teal);
}
.cal-day.is-sel .cal-dot{background:var(--paper)}

.cal-note{
  margin:12px 0 10px;
  font-size:11px;
  line-height:1.6;
  color:var(--ink-50);
}

.cal-picked{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 11px;
  margin-bottom:10px;
  border:1.3px dashed rgba(42,46,49,.32);
  border-radius:var(--r-sm);
  background:rgba(232,237,240,.6);
  font-size:12.5px;
  color:var(--ink);
}
.cp-tag{
  font-size:11px;
  font-weight:700;
  padding:2px 8px;
  border-radius:7px 5px 8px 6px / 6px 8px 5px 7px;
  background:var(--ink);
  color:var(--paper);
  white-space:nowrap;
}
.cp-date{color:var(--ink);font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.cal-people{display:flex;flex-direction:column;gap:8px}

.cal-person{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:48px;
  padding:7px 11px;
  font-family:inherit;
  font-size:14px;
  color:var(--ink);
  background:rgba(246,244,239,.72);
  border:1.3px solid var(--ink-30);
  border-radius:12px 9px 13px 10px / 10px 13px 9px 12px;
  cursor:pointer;
  text-align:start;
  transition:background .16s ease, border-color .16s ease, transform .1s ease;
}
.cal-person:active{transform:scale(.99);background:rgba(232,237,240,.9);border-color:var(--ink)}
.cal-person:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}
.cp-name{flex:1 1 auto;min-width:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cp-pct{flex:0 0 auto;font-size:12.5px;font-weight:700;color:var(--teal);font-variant-numeric:tabular-nums}

.cal-empty{
  margin:0;
  padding:14px;
  text-align:center;
  font-size:12.5px;
  color:var(--ink-50);
  border:1.2px dashed rgba(42,46,49,.28);
  border-radius:var(--r-sm);
}

/* حقول الإدخال */

.field{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}
.field > span{font-size:12px;color:var(--ink-70);font-weight:500}

.field input,
.field select{
  width:100%;
  min-height:46px;
  padding:9px 12px;
  font-size:15px;
  color:var(--ink);
  background:var(--paper);
  border:1.4px solid var(--ink);
  border-radius:11px 9px 12px 10px / 10px 12px 9px 11px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
  -moz-appearance:textfield;
}
.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
.field input:focus,
.field select:focus{
  border-color:var(--ink);
  box-shadow:0 0 0 3px rgba(126,154,150,.32);
}
.field input::placeholder{color:var(--ink-50)}

.field-error{
  margin:-6px 0 10px;
  font-size:12px;
  color:var(--danger);
  font-weight:500;
}

/* ---------------- التوست ---------------- */

.toast{
  position:fixed;
  inset-inline:0;
  bottom:26px;
  z-index:200;
  margin-inline:auto;
  width:max-content;
  max-width:88vw;
  padding:10px 18px;
  font-size:13px;
  font-weight:500;
  color:var(--paper);
  background:var(--ink);
  border-radius:12px 9px 13px 10px / 10px 13px 9px 12px;
  opacity:0;
  transform:translateY(10px);
  pointer-events:none;
  transition:opacity .22s ease, transform .22s ease;
}
.toast.show{opacity:1;transform:none}

/* ---------------- الشاشات الواسعة ---------------- */

@media (min-width:720px){
  .people-list{
    display:grid;
    grid-template-columns:1fr 1fr;
    align-items:start;
  }
  .brand h1{font-size:29px}
  .gauge-dial{width:200px}
  .gauge-panel{gap:14px 20px}
  .gauge-meta{flex:0 1 200px}
}

@media (min-width:1024px){
  .gauge-dial{width:220px}
}

@media (max-width:380px){
  .dp-hint{display:none}
  .mini-dial{width:48px;height:48px}
  .md-txt{font-size:52px}
  .gauge-dial{width:min(60vw,180px)}
}

/* ==========================================================
   تحديث المظهر — ألوان أغنى، شعارات، ومخططات
   ========================================================== */

/* لمسة لونية في الترويسة */
.app-header{
  background:linear-gradient(105deg, rgba(31,122,110,.13), rgba(210,130,60,.11) 48%, rgba(63,110,158,.13));
  border-radius:0 0 22px 22px;
  padding-bottom:14px;
}
.star-lg{color:var(--teal)}

/* معيّن ذهبي قبل عناوين اللوحات */
.panel-head h3::before{
  content:'';
  display:inline-block;
  width:8px;height:8px;
  margin-inline-end:8px;
  border-radius:2px;
  background:var(--gold);
  border:1px solid rgba(38,48,47,.35);
  transform:rotate(45deg) translateY(-1px);
  vertical-align:middle;
}

/* شعار كل متابَع داخل الرمز */
.avatar{color:var(--paper)}
.avatar svg{width:22px;height:22px;display:block}
.avatar--lg svg{width:30px;height:30px}
.avatar--sm svg{width:17px;height:17px}

/* شريط لوني أعلى بطاقة الشخص */
.pcard::before{
  content:'';
  position:absolute;
  top:0;
  inset-inline:16px;
  height:4px;
  border-radius:0 0 6px 6px;
  background:var(--pc,var(--teal));
  opacity:.9;
}

/* اختيار الشعار */
.emblem-row{display:flex;gap:9px;flex-wrap:wrap;padding-top:2px}
.emblem-chip{
  width:46px;height:46px;
  display:grid;place-items:center;
  color:var(--ink);
  background:rgba(251,247,236,.82);
  border:1.4px solid var(--ink-30);
  border-radius:50% 46% 52% 48% / 48% 52% 46% 50%;
  cursor:pointer;
  transition:transform .12s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.emblem-chip svg{width:23px;height:23px}
.emblem-chip.is-on{background:var(--ink);color:var(--paper);border-color:var(--ink);transform:scale(1.05)}
.emblem-chip:active{transform:scale(.93)}
.emblem-chip:focus-visible{outline:2px dashed var(--ink);outline-offset:2px}

/* المخطط البياني */
.chart-panel{padding-bottom:10px}
.chart{width:100%;height:auto;display:block;overflow:visible;margin-top:2px}
.chart-grid{stroke:rgba(38,48,47,.13);stroke-width:1;stroke-dasharray:2 5}
.chart-avg{stroke:var(--slate);stroke-width:1.6;stroke-dasharray:6 4;opacity:.85}
.chart-avg-t{font-family:'Tajawal',sans-serif;font-size:10px;font-weight:700;fill:var(--slate)}
.chart-lb{font-family:'Tajawal',sans-serif;font-size:9.5px;fill:rgba(38,48,47,.55)}
.chart-vl{font-family:'Tajawal',sans-serif;font-size:9px;font-weight:700;fill:rgba(38,48,47,.72);font-variant-numeric:tabular-nums}
.chart-hit{cursor:pointer}
.chart-hit:active{opacity:.35}

/* أشرطة اليوم داخل المخطط */
.daybars{display:flex;flex-direction:column;gap:11px;margin:6px 0 4px}
.daybar-row{display:flex;align-items:center;gap:9px}
.db-name{flex:0 0 92px;font-size:12px;font-weight:700;color:var(--ink-82)}
.db-track{
  flex:1 1 auto;
  height:16px;
  border:1.3px solid var(--ink-30);
  border-radius:9px 7px 10px 8px / 8px 10px 7px 9px;
  background:rgba(251,247,236,.75);
  overflow:hidden;
}
.db-track--empty{opacity:.55}
.db-fill{display:block;height:100%;width:0;border-radius:7px;transition:width .55s cubic-bezier(.2,.9,.3,1)}
.db-val{flex:0 0 auto;min-width:40px;text-align:end;font-size:12px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}

/* أيام قادمة في التقويم */
.cal-day.is-future{border-style:dashed;color:var(--ink-70)}

/* ---------------- تقليل الحركة ---------------- */

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}