/* ============================================================
   Ocean Builders — Shared Design System
   Used by all OB tools (Scheduler, Map Calculator, future apps)
   ============================================================ */

/* ── Design Tokens — DELIBERATELY EMPTY ─────────────────────────
   The duplicate :root block that used to live here was overriding
   --ob-accent etc. with the legacy indigo palette. ob-tokens.css
   now owns those variables and points them at the OB blue palette
   via its legacy alias layer. Re-introducing a :root block here
   would silently revert the entire app to indigo — don't.
   --------------------------------------------------------------- */

/* ── Shared Top Nav ─────────────────────────────────────────── */
.ob-nav {
  background: var(--ob-surface);
  border-bottom: 1px solid var(--ob-border);
  padding: 0 20px;
  height: var(--ob-nav-height);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 200;
  box-shadow: var(--ob-shadow);
  font-family: var(--ob-font);
}

.ob-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.ob-nav-logo img {
  height: 30px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: 3px;
  padding: 2px 4px;
}

.ob-nav-divider {
  width: 1px;
  height: 24px;
  background: var(--ob-border);
  flex-shrink: 0;
}

.ob-nav-app-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ob-text);
  letter-spacing: -0.2px;
}

.ob-nav-spacer { flex: 1; }

/* ── App Switcher ───────────────────────────────────────────── */
.ob-app-switcher {
  position: relative;
}

.ob-app-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  background: var(--ob-surface2);
  color: var(--ob-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--ob-font);
  transition: all 0.15s;
}
.ob-app-switcher-btn:hover {
  border-color: var(--ob-accent);
  color: var(--ob-accent);
  background: var(--ob-accent-light);
}

.ob-app-switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--ob-surface);
  border: 1px solid var(--ob-border);
  border-radius: 12px;
  box-shadow: var(--ob-shadow-lg);
  min-width: 240px;
  padding: 8px;
  z-index: 1000;
}
.ob-app-switcher-dropdown.open { display: block; }

.ob-app-switcher-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ob-muted);
  padding: 6px 10px 4px;
}

.ob-app-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ob-text);
  transition: background 0.12s;
  cursor: pointer;
}
.ob-app-item:hover { background: var(--ob-accent-light); }
.ob-app-item.active { background: var(--ob-accent-light); }

.ob-app-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ob-app-item-info { flex: 1; }
.ob-app-item-name { font-size: 13px; font-weight: 600; color: var(--ob-text); }
.ob-app-item-desc { font-size: 11px; color: var(--ob-muted); margin-top: 1px; }

.ob-app-item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--ob-accent-light);
  color: var(--ob-accent);
}

/* ── Shared Nav User Name ───────────────────────────────────── */
.ob-user-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--ob-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Hamburger / Menu Button ────────────────────────────────── */
.ob-hamburger-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--ob-radius);
  border: 1px solid var(--ob-border);
  background: var(--ob-surface2);
  color: var(--ob-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-family: var(--ob-font);
  transition: all 0.15s;
  flex-shrink: 0;
}
.ob-hamburger-btn:hover {
  border-color: var(--ob-accent);
  color: var(--ob-accent);
  background: var(--ob-accent-light);
}

/* ── Shared Nav Sign Out ────────────────────────────────────── */
.ob-signout-btn {
  padding: 5px 12px;
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  background: none;
  color: var(--ob-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--ob-font);
  transition: all 0.15s;
  white-space: nowrap;
}
.ob-signout-btn:hover {
  border-color: var(--ob-danger);
  color: var(--ob-danger);
  background: #fef2f2;
}

/* ── Mobile Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .ob-nav {
    padding: 0 10px;
    gap: 6px;
    height: 48px;
    flex-wrap: nowrap;
    overflow: visible;
  }
  .ob-nav-logo img { height: 24px; }
  .ob-nav-divider { height: 18px; }
  .ob-nav-app-name { font-size: 13px; white-space: nowrap; }
  .ob-app-switcher { position: static; }
  .ob-app-switcher-btn { padding: 4px 8px; font-size: 11px; }
  .ob-app-switcher-dropdown {
    position: fixed;
    top: 48px;
    right: 8px;
    left: 8px;
    min-width: auto;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 10000;
  }
  .ob-signout-btn { padding: 4px 8px; font-size: 11px; }
  .ob-user-name { display: none; }
  .ob-hamburger-btn { width: 30px; height: 30px; font-size: 16px; }
}

/* ════════════════════════════════════════════════════════════════════
   Notifications bell (top-right of the shared nav)
   ────────────────────────────────────────────────────────────────────
   Lives in ob-shared.css (loaded everywhere) so the bell looks the
   same on every page that includes shared-nav.js. Previously these
   rules were in sc-redesign.css which is only loaded by the scheduler
   shell + projects page — pages like /mapping, /sales, /map-calculator
   that load the same nav got the bell DOM but no styles, so the
   button rendered as a default browser <button>.
   ──────────────────────────────────────────────────────────────────── */
.sc-notif-wrap { position: relative; display: inline-flex; }
.sc-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg-2, #475569);
  cursor: pointer;
  padding: 0;
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.sc-notif-btn:hover { background: var(--neutral-50, #f1f5f9); }
.sc-notif-btn.is-open { background: var(--neutral-50, #f1f5f9); border-color: var(--border-2, #d1d5db); }
.sc-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.sc-notif-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border: 1px solid var(--border-2, #d1d5db);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.14);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sc-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1, #eef1f5);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
}
.sc-notif-mark-all {
  background: transparent;
  border: none;
  color: var(--ob-blue-500, #2870B0);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.sc-notif-mark-all:hover { background: rgba(40, 112, 176, 0.08); }
.sc-notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}
.sc-notif-empty {
  padding: 24px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--fg-3, #6B7685);
}
.sc-notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out);
  border-left: 3px solid transparent;
}
.sc-notif-item:hover { background: var(--neutral-50, #f8fafc); }
.sc-notif-item.is-unread {
  background: rgba(40, 112, 176, 0.04);
  border-left-color: var(--ob-blue-500, #2870B0);
}
.sc-notif-item-body { flex: 1; min-width: 0; }
.sc-notif-item-line {
  font-size: 13px;
  color: var(--fg-1);
  margin-bottom: 2px;
}
.sc-notif-item-line strong { font-weight: 600; }
.sc-notif-item-snippet {
  font-size: 12px;
  color: var(--fg-3, #6B7685);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.sc-notif-item-time {
  font-size: 11px;
  color: var(--fg-4, #94a3b8);
}
.sc-notif-item-dismiss {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-3, #6B7685);
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sc-notif-item-dismiss:hover {
  background: var(--neutral-100, #e2e8f0);
  color: var(--fg-1);
}
