/* Workforce / OPERA — App Shell */

.wf-app-shell {
  min-height: calc(100vh - 32px);
  margin: 16px;
  display: grid;
  grid-template-columns: var(--wf-sidebar-width) 1fr;
  background: var(--wf-surface);
  border: 1px solid rgba(255, 255, 255, 0.70);
  border-radius: var(--wf-radius-xl);
  box-shadow: var(--wf-shadow-lg);
  overflow: hidden;
}

/* ---- Sidebar ---- */
.wf-sidebar {
  background: var(--wf-sidebar);
  border-right: 1px solid var(--wf-border);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
  overflow-y: auto;
}

.wf-sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--wf-border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.wf-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--wf-font-lg);
  font-weight: 700;
  color: var(--wf-primary);
  letter-spacing: 0.5px;
  text-decoration: none;
}

.wf-sidebar-logo svg { width: 24px; height: 24px; flex-shrink: 0; }

.wf-sidebar-section {
  padding: 12px 10px 4px;
}

.wf-sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--wf-text-soft);
  padding: 0 8px 6px;
}

.wf-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--wf-radius-sm);
  color: var(--wf-text-muted);
  text-decoration: none;
  font-size: var(--wf-font-md);
  font-weight: 500;
  transition: background var(--wf-transition), color var(--wf-transition);
  margin-bottom: 2px;
  position: relative;
}

.wf-nav-item:hover {
  background: var(--wf-surface-soft);
  color: var(--wf-text);
  text-decoration: none;
}

.wf-nav-item.is-active {
  background: var(--wf-primary-soft);
  color: var(--wf-primary);
  font-weight: 600;
}

.wf-nav-item.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.wf-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wf-nav-icon svg { width: 18px; height: 18px; }

.wf-nav-badge {
  margin-left: auto;
  background: var(--wf-danger-soft);
  color: var(--wf-danger);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.wf-nav-item.is-active .wf-nav-badge {
  background: var(--wf-primary);
  color: #fff;
}

.wf-sidebar-footer {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--wf-border-soft);
}

.wf-sidebar-version {
  font-size: 10px;
  color: var(--wf-text-soft);
  text-align: center;
  padding: 6px 0 2px;
}

/* ---- Main area ---- */
.wf-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 32px);
}

/* ---- Topbar ---- */
.wf-topbar {
  height: var(--wf-topbar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--wf-border);
  background: var(--wf-surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.wf-topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.wf-topbar-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-soft);
  color: var(--wf-text);
  font-size: var(--wf-font-sm);
  transition: border-color var(--wf-transition), background var(--wf-transition);
}

.wf-topbar-search input:focus {
  outline: none;
  border-color: var(--wf-primary);
  background: var(--wf-surface);
}

.wf-topbar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--wf-text-soft);
  pointer-events: none;
}

.wf-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.wf-topbar-clock {
  font-size: 14px;
  font-weight: 600;
  color: var(--wf-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wf-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: var(--wf-radius-sm);
  background: transparent;
  color: var(--wf-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--wf-transition), color var(--wf-transition);
  position: relative;
}

.wf-icon-btn:hover {
  background: var(--wf-surface-soft);
  color: var(--wf-text);
}

.wf-icon-btn svg { width: 20px; height: 20px; }

.wf-notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--wf-danger);
  border: 2px solid var(--wf-surface);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Notification dropdown */
.wf-dropdown.wf-notif-dropdown {
  min-width: 340px;
  max-width: 380px;
  padding: 0;
  overflow: hidden;
}

.wf-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--wf-border-soft);
}

.wf-notif-title {
  font-weight: 700;
  font-size: var(--wf-font-md);
  color: var(--wf-text);
}

.wf-notif-mark-all {
  font-size: 12px;
  color: var(--wf-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--wf-radius-xs);
  transition: background var(--wf-transition);
}

.wf-notif-mark-all:hover { background: var(--wf-surface-soft); }

.wf-notif-list {
  max-height: 380px;
  overflow-y: auto;
}

