/* DosTime Health Universe — نمای کلی سلامت حرفه‌ای */
.health-universe{position:relative;overflow:hidden;border-radius:24px;border:none;background:linear-gradient(160deg,rgba(20,28,48,0.96),rgba(12,18,36,0.98));box-shadow:0 12px 32px rgba(0,0,0,0.28);margin-bottom:18px}
.health-universe::before{display:none}
.hu-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 14px 10px;background:linear-gradient(135deg,rgba(20,184,166,0.06),rgba(99,102,241,0.06),rgba(236,72,153,0.04));border-bottom:none}
/* حذف بک‌گراند و خط جداکننده هدر باکس سلامت (نبض زندگی شما) */
.hu-head,
html[data-theme='light'] .hu-head,
html[data-theme='dark'] .hu-head{
  background:transparent !important;
  background-color:transparent !important;
  background-image:none !important;
  border:none !important;
  border-bottom:none !important;
  box-shadow:none !important;
}
.hu-head::before,
.hu-head::after{
  display:none !important;
  background:none !important;
}

.hu-eyebrow{font-size:9px;font-weight:700;letter-spacing:.3px;color:#5eead4;margin-bottom:2px;opacity:.9}
.hu-head h2{font-size:13.5px;font-weight:800;color:#f1f5f9;letter-spacing:-.01em}
.hu-sub{font-size:10px;color:#94a3b8;margin-top:1px;font-weight:400}
.hu-badge{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:62px;padding:6px 10px;border-radius:12px;background:linear-gradient(135deg,#14b8a6,#6366f1);color:#fff;box-shadow:0 4px 14px rgba(99,102,241,0.28)}
.hu-badge-num{font-size:16px;font-weight:900;line-height:1}
.hu-badge span:last-child{font-size:9px;opacity:.92;margin-top:1px}
/* ════════════════════════════════════════════════════════════
   A) HEALTH CHART — ISOLATED (نمودار سلامت - ایزوله کامل)
   فقط .hu-chart-section را ویرایش کنید — به باکس‌ها کاری ندارد
   ════════════════════════════════════════════════════════════ */
.hu-chart-section{padding:6px 14px 0 14px}
.hu-chart-section .hu-hero{background:rgba(255,255,255,0.035);border:none;border-radius:18px;padding:6px 14px 10px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:360px;position:relative;overflow:hidden}

/* حذف باکس بک‌گراند کندو در تم تیره — کندو بدون باکس */
html[data-theme='dark'] .hu-chart-section{
  background:transparent !important;
  padding-top:2px !important;
}
html[data-theme='dark'] .hu-chart-section .hu-hero{
  background:transparent !important;
  background-color:transparent !important;
  border:none !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
html[data-theme='dark'] .hu-chart-section .hu-hero::after{
  display:none !important;
}

/* ════════════════════════════════════════════════════════════
   B) HEALTH BOXES — ISOLATED (باکس‌های پایین - ایزوله کامل)
   فقط .hu-boxes-section را ویرایش کنید — به نمودار کاری ندارد
   ════════════════════════════════════════════════════════════ */
.hu-boxes-section{padding:14px;display:flex;flex-direction:column;gap:12px}
/* ردیف نبض ۷ روزه + BMI کنار هم — همیشه یک ردیف دو ستونه */
.hu-row-2col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:540px){.hu-chart-section{padding:4px 10px 0 10px}.hu-chart-section .hu-hero{min-height:300px;padding:4px 8px 8px}.hu-row-2col{grid-template-columns:1fr 1fr;gap:10px}}
/* Legacy grid kept for backward compat — deprecated */
.hu-grid{display:grid;grid-template-columns:320px 1fr 1fr;grid-template-areas:"hero vitals bmi" "hero donut donut" "heat heat mood";gap:12px;padding:14px}
@media(max-width:900px){.hu-grid{grid-template-columns:1fr 1fr;grid-template-areas:"hero hero" "vitals bmi" "donut donut" "heat heat" "mood mood"}}
@media(max-width:540px){.hu-grid{grid-template-columns:1fr 1fr;grid-template-areas:"hero hero" "vitals bmi" "donut donut" "heat heat" "mood mood";gap:10px;padding:10px}.hu-head{padding:10px 12px}.hu-head h2{font-size:13px}.hu-hero{min-height:300px} .hu-svg{width:220px;height:220px}}
.hu-hero{grid-area:unset;background:rgba(255,255,255,0.035);border:none;border-radius:18px;padding:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:380px;position:relative;overflow:hidden}
.hu-hero::after{content:"";position:absolute;width:420px;height:420px;background:radial-gradient(circle at 50% 50%,rgba(99,102,241,0.18),transparent 70%);pointer-events:none}
.hu-svg{width:260px;height:260px;position:relative;z-index:1}
.hr-score{font-size:36px;font-weight:900;fill:#f1f5f9}
.hr-score-sub{font-size:13px;font-weight:800;fill:#2dd4bf}
.hr-score-cap{font-size:10px;fill:#94a3b8}
.hu-legend{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:10px;position:relative;z-index:1}
.hu-legend span{display:inline-flex;align-items:center;gap:4px;background:rgba(255,255,255,0.05);border:none;padding:4px 8px;border-radius:999px;font-size:10px;color:#cbd5e1;white-space:nowrap}
.hu-legend i{width:8px;height:8px;border-radius:99px;display:inline-block}
.hu-card{background:rgba(255,255,255,0.045);border:none;border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:8px;backdrop-filter:blur(8px);position:relative;overflow:hidden;box-shadow:0 4px 14px rgba(0,0,0,0.12)}
.hu-card::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,0.04),transparent);pointer-events:none}
.hu-card h4{font-size:11px;font-weight:800;color:#e2e8f0;display:flex;align-items:center;gap:6px}
.hu-card h4 small{font-weight:500;color:#94a3b8;font-size:10px;margin-inline-start:auto}
.hu-spark{width:100%;height:64px;display:block}
.hu-gauge{width:100%;height:110px}
.hu-gauge-val{font-size:22px;font-weight:900;fill:#f1f5f9;text-anchor:middle}
.hu-gauge-cap{font-size:10px;fill:#94a3b8;text-anchor:middle}
.hu-donut{display:flex;align-items:center;gap:10px}
.hu-donut svg{flex:0 0 110px;width:110px;height:110px}
.hu-donut-legend{flex:1;display:flex;flex-direction:column;gap:5px;font-size:10px;color:#cbd5e1}
.hu-donut-legend b{color:#f1f5f9}
.hu-donut-rail{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;padding:4px 2px 6px;scrollbar-width:none}
.hu-donut-rail::-webkit-scrollbar{display:none}
.hu-mini-donut{flex:0 0 84px;display:flex;flex-direction:column;align-items:center;gap:6px;background:rgba(255,255,255,0.03);border:none;border-radius:12px;padding:8px 6px;scroll-snap-align:start}
.hu-mini-donut svg{display:block}
.heat{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.heat-cell{aspect-ratio:1;border-radius:6px;background:rgba(255,255,255,0.06);border:none;position:relative;transition:transform .15s}
.heat-cell:hover{transform:scale(1.08)}
.heat-cell[data-v="100"]{background:linear-gradient(135deg,#14b8a6,#2dd4bf)}
.heat-cell[data-v="75"]{background:linear-gradient(135deg,#2dd4bf,#5eead4);opacity:.85}
.heat-cell[data-v="50"]{background:linear-gradient(135deg,#f59e0b,#fbbf24);opacity:.9}
.heat-cell[data-v="25"]{background:rgba(245,158,11,0.35)}
.heat-cell[data-v="0"]{background:rgba(255,255,255,0.06)}
.heat-cell small{position:absolute;inset:0;display:grid;place-items:center;font-size:7px;color:rgba(255,255,255,0.7);font-weight:700}
.heat-cell small{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;line-height:1.25;}
.heat-cell small b{font-size:10.5px;font-weight:900;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.55);}
.heat-cell small i{font-style:normal;font-size:7px;font-weight:900;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.55);}
.heat-cell[data-v="75"] small b,.heat-cell[data-v="75"] small i{color:#07332e;text-shadow:none;}
.heat-cell[data-v="50"] small b,.heat-cell[data-v="50"] small i{color:#5b2d0c;text-shadow:none;}
.heat-cell[data-v="0"] small{opacity:.75;}
.hh-water-chart .hh-wval{font-size:13px;font-weight:900;}
.hh-water-chart .hh-wval.tr-up{color:#16a34a;}
.hh-water-chart .hh-wval.tr-dn{color:#dc2626;}
html[data-theme='dark'] .hh-water-chart .hh-wval.tr-up{color:#4ade80;}
html[data-theme='dark'] .hh-water-chart .hh-wval.tr-dn{color:#f87171;}
.hh-mdot.tr-up{fill:#16a34a;stroke:#fff;stroke-width:1.5;}
.hh-mdot.tr-dn{fill:#dc2626;stroke:#fff;stroke-width:1.5;}
html[data-theme='dark'] .hh-mdot.tr-up{fill:#4ade80;}
html[data-theme='dark'] .hh-mdot.tr-dn{fill:#f87171;}
.heat-cell small i.tr-up{color:#4ade80;text-shadow:0 1px 2px rgba(0,0,0,.6);}
.heat-cell small i.tr-dn{color:#f87171;text-shadow:0 1px 2px rgba(0,0,0,.6);}
.heat-cell small i.tr-st{color:rgba(255,255,255,.65);text-shadow:0 1px 2px rgba(0,0,0,.6);}
.heat-cell[data-v="75"] small i.tr-up,.heat-cell[data-v="50"] small i.tr-up{color:#065f46;text-shadow:none;}
.heat-cell[data-v="75"] small i.tr-dn,.heat-cell[data-v="50"] small i.tr-dn{color:#991b1b;text-shadow:none;}
.heat-cell[data-v="75"] small i.tr-st,.heat-cell[data-v="50"] small i.tr-st{color:rgba(0,0,0,.45);text-shadow:none;}
.hu-timeline{display:flex;gap:6px;overflow-x:auto;padding:6px 2px;scrollbar-width:thin}
.hu-time-dot{flex:0 0 44px;height:56px;border-radius:12px;background:rgba(255,255,255,0.05);border:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:10px;color:#e2e8f0}
.hu-time-dot b{font-size:13px}
.hu-time-dot.ok{background:linear-gradient(135deg,rgba(34,197,94,0.18),rgba(187,247,208,0.12));border-color:rgba(34,197,94,0.25)}
.hu-level{height:8px;border-radius:999px;background:rgba(255,255,255,0.08);overflow:hidden}
.hu-level i{height:100%;display:block;border-radius:999px;background:linear-gradient(90deg,#f59e0b,#fbbf24);transition:width .8s}
/* Quick Actions Rail — 8 گزینه در یک ردیف ریلی */
.quick-grid{display:flex !important;gap:8px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;padding:4px 2px 8px;scrollbar-width:none;grid-template-columns:unset !important}
.quick-grid::-webkit-scrollbar{display:none}
.quick-grid > a, .quick-grid > div{flex:0 0 92px;scroll-snap-align:start}
.quick-grid .quick-card{flex:0 0 92px;min-width:92px;min-height:88px;padding:10px 6px}
@media(max-width:420px){.quick-grid > a, .quick-grid > div{flex:0 0 84px} .quick-grid .quick-card{min-width:84px}}
@keyframes huDash{from{stroke-dashoffset:880}to{stroke-dashoffset:var(--off)}}

.hu-click{cursor:pointer;transition:transform .15s, box-shadow .15s}
.hu-click:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(0,0,0,0.18)}
.hu-click:active{transform:translateY(0)}
.hu-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;padding:16px}
.hu-modal.open{display:flex}
.hu-modal-backdrop{position:absolute;inset:0;background:rgba(2,6,23,0.72);backdrop-filter:blur(8px)}
.hu-modal-box{position:relative;z-index:1;max-width:720px;width:100%;max-height:88vh;overflow:auto;background:linear-gradient(180deg,#1a2440,#0f172a);border:none;border-radius:20px;box-shadow:0 24px 60px rgba(0,0,0,0.6);padding:0}
.hu-modal-head{position:sticky;top:0;background:rgba(15,23,42,0.92);backdrop-filter:blur(8px);padding:14px 16px;border-bottom:none;display:flex;align-items:center;justify-content:space-between;z-index:2}
.hu-modal-title{font-size:13px;font-weight:900;color:#f1f5f9}
.hu-modal-close{width:32px;height:32px;border-radius:999px;border:1px solid rgba(255,255,255,0.1);background:rgba(255,255,255,0.06);color:#e2e8f0;display:grid;place-items:center;cursor:pointer;font-size:14px}
.hu-modal-body{padding:14px;display:flex;flex-direction:column;gap:12px}
.hu-modal-body .hu-card{cursor:default}
.hu-modal-body .hu-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media(max-width:480px){.hu-modal-body .hu-stat-grid{grid-template-columns:1fr}}
.hu-stat{padding:10px;border-radius:12px;background:rgba(255,255,255,0.035);border:none;display:flex;flex-direction:column;gap:4px}
.hu-stat small{font-size:10px;color:#94a3b8}
.hu-stat b{font-size:16px;color:#f1f5f9}
.hu-modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:560px){.hu-modal-grid{grid-template-columns:1fr}}
.hu-modal-card{padding:12px;border-radius:14px;background:rgba(255,255,255,0.035);border:none;display:flex;flex-direction:column;gap:6px}
.hu-modal-card h5{font-size:11px;font-weight:800;color:#e2e8f0;margin:0}
.hu-modal-card .hu-tip{font-size:10.5px;line-height:1.6;color:#cbd5e1;background:rgba(255,255,255,0.03);border:1px dashed rgba(255,255,255,0.07);border-radius:8px;padding:7px 8px}
.hu-modal-card .hu-nums{display:flex;gap:8px;flex-wrap:wrap;font-size:10px;color:#94a3b8}
.hu-modal-card .hu-nums b{font-size:12px;color:#f1f5f9}

.heat-cell{cursor:pointer}
.heat-cell.active{outline:2px solid #14b8a6; outline-offset:1px; border-color:#14b8a6 !important; box-shadow:0 0 0 4px rgba(20,184,166,0.22), 0 4px 12px rgba(0,0,0,0.25); transform:scale(1.07); z-index:1}
.hu-modal-grid.hu-2col{grid-template-columns:1fr 1fr !important}
.hu-donut{display:flex;align-items:center;justify-content:center;padding:4px 0}
.hu-vbars{display:flex;align-items:flex-end;gap:4px;height:64px;padding:6px 2px 2px}
.hu-vbars i{flex:1;border-radius:4px;min-height:3px;display:block}
.hu-pie{display:flex;align-items:center;gap:10px}
.hu-pie-legend{display:flex;flex-direction:column;gap:5px;font-size:10px;color:#cbd5e1;flex:1;min-width:0}
.hu-pie-legend span{display:flex;align-items:center;gap:5px;white-space:nowrap}
.hu-pie-legend i{width:9px;height:9px;border-radius:3px;display:inline-block;flex:0 0 auto}
.hu-pie-legend b{color:#f1f5f9}
@media(max-width:560px){.hu-modal-grid.hu-2col{grid-template-columns:1fr 1fr !important;gap:8px}.hu-modal-card{padding:10px}.hu-modal-card h5{font-size:10.5px}.hu-pie{flex-direction:column;gap:6px}}

/* Medications — match Health Universe boxes (calendar/record) at end of dashboard */
.med-card.hu-card, .med-card {
  background: rgba(255,255,255,0.045) !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 12px !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.med-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  pointer-events: none; border-radius: 16px;
}
.med-card > * { position: relative; z-index: 1; }
.med-card .med-head { gap: 10px; align-items: center; }
.med-card .drug-glyph {
  width: 38px; height: 38px; border-radius: 12px;
  font-size: 18px; box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  flex-shrink: 0;
}
html[data-theme='light'] .med-card { background: #ffffff !important; box-shadow: 0 4px 16px rgba(45,40,66,0.06) !important; }
html[data-theme='light'] .med-card::before { background: linear-gradient(180deg, rgba(255,255,255,0.65), transparent); }
.med-card .drug-name { font-size: 12.5px; font-weight: 800; color: #f1f5f9; letter-spacing: -0.01em; }
html[data-theme='light'] .med-card .drug-name { color: #1e293b; }
.med-hu-dosage { font-weight: 500; font-size: 10.5px; color: #94a3b8; margin-inline-start: 6px; }
.med-hu-sub { font-size: 10.5px; color: #94a3b8; margin-top: 2px; font-weight: 400; }
html[data-theme='light'] .med-hu-sub { color: #64748b; }
.med-card .med-meta {
  background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.07);
  border-radius: 12px; padding: 8px 10px; margin-top: 2px;
  border-top: 1px dashed rgba(255,255,255,0.07) !important; padding-top: 8px !important;
}
html[data-theme='light'] .med-card .med-meta { background: #f8fafc; border-color: #e2e8f0; }
.med-hu-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.med-hu-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.06); font-size: 10px; color: #cbd5e1;
  white-space: nowrap; font-weight: 500;
}
html[data-theme='light'] .med-hu-chip { background: #eef2ff; color: #6366f1; }
.med-card .stock-track { height: 6px; background: rgba(255,255,255,0.08); flex: 1; min-width: 80px; border-radius: 999px; overflow: hidden; }
html[data-theme='light'] .med-card .stock-track { background: #e2e8f0; }
.med-card .stock-fill.ok { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.med-card .stock-fill.low { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.med-card .med-actions {
  border-top: none !important; background: transparent !important;
  padding-top: 10px !important; gap: 6px; flex-wrap: wrap; margin-top: 2px;
}
.med-card .med-actions .btn {
  flex: 1 1 auto; min-width: 64px; height: 30px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; gap: 4px;
}
html[data-theme='dark'] .med-card .med-actions .btn-secondary {
  background: rgba(255,255,255,0.06) !important; border: none !important; color: #e2e8f0 !important;
}
html[data-theme='dark'] .med-card .med-actions .btn-secondary:hover { background: rgba(255,255,255,0.10) !important; }
html[data-theme='light'] .med-card .med-actions .btn-secondary { background: #f1f5f9 !important; border: none !important; color: #334155 !important; }
html[data-theme='light'] .med-card .med-actions .btn-secondary:hover { background: #e2e8f0 !important; }
.med-card.paused-card { opacity: 0.9; }
.med-card .med-note.hu-tip {
  background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.07);
  border-radius: 8px; padding: 6px 8px; font-size: 10.5px; line-height: 1.6; color: #cbd5e1;
}
html[data-theme='light'] .med-card .med-note.hu-tip { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.med-card .badge { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 700; }
.stack .med-card + .med-card { margin-top: 2px; }

/* Delete button at top next to badge — content-sized */
.med-card .med-head .med-head-delete {
  flex: 0 0 auto !important;
  min-width: auto !important;
  width: auto !important;
  height: 28px !important;
  padding-inline: 10px !important;
  font-size: 11px !important;
  border-radius: 999px !important;
  gap: 4px;
  white-space: nowrap;
}
.med-card .med-head { flex-wrap: nowrap; }
.med-card .med-head .badge { flex-shrink: 0; }

/* ── Top actions row (افزودن داروی جدید + کد + دوربین) — کشیده و منظم ── */
.med-actions-top { display:flex; gap:8px; align-items:stretch; flex-wrap:wrap; }
.med-actions-top .btn { flex:1 1 140px; min-width:140px; height:44px; min-height:44px; border-radius:12px; justify-content:center; font-weight:700; }
.med-actions-top .icon-btn.icon-box { flex:0 0 44px; width:44px; height:44px; min-width:44px; min-height:44px; border-radius:12px; display:grid; place-items:center; }
@media(max-width:360px){ .med-actions-top { gap:6px; } .med-actions-top .btn { min-width:120px; height:42px; } }

/* ── Calendar drug-card — one-row header + buttons below, quick-card glass theme ── */
.drug-card.hu-card {
  background: rgba(255,255,255,0.045) !important;
  border: none !important;
  border-radius: 16px !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
}
html[data-theme='light'] .drug-card.hu-card { background: #fff !important; box-shadow: 0 4px 16px rgba(45,40,66,0.06) !important; }
.drug-card.hu-card .drug-name { line-height:1.2; }
.drug-card.hu-card .drug-detail { line-height:1.3; }
.drug-card.hu-card .btn { height:28px !important; min-height:28px !important; font-size:11px !important; padding:0 12px !important; border-radius:999px !important; }
html[data-theme='dark'] .drug-card.hu-card .btn-secondary { background: rgba(255,255,255,0.06) !important; border:none !important; color:#e2e8f0 !important; }

/* drug-card clearer icons — single-row texts */
.drug-card.hu-card .row { width:100%; }
.drug-card.hu-card span[style*="42px"] { filter:saturate(1.05) brightness(1.02); }

/* drug-card reduced height to match 7-day/BMI boxes */
.drug-card.hu-card { min-height: auto !important; padding:8px !important; gap:4px !important; }
.drug-card.hu-card .row { gap:6px !important; }
