/* N-CORE employee mobile top screen — 2026-10-21 FINAL approved reference.
   Desktop admin UI and all app business/identity logic stay untouched.
   Content remains real HTML, not a flattened design screenshot. */

/* Correct a precedence problem in older mobile styles: a visually hidden
   module card must never be re-displayed by .coreGrid .coreCard display:grid!important.
   Authorization is also enforced by JavaScript/server; this is UI defense-in-depth. */
#coreModules > .coreCard.hidden { display:none!important; }
/* Management-only phone shortcut is separate from the immutable three employee cards. */
#personMasterMobileShortcut{display:none!important;}
#coreModules.hidden { display:none!important; }

@media screen and (max-width:620px){
  body{background:#f6f9ff;}
  main{width:100%;max-width:100%;padding:10px!important;}
  #status.notice{
    margin:8px 0 11px!important;padding:10px 12px!important;
    border-radius:13px!important;border-color:#c8ddf7!important;
    background:#ecf5ff!important;color:#162a41;
    line-height:1.35!important;font-size:15px!important;
  }
  #status.notice.err{background:#ffebee!important;border-color:#ef9a9a!important}
  #status.notice.warn{background:#fff3e0!important;border-color:#ffcc80!important}
  #welcomePanel{
    box-sizing:border-box!important;
    display:grid!important;grid-template-columns:54px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;align-items:center!important;
    column-gap:14px!important;row-gap:3px!important;
    min-height:116px!important;padding:15px 13px!important;
    margin:10px 0 12px!important;background:#fff!important;
    border:1px solid #d7e4f5!important;border-radius:17px!important;
    box-shadow:0 2px 8px #12486c0a!important;
  }
  #welcomePanel .welcomeAvatar{
    position:relative!important;display:block!important;
    grid-row:1/3!important;grid-column:1!important;
    width:43px!important;height:43px!important;align-self:center!important;
    flex:none!important;border-radius:50%!important;background:#14a14a!important;
    font-size:0!important;color:transparent!important;margin-bottom:15px!important;
  }
  #welcomePanel .welcomeAvatar:after{
    content:""!important;position:absolute!important;
    top:36px!important;left:-1px!important;width:45px!important;height:27px!important;
    background:#14a14a!important;border-radius:25px 25px 6px 6px!important;
  }
  #welcomePanel .welcomeCopy{
    display:flex!important;min-width:0!important;flex-direction:column!important;
    gap:4px!important;grid-column:2!important;grid-row:1/3!important;
  }
  #welcomePanel .welcomeCopy strong{
    font-size:clamp(17px,4.7vw,20px)!important;font-weight:800!important;
    color:#15253d!important;line-height:1.35!important;overflow-wrap:anywhere!important;
  }
  #welcomePanel .welcomeCopy span{
    color:#475b79!important;font-size:clamp(12px,3.35vw,14px)!important;
    line-height:1.5!important;overflow-wrap:anywhere!important;
  }
  /* Preserve the dynamic JST date, but avoid pushing the username off-screen.
     Date below the greeting is intentionally clearer than overlapping it on tiny phones. */
  #welcomePanel #welcomeDate{
    grid-column:2!important;grid-row:3!important;
    justify-self:start!important;margin:3px 0 0!important;
    white-space:normal!important;text-align:left!important;
    font-size:11px!important;line-height:1.3!important;color:#6b7790!important;
  }
  #coreModules{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;gap:11px!important;margin:5px 0 0!important;
  }
  #coreModules.hidden{display:none!important;}
  #coreModules > .coreCard.hidden{display:none!important;}
  #coreModules > .coreCard{
    position:relative!important;box-sizing:border-box!important;
    display:grid!important;grid-template-columns:75px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    min-height:116px!important;padding:15px 34px 15px 14px!important;
    margin:0!important;column-gap:14px!important;row-gap:4px!important;
    align-content:center!important;align-items:center!important;
    border-radius:17px!important;border-width:2px!important;
    box-shadow:0 2px 9px #15446d0c!important;cursor:pointer!important;
    -webkit-tap-highlight-color:transparent;
  }
  #coreModules > .attendanceCore{background:#eef6ff!important;border-color:#83bdf8!important;}
  #coreModules > .cultivationCore{background:#f0fbef!important;border-color:#8ad98d!important;}
  #coreModules > .harvestCore{background:#fff7ec!important;border-color:#ffc278!important;}
  #coreModules > .coreCard .moduleIcon{
    display:flex!important;grid-column:1!important;grid-row:1/3!important;
    width:75px!important;height:78px!important;margin:0!important;padding:0!important;
    align-self:center!important;justify-content:center!important;align-items:center!important;
  }
  #coreModules > .coreCard .moduleIcon svg{
    width:69px!important;height:69px!important;max-width:100%!important;
  }
  #coreModules > .coreCard h3{
    display:block!important;grid-column:2!important;grid-row:1!important;
    align-self:end!important;min-width:0!important;margin:0!important;
    color:#18263e!important;font-size:clamp(19px,5.55vw,23px)!important;
    line-height:1.25!important;font-weight:800!important;
  }
  #coreModules > .coreCard .mini{
    display:block!important;grid-column:2!important;grid-row:2!important;
    min-width:0!important;margin:0!important;
    color:#52647f!important;font-size:clamp(11px,3.15vw,13px)!important;
    line-height:1.45!important;overflow-wrap:anywhere!important;
  }
  /* Keep approved card colors and geometry; break the long cultivation caption at its two logical parts. */
  #coreModules > .cultivationCore .mini span{display:block!important;white-space:normal!important;overflow-wrap:anywhere!important;}
  #personMasterMobileShortcut:not(.hidden){display:inline-flex!important;align-items:center;justify-content:center;min-height:44px;max-width:100%;padding:9px 12px;margin:8px 0;border:1px solid #b9d7c6;border-radius:9px;background:#f0f7f1;color:#22543b;font-weight:800;text-decoration:none;}
  #coreModules > .coreCard > button{display:none!important;}
  #coreModules > .coreCard > .notice:not(.hidden){
    display:block!important;grid-column:1/-1!important;grid-row:auto!important;
    margin:6px 0 0!important;padding:8px!important;
    font-size:12px!important;
  }
  #coreModules > .coreCard:after{
    content:"›"!important;position:absolute!important;
    right:12px!important;top:50%!important;transform:translateY(-50%)!important;
    font-size:34px!important;line-height:1!important;
  }
  #coreModules > .attendanceCore:after{color:#2876b5!important}
  #coreModules > .cultivationCore:after{color:#297a41!important}
  #coreModules > .harvestCore:after{color:#d76829!important}
  #coreModules > .coreCard:focus-visible{
    outline:3px solid #225acb!important;outline-offset:3px!important;
  }
}
@media screen and (max-width:350px){
  #coreModules > .coreCard{
    grid-template-columns:60px minmax(0,1fr)!important;column-gap:9px!important;
    padding:12px 28px 12px 10px!important;min-height:109px!important;
  }
  #coreModules > .coreCard .moduleIcon{width:60px!important;height:64px!important}
  #coreModules > .coreCard .moduleIcon svg{width:58px!important;height:58px!important}
  #coreModules > .coreCard h3{font-size:18px!important}
  #coreModules > .coreCard .mini{font-size:11px!important}
  #welcomePanel{grid-template-columns:46px minmax(0,1fr)!important;column-gap:11px!important}
}
@media print{
  #coreModules > .coreCard.hidden{display:none!important}
}
