/* =====================================================================
   ZYNTRA – shared design system (plain CSS on top of Bootstrap 5.3)
   Change the brand colours here and both designs update.
   ===================================================================== */

@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('../fonts/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('../fonts/Poppins-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('../fonts/Poppins-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('../fonts/Poppins-Bold.ttf') format('truetype'); }

:root {
    --z-green-950: #062a18;
    --z-green-900: #0a3d24;
    --z-green-800: #0d5131;
    --z-green-700: #11663d;
    --z-green-600: #15803d;
    --z-green-500: #1fa34f;
    --z-green-400: #3cc26a;
    --z-green-100: #dcf5e4;
    --z-green-50:  #eefaf2;
    --z-amber: #f59e0b;  --z-amber-50: #fff7e6;
    --z-red:   #e5484d;  --z-red-50:   #fdeeee;
    --z-blue:  #3b82f6;  --z-blue-50:  #ebf2ff;
    --z-grey:  #6b7a72;  --z-grey-50:  #f1f4f2;

    --z-bg: #f3f6f4;
    --z-surface: #ffffff;
    --z-text: #11231a;
    --z-muted: #6b7a72;
    --z-border: #e3e9e5;
    --z-radius: 16px;
    --z-radius-sm: 10px;
    --z-shadow: 0 1px 2px rgba(10, 61, 36, .04), 0 6px 20px rgba(10, 61, 36, .06);
    --z-gradient: linear-gradient(140deg, var(--z-green-950) 0%, var(--z-green-800) 55%, var(--z-green-600) 100%);

    /* Bootstrap overrides */
    --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--z-text);
    --bs-body-bg: var(--z-bg);
    --bs-primary: #15803d;
    --bs-primary-rgb: 21, 128, 61;
    --bs-link-color: var(--z-green-600);
    --bs-link-color-rgb: 21, 128, 61;
    --bs-link-hover-color-rgb: 13, 81, 49;
    --bs-link-hover-color: var(--z-green-800);
    --bs-border-color: var(--z-border);
    --bs-border-radius: 10px;
    --bs-secondary-color: var(--z-muted);
}

body { font-size: 14px; -webkit-font-smoothing: antialiased; }
.text-muted, .text-secondary { color: var(--z-muted) !important; }
.fw-600 { font-weight: 600; }
.small-xs { font-size: 11px; }

/* ---- Buttons & forms ------------------------------------------------- */
.btn { font-weight: 500; border-radius: var(--z-radius-sm); }
.btn-primary { --bs-btn-bg: var(--z-green-600); --bs-btn-border-color: var(--z-green-600); --bs-btn-hover-bg: var(--z-green-700); --bs-btn-hover-border-color: var(--z-green-700); --bs-btn-active-bg: var(--z-green-800); --bs-btn-active-border-color: var(--z-green-800); --bs-btn-disabled-bg: var(--z-green-500); --bs-btn-disabled-border-color: var(--z-green-500); }
.btn-outline-primary { --bs-btn-color: var(--z-green-600); --bs-btn-border-color: var(--z-green-600); --bs-btn-hover-bg: var(--z-green-600); --bs-btn-hover-border-color: var(--z-green-600); --bs-btn-active-bg: var(--z-green-700); }
.btn-soft { background: var(--z-green-50); color: var(--z-green-700); border: 0; }
.btn-soft:hover { background: var(--z-green-100); color: var(--z-green-800); }
.form-control, .form-select { border-radius: var(--z-radius-sm); border-color: var(--z-border); padding: .6rem .85rem; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--z-green-500); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--z-green-500) 18%, transparent); }
.form-check-input:checked { background-color: var(--z-green-600); border-color: var(--z-green-600); }
.form-label { font-weight: 500; font-size: 13px; margin-bottom: .35rem; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--z-muted); }
.input-icon > .form-control { padding-left: 2.6rem; }

/* ---- Cards ------------------------------------------------------------ */
.z-card { background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius); box-shadow: var(--z-shadow); }
.z-card-body { padding: 18px; }
.z-card-title { font-size: 15px; font-weight: 600; margin: 0; }

/* ---- Avatar ----------------------------------------------------------- */
.z-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; color: var(--z-green-800); background: var(--z-green-100); flex-shrink: 0; overflow: hidden; }
.z-avatar img { width: 100%; height: 100%; object-fit: cover; }
.z-avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.z-avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.z-avatar.xl { width: 84px; height: 84px; font-size: 26px; }

