/* ===================================================================
   Property Wharf - Main Application Dashboard Layout
   =================================================================== */

.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  position: relative;
  z-index: 1;
}

/* ===================================================================
   Top Navigation Bar
   =================================================================== */
.app-navbar {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.nav-brand-emblem {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand-emblem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.nav-brand-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.nav-brand-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(245, 158, 11, 0.25);
  text-transform: uppercase;
}

/* Primary View Switcher: Map View & List View */
.view-switcher-group {
  display: flex;
  background-color: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-nav-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.btn-nav-view:hover {
  color: var(--text-primary);
}

.btn-nav-view.active {
  background-color: var(--bg-card);
  color: var(--accent-teal);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Nav Right Actions */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-add-asset {
  padding: 8px 16px;
  font-size: 13px;
}

.user-profile-dropdown-wrapper {
  position: relative;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-family: inherit;
  color: inherit;
}

.user-profile-badge:hover,
.user-profile-badge.active {
  border-color: var(--accent-teal);
  background-color: var(--bg-card-hover, rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow-sm);
}

.user-avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background-color: var(--accent-teal);
  color: #060d17;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar-initial img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dropdown-caret-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  margin-left: 2px;
}

.user-profile-badge.active .dropdown-caret-icon {
  transform: rotate(180deg);
  color: var(--accent-teal);
}

/* Dropdown Menu Box */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 6px 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: 10px 14px 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background-color: var(--accent-teal);
  color: #060d17;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.dropdown-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dropdown-header-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-header-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-header-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-menu-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.dropdown-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--accent-teal);
}

.dropdown-menu-item.danger:hover {
  background-color: rgba(251, 113, 133, 0.08);
  color: var(--accent-rose, #fb7185);
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  color: var(--accent-coral);
  border-color: var(--accent-coral);
  background-color: rgba(251, 113, 133, 0.1);
}

/* ===================================================================
   Top Portfolio Metrics Ribbon
   =================================================================== */
.portfolio-metrics-ribbon {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
}

.metrics-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.metric-strip-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.metric-strip-card:hover {
  border-color: var(--border-light);
}

.metric-icon-square {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.metric-strip-content {
  display: flex;
  flex-direction: column;
}

.metric-label-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-value-main {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-extra-note {
  font-size: 11px;
  color: var(--accent-teal);
  font-weight: 500;
}

/* ===================================================================
   Main Views Content Host
   =================================================================== */
.app-main-viewport {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (max-width: 900px) {
  .app-navbar {
    padding: 0 16px;
  }
  .user-info-text {
    display: none;
  }
  .metrics-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .nav-brand-tag {
    display: none;
  }
  .btn-nav-view span {
    display: none;
  }
  .metrics-container {
    grid-template-columns: 1fr;
  }
}

/* ===================================================================
   Site Footer (Uniform with Landing Page)
   =================================================================== */
.site-footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 48px 40px 32px 40px;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-top-row {
  max-width: 1200px;
  margin: 0 auto 36px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom-row {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 16px;
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-emblem-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--accent-teal);
  box-shadow: 0 0 12px rgba(0, 229, 176, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
}

.brand-emblem-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-main-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-sub-title {
  font-size: 11px;
  color: var(--accent-teal);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

