/* ════ STAFF CARD GRID ════ */
.sr-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.sr-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: box-shadow 0.15s;
}

.sr-card:hover {
  box-shadow: 0 4px 16px rgba(26,82,118,.10);
  border-color: var(--blue-m);
}

/* ════ UNIFIED SUB-TAB DESIGN ════ */
.sup-tabs {
  display: flex;
  gap: 4px;
  background: #F5F7FA;
  border-bottom: 2px solid #E0E6ED;
  padding: 8px 8px 0;
  margin-bottom: 14px;
  flex-wrap: wrap;
  border-radius: 8px 8px 0 0;
}

.sup-tab {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  color: #4A5D73;
  background: #E9EEF5;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border: 1px solid #E0E6ED;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}

.sup-tab:hover {
  background: #D6EAF8;
  color: #2E86C1;
}

.sup-tab-active {
  background: #2E86C1;
  color: #fff;
  border-color: #E0E6ED;
  border-bottom-color: #1B4F72;
  font-weight: 600;
}

/* ════ LOGIN SCREEN ════ */
#ls {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1A5276 0%, #2E86C1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9900;
}

.lb {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px;
  width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.ll {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.li {
  width: 46px;
  height: 46px;
  background: var(--blue);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.lt2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
}

.ls2 {
  font-size: 12px;
  color: var(--text2);
}

.lf {
  margin-bottom: 13px;
}

.lf label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lf input,
.lf select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13px;
  font-family: var(--f);
  color: var(--text);
}

.lf input:focus,
.lf select:focus {
  outline: none;
  border-color: var(--blue-m);
  box-shadow: 0 0 0 2px var(--blue-p);
}

.lb-btn {
  width: 100%;
  padding: 11px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--f);
  margin-top: 6px;
  transition: background 0.15s;
}

.lb-btn:hover {
  background: var(--blue-m);
}

.l-hint {
  text-align: center;
  font-size: 10px;
  color: var(--text3);
  margin-top: 12px;
}

/* ════ PASSWORD TOGGLE ════ */
.l-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.l-pass-wrap input {
  width: 100%;
  padding-right: 36px;
}

.l-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 4px;
  color: var(--text2);
  line-height: 1;
  opacity: 0.6;
}

.l-eye:hover { opacity: 1; }