/* ---- Status badges ---------------------------------------------------- */
.z-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.z-badge.green  { background: var(--z-green-50); color: var(--z-green-600); }
.z-badge.amber  { background: var(--z-amber-50); color: #b45309; }
.z-badge.red    { background: var(--z-red-50); color: #c0262d; }
.z-badge.blue   { background: var(--z-blue-50); color: #1d5fd6; }
.z-badge.grey   { background: var(--z-grey-50); color: var(--z-grey); }

/* ---- Icon tones ------------------------------------------------------- */
.tone { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; width: 42px; height: 42px; font-size: 19px; flex-shrink: 0; }
.tone.green { background: var(--z-green-50); color: var(--z-green-600); }
.tone.amber { background: var(--z-amber-50); color: var(--z-amber); }
.tone.red   { background: var(--z-red-50); color: var(--z-red); }
.tone.blue  { background: var(--z-blue-50); color: var(--z-blue); }
.tone.grey  { background: var(--z-grey-50); color: var(--z-grey); }

/* ---- Brand mark ------------------------------------------------------- */
.z-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.z-logo img { width: 34px; height: 34px; }
.z-logo span { font-weight: 700; font-size: 22px; letter-spacing: -.5px; }

/* ---- Lists ------------------------------------------------------------ */
.z-list { list-style: none; margin: 0; padding: 0; }
.z-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--z-border); }
.z-list > li:last-child { border-bottom: 0; }

/* ---- Notifications ---------------------------------------------------- */
.z-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: inherit; text-decoration: none; font-size: 20px; }
.z-bell .count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--z-red); color: #fff; font-size: 10.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.z-bell .count:empty, .z-bell .count[data-count="0"] { display: none; }
.z-notif { display: flex; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--z-border); }
.z-notif:hover { background: var(--z-green-50); color: inherit; }
.z-notif.unread { background: var(--z-green-50); }
.z-notif.unread .z-notif-title::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--z-green-500); margin-left: 6px; vertical-align: middle; }
.z-notif .tone { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
.z-notif-title { font-weight: 600; font-size: 13.5px; }
.z-notif-body { font-size: 12.5px; color: var(--z-muted); line-height: 1.45; }
.z-notif-time { font-size: 11px; color: var(--z-muted); }

.z-toast-wrap { position: fixed; z-index: 1090; left: 50%; transform: translateX(-50%); top: 14px; width: min(420px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.z-toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--z-border); border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(6, 42, 24, .18); animation: zToastIn .25s ease-out; text-decoration: none; color: var(--z-text); }
.z-toast .tone { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
@keyframes zToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.z-empty { text-align: center; padding: 36px 16px; color: var(--z-muted); }
.z-empty i { font-size: 34px; color: var(--z-green-400); display: block; margin-bottom: 6px; }

/* =====================================================================
   MOBILE – app-style design
   ===================================================================== */
.z-mobile { background: var(--z-bg); min-height: 100vh; min-height: 100dvh; }
.z-app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; background: var(--z-bg); padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.z-app.no-nav { padding-bottom: 24px; }

.m-header { padding: calc(14px + env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; gap: 10px; background: var(--z-bg); position: sticky; top: 0; z-index: 20; }
.m-header h1 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; }
.m-header .back { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--z-border); color: var(--z-text); text-decoration: none; font-size: 18px; }
.m-content { padding: 4px 18px 20px; }
.m-section-title { font-size: 14px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.m-section-title a { font-size: 12.5px; font-weight: 500; text-decoration: none; }

/* Greeting */
.m-greet { display: flex; align-items: center; gap: 12px; }
.m-greet .hello { font-size: 13px; color: var(--z-muted); }
.m-greet .name { font-size: 18px; font-weight: 600; line-height: 1.2; }
.m-greet .date { font-size: 12px; color: var(--z-muted); }

/* Status card */
.m-status { display: flex; align-items: center; gap: 12px; border-radius: var(--z-radius); padding: 14px 16px; margin-top: 16px; }
.m-status.out { background: var(--z-red-50); }
.m-status.out .tone { background: var(--z-red); color: #fff; }
.m-status.out strong { color: #c0262d; }
.m-status.working { background: var(--z-green-50); }
.m-status.working .tone { background: var(--z-green-600); color: #fff; }
.m-status.working strong { color: var(--z-green-700); }
.m-status.on_break { background: var(--z-amber-50); }
.m-status.on_break .tone { background: var(--z-amber); color: #fff; }
.m-status.on_break strong { color: #b45309; }
.m-status.completed { background: var(--z-blue-50); }
.m-status.completed .tone { background: var(--z-blue); color: #fff; }
.m-status.completed strong { color: #1d5fd6; }
.m-status .label { font-size: 12px; color: var(--z-muted); }
.m-status strong { display: block; font-size: 16px; }
.m-status .clock { margin-left: auto; text-align: right; font-size: 12px; color: var(--z-muted); }
.m-status .clock b { display: block; font-size: 18px; color: var(--z-text); font-variant-numeric: tabular-nums; }

/* Big punch buttons */
.m-punch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.m-punch a, .m-punch button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; border-radius: var(--z-radius); text-decoration: none; font-weight: 500; font-size: 14px; border: 1px solid var(--z-border); background: #fff; color: var(--z-text); box-shadow: var(--z-shadow); transition: transform .1s; }
.m-punch a i, .m-punch button i { font-size: 28px; }
.m-punch a:active, .m-punch button:active { transform: scale(.97); }
.m-punch .primary { background: var(--z-gradient); color: #fff; border: 0; }
.m-punch .disabled { opacity: .45; pointer-events: none; box-shadow: none; }
.m-punch:has(> :only-child) { grid-template-columns: 1fr; }
.m-punch form > button { min-height: 108px; }
.m-break { margin-top: 10px; }

/* Tiles */
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 10px; background: #fff; border: 1px solid var(--z-border); border-radius: var(--z-radius); box-shadow: var(--z-shadow); text-decoration: none; color: var(--z-text); font-size: 13px; font-weight: 500; position: relative; text-align: center; }
.m-tile i { font-size: 24px; color: var(--z-green-700); }
.m-tile .dot { position: absolute; top: 10px; right: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--z-amber); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* Mini stats (manager view on mobile) */
.m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-stats > div { background: #fff; border: 1px solid var(--z-border); border-radius: 14px; padding: 10px 6px; text-align: center; }
.m-stats b { display: block; font-size: 18px; }
.m-stats span { font-size: 11px; color: var(--z-muted); }

/* Bottom navigation */
.m-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; background: #fff; border-top: 1px solid var(--z-border); display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: 0 -4px 20px rgba(10, 61, 36, .05); }
.m-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: var(--z-muted); font-size: 11px; font-weight: 500; position: relative; }
.m-nav a i { font-size: 21px; }
.m-nav a.active { color: var(--z-green-600); }
.m-nav a.active i::before { font-weight: bold !important; }
.m-nav .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--z-red); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.m-nav .count[data-count="0"] { display: none; }

/* Login */
.z-app.no-nav:has(.m-login) { padding-bottom: 0; background: #fff; }
.m-login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.m-login-top { text-align: center; padding: calc(56px + env(safe-area-inset-top)) 24px 0; position: relative; }
.m-login-top img { width: 64px; height: 64px; }
.m-login-top h1 { font-size: 30px; font-weight: 700; margin: 8px 0 0; color: var(--z-green-900); letter-spacing: -.5px; }
.m-login-top p { font-size: 12.5px; color: var(--z-muted); margin: 0; }
.m-wave { height: 90px; margin-top: 18px; display: block; width: 100%; }
.m-wave-old { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 90' preserveAspectRatio='none'%3E%3Cpath d='M0 55 C80 10 150 90 230 50 S350 15 400 40 L400 90 L0 90Z' fill='%23dcf5e4'/%3E%3Cpath d='M0 70 C90 30 170 95 250 62 S360 35 400 58 L400 90 L0 90Z' fill='%233cc26a' opacity='.55'/%3E%3Cpath d='M0 82 C100 55 180 98 260 76 S360 60 400 74 L400 90 L0 90Z' fill='%2315803d' opacity='.35'/%3E%3C/svg%3E") center/100% 100% no-repeat; }
.m-login-form { padding: 6px 24px 30px; flex: 1; }
.m-login-form h2 { text-align: center; font-size: 19px; font-weight: 600; margin: 0; }
.m-login-form > p { text-align: center; font-size: 12.5px; color: var(--z-muted); }
.m-login-form .form-control { padding-top: .75rem; padding-bottom: .75rem; }
.m-login-form .btn-primary { padding: .75rem; }

/* Punch / face verification */
.m-verify { text-align: center; }
.m-camera { position: relative; width: 250px; height: 250px; margin: 18px auto 10px; border-radius: 50%; overflow: hidden; background: var(--z-green-50); border: 5px solid #fff; box-shadow: 0 0 0 3px var(--z-green-400), var(--z-shadow); }
.m-camera video, .m-camera img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.m-camera img { transform: none; }
.m-camera .frame { position: absolute; inset: 40px; pointer-events: none; }
.m-camera .frame::before, .m-camera .frame::after { content: ''; position: absolute; width: 34px; height: 34px; border: 3px solid var(--z-green-400); }
.m-camera .frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.m-camera .frame::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.m-camera .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--z-green-700); font-size: 13px; gap: 6px; padding: 30px; }
.m-camera .placeholder i { font-size: 54px; }
.m-checks { text-align: left; margin-top: 18px; }
.m-check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--z-border); border-radius: 14px; margin-bottom: 10px; }
.m-check .tone { width: 38px; height: 38px; font-size: 17px; }
.m-check .t { font-size: 13.5px; font-weight: 600; }
.m-check .s { font-size: 12px; color: var(--z-muted); }
.m-check .state { margin-left: auto; font-size: 20px; }
.m-check .state .bi-check-circle-fill { color: var(--z-green-500); }
.m-check .state .bi-exclamation-circle-fill { color: var(--z-amber); }
.m-check .state .bi-x-circle-fill { color: var(--z-red); }

/* Success */
.m-success { text-align: center; padding-top: 34px; }
.m-success .tick { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto; background: var(--z-green-500); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 52px; box-shadow: 0 0 0 12px var(--z-green-100); animation: zPop .35s ease-out; }
.m-success .tick.warn { background: var(--z-amber); box-shadow: 0 0 0 12px var(--z-amber-50); }
@keyframes zPop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.m-success h2 { font-size: 20px; font-weight: 600; margin: 28px 0 6px; }
.m-success .time { font-size: 32px; font-weight: 700; letter-spacing: -.5px; }
.m-success .loc { display: inline-flex; gap: 6px; align-items: center; background: var(--z-green-50); color: var(--z-green-700); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 500; margin-top: 10px; }

/* Calendar strip / history */
.m-day { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--z-border); border-radius: 14px; margin-bottom: 8px; }
.m-day .d { width: 46px; text-align: center; border-radius: 10px; background: var(--z-green-50); padding: 5px 0; }
.m-day .d b { display: block; font-size: 17px; line-height: 1.1; }
.m-day .d span { font-size: 10.5px; color: var(--z-muted); text-transform: uppercase; }
.m-day .times { font-size: 12.5px; color: var(--z-muted); }
.m-day .times b { color: var(--z-text); font-weight: 600; }

.m-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-summary div { background: #fff; border: 1px solid var(--z-border); border-radius: 12px; padding: 10px 4px; text-align: center; }
.m-summary b { display: block; font-size: 17px; }
.m-summary span { font-size: 10.5px; color: var(--z-muted); }

.m-balance { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.m-balance::-webkit-scrollbar { display: none; }
.m-balance > div { min-width: 120px; flex: 1; background: #fff; border: 1px solid var(--z-border); border-radius: 14px; padding: 12px; }
.m-balance b { font-size: 22px; }
.m-balance .bar { height: 5px; background: var(--z-grey-50); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.m-balance .bar span { display: block; height: 100%; border-radius: 3px; }

.m-fab { position: fixed; right: max(18px, calc(50% - 242px)); bottom: calc(92px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 18px; background: var(--z-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 10px 24px rgba(10, 61, 36, .3); z-index: 25; text-decoration: none; }
.m-fab:hover { color: #fff; }

.m-install { display: none; align-items: center; gap: 12px; background: var(--z-gradient); color: #fff; border-radius: var(--z-radius); padding: 12px 14px; margin-top: 16px; }
.m-install.show { display: flex; }
.m-install .btn { background: #fff; color: var(--z-green-800); border: 0; font-size: 12.5px; }

/* Desktop visitor seeing a mobile screen: show it inside a phone frame */
.z-framed { background: var(--z-gradient); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.z-framed .z-app { width: 400px; max-width: 100%; min-height: 0; height: min(820px, calc(100vh - 60px)); border-radius: 36px; overflow-y: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 10px #0d1f16; padding-bottom: 0; }
.z-framed .m-nav { position: sticky; transform: none; left: auto; margin-top: 20px; border-radius: 0; }
.z-framed .m-fab { position: sticky; float: right; margin: -76px 16px 20px 0; }
.z-framed-note { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-size: 12px; text-align: center; }
.z-framed-note a { color: #fff; }

/* =====================================================================
   DESKTOP – dashboard design
   ===================================================================== */
.z-desktop { background: var(--z-bg); }
.d-sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: linear-gradient(180deg, var(--z-green-950), var(--z-green-900) 60%, var(--z-green-800)); color: #cfe7d8; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s; }
.d-sidebar .z-logo { padding: 22px 22px 18px; color: #fff; }
.d-company { margin: 0 14px 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.d-company .tone { width: 34px; height: 34px; font-size: 15px; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 10px; }
.d-company b { color: #fff; display: block; font-weight: 600; }
.d-nav { flex: 1; overflow-y: auto; padding: 0 12px; }
.d-nav .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(207, 231, 216, .55); padding: 14px 12px 6px; }
.d-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfe7d8; text-decoration: none; font-size: 13.5px; margin-bottom: 2px; }
.d-nav a i { font-size: 17px; width: 20px; text-align: center; }
.d-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.d-nav a.active { background: var(--z-green-500); color: #fff; font-weight: 500; box-shadow: 0 6px 16px color-mix(in srgb, var(--z-green-500) 35%, transparent); }
.d-nav a .pill { margin-left: auto; background: var(--z-amber); color: #fff; font-size: 11px; font-weight: 600; border-radius: 9px; padding: 1px 7px; }
.d-sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; }
.d-sidebar-foot a { color: #cfe7d8; text-decoration: none; }

.d-main { margin-left: 248px; min-height: 100vh; }
.d-topbar { position: sticky; top: 0; z-index: 1030; background: rgba(243, 246, 244, .9); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-bottom: 1px solid var(--z-border); }
.d-topbar h1 { font-size: 20px; font-weight: 600; margin: 0; }
.d-topbar .sub { font-size: 12.5px; color: var(--z-muted); }
.d-topbar .tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.d-topbar .z-bell { background: #fff; border: 1px solid var(--z-border); }
.d-user { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; background: #fff; border: 1px solid var(--z-border); text-decoration: none; color: inherit; }
.d-user b { font-size: 13px; font-weight: 600; display: block; line-height: 1.2; }
.d-user span { font-size: 11px; color: var(--z-muted); }
.d-content { padding: 24px 28px 40px; }
.d-menu-btn { display: none; }

.d-notif-menu { width: 380px; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--z-border); box-shadow: 0 16px 40px rgba(6, 42, 24, .15); }
.d-notif-menu .head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--z-border); }
.d-notif-menu .list { max-height: 380px; overflow-y: auto; }
.d-notif-menu .foot { display: block; text-align: center; padding: 10px; font-size: 13px; font-weight: 500; text-decoration: none; border-top: 1px solid var(--z-border); }

/* Stat cards */
.d-stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.d-stat .tone { width: 50px; height: 50px; font-size: 22px; border-radius: 14px; }
.d-stat b { font-size: 26px; font-weight: 700; display: block; line-height: 1.1; }
.d-stat span { font-size: 12.5px; color: var(--z-muted); }

/* Donut */
.d-donut { position: relative; width: 170px; height: 170px; flex-shrink: 0; }
.d-donut svg { transform: rotate(-90deg); }
.d-donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.d-donut .center b { font-size: 28px; font-weight: 700; }
.d-donut .center span { font-size: 12px; color: var(--z-muted); }
.d-legend { list-style: none; padding: 0; margin: 0; flex: 1; }
.d-legend li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.d-legend li i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.d-legend li b { margin-left: auto; }

/* Line chart */
.d-chart { width: 100%; height: auto; display: block; }
.d-chart .grid line { stroke: var(--z-border); }
.d-chart .axis text { font-size: 11px; fill: var(--z-muted); }

.d-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.d-quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border: 1px solid var(--z-border); border-radius: 14px; text-decoration: none; color: var(--z-text); font-size: 12.5px; font-weight: 500; text-align: center; transition: .15s; }
.d-quick a i { font-size: 24px; color: var(--z-green-600); }
.d-quick a:hover { border-color: var(--z-green-400); background: var(--z-green-50); }

/* Tables */
.z-table { margin: 0; }
.z-table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--z-muted); font-weight: 600; background: #f8faf9; border-bottom: 1px solid var(--z-border); padding: 11px 14px; white-space: nowrap; }
.z-table td { padding: 12px 14px; vertical-align: middle; border-color: var(--z-border); font-size: 13.5px; }
.z-table tbody tr:hover td { background: #fafcfb; }
.z-person { display: flex; align-items: center; gap: 10px; }
.z-person b { font-weight: 600; display: block; font-size: 13.5px; }
.z-person span { font-size: 12px; color: var(--z-muted); }

.z-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.z-filters .form-control, .z-filters .form-select { width: auto; min-width: 160px; }

.z-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--z-border); margin-bottom: 18px; overflow-x: auto; }
.z-tabs a { padding: 10px 14px; text-decoration: none; color: var(--z-muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.z-tabs a.active { color: var(--z-green-700); border-color: var(--z-green-600); }
.z-tabs a .pill { background: var(--z-amber); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 7px; margin-left: 4px; }

/* Desktop login */
.d-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.d-login-hero { background: var(--z-gradient); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.d-login-hero::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(60, 194, 106, .35), transparent 70%); }
.d-login-hero h2 { font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -1px; max-width: 460px; }
.d-login-hero p { color: rgba(255, 255, 255, .78); max-width: 420px; }
.d-login-features { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.d-login-features div { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.d-login-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.d-login-form form { width: 100%; max-width: 380px; }

@media (max-width: 991.98px) {
    .d-sidebar { transform: translateX(-100%); }
    .d-sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
    .d-main { margin-left: 0; }
    .d-menu-btn { display: inline-flex; }
    .d-topbar { padding: 12px 16px; }
    .d-content { padding: 18px 16px 32px; }
    .d-login { grid-template-columns: 1fr; }
    .d-login-hero { display: none; }
    .d-quick { grid-template-columns: repeat(2, 1fr); }
    .d-user .who { display: none; }
    .d-notif-menu { width: min(380px, calc(100vw - 24px)); }
}

/* Mobile screen shown inside the desktop dashboard (managers/admin opening "My Check-in" etc.) */
.z-embed { max-width: 560px; margin: 0 auto; background: var(--z-bg); }
.z-embed .m-header { position: static; padding-top: 0; background: transparent; }
.z-embed .m-header .z-bell { display: none; }
.z-embed .m-content { padding-left: 0; padding-right: 0; }
.z-embed .m-fab { position: fixed; right: 32px; bottom: 32px; }

/* Check-in first screen */
.m-checkin-top { background: var(--z-gradient); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 18px 64px; border-radius: 0 0 32px 32px; }
.m-checkin-top .z-avatar { border: 2px solid rgba(255,255,255,.4); }
.m-checkin-top .z-bell .count { border-color: transparent; }
.m-checkin-clock { font-size: 46px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.m-checkin-shift { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 12.5px; }
.m-checkin-btn { display: flex; align-items: center; justify-content: center; width: 176px; height: 176px; margin: -48px auto 14px; border-radius: 50%; background: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.18); text-decoration: none; position: relative; }
.m-checkin-btn::before { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--z-green-400); opacity: .5; animation: zPulse 2s ease-out infinite; }
.m-checkin-btn span { width: 148px; height: 148px; border-radius: 50%; background: var(--z-gradient); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 17px; }
.m-checkin-btn span i { font-size: 50px; line-height: 1; }
.m-checkin-btn:active span { transform: scale(.96); }
@keyframes zPulse { 0% { transform: scale(.92); opacity: .7; } 100% { transform: scale(1.12); opacity: 0; } }
.mt-n4 { margin-top: -40px; margin-bottom: 64px; }

/* Staff dashboard */
.m-timer { background: var(--z-gradient); color: #fff; border-radius: var(--z-radius); padding: 18px; margin-top: 14px; position: relative; overflow: hidden; }
.m-timer::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.07); }
.m-timer .big { font-size: 38px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.m-timer .meta { font-size: 12.5px; opacity: .85; }
.m-timer .pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.m-timer .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.m-timer .actions .btn { background: rgba(255,255,255,.16); color: #fff; border: 0; padding: 11px; }
.m-timer .actions .btn.light { background: #fff; color: var(--z-green-800); }
.m-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.m-kpis > div { background: #fff; border: 1px solid var(--z-border); border-radius: 14px; padding: 10px; }
.m-kpis b { display: block; font-size: 16px; }
.m-kpis span { font-size: 11px; color: var(--z-muted); }

/* v3: day chips, QR scanner */
.z-chip-check { display: inline-flex; align-items: center; border: 1px solid #d9e2dc; border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; background: #fff; }
.z-qr-box { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; max-width: 340px; margin: 0 auto; }
.z-qr-box video { width: 100%; height: 100%; object-fit: cover; }
.z-qr-box::after { content: ""; position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.z-qr-ok { display: inline-flex; gap: 6px; align-items: center; background: var(--z-green-50, #e8f6ef); color: var(--z-green-700, #0f7b4f); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
