/* shell.css — Dashboard shell: header bar, search, export, profile switcher,
   settings gear, notification badge, banners.
   Verbatim port of legacy dashboard-layout.css + dashboard-widgets.css +
   app-pet-profile.css. Class names preserved exactly. */

/* ── Banners ── */
/* Verbatim from dashboard-widgets.css:177-198. No role-banner — legacy
   never had one; admin state is shown in the profile-switcher dropdown. */
.demo-banner {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: var(--white);
  padding: 0.5rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.demo-banner-exit {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.demo-banner-exit:hover { background: rgba(255,255,255,0.35); }

/* ===== SHARED HEADER BAR ===== */
/* Verbatim from dashboard-layout.css:8-64 */
.dash-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 64px;
  background: var(--header-bg);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  box-shadow: 0 2px 8px var(--shadow-lg);
}

.dash-header .logo {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.dash-header .logo span {
  color: #80d4c8;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Shared header button style — btn-logout (verbatim from dashboard-layout.css:50-65) */
.btn-logout {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== GLOBAL SEARCH ===== */
/* Verbatim from dashboard-widgets.css:4-70 */
.dash-search {
  position: relative;
  margin: 0 1.5rem;
  flex: 1;
  max-width: 360px;
}
.dash-search input {
  width: 100%;
  padding: 0.45rem 0.9rem 0.45rem 2.2rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 0.85rem;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}
.dash-search input::placeholder { color: rgba(255,255,255,0.6); }
.dash-search input:focus { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }
.dash-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  pointer-events: none;
}
.search-results-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1100;
  margin-top: 0.3rem;
}
.search-results-dropdown.active { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
  font-size: 0.85rem;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.search-result-item:hover { background: var(--primary-light); }
.search-result-item:last-child { border-bottom: none; }
.search-result-type {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
}
.search-result-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-text mark { background: var(--warning-bg); color: var(--text); border-radius: 2px; padding: 0 1px; }
.search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
}
.search-result-answer {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}
.search-result-sources {
  padding: 0 1rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-light);
}
.search-score {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  margin-left: auto;
  flex-shrink: 0;
}

/* ===== EXPORT MENU ===== */
/* Verbatim from dashboard-widgets.css:72-104 */
.export-dropdown {
  position: relative;
  display: inline-block;
}
.export-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-lg);
  min-width: 200px;
  z-index: 1100;
  margin-top: 0.3rem;
  overflow: hidden;
}
.export-menu.active { display: block; }
.export-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.export-menu-item:hover { background: var(--primary-light); }

/* ===== PROFILE SWITCHER ===== */
/* Verbatim from dashboard-widgets.css:107-174 */
.profile-switcher {
  position: relative;
  display: inline-block;
}
.profile-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}
.profile-switcher-avatar {
  display: none; /* hidden when empty */
}
.profile-switcher-avatar.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.profile-switcher-avatar.emoji {
  display: inline-block;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}
.profile-switcher-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  min-width: 200px;
  z-index: 1100;
  margin-top: 0.3rem;
  padding: 0.4rem 0;
}
.profile-switcher-menu.active { display: block; }
.profile-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s;
}
.profile-switcher-item:hover { background: var(--primary-light); }
.profile-switcher-item.active { color: var(--primary); font-weight: 600; }
.profile-switcher-item.add-recipient { color: var(--primary); font-weight: 500; }
.profile-switcher-icon { flex-shrink: 0; font-size: 1rem; line-height: 1; width: 1.4em; text-align: center; }
.profile-switcher-name { white-space: nowrap; }
.profile-switcher-label { font-size: 0.72rem; color: var(--text-light); margin-left: auto; white-space: nowrap; }
.profile-switcher-divider { height: 1px; background: var(--border); margin: 0.3rem 0; }
.profile-switcher-section-header { font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; padding: 0.3rem 0.75rem 0.1rem; font-weight: 600; }
.profile-switcher-role { border-left: 3px solid var(--primary); margin: 0.15rem 0.4rem; border-radius: 4px; padding-left: 0.75rem; }
.profile-switcher-btn.profile-switcher-static { cursor: default; }
.profile-switcher-btn.profile-switcher-static:hover { background: transparent; }
.profile-switcher-btn.profile-switcher-static .profile-switcher-caret { display: none; }

/* ===== Profile switcher — pet/archive extensions ===== */
/* Verbatim from app-pet-profile.css:13-37 */
.badge-archived {
  display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-hover); color: var(--text-light); margin-left: 6px;
}
.profile-switcher-archived { opacity: 0.6; }
.profile-switcher-archived:hover { opacity: 0.8; }
.profile-switcher-toggle-archived {
  font-size: 11px; color: var(--text-light); padding: 4px 12px 6px;
  cursor: pointer; text-align: center;
}
.profile-switcher-toggle-archived:hover { color: var(--text); }

/* ===== Notification Badge & Settings Gear ===== */
/* Verbatim from dashboard-widgets.css:268-289 */
.settings-gear-wrapper {
  position: relative;
  display: inline-block;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: var(--text-inverted);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
}

/* ── Content offset for the fixed header + tab bar ── */
#panels-root:not(:empty) {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem;
}
#banners-root { position: relative; z-index: 1001; }

/* ── Tab icon spacing ── */
.dash-tab-icon { font-size: 1rem; margin-right: 0.25rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .dash-search { max-width: none; margin: 0 0.5rem; }
  .dash-search input { font-size: 0.8rem; padding: 0.35rem 0.8rem 0.35rem 2rem; }
  .dash-header { padding: 0.3rem 1rem; flex-wrap: wrap; gap: 0.3rem; height: auto; min-height: 64px; position: sticky; z-index: 1001; }
}