/* ════ LOGIN ERROR / LOCKOUT ════ */
.l-err-box {
  background: #FDEDEC;
  border: 1px solid #F5B7B1;
  border-radius: var(--r);
  color: #C0392B;
  font-size: 12px;
  padding: 8px 11px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.l-lockout-box {
  background: #FEF9E7;
  border: 1px solid #F9E79F;
  border-radius: var(--r);
  color: #7D6608;
  font-size: 12px;
  padding: 8px 11px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.l-timer {
  font-family: var(--m);
  font-weight: 700;
  font-size: 13px;
}

/* ════ FIRST-LOGIN ALERT ════ */
.l-alert-box {
  background: #FDF2F8;
  border: 1px solid #E8DAEF;
  border-radius: var(--r);
  color: #6C3483;
  font-size: 12px;
  padding: 10px 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.l-alert-info {
  background: #EBF5FB;
  border-color: #AED6F1;
  color: #1A5276;
}

/* ════ PASSWORD POLICY HINT ════ */
.l-policy-box {
  font-size: 11px;
  color: var(--text2);
  background: #F8F9FA;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 11px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ════ FORGOT PASSWORD LINK ════ */
.l-forgot {
  font-size: 12px;
  color: var(--blue-m);
  text-decoration: none;
}
.l-forgot:hover { text-decoration: underline; }

/* ════ RECOVERY LINK (subtle, admin only) ════ */
.l-recovery-link {
  font-size: 10px;
  color: var(--text3);
  text-decoration: none;
  opacity: 0.6;
}
.l-recovery-link:hover { opacity: 1; text-decoration: underline; }

/* ════ TAB SWITCH (retained for compatibility) ════ */
.tab-sw {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.tsw {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text2);
  transition: all 0.15s;
}

.tsw.active {
  background: var(--blue);
  color: #fff;
}

/* ════ INFO BOX ════ */
.ib {
  background: var(--blue-p);
  border: 1px solid #C8DCF0;
  border-radius: var(--r);
  padding: 9px 13px;
  margin-bottom: 12px;
  font-size: 11px;
  color: var(--blue);
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

/* ════ GRID 2 ════ */
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ════ BRANCHES GRID ════ */
.bsg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.bsg-c {
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 10px;
}

.bsg-n {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 10px;
}

.bsg-d {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dg {
  background: var(--green);
}

.da {
  background: var(--amber);
}

.dr {
  background: var(--red);
}

.dgr {
  background: var(--gray3);
}

/* ════ ATTENDANCE ════ */
.ac {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.1s;
}

.ac:hover {
  transform: scale(1.1);
}

.aP {
  background: #D5F5E3;
  color: #0B5345;
}

.aA {
  background: var(--red-l);
  color: #7B241C;
}

.aH {
  background: var(--amber-l);
  color: #784212;
}

.aL {
  background: var(--blue-l);
  color: var(--blue);
}

.aW {
  background: var(--gray2);
  color: var(--text3);
}

/* ════ AVATAR ════ */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ════ USER ADMIN ════ */
.ua-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.ua-row:last-child {
  border-bottom: none;
}

.ua-name {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
}

.ua-role {
  font-size: 11px;
  color: var(--text2);
}

.ua-branch {
  font-size: 11px;
  color: var(--blue);
}

/* ════ DASHBOARD REDESIGN ════ */

/* Metric cards row */
.dm-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.dm-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s;
}

.dm-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.dm-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.dm-icon-g { background: #D5F5E3; color: #1D9E75; }
.dm-icon-r { background: #FADBD8; color: #C0392B; }
.dm-icon-b { background: #D6EAF8; color: #1A5276; }
.dm-icon-a { background: #FDEBD0; color: #E67E22; }
.dm-icon-p { background: #E8DAEF; color: #6C3483; }

.dm-body { min-width: 0; }

.dm-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.dm-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.dm-val-g { color: #1D9E75; }
.dm-val-r { color: #C0392B; }
.dm-val-b { color: #1A5276; }
.dm-val-a { color: #E67E22; }
.dm-val-p { color: #6C3483; }

.dm-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}

/* Alerts bar */
.d-alert-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.d-alert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 500;
}

.d-alert-crit { background: #FADBD8; border: 1px solid #E8B4AF; color: #7B241C; }
.d-alert-low  { background: #FDEBD0; border: 1px solid #F0C598; color: #784212; }

.d-alert-icon { font-size: 14px; flex-shrink: 0; }

.d-alert-tag {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.d-alert-tag-r { background: #E8B4AF; color: #7B241C; }
.d-alert-tag-a { background: #F0C598; color: #784212; }

/* Main dashboard layout */
.dm-main {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 14px;
}

/* Enhanced stock grid — 5 cols fits 10 blood groups in 2 clean rows */
.dsg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.dsg-c {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 10px 10px;
  text-align: center;
  transition: box-shadow 0.13s;
  cursor: default;
}

.dsg-c:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.08); }

.dsg-ok   { border-top: 3px solid #1D9E75; }
.dsg-low  { border-top: 3px solid #E67E22; }
.dsg-crit { border-top: 3px solid #C0392B; background: #FFF8F8; }

.dsg-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.dsg-pos { color: #1D9E75; font-size: 13px; font-weight: 700; }
.dsg-neg { color: #C0392B; font-size: 13px; font-weight: 700; }

.dsg-v {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  margin: 4px 0;
}

.dsg-u {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.dsg-brk {
  font-size: 9px;
  color: var(--text3);
  margin-top: 5px;
  font-family: var(--m);
}

/* Activity timeline */
.dtl {
  display: flex;
  flex-direction: column;
}

.dtl-row {
  display: grid;
  grid-template-columns: 46px 10px 1fr;
  gap: 0 10px;
  align-items: flex-start;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.dtl-row:last-child { border-bottom: none; }

.dtl-time {
  font-size: 10px;
  font-family: var(--m);
  color: var(--text3);
  padding-top: 3px;
  text-align: right;
}

.dtl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.dtl-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.dtl-mod {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dtl-det {
  font-size: 12px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.dtl-by {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
}

/* ════ EQUIPMENT ASSET REGISTER ════ */
.eq-tabs {
  display: flex;
  gap: 4px;
  background: #F5F7FA;
  border-bottom: 2px solid #E0E6ED;
  padding: 8px 8px 0;
  margin-bottom: 14px;
  flex-wrap: wrap;
  border-radius: 8px 8px 0 0;
}

.eq-tab {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  color: #4A5D73;
  background: #E9EEF5;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border: 1px solid #E0E6ED;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}

.eq-tab:hover {
  background: #D6EAF8;
  color: #2E86C1;
}

.eq-tab.active {
  background: #2E86C1;
  color: #fff;
  border-color: #E0E6ED;
  border-bottom-color: #1B4F72;
  font-weight: 600;
}

.eq-dw {
  font-size: 11px;
  color: #2E86C1;
  margin-top: 3px;
  font-weight: 500;
}

@media print {
  .sidebar, .topbar, #eq-detail, .eq-tabs,
  .card-h button, .card-h label, #eq-alerts-body { display: none !important; }
  .main { overflow: visible !important; }
  .content { overflow: visible !important; padding: 0 !important; }
  #page-equipment { display: block !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ════ DASHBOARD v2 — dm2- ════ */

.dm2-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.dm2-kcard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .15s, transform .15s;
  cursor: default;
}
.dm2-kcard:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  transform: translateY(-1px);
}
.dm2-kcard.dm2-pulse { animation: dm2pulse .5s ease; }
@keyframes dm2pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.03); box-shadow: 0 0 18px rgba(192,57,43,.18); }
  100% { transform: scale(1); }
}

.dm2-kico {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.dm2-kico-g { background: #D5F5E3; }
.dm2-kico-r { background: #FADBD8; }
.dm2-kico-b { background: #D6EAF8; }
.dm2-kico-a { background: #FDEBD0; }
.dm2-kico-p { background: #E8DAEF; }

.dm2-klbl {
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .04em;
}

.dm2-kval {
  font-size: 28px; font-weight: 700; line-height: 1; font-family: var(--m);
}

.dm2-kfoot {
  display: flex; align-items: center; justify-content: space-between;
}

.dm2-ksub { font-size: 11px; color: var(--text3); }

.dm2-chip {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; display: inline-flex; align-items: center;
}
.dm2-chip-up { background: #D5F5E3; color: #1D9E75; }
.dm2-chip-dn { background: #FADBD8; color: #C0392B; }
.dm2-chip-n  { background: #F4F6F8; color: #909CA7; }

/* Mid row */
.dm2-mid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 14px;
  margin-bottom: 14px;
}

.dm2-livedot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: #C0392B; margin-right: 6px;
  animation: dm2blink 1.5s infinite;
}
@keyframes dm2blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Bottom row */
.dm2-bot {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
}

/* Chart tabs */
.dm2-tabs { display: flex; gap: 3px; }

.dm2-tab {
  padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 500;
  cursor: pointer; color: var(--text2); background: transparent;
  border: 1px solid transparent; transition: all .15s; user-select: none;
}
.dm2-tab:hover { background: var(--gray); color: var(--text); }
.dm2-tab.active { background: #FADBD8; color: #C0392B; border-color: #E8B4AF; font-weight: 600; }

/* Quick actions */
.dm2-qa-list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }

.dm2-qa {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--gray);
  cursor: pointer; font-family: var(--f); color: var(--text);
  font-size: 12px; font-weight: 500; width: 100%; text-align: left;
  transition: all .15s;
}
.dm2-qa:hover { background: #EBF5FB; border-color: #AED6F1; color: var(--blue); transform: translateX(2px); }
.dm2-qa-red:hover { background: #FADBD8; border-color: #E8B4AF; color: #C0392B; }
.dm2-qa-ico { font-size: 15px; }
.dm2-qa-txt { flex: 1; }
.dm2-qa-arr { color: var(--text3); font-size: 12px; }

/* Critical alert modal */
.dm2-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 9000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.dm2-overlay.open { opacity: 1; pointer-events: all; }

.dm2-modal {
  background: var(--white); border-radius: var(--rl); padding: 24px;
  width: 430px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.18);
  transform: translateY(8px); transition: transform .2s;
}
.dm2-overlay.open .dm2-modal { transform: translateY(0); }

.dm2-mh {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; font-size: 15px; font-weight: 600; color: var(--text);
}
.dm2-mclose {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--gray);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text2); transition: all .15s;
}
.dm2-mclose:hover { background: #FADBD8; color: #C0392B; border-color: #E8B4AF; }

.dm2-alert-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; min-height: 24px; }
.dm2-apill { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.dm2-apill-r { background: #FADBD8; color: #C0392B; }
.dm2-apill-a { background: #FDEBD0; color: #E67E22; }

/* Responsive */
@media (max-width: 1300px) { .dm2-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1050px) { .dm2-mid, .dm2-bot { grid-template-columns: 1fr; } }
@media (max-width: 780px)  { .dm2-strip { grid-template-columns: repeat(2, 1fr); } }
