/* Layout geral (somente itens em uso) */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Header superior */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #f8f9fa;
  color: #495057;
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
}
.app-header .app-title {
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #495057;
}
.app-header .app-title .app-icon {
  width: 32px;
  height: 32px;
  background: #495057;
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}
.app-header .header-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
}
.app-header .header-search {
  position: relative;
}
.app-header .header-search input {
  background: white;
  border: 1px solid #ced4da;
  color: #495057;
  padding: 4px 32px;
  border-radius: 4px;
  font-size: 14px;
  width: 200px;
}
.app-header .header-search::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}
.app-header .header-search input::placeholder {
  color: #6c757d;
}
.app-header .header-search input:focus {
  outline: none;
  background: white;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
.app-header .header-btn {
  background: white;
  border: 1px solid #ced4da;
  color: #495057;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.app-header .header-btn:hover {
  background: #e9ecef;
  color: #495057;
  text-decoration: none;
  border-color: #adb5bd;
}

/* Sidebar */
.app-sidebar {
  width: 280px;
  background: #f8f9fa;
  padding-top: 48px;
  min-height: 100vh;
  flex-shrink: 0;
}
.sidebar-section {
  padding: 16px;
  background-color: #f5f5f5;
}
.sidebar-title {
  font-size: 14px;
  font-weight: bold;
  color: #323130;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-count {
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: #6c757d;
  margin-left: auto;
}
.sidebar-list {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-item {
  padding: 8px 12px;
  margin-bottom: 2px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #495057;
  border-left: 3px solid transparent;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.3;
}
.sidebar-item:hover {
  background: #e9ecef;
  color: #323130;
}
.sidebar-item.active {
  background: #e9ecef;
  border-left-color: #6c757d;
  color: #495057;
  font-weight: 500;
}

/* Main content */
.app-main {
  flex: 1;
  padding-top: 48px;
  background: white;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.main-content {
  padding: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.main-content.with-padding {
  padding: 20px;
}

/* Home: centraliza a lista com largura máxima e respiro lateral */
.home-centered {
  width: 80%;               /* mais espaço nas laterais em telas grandes */
  max-width: 1400px;        /* limite superior confortável */
  margin: 0 auto;           /* centraliza */
  padding: 0 16px;          /* respiro lateral em telas menores */
  box-sizing: border-box;   /* inclui padding no cálculo da largura */
}

@media (max-width: 1200px) {
  .home-centered { width: 90%; }
}
@media (max-width: 768px) {
  .home-centered { width: 100%; }
}

.app-main,
.main-content,
#viewer { min-width: 0 !important; }

.app-layout,
.app-main,
.main-content { overflow-x: hidden; }

/* Lista de relatórios (Home) */
.table-responsive {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 8px;
}
.table-responsive table {
  margin-bottom: 0;
}
.table-responsive *,
.table-responsive table *,
.table-responsive thead *,
.table-responsive th *,
.table-responsive td *,
.table-responsive tr * {
  border: none !important;
  border-collapse: collapse !important;
}
.table-responsive thead th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 10;
}

/* Botões de ação (Home) */
.zylix-action-buttons {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  /*justify-content: flex-end; */
}
.zylix-action-buttons .btn {
  flex-shrink: 0;
  font-size: 13px;
  padding: 4px 8px;
}

/* Responsivo essencial */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: -280px;
    top: 48px;
    height: calc(100vh - 48px);
    z-index: 999;
    transition: left 0.3s ease;
  }
  .app-sidebar.show {
    left: 0;
  }
  .app-main {
    margin-left: 0;
  }
  .app-header .header-search input {
    width: 150px;
  }
}

/* Utilidades essenciais */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}
body {
  margin: 0;
  padding: 0;
}
.gap-2 {
  gap: 0.5rem;
}

/* BoldReports básico (mantido aqui pois a Home usa #viewer em embeds) */
#designer,
#viewer {
  width: 100% !important;
  max-width: 100% !important;
}
@media (max-width: 768px) {
  #designer,
  #viewer {
    height: 600px !important;
  }
}

/* Ícones MDL2 usados nos botões */
.fluent-mdl2-view::before {
  content: "\E890";
  font-family: "Segoe MDL2 Assets", "Segoe UI", sans-serif;
  font-size: 16px;
}

/* Botões monocromáticos (View/Edit/PDF) */
.btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
}
.btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

/* Botão de excluir destacado */
.zylix-btn-delete {
  background-color: #cc0000 !important;
  border-color: #cc0000 !important;
  color: #fff !important;
  transition: all 0.2s ease;
}
.zylix-btn-delete:hover {
  background-color: #990000 !important;
  border-color: #990000 !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.2);
}
.zylix-btn-delete:focus,
.zylix-btn-delete:active {
  background-color: #990000 !important;
  border-color: #990000 !important;
  color: #fff !important;
  box-shadow: 0 0 0 0.2rem rgba(255, 0, 0, 0.25);
}

/* Variante de botão de ação minimalista (se usado em outros pontos) */
.zylix-action-btn {
  margin-right: 6px;
  margin-bottom: 4px;
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}