/* ==========================================================================
   RAZES CLIENT PORTAL — LAYOUT STYLESHEET
   Shell: Sticky Topbar, Refined Sidebar, Main Viewport Container
   ========================================================================== */

/* Overall Shell */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-app);
  position: relative;
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  transition: var(--transition-normal);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #F1F5F9;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.sidebar-toggle-btn:hover {
  background: #E2E8F0;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.project-selector:hover {
  background: #F1F5F9;
  color: var(--text-primary);
}
.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Topbar Center (Quick Search) */
.topbar-center {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 440px;
  margin: 0 24px;
}

.global-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  background: #F1F5F9;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}
.global-search-bar:hover {
  background: #E2E8F0;
  color: var(--text-secondary);
}
.global-search-bar input {
  background: transparent;
  width: 100%;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}
.kbd-shortcut {
  font-size: 11px;
  font-family: var(--font-mono);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

/* Topbar Right */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Role Switcher Pill */
.role-badge-toggle {
  display: flex;
  align-items: center;
  background: #F1F5F9;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.role-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}
.role-pill.active {
  background: #0F172A;
  color: #FFFFFF;
  box-shadow: var(--shadow-xs);
}

/* Notification Bell */
.notification-bell-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  transition: var(--transition-fast);
}
.notification-bell-btn:hover {
  background: #F1F5F9;
  color: var(--text-primary);
}
.notification-counter {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--brand-orange);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

/* User Avatar & Menu */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  transition: var(--transition-fast);
}
.user-menu-btn:hover {
  border-color: var(--border-medium);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
}
.user-name-role {
  text-align: left;
  line-height: 1.2;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.user-role-label {
  font-size: 10px;
  color: var(--text-muted);
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 68px;
  left: 0;
  bottom: 0;
  width: 256px;
  background: #FFFFFF;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
  z-index: 90;
  overflow-y: auto;
  transition: var(--transition-smooth);
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
}
.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-link-icon {
  font-size: 16px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}
.sidebar-link:hover {
  background: #F8FAFC;
  color: var(--text-primary);
}
.sidebar-link:hover .sidebar-link-icon {
  color: var(--text-primary);
}
.sidebar-link.active {
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 600;
}
.sidebar-link.active .sidebar-link-icon {
  color: #FFFFFF;
}

.sidebar-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--brand-orange-bg);
  color: var(--brand-orange);
}
.sidebar-link.active .sidebar-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* Sidebar Founder / WhatsApp Support Card */
.sidebar-support-card {
  background: linear-gradient(145deg, #18191E 0%, #0F172A 100%);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: #FFFFFF;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-support-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
}
.support-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.support-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid #10B981;
}
.support-info h4 {
  font-size: 12px;
  font-weight: 600;
  color: #F8FAFC;
}
.support-info p {
  font-size: 11px;
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 4px;
}
.support-online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  animation: pulseGlow 2s infinite;
}
.support-btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: var(--transition-fast);
  margin-top: 6px;
}
.support-btn-whatsapp:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* ==========================================================================
   MAIN CONTENT VIEWPORT
   ========================================================================== */
.main-viewport {
  margin-left: 256px;
  margin-top: 68px;
  flex: 1;
  min-height: calc(100vh - 68px);
  padding: 28px 36px 60px 36px;
  max-width: 1600px;
  transition: var(--transition-smooth);
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}
.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page Header in Main View */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.view-title-group h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.view-title-group p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Overlay for Mobile Sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 85;
}
