/* ═══════════════════════════════════════════════════════════════
   WOODPLAN — REDESIGN OVERLAY (B)
   Layout C + paleta Nord
   Wgrywany PO styles-ui-patch.css; nadpisuje co trzeba.
═══════════════════════════════════════════════════════════════ */

/* ── Sidebar: węższy, header 56px, sticky search ─────────────── */
:root {
  --sb-width: 236px;
  --topbar-h: 56px;
}

.sidebar {
  padding: 0 !important;
}

/* HEADER sidebara — logo + collapse */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sidebar-header .logo-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.sidebar-header .logo-mark img {
  width: 22px; height: 22px;
  filter: brightness(0) invert(1);
}
.sidebar-header .brand {
  flex: 1; min-width: 0;
}
.sidebar-header .brand-name {
  font-size: 14px; font-weight: 700;
  color: var(--sb-text-active);
  line-height: 1;
  letter-spacing: -0.01em;
}
.sidebar-header .brand-sub {
  font-size: 10px; color: rgba(216,222,233,0.45);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-header .collapse-btn {
  background: none; border: none;
  color: rgba(216,222,233,0.5);
  font-size: 14px; cursor: pointer;
  padding: 4px 6px; border-radius: 4px;
}
.sidebar-header .collapse-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sb-text-active);
}

/* STICKY SEARCH w sidebarze */
.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sidebar-search-input {
  position: relative;
}
.sidebar-search-input input {
  width: 100%;
  padding: 7px 30px 7px 30px;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 6px;
  font-size: 12px;
  color: #fff !important;
  font-family: 'Manrope', sans-serif;
  box-sizing: border-box;
}
.sidebar-search-input input::placeholder {
  color: rgba(216,222,233,0.4);
}
.sidebar-search-input input:focus {
  outline: none;
  border-color: rgba(136,192,208,0.4) !important;
  box-shadow: 0 0 0 2px rgba(136,192,208,0.12) !important;
}
.sidebar-search-input .icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: rgba(216,222,233,0.4); font-size: 13px; pointer-events: none;
}
.sidebar-search-input .kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: rgba(216,222,233,0.35);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  pointer-events: none;
}

/* USER CHIP na DOLE sidebara (zamiast user-badge na górze) */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
  margin-top: auto;
}
.sidebar-user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.sidebar-user-chip:hover {
  background: rgba(255,255,255,0.04);
}
.sidebar-user-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #88c0d0, #5e81ac);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.sidebar-user-chip .info { flex: 1; min-width: 0; }
.sidebar-user-chip .name {
  font-size: 12px; font-weight: 600;
  color: var(--sb-text-active);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-chip .role {
  font-size: 10px;
  color: rgba(216,222,233,0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-chip .chevron {
  color: rgba(216,222,233,0.4); font-size: 14px;
  flex-shrink: 0;
}

/* USER MENU (popup nad chipem) */
.user-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 8px; right: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(46,52,64,0.25);
  padding: 6px;
  z-index: 1100;
  display: none;
}
.user-menu.open { display: block; }
.user-menu .menu-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-menu .menu-header .name {
  font-size: 14px; font-weight: 700; color: var(--text-1);
}
.user-menu .menu-header .sub {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
}
.user-menu .menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px; color: var(--text-1);
  cursor: pointer;
  border: none; background: none;
  width: 100%; text-align: left;
  font-family: 'Manrope', sans-serif;
  transition: background 0.12s;
}
.user-menu .menu-item:hover {
  background: var(--bg-app);
}
.user-menu .menu-item .ico {
  width: 18px; text-align: center; font-size: 14px; opacity: 0.7;
}
.user-menu .menu-item.danger { color: var(--danger); }
.user-menu .menu-divider {
  height: 1px; background: var(--border); margin: 6px 4px;
}
.user-menu .menu-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  font-size: 12.5px; color: var(--text-2);
}
.user-menu .menu-toggle .pill {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg-app); color: var(--text-2);
  font-weight: 600;
}
.user-menu .menu-toggle.on .pill { background: #d1fae5; color: #065f46; }

/* TIMER w footerze (kompaktowy) */
.sidebar-timer-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: rgba(163,190,140,0.12);
  border: 1px solid rgba(163,190,140,0.3);
  border-radius: 6px;
  margin-bottom: 8px;
}
.sidebar-timer-chip .dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(163,190,140,0.2);
  animation: timerPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.sidebar-timer-chip .time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; color: rgba(236,239,244,0.85);
  font-weight: 600;
  flex: 1;
}
.sidebar-timer-chip .stop-btn {
  background: none; border: none;
  font-size: 10px; color: rgba(216,222,233,0.5);
  cursor: pointer; padding: 0;
  font-weight: 600;
}
.sidebar-timer-chip .stop-btn:hover { color: var(--danger); }

/* Ukryj stary user-badge — zastąpiony chipem na dole */
.sidebar > .user-badge {
  display: none !important;
}
/* Ukryj stary logo-block (duża karta na górze) */
.sidebar > div:first-of-type:not(.sidebar-header):not(.sidebar-search):not(.sidebar-footer):not(#mainNav):not(#workTimerContainer):not(#sidebarTimerContainer) {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   TOP BAR — kompaktowy, segmentowe taby, kontekst akcje
══════════════════════════════════════════════════════════════ */
.top-bar {
  height: var(--topbar-h);
  padding: 0 28px !important;
  gap: 16px;
}
.top-bar h1#pageTitle {
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  margin: 0;
  flex-shrink: 0;
}

