/* WerkPilot – HYMOTEQ Synchronisationsstatus und Abmelden in der bestehenden Seitenleiste.
   Eigenes UI-Modul: keine Veraenderung von Uhr, Fluegeln, Wetter oder Speicher-API. */
@media screen {
  .werkpilot-sync-gadget { display: none; }
  html body.werkpilot-header-branding[data-view]:not([data-view="login"]):not([data-view="register"]):not([data-view="twofa"]) .modern-app-header .werkpilot-sync-gadget {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    gap: 10px;
    width: 237px;
    height: 57px;
    box-sizing: border-box;
    padding: 5px 13px 5px 7px;
    overflow: hidden;
    border: 1px solid #d5d9de;
    border-radius: 16px;
    background: linear-gradient(150deg,#fdfdfe 0%,#f0f2f5 50%,#e7e9ed 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 3px 9px rgba(32,35,40,.09);
    color: #252a30;
    white-space: nowrap;
  }
  .werkpilot-sync-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid #d8dde2;
    border-radius: 50%;
    background: linear-gradient(145deg,#fff,#e6e9ed);
    box-shadow: inset 0 1px 1px #fff, 0 2px 4px rgba(15,20,25,.08);
    color: #4a555f;
  }
  .werkpilot-sync-symbol svg { width: 27px; height: 27px; display: block; }
  .werkpilot-sync-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 3px; }
  .werkpilot-sync-title { display: flex; align-items: center; min-width: 0; gap: 7px; font-size: 13px; line-height: 1.1; }
  .werkpilot-sync-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: inherit; font-weight: 900; }
  .werkpilot-sync-dot {
    display: block;
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8a929d;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.15),0 0 0 2px rgba(255,255,255,.8);
  }
  .werkpilot-sync-copy small { color: #626b74; font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
  .werkpilot-sync-gadget[data-sync-state="saved"] .werkpilot-sync-dot { background: #1cbc5b; box-shadow: 0 0 0 2px #dcf7e8,0 0 8px rgba(28,188,91,.32); }
  .werkpilot-sync-gadget[data-sync-state="saving"] .werkpilot-sync-dot { background: #ecab21; }
  .werkpilot-sync-gadget[data-sync-state="saving"] .werkpilot-sync-symbol svg { animation: werkpilot-sync-rotate 1.6s linear infinite; }
  .werkpilot-sync-gadget[data-sync-state="error"] .werkpilot-sync-dot,
  .werkpilot-sync-gadget[data-sync-state="conflict"] .werkpilot-sync-dot,
  .werkpilot-sync-gadget[data-sync-state="offline"] .werkpilot-sync-dot { background: #cc1533; box-shadow: 0 0 0 2px #fce1e6; }
  @keyframes werkpilot-sync-rotate { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) {
    .werkpilot-sync-gadget[data-sync-state="saving"] .werkpilot-sync-symbol svg { animation: none; }
  }

  /* Abmelden nur als neuer Eintrag – vorhandene Navigation/Admin-Steuerung unveraendert. */
  html body:not([data-view="login"]):not([data-view="register"]):not([data-view="twofa"]) #wp-sidebar #wp-sidebar-logout {
    display: flex;
    flex: 0 0 56px;
    align-items: center;
    gap: 21px;
    width: 100%;
    min-width: 0;
    height: 56px;
    margin: 0;
    padding: 0 17px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-top-color: #e7e8ec;
    border-radius: 9px;
    background: #fff;
    color: #a40a1c;
    font: inherit;
    font-size: 16px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
  }
  #wp-sidebar #wp-sidebar-logout .nav-icon { flex: 0 0 27px; width: 27px; height: 27px; stroke: currentColor; fill: none; stroke-width: 1.9; }
  #wp-sidebar #wp-sidebar-logout:hover, #wp-sidebar #wp-sidebar-logout:focus-visible { background: #fff4f5; }
  body.wp-sidebar-collapsed #wp-sidebar #wp-sidebar-logout { justify-content: center !important; padding: 0 !important; }
  body.wp-sidebar-collapsed #wp-sidebar #wp-sidebar-logout span { display: none !important; }
  @media (max-width: 700px) {
    body.wp-sidebar-mobile-open #wp-sidebar #wp-sidebar-logout { justify-content: flex-start !important; padding: 0 17px !important; }
    body.wp-sidebar-mobile-open #wp-sidebar #wp-sidebar-logout span { display: inline !important; }
  }
  /* Die Uhr haengt weiterhin absolut an der Mitte des Headers. Auf schmalen
     Desktops wird lediglich der Platzbedarf des NEUEN Status-Gadgets reduziert. */
  @media (max-width: 1690px) {
    html body.werkpilot-header-branding[data-view]:not([data-view="login"]):not([data-view="register"]):not([data-view="twofa"]) .modern-app-header .werkpilot-sync-gadget { width: 173px; padding-right: 8px; gap: 5px; }
    .werkpilot-sync-title { font-size: 12px; }
    .werkpilot-sync-copy small { font-size: 9px; }
  }
  @media (max-width: 1450px) {
    html body.werkpilot-header-branding[data-view]:not([data-view="login"]):not([data-view="register"]):not([data-view="twofa"]) .modern-app-header .werkpilot-sync-gadget {
      width: 57px;
      padding: 5px;
      justify-content: center;
    }
    .werkpilot-sync-copy { display: none; }
  }
}
@media print { .werkpilot-sync-gadget, #wp-sidebar-logout { display: none !important; } }