.wf-notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--wf-border-soft);
  cursor: pointer;
  transition: background var(--wf-transition);
}

.wf-notif-item[href] {
  color: inherit;
  text-decoration: none;
}

.wf-notif-item:hover { background: var(--wf-surface-soft); }
.wf-notif-item:last-child { border-bottom: none; }

.wf-notif-item--unread {
  background: color-mix(in srgb, var(--wf-primary) 5%, transparent);
}

.wf-notif-item--unread:hover {
  background: color-mix(in srgb, var(--wf-primary) 10%, transparent);
}

.wf-notif-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wf-notif-icon svg { width: 16px; height: 16px; }

.wf-notif-content {
  flex: 1;
  min-width: 0;
}

.wf-notif-item-title {
  font-size: var(--wf-font-sm);
  font-weight: 600;
  color: var(--wf-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-notif-item-body {
  font-size: 12px;
  color: var(--wf-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wf-notif-item-time {
  font-size: 11px;
  color: var(--wf-text-soft);
  margin-top: 4px;
}

.wf-notif-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--wf-text-soft);
  font-size: var(--wf-font-sm);
}

/* User dropdown */
.wf-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 5px;
  border-radius: var(--wf-radius-sm);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background var(--wf-transition);
}

.wf-user-menu:hover { background: var(--wf-surface-soft); }

.wf-user-menu-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.wf-user-menu-name { font-size: var(--wf-font-sm); font-weight: 600; color: var(--wf-text); }
.wf-user-menu-role { font-size: 11px; color: var(--wf-text-soft); }

.wf-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  box-shadow: var(--wf-shadow-md);
  padding: 6px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.wf-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wf-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--wf-radius-xs);
  color: var(--wf-text);
  font-size: var(--wf-font-sm);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--wf-transition);
}

.wf-dropdown-item:hover { background: var(--wf-surface-soft); text-decoration: none; }
.wf-dropdown-item svg { width: 16px; height: 16px; color: var(--wf-text-muted); }
.wf-dropdown-divider { height: 1px; background: var(--wf-border-soft); margin: 4px 0; }
.wf-dropdown-item.wf-danger { color: var(--wf-danger); }
.wf-dropdown-item.wf-danger svg { color: var(--wf-danger); }

.wf-dropdown-trigger { position: relative; }

/* ---- Page content area ---- */
.wf-page {
  flex: 1;
  padding: 28px 32px 120px;
  overflow-y: auto;
}

/* Mobile sidebar toggle */
.wf-sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: var(--wf-radius-sm);
  background: transparent;
  color: var(--wf-text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.wf-sidebar-toggle svg { width: 22px; height: 22px; }

.wf-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.3);
  z-index: 149;
}

/* ---- Skip link (accessibility) ---- */
.wf-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--wf-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 var(--wf-radius-sm) 0;
  font-size: var(--wf-font-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top var(--wf-transition);
}

.wf-skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* ---- Focus visible (accessibility) ---- */
*:focus-visible {
  outline: 2px solid var(--wf-primary);
  outline-offset: 2px;
}

.wf-btn:focus-visible,
.wf-nav-item:focus-visible,
.wf-icon-btn:focus-visible,
.wf-dropdown-item:focus-visible {
  outline: 2px solid var(--wf-primary);
  outline-offset: 2px;
}

.wf-modal-close:focus-visible {
  outline: 2px solid var(--wf-primary);
  outline-offset: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .wf-app-shell {
    grid-template-columns: 1fr;
  }
  .wf-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 150;
    width: var(--wf-sidebar-width);
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 280ms ease;
  }
  .wf-sidebar.is-open { transform: translateX(0); }
  .wf-sidebar-toggle { display: flex; }
  .wf-sidebar-overlay.is-visible { display: block; }
}

@media (max-width: 640px) {
  .wf-app-shell { margin: 0; border-radius: 0; border: none; }
  .wf-page { padding: 16px 16px 100px; }
  .wf-topbar { padding: 0 12px; }
  .wf-user-menu-info { display: none; }
  .wf-topbar-search { max-width: none; }
}
