/* ============================================================
   Shared feature-mockup animation system (mck-)
   Used across gps-tracking, attendance, payroll, god-map,
   expense, reports pages. App-mockup style, light theme.
   ============================================================ */
.mck{ --c2:#0369a1; --cy:#38bdf8; --vi:#115e59; --or:#c2410c; --bl:#0369a1; --gr:#15803d;
  --line:rgba(15,23,42,.10); --ink:#1e293b; --mut:#5b6b80; --bg2:#f4f7fb; }
.mck-builder{ display:grid; grid-template-columns:1.55fr 1fr; gap:14px; }
.mck-stage{ position:relative; border-radius:16px; overflow:hidden; border:1px solid var(--line);
  background:linear-gradient(180deg,#f4f8fd,#e8eef5); box-shadow:0 14px 34px rgba(15,23,42,.09); aspect-ratio:16/11; }
.mck-map{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.mck-panel{ background:linear-gradient(180deg,#fff,var(--bg2)); border:1px solid var(--line); border-radius:16px;
  padding:16px 17px; display:flex; flex-direction:column; gap:12px; box-shadow:0 14px 34px rgba(15,23,42,.09); }
.mck-phead{ display:flex; justify-content:space-between; align-items:center; padding-bottom:10px; border-bottom:1px solid var(--line); }
.mck-ptitle{ font-size:14px; font-weight:700; color:var(--ink); }
.mck-tag{ font-size:9px; letter-spacing:.1em; text-transform:uppercase; font-weight:700; padding:4px 10px; border-radius:100px;
  color:#15803d; background:rgba(34,197,94,.12); display:inline-flex; align-items:center; gap:5px; }
.mck-tag::before{ content:""; width:6px; height:6px; border-radius:50%; background:#15803d; animation:mck-blink 1.4s infinite; }
.mck-tag.amber{ color:#a16207; background:rgba(245,158,11,.15); } .mck-tag.amber::before{ background:#a16207; }
.mck-tag.violet{ color:#0f766e; background:rgba(15, 118, 110,.12); } .mck-tag.violet::before{ background:#0f766e; }
@keyframes mck-blink{ 0%,100%{opacity:1} 50%{opacity:.25} }
.mck-row{ display:flex; align-items:center; gap:10px; font-size:12.5px; color:var(--ink); }
.mck-row .av{ width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:10px; font-weight:700; flex-shrink:0; }
.mck-row .meta{ margin-left:auto; font-size:11px; color:var(--mut); font-variant-numeric:tabular-nums; }
.mck-sub{ font-size:11px; color:var(--mut); }
.mck-chip{ display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; padding:5px 10px; border-radius:100px; background:var(--bg2); border:1px solid var(--line); color:var(--mut); }
.mck-badge{ font-size:10.5px; font-weight:700; padding:2px 9px; border-radius:100px; margin-left:auto; }
.mck-badge.on{ color:#15803d; background:rgba(34,197,94,.12); }
.mck-badge.idle{ color:#a16207; background:rgba(245,158,11,.15); }
.mck-badge.off{ color:#5b6b80; background:rgba(100,116,139,.14); }
.mck-metric{ font-size:1.7rem; font-weight:800; color:var(--ink); letter-spacing:-.02em; line-height:1; font-variant-numeric:tabular-nums; }
.mck-metric small{ font-size:.8rem; font-weight:600; color:var(--mut); }
.mck-prog{ height:6px; border-radius:100px; background:var(--bg2); border:1px solid var(--line); overflow:hidden; }
.mck-prog i{ display:block; height:100%; width:0; background:linear-gradient(90deg,var(--cy),var(--c2)); border-radius:100px; animation:mck-fill 5s ease-in-out infinite; }
.mck-prog.gr i{ background:linear-gradient(90deg,#4ade80,#15803d); }
.mck-prog.vi i{ background:linear-gradient(90deg,#115e59,#0f766e); }
@keyframes mck-fill{ 0%,8%{width:0} 55%,92%{width:100%} 100%{width:0} }
.mck-push{ margin-top:auto; }

/* self-drawing route + geofence + moving markers */
.mck-route{ stroke-dasharray:100; stroke-dashoffset:100; animation:mck-draw 5s ease-in-out infinite; }
@keyframes mck-draw{ 0%,8%{stroke-dashoffset:100} 55%,92%{stroke-dashoffset:0} 100%{stroke-dashoffset:100} }
.mck-geo{ transform-origin:center; animation:mck-geo 3s ease-out infinite; }
@keyframes mck-geo{ 0%{ opacity:.7; r:6; } 100%{ opacity:0; r:34; } }

/* weekly / month bars */
.mck-bars{ display:flex; align-items:flex-end; gap:7px; height:74px; }
.mck-bcol{ flex:1; display:flex; flex-direction:column; align-items:center; gap:5px; height:100%; justify-content:flex-end; }
.mck-bcol .b{ width:100%; border-radius:5px 5px 0 0; background:linear-gradient(180deg,var(--cy),var(--c2)); transform-origin:bottom; transform:scaleY(0); animation:mck-grow 3.6s ease-in-out infinite; }
.mck-bcol.vi .b{ background:linear-gradient(180deg,#115e59,#0f766e); }
.mck-bcol span{ font-size:9px; color:#6b7a90; font-weight:600; }
@keyframes mck-grow{ 0%{transform:scaleY(0)} 45%,82%{transform:scaleY(1)} 100%{transform:scaleY(0)} }

/* battery + polling (gps battery feature) */
.mck-battstage{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:26px; }
.mck-batt{ width:220px; height:104px; border:5px solid #334155; border-radius:16px; position:relative; padding:8px; }
.mck-batt::after{ content:""; position:absolute; right:-15px; top:32px; width:11px; height:40px; background:#334155; border-radius:0 5px 5px 0; }
.mck-batt i{ display:block; height:100%; border-radius:8px; background:linear-gradient(90deg,#22c55e,#15803d); animation:mck-drain 6s ease-in-out infinite; }
@keyframes mck-drain{ 0%{width:92%} 72%{width:66%} 88%{width:60%} 100%{width:92%} }
.mck-battpct{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:1.4rem; color:#0f172a; }
.mck-poll{ display:flex; align-items:center; gap:14px; }
.mck-poll .pdot{ width:14px; height:14px; border-radius:50%; background:var(--c2); position:relative; }
.mck-poll .pdot::after{ content:""; position:absolute; inset:0; border-radius:50%; background:var(--c2); animation:mck-ping 2s ease-out infinite; }
.mck-poll .pdot:nth-child(2)::after{ animation-delay:.4s; }
.mck-poll .pdot:nth-child(3)::after{ animation-delay:.8s; }
@keyframes mck-ping{ 0%{transform:scale(1);opacity:.55} 100%{transform:scale(3);opacity:0} }

/* ---- centre stage (non-map widgets sit here) ---- */
.mck-center{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:20px; }

/* PHONE frame */
.mck-phone{ width:150px; height:230px; border-radius:24px; background:#0f172a; padding:10px; box-shadow:0 20px 44px rgba(15,23,42,.28); position:relative; }
.mck-phone::before{ content:""; position:absolute; top:14px; left:50%; transform:translateX(-50%); width:44px; height:5px; border-radius:5px; background:#334155; }
.mck-screen{ width:100%; height:100%; border-radius:16px; background:#fff; overflow:hidden; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:16px; }

/* SELFIE face capture */
.mck-face{ width:88px; height:88px; border-radius:50%; background:radial-gradient(circle at 50% 38%,#e0f2fe,#eef3f8); display:flex; align-items:center; justify-content:center; font-size:2.6rem; color:#0369a1; position:relative; }
.mck-scan{ position:absolute; inset:-8px; border-radius:50%; border:3px solid transparent; border-top-color:var(--c2); border-right-color:var(--c2); animation:mck-spin 1.3s linear infinite; }
@keyframes mck-spin{ to{ transform:rotate(360deg); } }
.mck-scanline{ position:absolute; left:8%; right:8%; height:3px; background:linear-gradient(90deg,transparent,var(--c2),transparent); border-radius:3px; animation:mck-scanmove 2.4s ease-in-out infinite; }
@keyframes mck-scanmove{ 0%,100%{ top:18%; } 50%{ top:78%; } }
.mck-verified{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:#15803d; opacity:0; animation:mck-verin 4s ease-in-out infinite; }
@keyframes mck-verin{ 0%,55%{ opacity:0; transform:scale(.8); } 66%,90%{ opacity:1; transform:scale(1); } 100%{ opacity:0; } }

/* CALENDAR */
.mck-cal{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px; box-shadow:0 12px 30px rgba(15,23,42,.1); width:min(88%,320px); }
.mck-cal-h{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-weight:700; color:var(--ink); font-size:13px; }
.mck-cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.mck-cal-d{ aspect-ratio:1; border-radius:7px; background:var(--bg2); display:flex; align-items:center; justify-content:center; font-size:10.5px; color:var(--mut); font-weight:600; }
.mck-cal-d.p{ background:rgba(34,197,94,.16); color:#15803d; animation:mck-pop 4s ease-in-out infinite; }
.mck-cal-d.l{ background:rgba(245,158,11,.18); color:#a16207; }
.mck-cal-d.a{ background:rgba(15, 118, 110,.15); color:#0f766e; }
.mck-cal-d:nth-child(7n) { }
.mck-cal-d.p:nth-child(2){ animation-delay:.2s } .mck-cal-d.p:nth-child(3){ animation-delay:.4s } .mck-cal-d.p:nth-child(4){ animation-delay:.6s }
@keyframes mck-pop{ 0%,20%{ transform:scale(.6); opacity:0; } 34%,90%{ transform:scale(1); opacity:1; } 100%{ transform:scale(1); opacity:1; } }

/* CLOCK / time */
.mck-clockcard{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:22px 26px; box-shadow:0 12px 30px rgba(15,23,42,.1); text-align:center; }
.mck-clockface{ width:96px; height:96px; border-radius:50%; border:4px solid #e2e8f0; margin:0 auto 14px; position:relative; }
.mck-hand{ position:absolute; bottom:50%; left:50%; transform-origin:bottom; background:#0f172a; border-radius:3px; }
.mck-hand.h{ width:4px; height:26px; transform:translateX(-50%) rotate(90deg); animation:mck-hh 8s linear infinite; }
.mck-hand.m{ width:3px; height:36px; transform:translateX(-50%) rotate(0deg); animation:mck-mm 4s linear infinite; }
.mck-clockface::after{ content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:8px; height:8px; border-radius:50%; background:var(--c2); }
@keyframes mck-hh{ to{ transform:translateX(-50%) rotate(450deg); } }
@keyframes mck-mm{ to{ transform:translateX(-50%) rotate(360deg); } }

/* PAYSLIP */
.mck-slip{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px 18px; box-shadow:0 12px 30px rgba(15,23,42,.1); width:min(90%,300px); }
.mck-slip-h{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; padding-bottom:10px; border-bottom:1px solid var(--line); font-weight:700; color:var(--ink); font-size:13px; }
.mck-slip-l{ display:flex; justify-content:space-between; font-size:12px; color:var(--mut); padding:5px 0; opacity:0; animation:mck-slipin 4s ease-in-out infinite; }
.mck-slip-l:nth-child(2){ animation-delay:.15s } .mck-slip-l:nth-child(3){ animation-delay:.3s } .mck-slip-l:nth-child(4){ animation-delay:.45s }
.mck-slip-l b{ color:var(--ink); font-weight:700; }
.mck-slip-total{ display:flex; justify-content:space-between; align-items:center; margin-top:10px; padding-top:10px; border-top:2px solid var(--line); font-weight:800; color:var(--ink); }
@keyframes mck-slipin{ 0%,15%{ opacity:0; transform:translateX(-8px); } 30%,90%{ opacity:1; transform:translateX(0); } 100%{ opacity:1; } }

/* RECEIPT scan */
.mck-receipt{ width:120px; background:#fff; border-radius:10px 10px 4px 4px; padding:14px 12px; box-shadow:0 14px 34px rgba(15,23,42,.16); position:relative; overflow:hidden; }
.mck-receipt::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:8px; background:repeating-linear-gradient(-45deg,#fff 0 6px,transparent 6px 12px); }
.mck-rline{ height:6px; border-radius:3px; background:#e2e8f0; margin-bottom:7px; }
.mck-rline.s{ width:60%; } .mck-rline.m{ width:85%; } .mck-rline.big{ height:12px; width:70%; background:#cbd5e1; margin-bottom:12px; }
.mck-rscan{ position:absolute; left:0; right:0; height:26px; top:0; background:linear-gradient(180deg,rgba(2, 132, 199,.28),transparent); border-top:2px solid var(--c2); animation:mck-rscanmove 2.6s ease-in-out infinite; }
@keyframes mck-rscanmove{ 0%,100%{ top:2%; } 50%{ top:82%; } }

/* STEPS (approval workflow) */
.mck-steps{ display:flex; flex-direction:column; gap:0; width:min(90%,300px); }
.mck-step{ display:flex; align-items:center; gap:12px; padding:9px 0; position:relative; }
.mck-step .d{ width:26px; height:26px; border-radius:50%; background:var(--bg2); border:2px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:11px; color:var(--mut); flex-shrink:0; z-index:1; transition:.3s; }
.mck-step:not(:last-child)::after{ content:""; position:absolute; left:12px; top:32px; bottom:-4px; width:2px; background:var(--line); }
.mck-step .t{ font-size:12.5px; color:var(--ink); font-weight:600; }
.mck-step.done .d{ background:#15803d; border-color:#15803d; color:#fff; animation:mck-stepin .4s both; }
.mck-step.done .t{ color:var(--ink); }
.mck-step.s1.done .d{ animation-delay:.4s } .mck-step.s2.done .d{ animation-delay:1.3s } .mck-step.s3.done .d{ animation-delay:2.2s }
@keyframes mck-stepin{ 0%{ transform:scale(.4); opacity:0; } 100%{ transform:scale(1); opacity:1; } }

/* GAUGE / budget */
.mck-gauge{ width:min(90%,320px); }
.mck-gauge-h{ display:flex; justify-content:space-between; font-size:12px; color:var(--mut); font-weight:600; margin-bottom:8px; }
.mck-gauge-bar{ height:16px; border-radius:100px; background:var(--bg2); border:1px solid var(--line); overflow:hidden; position:relative; }
.mck-gauge-bar i{ display:block; height:100%; width:0; border-radius:100px; background:linear-gradient(90deg,#4ade80,#f59e0b,#ef4444); animation:mck-gauge 5s ease-in-out infinite; }
@keyframes mck-gauge{ 0%,8%{width:0} 55%,92%{width:88%} 100%{width:0} }
.mck-gauge-alert{ margin-top:12px; display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:700; color:#dc2626; background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.25); padding:7px 12px; border-radius:10px; opacity:0; animation:mck-alertin 5s ease-in-out infinite; }
@keyframes mck-alertin{ 0%,60%{ opacity:0; transform:translateY(4px);} 72%,92%{ opacity:1; transform:translateY(0);} 100%{opacity:0;} }

/* DONUT */
.mck-donut{ width:130px; height:130px; border-radius:50%; background:conic-gradient(var(--c2) 0turn,var(--c2) var(--v,.62turn),#e2e8f0 var(--v,.62turn)); position:relative; animation:mck-donutspin 5s ease-in-out infinite; }
.mck-donut::after{ content:""; position:absolute; inset:20px; border-radius:50%; background:#fff; }
.mck-donut-c{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:800; color:var(--ink); font-size:1.2rem; z-index:1; }
@keyframes mck-donutspin{ 0%{ --v:0turn; } 60%,100%{ --v:.62turn; } }
@property --v{ syntax:'<angle>'; inherits:false; initial-value:0turn; }

/* LINE chart (svg draw) */
.mck-line{ stroke-dasharray:100; stroke-dashoffset:100; animation:mck-draw 5s ease-in-out infinite; }
.mck-line-dot{ opacity:0; animation:mck-dotin 5s ease-in-out infinite; }

/* status list dots */
.mck-sdot{ width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.mck-sdot.on{ background:#22c55e; box-shadow:0 0 0 0 rgba(34,197,94,.5); animation:mck-sdotpulse 1.8s infinite; }
.mck-sdot.idle{ background:#f59e0b; } .mck-sdot.off{ background:#94a3b8; }
@keyframes mck-sdotpulse{ 0%{ box-shadow:0 0 0 0 rgba(34,197,94,.5);} 70%{ box-shadow:0 0 0 7px rgba(34,197,94,0);} 100%{ box-shadow:0 0 0 0 rgba(34,197,94,0);} }

/* @property counters (gps-tracking) */
@property --gtDay{ syntax:'<integer>'; inherits:false; initial-value:0; }
@property --gtWeek{ syntax:'<integer>'; inherits:false; initial-value:0; }
@property --gtDur{ syntax:'<integer>'; inherits:false; initial-value:0; }
.mck-cDay{ counter-reset:d var(--gtDay); animation:mck-nDay 3.2s ease-out both; }
.mck-cDay::after{ content:counter(d); }
@keyframes mck-nDay{ from{--gtDay:0} to{--gtDay:42} }
.mck-cWeek{ counter-reset:w var(--gtWeek); animation:mck-nWeek 3.4s ease-out both; }
.mck-cWeek::after{ content:counter(w); }
@keyframes mck-nWeek{ from{--gtWeek:0} to{--gtWeek:249} }
.mck-cDur{ counter-reset:u var(--gtDur); animation:mck-nDur 4s ease-out both; }
.mck-cDur::after{ content:counter(u); }
@keyframes mck-nDur{ from{--gtDur:0} to{--gtDur:24} }

@media (max-width:991px){ .mck-builder{ grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce){
  .mck-route,.mck-line{ stroke-dashoffset:0; } .mck-prog i,.mck-gauge-bar i{ width:80%; } .mck-bcol .b{ transform:scaleY(1); }
  .mck-batt i{ width:80%; } .mck *{ animation:none !important; }
  .mck-verified,.mck-slip-l,.mck-cal-d.p,.mck-gauge-alert{ opacity:1; }
}
