/*
 * ASI-OS interface regression boundary
 *
 * This small final layer deliberately fixes shared shell defects without
 * changing application data or business behaviour. Keep it loaded after the
 * historic stylesheets so old, duplicated rules cannot reintroduce them.
 */

body.os-embedded {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

body.os-embedded :where(.portal-workspace, main.page, .panel, .form, .form-row, .grid, .metric-grid) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

/* An app opened inside ASI-OS uses the shell menu. Its own portal burger must
   never be rendered as a second menu button. */
body.os-embedded :where(.topbar, .portal-sidebar, .mobile-nav, [data-mobile-nav], .salary-top-tools) {
  display: none !important;
}

body.os-embedded :where(input, select, textarea, button, .button) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

/* Jarvis bleibt als App verfügbar, belegt aber nicht dauerhaft den Desktop. */
#asiJarvisDock:not(.is-expanded) {
  display: none !important;
}

body.os-embedded :where(.panel, .metric-card, .compact-record, .form, .form-row, .section-head) :where(h1, h2, h3, h4, p, strong, small, span, label, a, button, .button) {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

:where(.employee-desktop, .kernwerk-shell, .asi-classic-shell) :where(.window, .window-bar, .window-title, .window-controls, .os-app-content, .os-workspace, .os-workspace-main, .os-card, .os-list-row, .os-metric, .os-dialog, .start-app, .mobile-app) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

:where(.employee-desktop, .kernwerk-shell, .asi-classic-shell) :where(.os-card, .os-list-row, .os-metric, .os-dialog, .start-app, .mobile-app) :where(h1, h2, h3, h4, p, strong, small, span, label, a, button) {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

:where(.employee-desktop, .kernwerk-shell, .asi-classic-shell) :where(input, select, textarea, button) {
  max-width: 100%;
}

/* Arbeitsbeginn und Arbeitsende werden bewusst nach rechts geschoben. */
.task-time-action[data-slide-to-confirm] {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none !important;
  transition: filter .16s ease, box-shadow .16s ease, transform .16s ease;
}

.task-time-action-tap-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 6px;
  display: grid;
  place-items: center;
  height: calc(100% - 8px);
  max-height: 52px;
  min-height: 28px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  color: #14344b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .24);
  font-size: max(18px, .9em);
  font-weight: 1000;
  line-height: 1;
  transform: translate(var(--slide-offset, 0px), -50%);
  transition: transform .16s ease, box-shadow .16s ease;
  pointer-events: none;
}

.task-time-action.start .task-time-action-tap-icon {
  color: #08703a;
}

.task-time-action.end .task-time-action-tap-icon {
  color: #b21521;
}

.task-time-action-content {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 0 10px 0 clamp(46px, 22%, 64px);
  line-height: 1.05;
  pointer-events: none;
}

.task-time-action-label,
.task-time-action-state-text {
  display: block;
  white-space: nowrap;
}

.task-time-action-state-text {
  font-size: max(9px, .55em);
  font-weight: 800;
  letter-spacing: .03em;
  opacity: .9;
}

.task-time-action[data-action-state="busy"] {
  transform: none !important;
  filter: brightness(1.08);
  cursor: progress !important;
}

.task-time-action[data-action-state="busy"]:disabled,
.task-time-action[data-action-state="success"]:disabled {
  opacity: 1;
}

.task-time-action[data-action-state="busy"] .task-time-action-tap-icon {
  animation: asi-attendance-pulse .8s ease-in-out infinite alternate;
}

.task-time-action[data-action-state="success"] {
  outline: 3px solid rgba(255, 255, 255, .94);
  outline-offset: -4px;
  filter: brightness(1.1);
}

.task-time-action[data-action-state="error"] {
  outline: 3px solid #fff;
  outline-offset: -4px;
  box-shadow: 0 0 0 3px #b91c1c, 0 8px 18px rgba(127, 29, 29, .25) !important;
}

@keyframes asi-attendance-pulse {
  from { opacity: .72; transform: translate(var(--slide-offset, 0px), -50%) scale(.92); }
  to { opacity: 1; transform: translate(var(--slide-offset, 0px), -50%) scale(1.04); }
}

.task-time-action[data-slide-to-confirm]:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.gps-action-sr {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .task-time-action[data-slide-to-confirm],
  .task-time-action-tap-icon { transition: none !important; animation: none !important; }
}

@media (min-width: 821px) {
  :is(.kernwerk-shell, .asi-classic-shell) .taskbar {
    justify-content: flex-start !important;
    padding-left: 220px !important;
    padding-right: 78px !important;
  }

  :is(.kernwerk-shell, .asi-classic-shell) .task-center {
    width: 100% !important;
    max-width: none !important;
    justify-content: flex-start !important;
  }

  :is(.kernwerk-shell, .asi-classic-shell) .task-search {
    flex: 0 1 300px;
    width: min(300px, 22vw) !important;
    min-width: 190px;
  }

  :is(.kernwerk-shell, .asi-classic-shell) .attendance-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(190px, 220px)) minmax(220px, 1fr) auto;
    flex: 1 1 auto;
    gap: 10px;
  }

  :is(.kernwerk-shell, .asi-classic-shell) .attendance-actions .task-time-action {
    width: 100%;
    min-width: 190px;
  }

  :is(.kernwerk-shell, .asi-classic-shell) .attendance-actions .task-time-status {
    width: 100%;
    max-width: none !important;
    padding: 0 8px;
  }

  .gps-monitor-health {
    min-height: 38px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #173957;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
  }
}

