/* Shared responsive layer for desktop, Android and iOS */
html, body { width: 100%; max-width: 100% !important; overflow-x: hidden !important; overflow-x: clip !important; }
#sm-staging-badge { max-width: calc(100vw - 150px); overflow: hidden; text-overflow: ellipsis; z-index: 2147482000 !important; }
.sm-modal-overlay { box-sizing: border-box; overscroll-behavior: contain; }
.sm-modal-box { box-sizing: border-box; max-height: calc(100dvh - 32px); overflow: auto; }
.sm-hr-tabs { scrollbar-width: thin; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.sm-hr-tabs > button { flex: 0 0 auto; scroll-snap-align: center; min-height: 44px; }
.sm-hr-tabs > button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
.sm-employee-row { min-width: 0; }
.sm-file-input { min-height: 44px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.sm-hr-pager button:disabled { opacity: .45; cursor: not-allowed; }
.sm-tb-btn { min-height: 40px !important; padding: 6px 10px !important; border-radius: 10px !important; }
.sm-theme-picker { position: relative; flex: 0 0 auto; }
.sm-theme-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.sm-theme-swatch, .sm-theme-choice > span { width: 13px; height: 13px; border-radius: 50%; background: #2f6fed; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.sm-theme-menu { position: absolute; z-index: 2147482100; top: calc(100% + 8px); inset-inline-start: 0; min-width: 132px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 14px 35px rgba(0,0,0,.2); }
.sm-theme-menu[hidden] { display: none !important; }
.sm-theme-choice { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: start; cursor: pointer; }
.sm-theme-choice:hover, .sm-theme-choice:focus-visible { background: var(--surface-2); }
.sm-theme-choice.sm-theme-noble > span { background: #1c2531; }
.sm-theme-choice.sm-theme-sand > span { background: #a99a6b; }
@media (max-width: 879px) {
  #sm-staging-badge { top: 58px !important; font-size: 10px !important; padding: 3px 9px !important; }
  nav, [role="navigation"] { width: 100%; max-width: 100vw; box-sizing: border-box; overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch; touch-action: pan-x !important; overscroll-behavior-inline: contain; scrollbar-width: none !important; scroll-snap-type: x proximity; padding-inline: 8px 28px !important; }
  nav::-webkit-scrollbar, [role="navigation"]::-webkit-scrollbar, .sm-hr-tabs::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
  nav > button { flex: 0 0 auto; min-width: 58px; min-height: 44px; padding-inline: 8px !important; font-size: 10.5px !important; scroll-snap-align: center; }
  nav.sm-appnav > button { padding: 7px 10px !important; font-size: 10px !important; }
  .sm-tb-btn { min-height: 44px !important; padding: 6px 9px !important; }
  main, [role="main"] { padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important; }
  .sm-modal-overlay { padding: max(10px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom)) !important; }
  .sm-modal-box { width: 100% !important; max-width: 100% !important; padding: 16px !important; border-radius: 14px !important; }
  .sm-hr-grid { grid-template-columns: minmax(0,1fr) !important; }
  .sm-hr-toolbar, .sm-hr-filters { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .sm-hr-toolbar > *, .sm-hr-filters > * { width: 100% !important; max-width: none !important; min-width: 0 !important; }
  .sm-hr-toolbar > input { grid-column: 1 / -1; }
  .sm-employee-row { align-items: flex-start !important; flex-wrap: wrap; }
  .sm-employee-row > :nth-child(2) { flex-basis: calc(100% - 64px) !important; }
  .sm-employee-row > :last-child { margin-inline-start: 56px; text-align: start !important; }
  .sm-hr-card { padding: 13px !important; border-radius: 12px !important; }
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  button, [role="button"], a { touch-action: manipulation; }
  button { min-height: 44px; min-width: 44px; }
  button:empty { min-width: 44px; }
  input, select, textarea { font-size: 16px !important; }
}

.sm-notif-trigger{position:relative;width:44px;height:44px;min-width:44px;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.sm-notif-badge{position:absolute;top:-5px;inset-inline-end:-5px;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#d94b4b;color:#fff;font:700 10px system-ui;line-height:19px;text-align:center;border:2px solid var(--surface)}
.sm-notif-panel{position:fixed;z-index:2147482500;top:68px;inset-inline-end:18px;width:min(390px,calc(100vw - 24px));max-height:min(680px,calc(100dvh - 88px));display:flex;flex-direction:column;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:20px;box-shadow:0 28px 70px rgba(0,0,0,.35);overflow:hidden}
.sm-notif-panel[hidden]{display:none!important}
.sm-notif-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 17px;border-bottom:1px solid var(--border)}
.sm-notif-head>div{display:flex;flex-direction:column;gap:2px}.sm-notif-head strong{font-size:16px}.sm-notif-head span{font-size:11.5px;color:var(--text-muted)}
.sm-notif-close{width:36px;height:36px;border:1px solid var(--border);border-radius:11px;background:var(--surface-2);color:var(--text);font-size:22px;cursor:pointer}
.sm-notif-list{overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:8px;flex:1 1 auto;min-height:0}
.sm-notif-item{width:100%;display:flex;gap:10px;text-align:start;padding:12px;border:0;border-bottom:1px solid var(--border);background:transparent;color:var(--text);cursor:pointer;border-radius:11px}
.sm-notif-item.is-unread{background:color-mix(in srgb,var(--accent) 10%,transparent)}.sm-notif-dot{width:8px;height:8px;border-radius:50%;background:transparent;margin-top:6px;flex:0 0 auto}.sm-notif-item.is-unread .sm-notif-dot{background:var(--accent)}
.sm-notif-copy{display:flex;flex-direction:column;gap:4px;min-width:0}.sm-notif-copy strong{font-size:13px}.sm-notif-copy>span{font-size:12px;line-height:1.55;color:var(--text-muted)}.sm-notif-copy small{font-size:10px;color:var(--text-muted)}
.sm-notif-empty{padding:42px 16px;text-align:center;color:var(--text-muted)}.sm-notif-readall{margin:9px 12px 12px;padding:11px;border:1px solid var(--border);border-radius:11px;background:var(--surface-2);color:var(--text);font-weight:700;cursor:pointer}
@media(max-width:600px){
 html.sm-notifs-open,html.sm-notifs-open body{overflow:hidden!important;overscroll-behavior:none!important}
 .sm-notif-panel{top:max(10px,env(safe-area-inset-top));right:8px!important;bottom:max(10px,env(safe-area-inset-bottom));left:8px!important;inset-inline:8px!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;border-radius:20px;box-sizing:border-box;isolation:isolate}
 .sm-notif-head{position:relative;z-index:2;flex:0 0 auto;padding:14px;background:var(--surface);border-radius:20px 20px 0 0}
 .sm-notif-head>div{min-width:0}.sm-notif-head strong,.sm-notif-head span{overflow-wrap:anywhere}
 .sm-notif-list{flex:1 1 auto;min-height:0;padding:6px 10px 12px;overflow-y:auto!important;overflow-x:hidden!important}
 .sm-notif-item{padding:13px 10px;min-height:72px;flex:0 0 auto}.sm-notif-copy{overflow:hidden}.sm-notif-copy>span{overflow-wrap:anywhere}
 .sm-notif-close{position:static!important;flex:0 0 44px;width:44px;height:44px;margin:0!important;transform:none!important}
 .sm-notif-readall{position:relative;z-index:2;flex:0 0 auto;margin:8px 12px 12px;min-height:48px;background:var(--surface-2)}
}
@media (max-width: 480px) {
  .sm-hr-toolbar, .sm-hr-filters { grid-template-columns: 1fr; }
  .sm-hr-toolbar > input { grid-column: auto; }
  .sm-hr-pager button { min-width: 96px !important; }
}
@supports (padding: max(0px)) {
  nav { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}


/* Portal UI quality layer v1 */
:root {
  --sm-control-height: 44px;
  --sm-control-radius: 11px;
  --sm-panel-radius: 16px;
  --sm-focus-ring: color-mix(in srgb, var(--accent) 72%, white);
}

*, *::before, *::after { box-sizing: border-box; }

:where(button, a, input, select, textarea, [role="button"], [role="tab"]):focus-visible {
  outline: 3px solid var(--sm-focus-ring) !important;
  outline-offset: 2px !important;
}

:where(button, input, select, textarea) { font: inherit; }
:where(input, select, textarea) { min-height: var(--sm-control-height); }
:where(button, [role="button"]) { -webkit-tap-highlight-color: transparent; }

#sm-login-card,
#sm-login-card .sm-stagger,
#sm-login-card .sm-stagger > *,
#sm-login-card .sm-stagger * {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
}

#sm-login-card input {
  min-height: 48px;
  border-radius: var(--sm-control-radius) !important;
}

#sm-login-card button {
  min-height: 46px;
}

.sm-theme-menu {
  max-height: min(360px, calc(100dvh - 96px));
  overflow: auto;
  overscroll-behavior: contain;
}

.sm-theme-choice[aria-current="true"],
.sm-theme-choice[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}

.sm-hr-tabs,
[role="tablist"] {
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.sm-hr-tabs > button,
[role="tablist"] > [role="tab"] {
  min-height: var(--sm-control-height);
  white-space: nowrap;
}

.sm-hr-card {
  border-radius: var(--sm-panel-radius) !important;
  box-shadow: none !important;
}

.sm-hr-toolbar :where(input, select, button),
.sm-hr-filters :where(input, select, button) {
  min-height: var(--sm-control-height);
}

.sm-modal-overlay {
  align-items: center;
  justify-content: center;
}

.sm-modal-box {
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.sm-notif-panel {
  overscroll-behavior: contain;
}

.sm-notif-item {
  min-height: 64px;
  align-items: flex-start;
}

@media (max-width: 600px) {
  #sm-login-card {
    max-width: calc(100vw - 24px) !important;
    margin-inline: auto !important;
  }

  .sm-theme-menu {
    inset-inline-start: auto;
    inset-inline-end: 0;
    max-width: calc(100vw - 16px);
  }

  .sm-hr-tabs,
  [role="tablist"] {
    padding: 4px 2px 8px;
    scroll-padding-inline: 12px;
  }

  .sm-modal-overlay {
    align-items: flex-end;
  }

  .sm-modal-box {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top))) !important;
    border-end-start-radius: 0 !important;
    border-end-end-radius: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
