/* ═══════════════════════════════════════════
   MAIN SHELL
═══════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.search-wrap {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
  position: relative;
}
.search-wrap svg,
.search-wrap > i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px 8px 34px;
  color: var(--text-1);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder {
  color: var(--text-3);
}
.search-input:focus {
  border-color: var(--brass);
  background: var(--surface);
}

.gsearch-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  max-height: 420px;
  overflow-y: auto;
  z-index: 120;
  padding: 4px 0;
}
.gsearch-group {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 10px 14px 4px;
}
.gsearch-result {
  display: block;
  padding: 8px 14px;
  color: inherit;
  text-decoration: none;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.gsearch-result.is-highlighted,
.gsearch-result:hover {
  background: var(--surface-hi);
  border-left-color: var(--brass);
}
.gsearch-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}
.gsearch-result-subtitle {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.gsearch-loading,
.gsearch-empty {
  padding: 14px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

.topbar-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 26px 28px;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--text-1);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary:hover {
  background: #2a4060;
  color: #fff;
}
.btn-primary svg {
  width: 13px;
  height: 13px;
}

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-ghost-sm:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.btn-ghost-sm svg {
  width: 13px;
  height: 13px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-danger:hover {
  background: #fee2e2;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.12s;
  text-decoration: none;
}
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-secondary:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}

/* ═══════════════════════════════════════════
   FLASH MESSAGES
═══════════════════════════════════════════ */
.flash {
  padding: 10px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  font-size: 13px;
}
.flash-notice {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.flash-alert {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ═══════════════════════════════════════════
   BACK LINK
═══════════════════════════════════════════ */
.back-link {
  font-size: 12px;
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
}
.back-link:hover {
  color: var(--brass-lo);
}

/* ═══════════════════════════════════════════
   TOPBAR + BUTTONS — MOBILE
═══════════════════════════════════════════ */
.mobile-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-size: 18px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  transition: background 0.12s;
  flex-shrink: 0;
}
.mobile-hamburger:hover {
  background: var(--surface-hi);
}

.mobile-search-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-size: 15px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  transition: background 0.12s;
}
.mobile-search-toggle:hover {
  background: var(--surface-hi);
}

.mobile-search-bar {
  display: none;
}

.mobile-search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 15px;
  padding: 4px 6px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .mobile-search-toggle {
    display: flex;
    align-items: center;
  }
  .mobile-search-bar {
    display: none;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .mobile-search-bar.mobile-search-open {
    display: flex;
  }
  .mobile-hamburger {
    display: flex;
    align-items: center;
  }
  .search-wrap {
    display: none;
  }
  .topbar-date {
    display: none;
  }
  .topbar-heading {
    font-size: 16px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-controls {
    padding: 8px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .topbar {
    padding: 10px 16px;
    gap: 8px;
  }
  .view-scroll {
    padding: 14px 16px;
    overflow-x: hidden;
  }
  .main {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .btn-ghost-sm {
    padding: 8px 12px;
    font-size: 12px;
  }
  #flash-messages {
    margin: 0 16px !important;
  }
  /* New Job as compact pill in topbar */
  .topbar-btns .btn-primary {
    padding: 7px 14px;
    font-size: 12px;
  }
  .topbar-btns .btn-primary i {
    display: none;
  }
}

/* Masquerade banner — floating pill */
.masquerade-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #1c2e42;
  color: #fde68a;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    0 0 0 2px #f59e0b;
  white-space: nowrap;
}
.masquerade-banner strong {
  color: #fff;
  font-weight: 700;
}
.masquerade-exit {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fde68a;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.masquerade-exit:hover {
  background: rgba(255, 255, 255, 0.25);
}
@media (max-width: 768px) {
  .masquerade-banner {
    bottom: 12px;
    padding: 8px 16px;
    font-size: 12px;
    gap: 8px;
  }
}

/* Environment banner — staging/playground indicator */
.env-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  text-align: center;
  padding: 3px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}
.env-banner-staging {
  background: #f59e0b;
  color: #000;
}
.env-banner-playground {
  background: #8b5cf6;
  color: #fff;
}
/* Bump masquerade banner up when env banner is present */
body:has(.env-banner) .masquerade-banner {
  bottom: 40px;
}
@media (max-width: 768px) {
  body:has(.env-banner) .masquerade-banner {
    bottom: 32px;
  }
}

/* ═══════════════════════════════════════════
   NOTIFICATION BELL + DROPDOWN
═══════════════════════════════════════════ */
.notif-bell-wrap {
  position: relative;
}
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  transition:
    background 0.12s,
    color 0.12s;
  display: flex;
  align-items: center;
}
.notif-bell-btn:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  text-align: center;
  pointer-events: none;
}

/* Dropdown panel */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.notif-dropdown-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.notif-mark-all {
  font-size: 12px;
  color: var(--brass);
  text-decoration: none;
}
.notif-mark-all:hover {
  text-decoration: underline;
}
.notif-dropdown-list {
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
}
.notif-empty,
.notif-dropdown-loading {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.notif-item,
.notif-page-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.notif-item:hover,
.notif-page-item:hover {
  background: var(--surface-hi);
}
.notif-item:last-child,
.notif-page-item:last-child {
  border-bottom: none;
}
.notif-unread {
  background: rgba(184, 146, 74, 0.06);
}
.notif-unread .notif-message {
  font-weight: 600;
  color: var(--text-1);
}
.notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
  margin-top: 2px;
}
.notif-unread .notif-icon {
  background: rgba(184, 146, 74, 0.15);
  color: var(--brass);
}
.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-message {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}
.notif-time {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass);
  flex-shrink: 0;
  margin-top: 8px;
}
.notif-dropdown-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.notif-view-all {
  font-size: 12px;
  color: var(--brass);
  text-decoration: none;
  font-weight: 500;
}
.notif-view-all:hover {
  text-decoration: underline;
}

.notif-push-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: 0.15s;
}
.notif-push-btn:hover:not(:disabled) {
  border-color: var(--brass);
  color: var(--brass);
}
.notif-push-btn:disabled {
  cursor: default;
}

/* Full page notification list */
.notif-page-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 8px);
  overflow: hidden;
}
.notif-page-item {
  padding: 14px 20px;
}

@media (max-width: 768px) {
  .notif-dropdown {
    width: 300px;
    right: -40px;
  }
  .notif-page-item {
    padding: 12px 14px;
  }
}