@media (forced-colors: active) {
  .task-time-action-tap-icon {
    border: 2px solid ButtonText;
    background: ButtonFace;
    color: ButtonText !important;
  }

  .task-time-action[data-action-state="busy"],
  .task-time-action[data-action-state="success"],
  .task-time-action[data-action-state="error"] {
    outline: 3px solid Highlight;
  }
}

.gps-action-result-popup {
  position: fixed;
  z-index: 2147483600;
  left: 50%;
  bottom: 84px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  width: min(520px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 18px;
  background: #10263a;
  color: #fff;
  box-shadow: 0 18px 50px rgba(3, 15, 28, .4);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 22px);
  transition: opacity .18s ease, transform .18s ease;
}

.gps-action-result-popup[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.gps-action-result-popup[data-outcome="success"] { background: #08663b; }
.gps-action-result-popup[data-outcome="error"] { background: #8f1824; }
.gps-action-result-popup[data-outcome="info"] { background: #173957; }
.gps-action-result-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: 25px;
  font-weight: 1000;
}
.gps-action-result-copy { min-width: 0; }
.gps-action-result-copy strong { display: block; font-size: 16px; line-height: 1.2; }
.gps-action-result-copy p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; }
.gps-action-result-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 820px) {
  .gps-action-result-popup { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

.scheduled-start-reminder {
  position: fixed;
  z-index: 2147483601;
  inset: 50% auto auto 50%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  width: min(560px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 24px;
  background: linear-gradient(145deg, #10283d, #081825);
  color: #fff;
  box-shadow: 0 26px 90px rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(.97);
  transition: opacity .18s ease, transform .18s ease;
}
.scheduled-start-reminder[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.scheduled-start-reminder__mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 19px;
  background: #d81925;
  font-size: 30px;
}
.scheduled-start-reminder__copy { min-width: 0; }
.scheduled-start-reminder__copy small { color: #80e4f0; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.scheduled-start-reminder__copy h2 { margin: 5px 0 7px; font-size: 25px; }
.scheduled-start-reminder__copy p { margin: 0; color: #dce9f2; font-size: 14px; line-height: 1.5; }
.scheduled-start-reminder__actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.scheduled-start-reminder__actions button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.scheduled-start-reminder__confirm { background: #149957; color: #fff; }
.scheduled-start-reminder__later { background: rgba(255, 255, 255, .13); color: #fff; }
@media (max-width: 520px) {
  .scheduled-start-reminder { grid-template-columns: 52px minmax(0, 1fr); padding: 17px; }
  .scheduled-start-reminder__mark { width: 50px; height: 50px; border-radius: 15px; font-size: 24px; }
  .scheduled-start-reminder__copy h2 { font-size: 21px; }
  .scheduled-start-reminder__actions { grid-template-columns: 1fr; }
}

/* A pointer hover may highlight an icon, but may never look like a drag. */
body:not(.desktop-edit-mode):is(.kernwerk-shell, .asi-classic-shell) .app-icon:hover,
body:not(.desktop-edit-mode):is(.kernwerk-shell, .asi-classic-shell) .app-icon:focus {
  transform: none !important;
}

body:not(.desktop-edit-mode):is(.kernwerk-shell, .asi-classic-shell) .app-icon:hover b,
body:not(.desktop-edit-mode):is(.kernwerk-shell, .asi-classic-shell) .app-icon:focus b {
  transform: none !important;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body.os-embedded main.page {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 12px max(12px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    overflow-x: hidden !important;
  }

  /* Admin windows are already full-screen on phones. Maximise/content-only
     controls are redundant there and used to hide the close button beneath
     the single shell burger. */
  :is(.kernwerk-shell, .asi-classic-shell) #windows > .window > .window-bar .window-controls [data-max],
  :is(.kernwerk-shell, .asi-classic-shell) #windows > .window > .window-bar .window-controls [data-content-fullscreen] {
    display: none !important;
  }

  :is(.kernwerk-shell, .asi-classic-shell) #windows > .window > .window-bar .window-controls {
    flex: 0 0 auto !important;
    max-width: none !important;
    margin-right: 60px !important;
  }

  .employee-desktop .window > .titlebar .window-controls {
    flex: 0 0 auto !important;
    margin-right: 60px !important;
  }

  /* Reinforce the one-menu rule even when an older cached desktop theme is
     present: the header burger is the only mobile menu entry. */
  :is(.kernwerk-shell, .asi-classic-shell) .taskbar :where(.start-button, #startButton),
  .employee-desktop .taskbar > .start {
    display: none !important;
  }

  .employee-desktop .window,
  :is(.kernwerk-shell, .asi-classic-shell) #windows > .window {
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .employee-desktop .window iframe,
  :is(.kernwerk-shell, .asi-classic-shell) #windows > .window > iframe,
  :is(.kernwerk-shell, .asi-classic-shell) #windows > .window > .os-app-content {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}
.asi-push-onboarding {
  position: fixed;
  inset: 0;
  z-index: 2147483300;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 12, 24, .82);
  backdrop-filter: blur(12px);
}

.asi-push-onboarding__card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid rgba(122, 211, 255, .32);
  border-radius: 24px;
  background: linear-gradient(145deg, #10283c, #071522);
  color: #fff;
  text-align: center;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
}

.asi-push-onboarding__icon {
  margin: 0 auto 14px;
  font-size: 42px;
}

.asi-push-onboarding__card small {
  color: #76d9ff;
  font-weight: 800;
  letter-spacing: .14em;
}

.asi-push-onboarding__card h2 {
  margin: 10px 0 12px;
  font-size: clamp(26px, 6vw, 36px);
}

.asi-push-onboarding__card p {
  margin: 0 0 22px;
  color: #d6e5ef;
  line-height: 1.55;
}

.asi-push-onboarding__card button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #10a861, #087845);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.asi-push-onboarding__card button:disabled {
  cursor: wait;
  opacity: .72;
}
/* Persönliche Favoriten auf der linken Admin-Hauptseite. */
.kernwerk-shell .kw-dock-nav{flex:0 1 auto;min-height:0;overflow-y:auto;scrollbar-width:none}
.kernwerk-shell .kw-dock-nav::-webkit-scrollbar{display:none}
.kernwerk-shell .kw-favorites{display:flex;min-height:0;flex:1 1 auto;flex-direction:column;margin-top:10px;padding-top:9px;border-top:1px solid rgba(255,255,255,.1)}
.kernwerk-shell .kw-dock-manage{width:34px;min-height:25px;margin:4px auto 0;border:1px solid rgba(255,255,255,.14);border-radius:8px;background:rgba(255,255,255,.07);color:#cfe0ec;font-size:18px;cursor:pointer}.kernwerk-shell .kw-dock-manage:hover,.kernwerk-shell .kw-dock-manage:focus-visible{background:rgba(85,213,219,.2);outline:none}.kw-dock-manager{display:grid;gap:7px}.kw-dock-manager-row{display:grid;grid-template-columns:22px 38px 1fr 36px 36px;align-items:center;gap:8px;padding:8px 10px;border:1px solid #d8e4ed;border-radius:12px}.kw-dock-manager-row input{width:18px;height:18px}.kw-dock-manager-row b{display:grid;width:34px;height:34px;place-items:center;border-radius:9px;background:#e9f1f6}.kw-dock-manager-row span{font-weight:800}.kw-dock-manager-row button{width:34px;height:34px;border:1px solid #cbd9e4;border-radius:9px;background:#fff;cursor:pointer}
.kernwerk-shell .kw-dock-item{position:relative;display:grid}.kernwerk-shell .kw-dock-item[hidden]{display:none!important}.kernwerk-shell .kw-dock-item.is-dragging{opacity:.45}.kernwerk-shell .kw-dock-item>.kw-dock-button{width:100%}.kw-dock-inline-controls{display:none;grid-template-columns:repeat(3,1fr);gap:2px;padding:0 3px 4px}.kw-dock-nav.is-editing .kw-dock-inline-controls{display:grid}.kw-dock-nav.is-editing .kw-dock-item{border:1px dashed rgba(85,213,219,.55);border-radius:10px;cursor:grab}.kw-dock-inline-controls button{min-width:0;height:21px;padding:0;border:1px solid rgba(255,255,255,.14);border-radius:5px;background:#23374a;color:#fff;cursor:pointer}.kw-dock-inline-controls button:last-child{background:#77242b}.kernwerk-shell .kw-dock-manage.is-active{background:#167647;color:#fff}
.kernwerk-shell .kw-favorites-head{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:0 2px 6px;color:#8fa5b9;font-size:8px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.kernwerk-shell .kw-favorites-head button{display:grid;width:25px;height:25px;place-items:center;border:1px solid rgba(255,255,255,.16);border-radius:8px;background:rgba(255,255,255,.08);color:#fff;font-size:18px;line-height:1;cursor:pointer}
.kernwerk-shell .kw-favorites-head button:hover,.kernwerk-shell .kw-favorites-head button:focus-visible{border-color:#55d5db;background:rgba(85,213,219,.2);outline:none}
.kernwerk-shell .kw-favorites-list{display:flex;min-height:0;flex-direction:column;gap:4px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}
.kernwerk-shell .kw-favorite-button{display:flex;min-height:45px;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px 2px;border:0;border-radius:10px;background:transparent;color:#d6e4ef;cursor:pointer}
.kernwerk-shell .kw-favorite-button:hover,.kernwerk-shell .kw-favorite-button:focus-visible{background:rgba(255,255,255,.1);color:#fff;outline:none}
.kernwerk-shell .kw-favorite-glyph{display:grid;min-width:28px;height:25px;place-items:center;border-radius:8px;background:rgba(255,255,255,.09);font-size:12px;font-weight:900}
.kernwerk-shell .kw-favorite-button small{display:block;width:68px;overflow:hidden;font-size:8px;font-weight:700;text-align:center;text-overflow:ellipsis;white-space:nowrap}
.kernwerk-shell .kw-favorite-item{position:relative;display:grid;cursor:grab}.kernwerk-shell .kw-favorite-item.is-dragging{opacity:.45}.kernwerk-shell .kw-favorite-remove{position:absolute;top:0;right:2px;display:grid;width:19px;height:19px;place-items:center;padding:0;border:1px solid rgba(255,255,255,.18);border-radius:50%;background:#25384a;color:#fff;font-size:14px;line-height:1;cursor:pointer}.kernwerk-shell .kw-favorite-remove:hover,.kernwerk-shell .kw-favorite-remove:focus-visible{background:#c71920;outline:none}
.kernwerk-shell .kw-favorites-empty{padding:8px 2px;color:#71879a;font-size:8px;line-height:1.35;text-align:center}
.kw-favorites-dialog{width:min(720px,100%);max-height:min(760px,calc(100vh - 44px));grid-template-columns:1fr!important}
.kw-favorites-dialog>*{grid-column:1!important}
.kw-favorites-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:390px;overflow:auto;padding:2px}
.kw-favorite-choice{display:grid!important;grid-template-columns:22px 40px minmax(0,1fr);align-items:center;gap:9px;min-height:54px;margin:0!important;padding:8px 10px!important;border:1px solid #d8e4ed;border-radius:12px;background:#fff;color:#173149;cursor:pointer}
.kw-favorite-choice:hover{border-color:#7fc8dd;background:#f4fbfd}.kw-favorite-choice input{width:18px!important;min-height:18px!important;margin:0!important;accent-color:#c71920}.kw-favorite-choice b{display:grid;width:36px;height:36px;place-items:center;border-radius:10px;background:#e9f1f6;color:#a91823;font-size:15px}.kw-favorite-choice span{overflow:hidden;font-size:13px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
.kernwerk-shell .kw-notification-action{border-color:#f1b8bd;color:#9e1822;background:linear-gradient(145deg,#fff8f8,#fde9eb);box-shadow:0 9px 20px rgba(174,28,39,.1)}
.kw-notice-status-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.kw-notice-status-head p{margin:4px 0;color:#607388}.kw-notice-recipients{display:grid;gap:7px;margin:12px 0}.kw-notice-recipient{display:grid;grid-template-columns:minmax(130px,1fr) 34px 90px minmax(125px,auto);align-items:center;gap:8px;padding:10px 12px;border:1px solid #d8e3ec;border-radius:11px;background:#fff}.kw-notice-recipient small{text-align:right;color:#708194}.kw-notice-checks{font-size:17px;font-weight:950;letter-spacing:-5px;color:#7f8d99}.kw-notice-recipient.is-opened .kw-notice-checks,.kw-notice-recipient.is-confirmed .kw-notice-checks{color:#159455}.kw-notice-recipient.is-confirmed{border-color:#98d6b6;background:#f3fbf6}
.kw-notice-dialog{scrollbar-width:none}.kw-notice-dialog::-webkit-scrollbar{display:none}.kw-notice-admin-body{margin-top:12px;padding:12px 14px;border-radius:11px;background:#eef3f7;white-space:pre-wrap}.kw-notice-admin-image{display:block;width:100%;max-height:320px;object-fit:contain;margin:12px 0;border-radius:12px;background:#e9eef3}.kw-notice-admin-audio{display:block;width:100%;margin:12px 0}.kw-notice-admin-file{display:block;margin:12px 0;padding:12px 14px;border-radius:11px;background:#e9f1f7;color:#173149;font-weight:800;text-decoration:none}.kw-notice-status-actions{display:flex;justify-content:space-between;gap:10px}
.kw-notice-history-row{grid-template-columns:58px minmax(0,1fr) auto!important;align-items:center!important}.kw-notice-history-image{grid-row:1/3;width:52px;height:52px;object-fit:cover;border-radius:9px;background:#e9eef3}.kw-notice-history-row small{grid-column:2/4}
@media(max-height:760px) and (min-width:701px){.kernwerk-shell .kw-dock-button{min-height:50px}.kernwerk-shell .kw-tenant-logo{margin-bottom:10px}.kernwerk-shell .kw-favorite-button{min-height:40px}}
@media(max-width:700px){.kw-favorites-dialog{max-height:calc(100dvh - 24px)}.kw-favorites-choices{grid-template-columns:1fr;max-height:none}.kernwerk-shell .kw-favorites{display:none}.kw-notice-recipient{grid-template-columns:1fr auto auto}.kw-notice-recipient small{grid-column:1/-1;text-align:left}}