/* Online status chip obok tytułu */
.online-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: #2d7a3e;
  background: #d6ead8;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  margin-left: 8px;
}
.online-chip::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
}

/* Top-bar prawa strona — kompakt */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.top-bar-actions .topbar-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-2);
  margin-right: 8px;
  white-space: nowrap;
}
.icon-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: all 0.15s;
  padding: 0;
}
.icon-btn:hover {
  background: var(--bg-app);
  border-color: var(--text-3);
}
.icon-btn .dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* CTA primary — „Nowe zlecenie" */
.btn-cta-new {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  transition: background 0.15s;
}
.btn-cta-new:hover { background: var(--accent-dark); }

/* Ukryj stare przyciski w top-barze */
.top-bar #pwaInstallBtn,
.top-bar #soundToggleBtn,
.top-bar .btn-danger[onclick*="logout"] {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE HEADER — czysty, tylko greeting + 🔔 + avatar
══════════════════════════════════════════════════════════════ */
@media screen and (max-width: 1024px) {
  .mobile-header {
    background: var(--bg-card) !important;
    color: var(--text-1) !important;
    padding: 12px 16px !important;
    height: 56px;
    border-bottom: 1px solid var(--border);
  }
  .mobile-header .hamburger {
    width: 32px; height: 32px;
    background: var(--bg-app);
    color: var(--text-1) !important;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
  }
  .mobile-header .greeting {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 12px;
  }
  .mobile-header .greeting .hello {
    font-size: 11px; color: var(--text-3);
    line-height: 1;
  }
  .mobile-header .greeting .name {
    font-size: 14px; font-weight: 700;
    color: var(--text-1);
    margin-top: 2px;
  }
  .mobile-header .icon-btn-mob {
    width: 32px; height: 32px;
    background: var(--bg-app);
    border: none;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    cursor: pointer;
  }
  .mobile-header .icon-btn-mob .dot {
    position: absolute; top: 5px; right: 5px;
    width: 7px; height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
  }
  .mobile-header .avatar-mob {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #88c0d0, #5e81ac);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
  }
  /* Ukryj stary mobile-header content (ale zachowaj container) */
  .mobile-header .mh-old { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   BOTTOM NAV — z FAB ＋ na środku
══════════════════════════════════════════════════════════════ */
@media screen and (max-width: 1024px) {
  .bottom-nav {
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border);
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom)) !important;
  }
  .bottom-nav-items {
    position: relative;
  }
  .bottom-nav-item {
    color: var(--text-3) !important;
    font-size: 10px;
  }
  .bottom-nav-item.active { color: var(--accent) !important; }
  .bottom-nav-item .bottom-nav-icon { font-size: 18px; }

  .bottom-nav-fab {
    width: 52px; height: 52px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 16px rgba(94,129,172,0.45);
    margin-top: -16px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
  }
  .bottom-nav-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(94,129,172,0.55);
  }
  .bottom-nav-fab:active { transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR COLLAPSE — tylko ikony 60px
══════════════════════════════════════════════════════════════ */
.sidebar-collapsed .sidebar-header .brand,
.sidebar-collapsed .sidebar-header .collapse-btn,
.sidebar-collapsed .sidebar-search,
.sidebar-collapsed .sidebar-user-chip .info,
.sidebar-collapsed .sidebar-user-chip .chevron,
.sidebar-collapsed .sidebar-timer-chip .time,
.sidebar-collapsed .sidebar-timer-chip .stop-btn {
  display: none !important;
}
.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 12px 6px;
}
.sidebar-collapsed .sidebar-footer {
  padding: 8px 6px;
}
.sidebar-collapsed .sidebar-user-chip {
  justify-content: center;
}
.sidebar-collapsed .sidebar-timer-chip {
  justify-content: center;
  padding: 7px;
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL CMD-K MODAL
══════════════════════════════════════════════════════════════ */
.cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(46,52,64,0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 2000;
  padding-top: 12vh;
}
.cmdk-overlay.open { display: flex; }
.cmdk-modal {
  width: 92%;
  max-width: 580px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(46,52,64,0.4);
  border: 1px solid var(--border);
  overflow: hidden;
}
.cmdk-input-wrap {
  display: flex; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.cmdk-input-wrap .icon { font-size: 18px; color: var(--text-3); }
.cmdk-input-wrap input {
  flex: 1; border: none; outline: none;
  font-size: 15px; font-family: 'Manrope', sans-serif;
  color: var(--text-1);
  background: transparent;
}
.cmdk-input-wrap .esc {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px;
}
.cmdk-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-section-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3);
  padding: 10px 12px 6px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px; color: var(--text-1);
}
.cmdk-item:hover, .cmdk-item.active {
  background: var(--bg-app);
}
.cmdk-item .ico {
  width: 18px; text-align: center; font-size: 14px; opacity: 0.7;
}
.cmdk-item .label { flex: 1; }
.cmdk-item .hint {
  font-size: 11px; color: var(--text-3);
}
.cmdk-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
