/* ==========================================================================
   CRM DEMANDAS - NEXXO | MAIN LAYOUT & GLOBAL STYLES
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
}

/* Layout Principal */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Operacional Compacta */
.sidebar {
  width: 72px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  transition: width var(--trans-normal);
  z-index: 20;
  flex-shrink: 0;
}

.sidebar:hover {
  width: 240px;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  text-decoration: none;
  color: var(--text-main);
  padding: 0 16px;
  width: 100%;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--brand-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.sidebar:hover .brand-name {
  opacity: 1;
}

.nav-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.nav-item a:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-item.active a {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.sidebar:hover .nav-label {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  width: 100%;
  padding: 0 12px;
}

/* Área de Conteúdo Principal */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  background-color: var(--bg-app);
}

/* Topbar / Header */
.topbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 18px 32px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.breadcrumb-and-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--trans-fast);
}

.breadcrumbs a:hover {
  color: var(--text-main);
}

.breadcrumb-separator {
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.breadcrumbs .current {
  color: var(--text-main);
  font-weight: 600;
}

/* Barra de Busca Superior */
.top-search-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-input {
  height: 38px;
  width: 260px;
  padding: 0 42px 0 36px;
  background-color: var(--bg-column);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: all var(--trans-fast);
}

.search-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  width: 320px;
}

.search-shortcut {
  position: absolute;
  right: 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
}

.icon-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
}

/* Linha de Título & Ações Principais */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
}

.header-title-block h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.6px;
}

.header-title-block p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Botões Modernos de Ação */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-normal);
  border: none;
  outline: none;
  text-decoration: none;
  user-select: none;
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background-color: var(--bg-app);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* Botão Azul Escuro Unificado Solicitado */
.btn-dark-blue {
  background-color: var(--btn-dark-blue);
  color: #ffffff;
  box-shadow: 0 3px 10px var(--btn-dark-blue-glow);
  border: 1px solid #1e293b;
}

.btn-dark-blue:hover {
  background-color: var(--btn-dark-blue-hover);
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: var(--brand-gradient-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: #ffffff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* Abas de Navegação & Filtros */
.view-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding: 4px 0 0 0;
}

.view-tabs {
  display: flex;
  gap: 24px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 2px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color var(--trans-fast);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2.5px;
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--trans-fast);
}

.control-pill:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
}

.filter-select {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background-color: #ffffff;
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--primary);
}
